Geotag
This commit is contained in:
@@ -42,6 +42,16 @@
|
|||||||
android:label="@string/title_activity_select_language"
|
android:label="@string/title_activity_select_language"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity android:name=".download.DownloadActivity"></activity>
|
<activity android:name=".download.DownloadActivity"></activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".GeoTag.GeoTagStoreList"
|
||||||
|
android:label="@string/title_activity_store_list_geotag"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package cpm.com.gskmtorange.GeoTag;
|
||||||
|
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationManager;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
|
||||||
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
|
import com.google.android.gms.location.LocationListener;
|
||||||
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
|
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||||
|
import com.google.android.gms.maps.SupportMapFragment;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ashishc on 27-12-2016.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallback,GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener{
|
||||||
|
|
||||||
|
private GoogleMap mMap;
|
||||||
|
double latitude =0.0;
|
||||||
|
double longitude =0.0;
|
||||||
|
LocationManager locationManager;
|
||||||
|
private Location mLastLocation;
|
||||||
|
private LocationManager locmanager = null;
|
||||||
|
FloatingActionButton fab,fabcarmabtn;
|
||||||
|
SupportMapFragment mapFragment;
|
||||||
|
SharedPreferences preferences;
|
||||||
|
|
||||||
|
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_geo_tag);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
|
||||||
|
|
||||||
|
fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
|
||||||
|
fabcarmabtn = (FloatingActionButton) findViewById(R.id.camrabtn);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||||
|
.findFragmentById(R.id.map);
|
||||||
|
mapFragment.getMapAsync(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package cpm.com.gskmtorange.GeoTag;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ListView;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ashishc on 27-12-2016.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class GeoTagStoreList extends AppCompatActivity {
|
||||||
|
|
||||||
|
|
||||||
|
ListView lv;
|
||||||
|
LinearLayout parent_linear,nodata_linear;
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.storelistlayout);
|
||||||
|
lv = (ListView) findViewById(R.id.list);
|
||||||
|
nodata_linear = (LinearLayout) findViewById(R.id.no_data_lay);
|
||||||
|
parent_linear = (LinearLayout) findViewById(R.id.parent_linear);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
package cpm.com.gskmtorange;
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
|
||||||
import android.support.design.widget.Snackbar;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.support.design.widget.NavigationView;
|
import android.support.design.widget.NavigationView;
|
||||||
@@ -21,6 +20,7 @@ import android.webkit.WebViewClient;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity
|
public class MainActivity extends AppCompatActivity
|
||||||
@@ -137,14 +137,16 @@ public class MainActivity extends AppCompatActivity
|
|||||||
else if (id == R.id.nav_geotag) {
|
else if (id == R.id.nav_geotag) {
|
||||||
|
|
||||||
|
|
||||||
|
Intent startDownload = new Intent(this,GeoTagStoreList.class);
|
||||||
|
startActivity(startDownload);
|
||||||
|
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (id == R.id.nav_export) {
|
else if (id == R.id.nav_export) {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context="cpm.com.gskmtorange.GeoTag.GeoTagActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/content_geo_tag" />
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@android:drawable/ic_menu_save"
|
||||||
|
app:backgroundTint="@color/colorPrimary"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/camrabtn"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|left"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
android:src="@android:drawable/ic_menu_camera"
|
||||||
|
app:backgroundTint="@color/colorPrimary"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:name="com.google.android.gms.maps.SupportMapFragment"
|
||||||
|
android:id="@+id/map"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="@dimen/custom_margin"
|
||||||
|
android:paddingLeft="@dimen/custom_margin"
|
||||||
|
android:paddingRight="@dimen/custom_margin"
|
||||||
|
android:paddingTop="@dimen/custom_margin"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context="cpm.com.gskmtorange.GeoTag.GeoTagActivity"
|
||||||
|
tools:showIn="@layout/activity_geo_tag">
|
||||||
|
|
||||||
|
</fragment>
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:weightSum="10"
|
||||||
|
android:id="@+id/parent_linear"
|
||||||
|
android:background="#fff">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/geotag_title_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Store List"
|
||||||
|
android:textColor="#e2e2e2"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="30sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/appbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay">
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="9"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:divider="@null"
|
||||||
|
android:dividerHeight="0dp"
|
||||||
|
>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/no_data_lay"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:weightSum="8"
|
||||||
|
android:background="@color/grey_background"
|
||||||
|
android:visibility="gone"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
card_view:cardBackgroundColor="@color/white"
|
||||||
|
card_view:cardCornerRadius="5dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="No data available"
|
||||||
|
android:textSize="25sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="4"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:background="@drawable/sad_cloud"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
card_view:cardBackgroundColor="@color/white"
|
||||||
|
card_view:cardCornerRadius="5dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="Please download data"
|
||||||
|
android:textSize="25sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
android:id="@+id/nav_geotag"
|
android:id="@+id/nav_geotag"
|
||||||
android:icon="@drawable/ic_menu_manage"
|
android:icon="@drawable/ic_menu_manage"
|
||||||
android:title="@string/menu_geotag" />
|
android:title="@string/menu_geotag" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_export"
|
||||||
|
android:icon="@drawable/ic_menu_share"
|
||||||
|
android:title="@string/menu_export" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_exit"
|
android:id="@+id/nav_exit"
|
||||||
android:icon="@drawable/ic_menu_send"
|
android:icon="@drawable/ic_menu_send"
|
||||||
|
|||||||
@@ -24,10 +24,15 @@
|
|||||||
<string name="select_language">Please select language</string>
|
<string name="select_language">Please select language</string>
|
||||||
<string name="title_activity_select_language">SelectLanguageActivity</string>
|
<string name="title_activity_select_language">SelectLanguageActivity</string>
|
||||||
|
|
||||||
|
<string name="title_activity_store_list_geotag">StoreListActivity</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="menu_daily_route_plan">Daily Route Plan</string>
|
<string name="menu_daily_route_plan">Daily Route Plan</string>
|
||||||
<string name="menu_daily_download">Daily Data Download</string>
|
<string name="menu_daily_download">Daily Data Download</string>
|
||||||
<string name="menu_upload_data">Upload Data</string>
|
<string name="menu_upload_data">Upload Data</string>
|
||||||
<string name="menu_geotag">Geo Tag</string>
|
<string name="menu_geotag">Geo Tag</string>
|
||||||
|
<string name="menu_export">Data Export</string>
|
||||||
|
|
||||||
<string name="menu_exit">Exit</string>
|
<string name="menu_exit">Exit</string>
|
||||||
<string name="menu_setting">Setting</string>
|
<string name="menu_setting">Setting</string>
|
||||||
<string name="menu_services">Services</string>
|
<string name="menu_services">Services</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user