Merge pull request #4 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GeoT
Geo t
This commit is contained in:
@@ -42,6 +42,16 @@
|
||||
android:label="@string/title_activity_select_language"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<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>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,139 @@
|
||||
package cpm.com.gskmtorange.Database;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.util.Log;
|
||||
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlHandlers.TableBean;
|
||||
|
||||
/**
|
||||
* Created by ashishc on 29-12-2016.
|
||||
*/
|
||||
|
||||
public class GSKOrangeDB extends SQLiteOpenHelper{
|
||||
|
||||
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE";
|
||||
public static final int DATABASE_VERSION = 13;
|
||||
private SQLiteDatabase db;
|
||||
TableBean tableBean;
|
||||
|
||||
|
||||
public GSKOrangeDB(Context context) {
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
|
||||
}
|
||||
|
||||
public void open() {
|
||||
try {
|
||||
|
||||
db = this.getWritableDatabase();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
|
||||
db.execSQL(TableBean.getJourneyPlan());
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
db.execSQL("DROP TABLE IF EXISTS " + TableBean.getJourneyPlan());
|
||||
|
||||
}
|
||||
|
||||
public void deleteTableWithStoreID(String storeid, String process_id){
|
||||
|
||||
}
|
||||
|
||||
public void deleteAllTables(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||
|
||||
db.delete("JOURNEY_PLAN", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
for (int i = 0; i < data.getSTORE_ID().size(); i++) {
|
||||
|
||||
values.put("STORE_ID", data.getSTORE_ID().get(i));
|
||||
values.put("EMP_ID", data.getEMP_ID().get(i));
|
||||
|
||||
values.put("STORE_NAME", data.getSTORE_NAME().get(i));
|
||||
|
||||
values.put("CITY", data.getCITY().get(i));
|
||||
|
||||
values.put("VISIT_DATE", data.getVISIT_DATE().get(i));
|
||||
|
||||
values.put("ADDRESS", data.getADDRESS().get(i));
|
||||
|
||||
values.put("UPLOAD_STATUS", data.getUPLOAD_STATUS().get(i));
|
||||
|
||||
values.put("STORETYPE", data.getSTORETYPE().get(i));
|
||||
|
||||
values.put("KEYACCOUNT_ID", data.getKEYACCOUNT_ID().get(i));
|
||||
|
||||
|
||||
values.put("STORETYPE_ID", data.getSTORETYPE_ID().get(i));
|
||||
|
||||
values.put("CHECKOUT_STATUS", data.getCHECKOUT_STATUS().get(i));
|
||||
|
||||
values.put("CLASSIFICATION", data.getCLASSIFICATION().get(i));
|
||||
|
||||
values.put("KEYACCOUNT", data.getKEYACCOUNT().get(i));
|
||||
values.put("CLASS_ID", data.getCLASS_ID().get(i));
|
||||
|
||||
values.put("CAMERA_ALLOW", data.getCAMERA_ALLOW().get(i));
|
||||
values.put("GEO_TAG", data.getGEO_TAG().get(i));
|
||||
|
||||
|
||||
db.insert("JOURNEY_PLAN", null, values);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Log.d("Exception in JCP", ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -5,8 +5,6 @@ import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.support.design.widget.NavigationView;
|
||||
@@ -22,6 +20,7 @@ import android.webkit.WebViewClient;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||
|
||||
@@ -143,6 +142,10 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
|
||||
|
||||
Intent startDownload = new Intent(this,GeoTagStoreList.class);
|
||||
startActivity(startDownload);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
|
||||
|
||||
@@ -150,6 +153,12 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
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:icon="@drawable/ic_menu_manage"
|
||||
android:title="@string/menu_geotag" />
|
||||
<item
|
||||
android:id="@+id/nav_export"
|
||||
android:icon="@drawable/ic_menu_share"
|
||||
android:title="@string/menu_export" />
|
||||
|
||||
<item
|
||||
android:id="@+id/nav_exit"
|
||||
android:icon="@drawable/ic_menu_send"
|
||||
|
||||
@@ -24,10 +24,15 @@
|
||||
<string name="select_language">Please select language</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_download">Daily Data Download</string>
|
||||
<string name="menu_upload_data">Upload Data</string>
|
||||
<string name="menu_geotag">Geo Tag</string>
|
||||
<string name="menu_export">Data Export</string>
|
||||
|
||||
<string name="menu_exit">Exit</string>
|
||||
<string name="menu_setting">Setting</string>
|
||||
<string name="menu_services">Services</string>
|
||||
|
||||
Reference in New Issue
Block a user