Merge branch 'master' into CategoryDownload
@@ -41,7 +41,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -39,4 +39,5 @@ dependencies {
|
||||
compile 'com.google.android.gms:play-services-location:9.0.2'
|
||||
compile 'com.google.android.gms:play-services-maps:9.0.2'
|
||||
compile 'com.android.support:cardview-v7:24.2.1'
|
||||
compile 'com.google.android.gms:play-services-appindexing:9.0.2'
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<activity android:name=".download.DownloadActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
|
||||
android:name=".GeoTag.GeoTagStoreList"
|
||||
android:label="@string/title_activity_store_list_geotag"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
@@ -79,6 +80,23 @@
|
||||
android:label="@string/title_activity_store_list_geotag"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".dailyentry.StoreimageActivity"
|
||||
android:label="@string/title_activity_store_list_geotag"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<activity
|
||||
android:name=".GeoTag.GeoTagActivity"
|
||||
android:label="@string/title_activity_store_geotag"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.maps.v2.API_KEY"
|
||||
android:value="AIzaSyD02po19go2JMhXJeAnKDiZSiNloPsWqzI" />
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.version"
|
||||
android:value="@integer/google_play_services_version" />
|
||||
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.Stock_FacingActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
@@ -90,6 +108,7 @@
|
||||
android:label="@string/title_activity_t2_pcompliance"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar"></activity>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -11,9 +11,13 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
||||
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||
@@ -21,6 +25,8 @@ import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
@@ -68,15 +74,20 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.execSQL(TableBean.getMappingStock());
|
||||
db.execSQL(TableBean.getMappingT2p());
|
||||
|
||||
|
||||
db.execSQL(CommonString.CREATE_TABLE_STORE_GEOTAGGING);
|
||||
db.execSQL(CommonString.CREATE_TABLE_COVERAGE_DATA);
|
||||
|
||||
|
||||
db.execSQL(TableBean.getDisplayChecklistMaster());
|
||||
db.execSQL(TableBean.getMappingDisplayChecklist());
|
||||
|
||||
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY);
|
||||
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_HEADER);
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_CHILD);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -563,6 +574,206 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
|
||||
public void InsertSTOREgeotag(String storeid, double lat, double longitude, String path,String status) {
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
values.put("STORE_ID", storeid);
|
||||
values.put("LATITUDE", Double.toString(lat));
|
||||
values.put("LONGITUDE", Double.toString(longitude));
|
||||
values.put("FRONT_IMAGE", path);
|
||||
values.put("GEO_TAG", status);
|
||||
values.put("STATUS", status);
|
||||
|
||||
db.insert(CommonString.TABLE_STORE_GEOTAGGING, null, values);
|
||||
|
||||
} catch (Exception ex) {
|
||||
Log.d("Database Exception ", ex.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void updateStatus(String id, String status, double lat, double longtitude) {
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
values.put("GEO_TAG", status);
|
||||
|
||||
db.update(CommonString.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void updateCheckoutStatus(String id, String status) {
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
values.put("CHECKOUT_STATUS", status);
|
||||
|
||||
db.update(CommonString.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<GeotaggingBeans> getinsertGeotaggingData(String status) {
|
||||
|
||||
|
||||
ArrayList<GeotaggingBeans> geodata = new ArrayList<GeotaggingBeans>();
|
||||
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("SELECT * from " + CommonString.TABLE_STORE_GEOTAGGING + " WHERE GEO_TAG = '" + status + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
int numrows = dbcursor.getCount();
|
||||
|
||||
dbcursor.moveToFirst();
|
||||
for (int i = 1; i <= numrows; ++i) {
|
||||
|
||||
GeotaggingBeans data = new GeotaggingBeans();
|
||||
|
||||
data.setStoreid(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STORE_ID")));
|
||||
data.setLatitude(Double.parseDouble(dbcursor.getString(dbcursor.getColumnIndexOrThrow("LATITUDE"))));
|
||||
data.setLongitude(Double.parseDouble(dbcursor.getString(dbcursor.getColumnIndexOrThrow("LONGITUDE"))));
|
||||
data.setUrl1(dbcursor.getString(dbcursor.getColumnIndexOrThrow("FRONT_IMAGE")));
|
||||
|
||||
geodata.add(data);
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
|
||||
dbcursor.close();
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
finally {
|
||||
if (dbcursor != null && !dbcursor.isClosed()) {
|
||||
dbcursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return geodata;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void updateGeoTagData(String storeid,String status) {
|
||||
|
||||
try {
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("GEO_TAG", status);
|
||||
|
||||
int l = db.update(CommonString.TABLE_STORE_GEOTAGGING, values,
|
||||
CommonString.KEY_STORE_ID + "=?", new String[] { storeid });
|
||||
System.out.println("update : " + l);
|
||||
} catch (Exception e) {
|
||||
Log.d("Database Data ", e.toString());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void updateDataStatus(String id,String status) {
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
values.put("GEO_TAG", status);
|
||||
|
||||
db.update(CommonString.KEY_JOURNEY_PLAN, values,
|
||||
CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void deleteGeoTagData(String storeid) {
|
||||
|
||||
try {
|
||||
db.delete(CommonString.TABLE_STORE_GEOTAGGING, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<CoverageBean> getCoverageData(String visitdate) {
|
||||
|
||||
ArrayList<CoverageBean> list = new ArrayList<CoverageBean>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
dbcursor = db.rawQuery("SELECT * from " + CommonString.TABLE_COVERAGE_DATA + " where "
|
||||
+ CommonString.KEY_VISIT_DATE + "='" + visitdate + "'",
|
||||
null);
|
||||
|
||||
|
||||
if (dbcursor != null) {
|
||||
|
||||
dbcursor.moveToFirst();
|
||||
while (!dbcursor.isAfterLast()) {
|
||||
CoverageBean sb = new CoverageBean();
|
||||
|
||||
sb.setStoreId(dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_STORE_ID)));
|
||||
sb.setUserId((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_USER_ID))));
|
||||
sb.setInTime(((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_IN_TIME)))));
|
||||
sb.setOutTime(((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_OUT_TIME)))));
|
||||
sb.setVisitDate((((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_VISIT_DATE))))));
|
||||
sb.setLatitude(((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_LATITUDE)))));
|
||||
sb.setLongitude(((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_LONGITUDE)))));
|
||||
sb.setStatus((((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_STATUS))))));
|
||||
sb.setImage((((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_IMAGE))))));
|
||||
sb.setReason((((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_REASON))))));
|
||||
sb.setReasonid((((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_REASON_ID))))));
|
||||
sb.setMID(Integer.parseInt(((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_ID))))));
|
||||
if(dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))==null){
|
||||
sb.setRemark("");
|
||||
}
|
||||
else{
|
||||
sb.setRemark((((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))))));
|
||||
}
|
||||
|
||||
list.add(sb);
|
||||
|
||||
|
||||
//Category List
|
||||
public ArrayList<CategoryGetterSetter> getCategoryListData(String keyAccountId, String storeTypeId, String classId) {
|
||||
ArrayList<CategoryGetterSetter> list = new ArrayList<>();
|
||||
@@ -1001,17 +1212,52 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
cd.setFacing(dbcursor.getString(dbcursor.getColumnIndexOrThrow("FACEUP_VALUE")));
|
||||
|
||||
list.add(cd);
|
||||
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
dbcursor.close();
|
||||
return list;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", "get Stock_Facing Sku After Save Data!" + e.toString());
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public long InsertCoverageData(CoverageBean data) {
|
||||
|
||||
//db.delete(CommonString1.TABLE_COVERAGE_DATA, "STORE_ID" + "='" + data.getStoreId() + "'", null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
values.put(CommonString.KEY_STORE_ID, data.getStoreId());
|
||||
values.put(CommonString.KEY_USER_ID, data.getUserId());
|
||||
values.put(CommonString.KEY_IN_TIME, data.getInTime());
|
||||
values.put(CommonString.KEY_OUT_TIME, data.getOutTime());
|
||||
values.put(CommonString.KEY_VISIT_DATE, data.getVisitDate());
|
||||
values.put(CommonString.KEY_LATITUDE, data.getLatitude());
|
||||
values.put(CommonString.KEY_LONGITUDE, data.getLongitude());
|
||||
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
||||
values.put(CommonString.KEY_REASON, data.getReason());
|
||||
values.put(CommonString.KEY_COVERAGE_STATUS, data.getStatus());
|
||||
values.put(CommonString.KEY_IMAGE, data.getImage());
|
||||
values.put(CommonString.KEY_COVERAGE_REMARK, data.getRemark());
|
||||
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
||||
values.put(CommonString.KEY_REASON, data.getReason());
|
||||
values.put(CommonString.KEY_GEO_TAG, data.getGEO_TAG());
|
||||
|
||||
return db.insert(CommonString.TABLE_COVERAGE_DATA, null, values);
|
||||
|
||||
} catch (Exception ex) {
|
||||
Log.d("Database Exception ", ex.toString());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean checkStockAndFacingData(String store_id, String category_id) {
|
||||
Log.d("Stock_Facing ", "Stock data--------------->Start<------------");
|
||||
@@ -1083,4 +1329,5 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
Log.d("Exception ", " in Insert MSL_Availability " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
package cpm.com.gskmtorange.GeoTag;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.MainActivity;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
@@ -31,30 +34,35 @@ import cpm.com.gskmtorange.constant.CommonString;
|
||||
* Created by ashishc on 27-12-2016.
|
||||
*/
|
||||
|
||||
public class GeoTagStoreList extends AppCompatActivity {
|
||||
public class GeoTagStoreList extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private SharedPreferences preferences;
|
||||
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
||||
String date,visit_status;
|
||||
GSKOrangeDB db;
|
||||
ListView list;
|
||||
// ListView list;
|
||||
ValueAdapter adapter;
|
||||
RecyclerView recyclerView;
|
||||
private SharedPreferences.Editor editor = null;
|
||||
LinearLayout parent_linear,nodata_linear;
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.storelistlayout);
|
||||
list = (ListView) findViewById(R.id.list_id);
|
||||
//list = (ListView) findViewById(R.id.list_id);
|
||||
|
||||
recyclerView=(RecyclerView) findViewById(R.id.drawer_layout_recycle);
|
||||
|
||||
// nodata_linear = (LinearLayout) findViewById(R.id.no_data_lay);
|
||||
//parent_linear = (LinearLayout) findViewById(R.id.parent_linear);
|
||||
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||
@@ -62,35 +70,24 @@ public class GeoTagStoreList extends AppCompatActivity {
|
||||
db = new GSKOrangeDB(GeoTagStoreList.this);
|
||||
db.open();
|
||||
|
||||
|
||||
list = (ListView)findViewById(R .id.list_id);
|
||||
|
||||
|
||||
storelist = db.getStoreData(date);
|
||||
|
||||
|
||||
if (storelist.size()>0) {
|
||||
list.setAdapter(new MyAdaptor());
|
||||
|
||||
adapter=new ValueAdapter(getApplicationContext(),storelist);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
|
||||
|
||||
Toast.makeText(getApplicationContext(),"Click",Toast.LENGTH_LONG).show();
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
private class MyAdaptor extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
@@ -133,27 +130,20 @@ public class GeoTagStoreList extends AppCompatActivity {
|
||||
holder.storename.setText(storelist.get(position).getSTORE_NAME());
|
||||
//holder.storeaddress.setText(storelist.get(position).getCITY());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
private class ViewHolder {
|
||||
/*private class ViewHolder {
|
||||
TextView storename, storeaddress;
|
||||
ImageView imgtick;
|
||||
Button checkout;
|
||||
|
||||
RelativeLayout l1;
|
||||
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
@@ -164,7 +154,7 @@ public class GeoTagStoreList extends AppCompatActivity {
|
||||
|
||||
if(id==android.R.id.home){
|
||||
|
||||
// NavUtils.navigateUpFromSameTask(this);
|
||||
|
||||
finish();
|
||||
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
@@ -173,6 +163,234 @@ public class GeoTagStoreList extends AppCompatActivity {
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// TODO Auto-generated method stub
|
||||
Intent intent = new Intent(GeoTagStoreList.this, MainActivity.class);
|
||||
|
||||
startActivity(intent);
|
||||
GeoTagStoreList.this.finish();
|
||||
}
|
||||
|
||||
|
||||
/*protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||
// TODO Auto-generated method stub
|
||||
// super.onListItemClick(l, v, position, id);
|
||||
|
||||
storelist = db.getStoreData(date);
|
||||
StoreBean sb = storelist.get(position);
|
||||
|
||||
// When clicked, show a toast with the TextView text
|
||||
if (storelist.get(position).getGEO_TAG().equalsIgnoreCase("U")) {
|
||||
|
||||
|
||||
Snackbar.make(v, R.string.title_geo_tag_activity_upload_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
|
||||
|
||||
} else if (storelist.get(position).getGEO_TAG().equalsIgnoreCase("D")){
|
||||
|
||||
|
||||
Snackbar.make(v, R.string.title_geo_tag_activity_geo_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (storelist.get(position).getGEO_TAG().equalsIgnoreCase("Y")) {
|
||||
|
||||
|
||||
Snackbar.make(v, R.string.title_geo_tag_activity_geo_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
|
||||
|
||||
|
||||
} else if (storelist.get(position).getGEO_TAG().equalsIgnoreCase("P")) {
|
||||
|
||||
Snackbar.make(v, R.string.title_geo_tag_activity_geo_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
|
||||
} else {
|
||||
|
||||
// PUT IN PREFERENCES
|
||||
editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STORE_ID, sb.getSTORE_ID());
|
||||
editor.putString(CommonString.KEY_STORE_NAME, sb.getSTORE_NAME());
|
||||
editor.putString(CommonString.KEY_VISIT_DATE, sb.getVISIT_DATE());
|
||||
editor.commit();
|
||||
|
||||
Intent intent = new Intent(GeoTagStoreList.this, GeoTagActivity.class);
|
||||
startActivity(intent);
|
||||
GeoTagStoreList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void GeoTagStoreList() {
|
||||
|
||||
this.finish();
|
||||
|
||||
}*/
|
||||
|
||||
public class ValueAdapter extends RecyclerView.Adapter<ValueAdapter.MyViewHolder>{
|
||||
|
||||
private LayoutInflater inflator;
|
||||
|
||||
List<StoreBean> data= Collections.emptyList();
|
||||
|
||||
public ValueAdapter(Context context, List<StoreBean> data){
|
||||
|
||||
inflator = LayoutInflater.from(context);
|
||||
this.data=data;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
|
||||
|
||||
View view=inflator.inflate(R.layout.geotagstorelist,parent,false);
|
||||
|
||||
MyViewHolder holder=new MyViewHolder(view);
|
||||
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ValueAdapter.MyViewHolder viewHolder, final int position) {
|
||||
|
||||
final StoreBean current=data.get(position);
|
||||
|
||||
//viewHolder.txt.setText(current.txt);
|
||||
|
||||
viewHolder.txt.setText(current.getSTORE_NAME());
|
||||
|
||||
if(current.getGEO_TAG().equalsIgnoreCase("Y"))
|
||||
{
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.geopin);
|
||||
}
|
||||
else if(current.getGEO_TAG().equalsIgnoreCase("D")){
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tick_d);
|
||||
}
|
||||
else if(current.getGEO_TAG().equalsIgnoreCase("U")){
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tick_u);
|
||||
}
|
||||
else if(current.getGEO_TAG().equalsIgnoreCase("P")){
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tick_p);
|
||||
}
|
||||
else
|
||||
{
|
||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
viewHolder.relativelayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if(current.getGEO_TAG().equalsIgnoreCase("Y"))
|
||||
{
|
||||
Snackbar.make(v, R.string.title_geo_tag_activity_geo_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
else if(current.getGEO_TAG().equalsIgnoreCase("D")){
|
||||
|
||||
Snackbar.make(v, R.string.title_geo_tag_activity_geo_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
|
||||
}
|
||||
else if(current.getGEO_TAG().equalsIgnoreCase("U")){
|
||||
|
||||
Snackbar.make(v, R.string.title_geo_tag_activity_upload_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
|
||||
|
||||
}
|
||||
else if(current.getGEO_TAG().equalsIgnoreCase("P")){
|
||||
|
||||
Snackbar.make(v, R.string.title_geo_tag_activity_geo_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// PUT IN PREFERENCES
|
||||
editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
editor.putString(CommonString.KEY_STORE_NAME, current.getSTORE_NAME());
|
||||
editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE());
|
||||
editor.commit();
|
||||
|
||||
Intent in =new Intent(GeoTagStoreList.this,GeoTagActivity.class);
|
||||
startActivity(in);
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
TextView txt;
|
||||
ImageView icon;
|
||||
RelativeLayout relativelayout;
|
||||
ImageView imageview;
|
||||
|
||||
public MyViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
txt=(TextView) itemView.findViewById(R.id.geolistviewxml_storename);
|
||||
relativelayout=(RelativeLayout) itemView.findViewById(R.id.relativelayout);
|
||||
imageview=(ImageView) itemView.findViewById(R.id.imageView1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<StoreBean> getdata() {
|
||||
List<StoreBean> data = new ArrayList<>();
|
||||
|
||||
storelist = db.getStoreData(date);
|
||||
|
||||
StoreBean storelistdata=new StoreBean();
|
||||
|
||||
|
||||
for(int i=0;i<storelist.size();i++)
|
||||
{
|
||||
|
||||
storelistdata.setSTORE_NAME(storelist.get(0).getSTORE_NAME());
|
||||
|
||||
data.add(storelistdata);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.location.Location;
|
||||
import android.location.LocationListener;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.Snackbar;
|
||||
@@ -47,6 +48,7 @@ import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
import org.xmlpull.v1.XmlPullParserFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.net.MalformedURLException;
|
||||
@@ -156,6 +158,16 @@ public class LoginActivity extends AppCompatActivity {
|
||||
mLoginFormView = findViewById(R.id.login_form);
|
||||
mProgressView = findViewById(R.id.login_progress);
|
||||
|
||||
|
||||
|
||||
// Create a Folder for Images
|
||||
|
||||
|
||||
File file = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_IMAGES");
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* private void populateAutoComplete() {
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.support.design.widget.NavigationView;
|
||||
@@ -24,6 +23,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package cpm.com.gskmtorange.constant;
|
||||
|
||||
import android.os.Environment;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 19-12-2016.
|
||||
*/
|
||||
@@ -13,16 +15,56 @@ public class CommonString {
|
||||
public static final String KEY_PASSWORD = "password";
|
||||
public static final String KEY_DATE = "date";
|
||||
public static final String KEY_STOREVISITED_STATUS = "STOREVISITED_STATUS";
|
||||
|
||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/GSK_MT_Images/";
|
||||
|
||||
public static final String KEY_PATH = "path";
|
||||
public static final String KEY_VERSION = "APP_VERSION";
|
||||
|
||||
|
||||
public static final String KEY_LANGUAGE = "LANGUAGE";
|
||||
public static final String KEY_NOTICE_BOARD_LINK = "NOTICE_BOARD_LINK";
|
||||
public static final String KEY_LOGIN_DATA = "LOGIN_DATA";
|
||||
public static final String KEY_CULTURE_ID = "CULTURE_ID";
|
||||
public static final String KEY_STORE_ID = "STORE_ID";
|
||||
public static final String KEY_STORE_NAME = "STORE_NAME";
|
||||
public static final String KEY_VISIT_DATE = "VISIT_DATE";
|
||||
public static final String KEY_CAMERA_ALLOW = "CAMERA_ALLOW";
|
||||
public static final String KEY_CHECKOUT_STATUS = "CHECKOUT_STATUS";
|
||||
public static final String KEY_CLASS_ID = "CLASS_ID";
|
||||
public static final String KEY_EMP_ID = "EMP_ID";
|
||||
public static final String KEY_GEO_TAG = "GEO_TAG";
|
||||
public static final String KEY_KEYACCOUNT_ID = "KEYACCOUNT_ID";
|
||||
public static final String KEY_STORETYPE_ID = "STORETYPE_ID";
|
||||
public static final String KEY_UPLOAD_STATUS = "UPLOAD_STATUS";
|
||||
public static final String KEY_STORE_IN_TIME = "STORE_IN_TIME";
|
||||
public static final String KEY_USER_ID = "USER_ID";
|
||||
public static final String KEY_IN_TIME = "IN_TIME";
|
||||
public static final String KEY_OUT_TIME = "OUT_TIME";
|
||||
public static final String KEY_LATITUDE = "LATITUDE";
|
||||
public static final String KEY_LONGITUDE = "LONGITUDE";
|
||||
public static final String KEY_COVERAGE_STATUS = "Coverage";
|
||||
public static final String KEY_REASON_ID = "REASON_ID";
|
||||
public static final String KEY_REASON = "REASON";
|
||||
public static final String KEY_COVERAGE_REMARK = "REMARK";
|
||||
public static final String KEY_IMAGE = "IMAGE";
|
||||
public static final String KEY_ID = "Id";
|
||||
public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID";
|
||||
|
||||
|
||||
|
||||
public static final String KEY_JOURNEY_PLAN = "JOURNEY_PLAN";
|
||||
|
||||
public static final String KEY_P = "P";
|
||||
public static final String KEY_D = "D";
|
||||
public static final String KEY_U = "U";
|
||||
public static final String KEY_C = "C";
|
||||
public static final String KEY_L = "Leave";
|
||||
public static final String KEY_N = "NOT_VISITED";
|
||||
public static final String KEY_INVALID = "INVALID";
|
||||
public static final String STORE_STATUS_LEAVE = "L";
|
||||
public static final String KEY_VALID = "Valid";
|
||||
public static final String DATA_DELETE_ALERT_MESSAGE="Saved data will be lost - Do you want to continue?";
|
||||
public static final String KEY_CHECK_IN = "I";
|
||||
// webservice constants
|
||||
|
||||
public static final String KEY_SUCCESS = "Success";
|
||||
@@ -41,16 +83,83 @@ public class CommonString {
|
||||
public static final String METHOD_NAME_UNIVERSAL_DOWNLOAD = "Download_Universal";
|
||||
public static final String SOAP_ACTION_UNIVERSAL = "http://tempuri.org/"
|
||||
+ METHOD_NAME_UNIVERSAL_DOWNLOAD;
|
||||
public static final String METHOD_UPLOAD_STOCK_XML_DATA = "DrUploadXml";
|
||||
public static final String SOAP_ACTION_UPLOAD_ASSET_XMLDATA = "http://tempuri.org/"
|
||||
+ METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
public static final String METHOD_UPLOAD_ASSET = "Upload_Stock_Availiablity_V1";
|
||||
public static final String METHOD_Get_DR_POSM_IMAGES = "GetImageNew";
|
||||
public static final String SOAP_ACTION_Get_DR_POSM_IMAGES = "http://tempuri.org/"
|
||||
+ METHOD_Get_DR_POSM_IMAGES;
|
||||
public static final String METHOD_Get_DR_STORE_IMAGES_GEO = "Upload_StoreGeoTag_IMAGES";
|
||||
public static final String SOAP_ACTION_DR_STORE_IMAGES_GEO = "http://tempuri.org/"
|
||||
+ METHOD_Get_DR_STORE_IMAGES_GEO;
|
||||
|
||||
//Alert Messages
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static final String MESSAGE_FAILURE = "Server Error.Please Access After Some Time";
|
||||
public static final String MESSAGE_FALSE = "Invalid User";
|
||||
public static final String MESSAGE_CHANGED = "Invalid UserId Or Password / Password Has Been Changed.";
|
||||
|
||||
public static final String MESSAGE_EXCEPTION = "Problem Occured : Report The Problem To Parinaam ";
|
||||
public static final String MESSAGE_SOCKETEXCEPTION = "Network Communication Failure. Check Your Network Connection";
|
||||
public static final String TABLE_STORE_GEOTAGGING = "STORE_GEOTAGGING";
|
||||
public static final String TABLE_COVERAGE_DATA = "COVERAGE_DATA";
|
||||
|
||||
|
||||
|
||||
public static final String CREATE_TABLE_COVERAGE_DATA = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_COVERAGE_DATA + " (" + KEY_ID
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ," + KEY_STORE_ID
|
||||
+ " VARCHAR,USER_ID VARCHAR, " + KEY_IN_TIME + " VARCHAR,"
|
||||
+ KEY_OUT_TIME + " VARCHAR," + KEY_VISIT_DATE + " VARCHAR,"
|
||||
+ KEY_LATITUDE + " VARCHAR," + KEY_LONGITUDE + " VARCHAR,"+ KEY_MERCHANDISER_ID + " VARCHAR,"
|
||||
+ KEY_COVERAGE_STATUS + " VARCHAR,"+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_GEO_TAG + " VARCHAR,"
|
||||
+ KEY_REASON_ID + " VARCHAR," + KEY_COVERAGE_REMARK
|
||||
+ " VARCHAR," + KEY_REASON + " VARCHAR)";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static final String CREATE_TABLE_STORE_GEOTAGGING = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_STORE_GEOTAGGING
|
||||
+ " ("
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ "STORE_ID"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "LATITUDE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "LONGITUDE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "GEO_TAG"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "STATUS"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "FRONT_IMAGE" + " VARCHAR)";
|
||||
|
||||
|
||||
|
||||
//File Path
|
||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/";
|
||||
|
||||
|
||||
//Table
|
||||
public static final String TABLE_INSERT_MSL_AVAILABILITY = "Msl_Availability_Data";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_MSL_AVAILABILITY = "CREATE TABLE IF NOT EXISTS "
|
||||
|
||||
@@ -1,30 +1,42 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GeoTag.GeoTagActivity;
|
||||
|
||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
@@ -34,16 +46,19 @@ import cpm.com.gskmtorange.constant.CommonString;
|
||||
*/
|
||||
|
||||
public class StoreListActivity extends AppCompatActivity {
|
||||
|
||||
ArrayList<CoverageBean> coverage;
|
||||
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
||||
|
||||
|
||||
ListView list;
|
||||
//ListView list;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
String date, visit_status;
|
||||
GSKOrangeDB db;
|
||||
|
||||
StoreListActivity.ValueAdapter adapter;
|
||||
RecyclerView recyclerView;
|
||||
private SharedPreferences.Editor editor = null;
|
||||
LinearLayout linearlay;
|
||||
String store_id;
|
||||
private Dialog dialog;
|
||||
boolean result_flag = false, leaveflag = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -64,127 +79,35 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
db.open();
|
||||
|
||||
|
||||
list = (ListView) findViewById(R.id.list_id);
|
||||
linearlay = (LinearLayout) findViewById(R.id.linearlayout);
|
||||
recyclerView = (RecyclerView) findViewById(R.id.drawer_layout_recycle);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void onResume() {
|
||||
// TODO Auto-generated method stub
|
||||
super.onResume();
|
||||
|
||||
storelist = db.getStoreData(date);
|
||||
|
||||
coverage=db.getCoverageData(date);
|
||||
|
||||
if (storelist.size() > 0) {
|
||||
list.setAdapter(new MyAdaptor());
|
||||
}
|
||||
//list.setAdapter(new MyAdaptor());
|
||||
adapter = new StoreListActivity.ValueAdapter(getApplicationContext(), storelist);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
} else {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
|
||||
Toast.makeText(getApplicationContext(), "Click", Toast.LENGTH_LONG).show();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private class MyAdaptor extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
|
||||
return storelist.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder holder = null;
|
||||
if (convertView == null) {
|
||||
holder = new ViewHolder();
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = inflater.inflate(R.layout.storeviewlist, null);
|
||||
|
||||
holder.storename = (TextView) convertView
|
||||
.findViewById(R.id.storelistviewxml_storename);
|
||||
holder.storeaddress = (TextView) convertView
|
||||
.findViewById(R.id.storelistviewxml_storeaddress);
|
||||
|
||||
holder.imgtick = (ImageView) convertView
|
||||
.findViewById(R.id.storelistviewxml_storeico);
|
||||
|
||||
holder.checkout = (Button) convertView
|
||||
.findViewById(R.id.chkout);
|
||||
|
||||
holder.l1 = (RelativeLayout) convertView
|
||||
.findViewById(R.id.storenamelistview_layout);
|
||||
|
||||
convertView.setTag(holder);
|
||||
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
holder.storename.setText(storelist.get(position).getSTORE_NAME());
|
||||
holder.storeaddress.setText(storelist.get(position).getCITY());
|
||||
|
||||
|
||||
holder.checkout.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(
|
||||
StoreListActivity.this);
|
||||
builder.setMessage("Are you sure you want to checkout")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("OK",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(
|
||||
DialogInterface dialog, int id) {
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Cancel",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(
|
||||
DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return convertView;
|
||||
recyclerView.setVisibility(View.INVISIBLE);
|
||||
linearlay.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private class ViewHolder {
|
||||
TextView storename, storeaddress;
|
||||
ImageView imgtick;
|
||||
Button checkout;
|
||||
|
||||
RelativeLayout l1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
@@ -192,11 +115,15 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
|
||||
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
|
||||
// NavUtils.navigateUpFromSameTask(this);
|
||||
finish();
|
||||
|
||||
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
}
|
||||
@@ -205,4 +132,286 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
public class ValueAdapter extends RecyclerView.Adapter<StoreListActivity.ValueAdapter.MyViewHolder> {
|
||||
|
||||
private LayoutInflater inflator;
|
||||
|
||||
List<StoreBean> data = Collections.emptyList();
|
||||
|
||||
public ValueAdapter(Context context, List<StoreBean> data) {
|
||||
|
||||
inflator = LayoutInflater.from(context);
|
||||
this.data = data;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreListActivity.ValueAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
|
||||
|
||||
View view = inflator.inflate(R.layout.storeviewlist, parent, false);
|
||||
|
||||
StoreListActivity.ValueAdapter.MyViewHolder holder = new StoreListActivity.ValueAdapter.MyViewHolder(view);
|
||||
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final StoreListActivity.ValueAdapter.MyViewHolder viewHolder, final int position) {
|
||||
|
||||
final StoreBean current = data.get(position);
|
||||
|
||||
|
||||
String storeid = current.getSTORE_ID();
|
||||
//viewHolder.txt.setText(current.txt);
|
||||
|
||||
viewHolder.txt.setText(current.getSTORE_NAME());
|
||||
viewHolder.address.setText(current.getADDRESS());
|
||||
|
||||
if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_VALID)) {
|
||||
viewHolder.chkbtn.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_U)) {
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tick_u);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tick_d);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_C)) {
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tick_c);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_P)) {
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tick_p);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_L)) {
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tickl);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_INVALID)) {
|
||||
|
||||
|
||||
if (coverage.size() > 0) {
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < coverage.size(); i++) {
|
||||
|
||||
|
||||
if (coverage.get(i).getInTime() != null) {
|
||||
|
||||
if (coverage.get(i).getOutTime() == null) {
|
||||
|
||||
if (storeid.equals(coverage.get(i).getStoreId())) {
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.checkin);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
|
||||
viewHolder.relativelayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
store_id = current.getSTORE_ID();
|
||||
|
||||
|
||||
if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_U)) {
|
||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
||||
|
||||
Snackbar.make(v, R.string.title_store_list_activity_store_data_uploaded, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_C)) {
|
||||
|
||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
|
||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_P)) {
|
||||
|
||||
Snackbar.make(v, R.string.title_store_list_activity_store_again_uploaded, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_L)) {
|
||||
Snackbar.make(v, R.string.title_store_list_activity_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else {
|
||||
|
||||
// PUT IN PREFERENCES
|
||||
editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
editor.putString(CommonString.KEY_STORE_NAME, current.getSTORE_NAME());
|
||||
editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE());
|
||||
editor.putString(CommonString.KEY_CAMERA_ALLOW, current.getCAMERA_ALLOW());
|
||||
editor.putString(CommonString.KEY_CHECKOUT_STATUS, current.getCHECKOUT_STATUS());
|
||||
editor.putString(CommonString.KEY_CLASS_ID, current.getCLASS_ID());
|
||||
editor.putString(CommonString.KEY_EMP_ID, current.getEMP_ID());
|
||||
editor.putString(CommonString.KEY_GEO_TAG, current.getGEO_TAG());
|
||||
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
|
||||
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
|
||||
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
|
||||
editor.commit();
|
||||
|
||||
// showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS());
|
||||
|
||||
if (!setcheckedmenthod(store_id)) {
|
||||
boolean enteryflag = true;
|
||||
if (coverage.size() > 0) {
|
||||
int i;
|
||||
for (i = 0; i < coverage.size(); i++) {
|
||||
|
||||
if (coverage.get(i).getInTime() != null) {
|
||||
|
||||
if (coverage.get(i).getOutTime() == null) {
|
||||
if (!store_id.equals(coverage.get(i).getStoreId())) {
|
||||
Snackbar.make(v, R.string.title_store_list_checkout_current, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
enteryflag = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (enteryflag) {
|
||||
showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS());
|
||||
}
|
||||
} else {
|
||||
Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView txt, address;
|
||||
ImageView icon;
|
||||
RelativeLayout relativelayout;
|
||||
ImageView imageview;
|
||||
Button chkbtn;
|
||||
|
||||
public MyViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
txt = (TextView) itemView.findViewById(R.id.storelistviewxml_storename);
|
||||
address = (TextView) itemView.findViewById(R.id.storelistviewxml_storeaddress);
|
||||
|
||||
relativelayout = (RelativeLayout) itemView.findViewById(R.id.storenamelistview_layout);
|
||||
imageview = (ImageView) itemView.findViewById(R.id.imageView2);
|
||||
|
||||
chkbtn = (Button) itemView.findViewById(R.id.chkout);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void showMyDialog(final String storeCd, final String storeName, final String status, final String visitDate, final String checkout_status) {
|
||||
dialog = new Dialog(this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(R.layout.dialogbox);
|
||||
|
||||
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.radiogrpvisit);
|
||||
|
||||
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
// find which radio button is selected
|
||||
if (checkedId == R.id.yes) {
|
||||
|
||||
Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
|
||||
startActivity(in);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
dialog.cancel();
|
||||
|
||||
} else if (checkedId == R.id.no) {
|
||||
|
||||
dialog.cancel();
|
||||
|
||||
if (checkout_status.equals(CommonString.KEY_INVALID) || checkout_status.equals(CommonString.KEY_VALID)) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||
builder.setMessage(CommonString.DATA_DELETE_ALERT_MESSAGE)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Yes",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
|
||||
|
||||
|
||||
/*Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
|
||||
startActivity(in);*/
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton("No",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
|
||||
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
|
||||
alert.show();
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
|
||||
/* Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
|
||||
startActivity(in);*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
|
||||
public boolean setcheckedmenthod(String store_cd) {
|
||||
|
||||
|
||||
for (int i = 0; i < coverage.size(); i++) {
|
||||
if (store_cd.equals(coverage.get(i).getStoreId())) {
|
||||
if (coverage.get(i).getOutTime() != null) {
|
||||
result_flag = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
result_flag = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return result_flag;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,381 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.location.Location;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.GoogleApiClient;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
|
||||
/**
|
||||
* Created by ashishc on 31-05-2016.
|
||||
*/
|
||||
public class StoreimageActivity extends AppCompatActivity implements View.OnClickListener,GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
|
||||
|
||||
|
||||
ImageView img_cam,img_clicked;
|
||||
Button btn_save;
|
||||
|
||||
String _pathforcheck,_path,str;
|
||||
|
||||
String store_id,visit_date,username,intime,date;
|
||||
private SharedPreferences preferences;
|
||||
AlertDialog alert;
|
||||
String img_str;
|
||||
private GSKOrangeDB database;
|
||||
|
||||
String lat,lon;
|
||||
GoogleApiClient mGoogleApiClient;
|
||||
ArrayList<CoverageBean> coverage_list;
|
||||
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_storeimage);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
||||
img_clicked = (ImageView) findViewById(R.id.img_cam_selfie);
|
||||
|
||||
btn_save = (Button) findViewById(R.id.btn_save_selfie);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
|
||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
|
||||
database = new GSKOrangeDB(this);
|
||||
database.open();
|
||||
|
||||
|
||||
coverage_list = database.getCoverageData(date);
|
||||
|
||||
img_cam.setOnClickListener(this);
|
||||
img_clicked.setOnClickListener(this);
|
||||
btn_save.setOnClickListener(this);
|
||||
|
||||
// Create an instance of GoogleAPIClient.
|
||||
if (mGoogleApiClient == null) {
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
||||
.addConnectionCallbacks(this)
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API)
|
||||
.build();
|
||||
}
|
||||
|
||||
if ( Build.VERSION.SDK_INT >= 23 &&
|
||||
ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
||||
ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if(id==android.R.id.home){
|
||||
|
||||
// NavUtils.navigateUpFromSameTask(this);
|
||||
finish();
|
||||
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
||||
startActivity(i);*/
|
||||
|
||||
finish();
|
||||
|
||||
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
int id = v.getId();
|
||||
|
||||
switch (id){
|
||||
|
||||
case R.id.img_cam_selfie:
|
||||
|
||||
_pathforcheck = store_id + "Store"
|
||||
+ "Image" + visit_date.replace("/","") + getCurrentTime().replace(":","")+".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
|
||||
intime = getCurrentTime();
|
||||
|
||||
startCameraActivity();
|
||||
|
||||
break;
|
||||
|
||||
case R.id.btn_save_selfie:
|
||||
|
||||
if (img_str !=null) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(
|
||||
StoreimageActivity.this);
|
||||
builder.setMessage("Do you want to save the data ")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("OK",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(
|
||||
DialogInterface dialog,
|
||||
int id) {
|
||||
|
||||
alert.getButton(
|
||||
AlertDialog.BUTTON_POSITIVE)
|
||||
.setEnabled(false);
|
||||
|
||||
String status ="INVALID";
|
||||
|
||||
|
||||
CoverageBean cdata = new CoverageBean();
|
||||
cdata.setStoreId(store_id);
|
||||
cdata.setVisitDate(visit_date);
|
||||
cdata.setUserId(username);
|
||||
cdata.setInTime(intime);
|
||||
cdata.setReason("");
|
||||
cdata.setReasonid("0");
|
||||
cdata.setLatitude(lat);
|
||||
cdata.setLongitude(lon);
|
||||
cdata.setImage(img_str);
|
||||
cdata.setRemark("");
|
||||
cdata.setStatus(CommonString.KEY_CHECK_IN);
|
||||
|
||||
database.InsertCoverageData(cdata);
|
||||
|
||||
database.updateCheckoutStatus(store_id, status);
|
||||
|
||||
/* SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
editor.putString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||
editor.putString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
|
||||
editor.commit();*/
|
||||
|
||||
|
||||
/* Intent in=new Intent(StoreimageActivity.this,StoreEntry.class);
|
||||
startActivity(in);
|
||||
|
||||
|
||||
|
||||
finish();*/
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Cancel",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(
|
||||
DialogInterface dialog,
|
||||
int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
}
|
||||
else {
|
||||
Toast.makeText(getApplicationContext(),
|
||||
"Please click the image", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void startCameraActivity() {
|
||||
|
||||
try {
|
||||
/*Log.i("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(_path);
|
||||
Uri outputFileUri = Uri.fromFile(file);
|
||||
|
||||
Intent intent = new Intent(
|
||||
MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
|
||||
startActivityForResult(intent, 0);*/
|
||||
|
||||
Log.i("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(_path);
|
||||
Uri outputFileUri = Uri.fromFile(file);
|
||||
|
||||
String defaultCameraPackage="";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
for (int n=0;n<list.size();n++) {
|
||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, 0);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
|
||||
Log.i("MakeMachine", "resultCode: " + resultCode);
|
||||
switch (resultCode) {
|
||||
case 0:
|
||||
Log.i("MakeMachine", "User cancelled");
|
||||
break;
|
||||
|
||||
case -1:
|
||||
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
|
||||
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
||||
|
||||
img_cam.setImageBitmap(bmp);
|
||||
|
||||
img_clicked.setVisibility(View.GONE);
|
||||
img_cam.setVisibility(View.VISIBLE);
|
||||
|
||||
img_str = _pathforcheck;
|
||||
_pathforcheck = "";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
|
||||
public String getCurrentTime() {
|
||||
|
||||
Calendar m_cal = Calendar.getInstance();
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||
String cdate = formatter.format(m_cal.getTime());
|
||||
|
||||
/* String intime = m_cal.get(Calendar.HOUR_OF_DAY) + ":"
|
||||
+ m_cal.get(Calendar.MINUTE) + ":" + m_cal.get(Calendar.SECOND);*/
|
||||
|
||||
return cdate;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnected(Bundle bundle) {
|
||||
|
||||
Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||
if (mLastLocation != null) {
|
||||
lat = String.valueOf(mLastLocation.getLatitude());
|
||||
lon = String.valueOf(mLastLocation.getLongitude());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionSuspended(int i) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed(ConnectionResult connectionResult) {
|
||||
|
||||
}
|
||||
|
||||
protected void onStart() {
|
||||
mGoogleApiClient.connect();
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
protected void onStop() {
|
||||
mGoogleApiClient.disconnect();
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package cpm.com.gskmtorange.gettersetter;
|
||||
|
||||
public class CoverageBean
|
||||
{
|
||||
protected int MID;
|
||||
protected String process_id;
|
||||
|
||||
public String getGEO_TAG() {
|
||||
return GEO_TAG;
|
||||
}
|
||||
|
||||
public void setGEO_TAG(String GEO_TAG) {
|
||||
this.GEO_TAG = GEO_TAG;
|
||||
}
|
||||
|
||||
protected String GEO_TAG;
|
||||
public String getProcess_id() {
|
||||
return process_id;
|
||||
}
|
||||
|
||||
public void setProcess_id(String process_id) {
|
||||
this.process_id = process_id;
|
||||
}
|
||||
|
||||
protected String storeId;
|
||||
protected String storename;
|
||||
|
||||
public String getStorename() {
|
||||
return storename;
|
||||
}
|
||||
|
||||
public void setStorename(String storename) {
|
||||
this.storename = storename;
|
||||
}
|
||||
|
||||
protected String Remark;
|
||||
|
||||
public String getRemark() {
|
||||
return Remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
Remark = remark;
|
||||
}
|
||||
|
||||
protected String userId;
|
||||
protected String app_version;
|
||||
protected String image_allow;
|
||||
|
||||
public String getImage_allow() {
|
||||
return image_allow;
|
||||
}
|
||||
|
||||
public void setImage_allow(String image_allow) {
|
||||
this.image_allow = image_allow;
|
||||
}
|
||||
|
||||
public String getApp_version() {
|
||||
return app_version;
|
||||
}
|
||||
|
||||
public void setApp_version(String app_version) {
|
||||
this.app_version = app_version;
|
||||
}
|
||||
|
||||
protected String inTime;
|
||||
|
||||
protected String outTime;
|
||||
|
||||
protected String visitDate;
|
||||
|
||||
protected String keycontactId;
|
||||
|
||||
protected String isdDeploy;
|
||||
|
||||
protected String uploadStatus;
|
||||
|
||||
private String latitude;
|
||||
|
||||
private String longitude;
|
||||
|
||||
private String reasonid="";
|
||||
|
||||
private String sub_reasonId="";
|
||||
|
||||
public String getSub_reasonId() {
|
||||
return sub_reasonId;
|
||||
}
|
||||
|
||||
public void setSub_reasonId(String sub_reasonId) {
|
||||
this.sub_reasonId = sub_reasonId;
|
||||
}
|
||||
|
||||
private String reason="";
|
||||
|
||||
private String status="N";
|
||||
|
||||
private String image="";
|
||||
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getMID() {
|
||||
return MID;
|
||||
}
|
||||
|
||||
public void setMID(int mID) {
|
||||
MID = mID;
|
||||
}
|
||||
|
||||
public String getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
||||
public void setStoreId(String storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getInTime() {
|
||||
return inTime;
|
||||
}
|
||||
|
||||
public void setInTime(String inTime) {
|
||||
this.inTime = inTime;
|
||||
}
|
||||
|
||||
public String getOutTime() {
|
||||
return outTime;
|
||||
}
|
||||
|
||||
public void setOutTime(String outTime) {
|
||||
this.outTime = outTime;
|
||||
}
|
||||
|
||||
public String getVisitDate() {
|
||||
return visitDate;
|
||||
}
|
||||
|
||||
public void setVisitDate(String visitDate) {
|
||||
this.visitDate = visitDate;
|
||||
}
|
||||
|
||||
public String getKeycontactId() {
|
||||
return keycontactId;
|
||||
}
|
||||
|
||||
public void setKeycontactId(String keycontactId) {
|
||||
this.keycontactId = keycontactId;
|
||||
}
|
||||
|
||||
public String getIsdDeploy() {
|
||||
return isdDeploy;
|
||||
}
|
||||
|
||||
public void setIsdDeploy(String isdDeploy) {
|
||||
this.isdDeploy = isdDeploy;
|
||||
}
|
||||
|
||||
public String getUploadStatus() {
|
||||
return uploadStatus;
|
||||
}
|
||||
|
||||
public void setUploadStatus(String uploadStatus) {
|
||||
this.uploadStatus = uploadStatus;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getReasonid() {
|
||||
return reasonid;
|
||||
}
|
||||
|
||||
public void setReasonid(String reasonid) {
|
||||
this.reasonid = reasonid;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cpm.com.gskmtorange.gettersetter;
|
||||
|
||||
public class GeotaggingBeans {
|
||||
|
||||
|
||||
|
||||
public String storeid;
|
||||
public String url1;
|
||||
public String url2;
|
||||
public String status;
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String url3;
|
||||
public double Latitude ;
|
||||
public double Longitude;
|
||||
|
||||
public String getStoreid() {
|
||||
return storeid;
|
||||
}
|
||||
public void setStoreid(String storeid) {
|
||||
this.storeid = storeid;
|
||||
}
|
||||
public double getLatitude() {
|
||||
return Latitude;
|
||||
}
|
||||
public void setLatitude(double d) {
|
||||
Latitude = d;
|
||||
}
|
||||
public double getLongitude() {
|
||||
return Longitude;
|
||||
}
|
||||
public void setLongitude(double d) {
|
||||
Longitude = d;
|
||||
}
|
||||
|
||||
|
||||
public void setUrl1(String url1)
|
||||
{
|
||||
|
||||
this.url1=url1;
|
||||
}
|
||||
|
||||
public String getUrl1()
|
||||
{
|
||||
|
||||
return url1;
|
||||
}
|
||||
|
||||
public void setUrl2(String url2)
|
||||
{
|
||||
|
||||
this.url2=url2;
|
||||
}
|
||||
|
||||
public String getUrl2()
|
||||
{
|
||||
|
||||
return url2;
|
||||
}
|
||||
|
||||
public void setUrl3(String url3)
|
||||
{
|
||||
|
||||
this.url3=url3;
|
||||
}
|
||||
|
||||
public String getUrl3()
|
||||
{
|
||||
|
||||
return url3;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
@@ -43,6 +44,7 @@ import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||
|
||||
@@ -54,15 +56,17 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
ArrayList<Stock_FacingGetterSetter> childDataList;
|
||||
List<Stock_FacingGetterSetter> hashMapListHeaderData;
|
||||
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> hashMapListChildData;
|
||||
List<Integer> checkHeaderArray = new ArrayList<>();
|
||||
|
||||
ExpandableListAdapter adapter;
|
||||
GSKOrangeDB db;
|
||||
|
||||
String categoryName, categoryId, storeId;
|
||||
String categoryName, categoryId, storeId, Error_Message = "";
|
||||
|
||||
String path = "", str = "", _pathforcheck = "", img1 = "";
|
||||
String path = "", str = "", _pathforcheck = "", img1 = "", img2 = "";
|
||||
static int child_position = -1;
|
||||
boolean isDialogOpen = true;
|
||||
boolean checkflag = true;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -89,45 +93,43 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
|
||||
prepareList();
|
||||
|
||||
str = Environment.getExternalStorageState();
|
||||
str = CommonString.FILE_PATH + _pathforcheck;
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
/*Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();*/
|
||||
|
||||
//if (validateData(listDataHeader, listDataChild)) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
||||
builder.setMessage("Are you sure you want to save")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
db.open();
|
||||
//db.InsertStock_Facing(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
||||
builder.setMessage("Are you sure you want to save")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
db.open();
|
||||
|
||||
if (db.checkStockAndFacingData(storeId, categoryId)) {
|
||||
db.updateStockAndFacing(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
} else {
|
||||
db.InsertStock_Facing(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
if (db.checkStockAndFacingData(storeId, categoryId)) {
|
||||
db.updateStockAndFacing(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
} else {
|
||||
db.InsertStock_Facing(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
}
|
||||
|
||||
Toast.makeText(getApplicationContext(), "Data has been saved", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
Toast.makeText(getApplicationContext(), "Data has been saved", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
})
|
||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
/*} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_AvailabilityActivity.this);
|
||||
})
|
||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
||||
builder.setMessage("Fill the value or fill 0 ")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
@@ -137,13 +139,22 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
int lastItem = firstVisibleItem + visibleItemCount;
|
||||
|
||||
if (firstVisibleItem == 0) {
|
||||
fab.setVisibility(View.VISIBLE);
|
||||
} else if (lastItem == totalItemCount) {
|
||||
fab.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
fab.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -284,62 +295,63 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
String date = new Date().toLocaleString().toString();
|
||||
String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock Camera1_" + tempDate + ".jpg";
|
||||
_pathforcheck = "Stock_Cam1_" + storeId + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity(groupPosition);
|
||||
startCameraActivity1(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img1.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
//headerTitle.setImg_cam(img1);
|
||||
headerTitle.setImage1(img1);
|
||||
img1 = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*if (headerTitle.getImg_cam().equals("")) {
|
||||
if (headerTitle.getImage1().equals("")) {
|
||||
img_camera1.setBackgroundResource(R.drawable.ic_menu_camera);
|
||||
} else {
|
||||
//img_camera1.setBackgroundResource(R.drawable.camtick);
|
||||
}*/
|
||||
img_camera1.setBackgroundResource(R.drawable.ic_menu_gallery);
|
||||
}
|
||||
|
||||
/*img_camera.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
img_camera2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String date = new Date().toLocaleString().toString();
|
||||
String TempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock" + headerTitle.getBrand_cd() + "_" + store_cd + "_" + visit_date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
||||
_pathforcheck = "Stock_Cam1_" + storeId + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity(groupPosition);
|
||||
startCameraActivity2(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img1.equalsIgnoreCase("")) {
|
||||
if (!img2.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
headerTitle.setImg_cam(img1);
|
||||
img1 = "";
|
||||
headerTitle.setImage2(img2);
|
||||
img2 = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (headerTitle.getImg_cam().equals("")) {
|
||||
img_camera.setBackgroundResource(R.drawable.cam);
|
||||
if (headerTitle.getImage2().equals("")) {
|
||||
img_camera2.setBackgroundResource(R.drawable.ic_menu_camera);
|
||||
} else {
|
||||
img_camera.setBackgroundResource(R.drawable.camtick);
|
||||
img_camera2.setBackgroundResource(R.drawable.ic_menu_gallery);
|
||||
}
|
||||
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
txt_header.setTextColor(getResources().getColor(R.color.red));
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
} else {
|
||||
txt_header.setTextColor(getResources().getColor(R.color.grey_dark));
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return convertView;
|
||||
}
|
||||
@@ -475,6 +487,29 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
|
||||
holder.ed_facing.setText(childData.getFacing());
|
||||
|
||||
if (!checkflag) {
|
||||
boolean tempflag = false;
|
||||
|
||||
if (holder.ed_stock.getText().toString().equals("")) {
|
||||
holder.ed_stock.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
holder.ed_stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.ed_stock.setHint("Empty");
|
||||
tempflag = true;
|
||||
}
|
||||
|
||||
if (holder.ed_facing.getText().toString().equals("")) {
|
||||
holder.ed_facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
holder.ed_facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.ed_facing.setHint("Empty");
|
||||
tempflag = true;
|
||||
}
|
||||
|
||||
if (tempflag) {
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
} else {
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
}
|
||||
|
||||
return convertView;
|
||||
}
|
||||
@@ -497,23 +532,97 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
LinearLayout lin_category;
|
||||
}
|
||||
|
||||
private void startCameraActivity(int position) {
|
||||
boolean validateData(List<Stock_FacingGetterSetter> listDataHeader,
|
||||
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> listDataChild) {
|
||||
boolean flag = true;
|
||||
checkHeaderArray.clear();
|
||||
|
||||
for (int i = 0; i < listDataHeader.size(); i++) {
|
||||
String imagePath = listDataHeader.get(i).getImage1();
|
||||
String imagePath1 = listDataHeader.get(i).getImage2();
|
||||
|
||||
for (int j = 0; j < listDataChild.get(listDataHeader.get(i)).size(); j++) {
|
||||
String stock = listDataChild.get(listDataHeader.get(i)).get(j).getStock();
|
||||
String faceup = listDataChild.get(listDataHeader.get(i)).get(j).getFacing();
|
||||
|
||||
if (!imagePath.equals("") || !imagePath1.equals("")) {
|
||||
if (!stock.equals("0")) {
|
||||
if (stock.equals("") || faceup.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
|
||||
flag = false;
|
||||
Error_Message = "Please fill all the data";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (stock.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
|
||||
flag = false;
|
||||
Error_Message = "Please fill all the data";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
|
||||
flag = false;
|
||||
Error_Message = "Please click either 1 image";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag == false) {
|
||||
checkflag = false;
|
||||
break;
|
||||
} else {
|
||||
checkflag = true;
|
||||
}
|
||||
}
|
||||
//expListView.invalidate();
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
return checkflag;
|
||||
}
|
||||
|
||||
private void startCameraActivity1(int position) {
|
||||
try {
|
||||
Log.e("Stock & Facing ", "startCameraActivity()");
|
||||
/*Log.e("Stock and Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
Uri outputFileUri = Uri.fromFile(file);
|
||||
|
||||
/*String defaultCameraPackage = "";
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
startActivityForResult(intent, position);*/
|
||||
|
||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
Uri outputFileUri = Uri.fromFile(file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
|
||||
for (int n = 0; n < list.size(); n++) {
|
||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
// Log.d("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
// Log.d("TAG", "package name : " + list.get(n).packageName);
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
/*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
Log.e("TAG", "package name : " + list.get(n).packageName);*/
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,11 +630,55 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, position);*/
|
||||
startActivityForResult(intent, 1);
|
||||
//startActivityForResult(intent, position);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void startCameraActivity2(int position) {
|
||||
try {
|
||||
/*Log.e("Stock and Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
Uri outputFileUri = Uri.fromFile(file);
|
||||
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
startActivityForResult(intent, position);
|
||||
startActivityForResult(intent, position);*/
|
||||
|
||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
Uri outputFileUri = Uri.fromFile(file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
for (int n = 0; n < list.size(); n++) {
|
||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
/*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
Log.e("TAG", "package name : " + list.get(n).packageName);*/
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, 2);
|
||||
//startActivityForResult(intent, position);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -534,7 +687,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
Log.e("Stock & Facing", "resultCode: " + resultCode);
|
||||
switch (resultCode) {
|
||||
/*switch (resultCode) {
|
||||
case 0:
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
break;
|
||||
@@ -542,13 +695,41 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img1 = _pathforcheck;
|
||||
//adapter.notifyDataSetChanged();
|
||||
adapter.notifyDataSetChanged();
|
||||
_pathforcheck = "";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
|
||||
switch (requestCode) {
|
||||
case 1:
|
||||
if (resultCode == -1) {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img1 = _pathforcheck;
|
||||
adapter.notifyDataSetChanged();
|
||||
_pathforcheck = "";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (resultCode == -1) {
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img2 = _pathforcheck;
|
||||
adapter.notifyDataSetChanged();
|
||||
_pathforcheck = "";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
}
|
||||
break;
|
||||
}
|
||||
// TODO Auto-generated method stub
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package cpm.com.gskmtorange.messgae;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
||||
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
||||
|
||||
/**
|
||||
* Created by ashishc on 03-01-2017.
|
||||
*/
|
||||
|
||||
public class AlertMessage {
|
||||
|
||||
public static final String MESSAGE_ERROR = "Network Error , ";
|
||||
|
||||
public static final String MESSAGE_DATA_NOT = "Data Not Uploaded , ";
|
||||
|
||||
private Exception exception;
|
||||
String value;
|
||||
private String data, condition,exceptionString;
|
||||
private Activity activity;
|
||||
private String error;
|
||||
|
||||
|
||||
|
||||
public AlertMessage(Activity activity, String data, String condition,
|
||||
Exception exception) {
|
||||
this.activity = activity;
|
||||
this.data = data;
|
||||
this.condition = condition;
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
public AlertMessage(Activity activity, String data, String condition,
|
||||
String exception, String a) {
|
||||
this.activity = activity;
|
||||
this.data = data;
|
||||
this.condition = condition;
|
||||
this.exceptionString = exception;
|
||||
this.error = a;
|
||||
}
|
||||
|
||||
|
||||
public void showMessage() {
|
||||
|
||||
if (condition.equals("success")) {
|
||||
|
||||
ShowAlert1(data);
|
||||
}
|
||||
else if(condition.equals("failure"))
|
||||
{
|
||||
ShowAlertSocket(data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void ShowAlert1(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
Intent i = new Intent(activity, GeoTagStoreList.class);
|
||||
activity.startActivity(i);
|
||||
|
||||
activity.finish();
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void ShowAlertSocket(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
Intent i = new Intent(activity, GeoTagStoreList.class);
|
||||
activity.startActivity(i);
|
||||
|
||||
activity.finish();
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package cpm.com.gskmtorange.xmlHandlers;
|
||||
|
||||
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||
|
||||
public class FailureXMLHandler extends DefaultHandler{
|
||||
|
||||
private String elementValue;
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
|
||||
|
||||
public FailureGetterSetter getFailureGetterSetter()
|
||||
{
|
||||
return failureGetterSetter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startDocument() throws SAXException {
|
||||
// TODO Auto-generated method stub
|
||||
super.startDocument();
|
||||
|
||||
failureGetterSetter = new FailureGetterSetter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void characters(char[] ch, int start, int length)
|
||||
throws SAXException {
|
||||
// TODO Auto-generated method stub
|
||||
super.characters(ch, start, length);
|
||||
|
||||
elementValue = new String(ch, start, length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endElement(String uri, String localName, String qName)
|
||||
throws SAXException {
|
||||
// TODO Auto-generated method stub
|
||||
super.endElement(uri, localName, qName);
|
||||
|
||||
if(qName.equals("STATUS"))
|
||||
{
|
||||
failureGetterSetter.setStatus(elementValue);
|
||||
}
|
||||
else if(qName.equals("ERRORMSG"))
|
||||
{
|
||||
failureGetterSetter.setErrorMsg(elementValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="cpm.com.gskmtorange.geotag.GeoTagActivity">
|
||||
tools:context="cpm.com.gskmtorange.GeoTag.GeoTagActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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.dailyentry.StoreimageActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.NoActionBar.PopupOverlay" />
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/contentstoreimage" />
|
||||
|
||||
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -11,7 +11,7 @@
|
||||
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:context="cpm.com.gskmtorange.GeoTag.GeoTagActivity"
|
||||
tools:showIn="@layout/activity_geo_tag">
|
||||
|
||||
</fragment>
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
android:id="@+id/content_msl__availability"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/activity_msl__availability">
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -46,7 +45,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="SKU"
|
||||
android:text="@string/stock_facing_sku_name"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
@@ -63,7 +62,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Stock"
|
||||
android:text="@string/stock_facing_stock"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
@@ -80,7 +79,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Faceup"
|
||||
android:text="@string/stock_facing_faceup"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="cpm.com.gskmtorange.dailyentry.StoreimageActivity"
|
||||
tools:showIn="@layout/activity_storeimage"
|
||||
android:weightSum="10"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/grey_background">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/colorPrimary">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Click Store Front Image"
|
||||
android:textSize="@dimen/store_entry_text_size"
|
||||
android:layout_centerInParent="true"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- <RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgloreal"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/loreal"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
|
||||
</RelativeLayout>-->
|
||||
|
||||
<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="8"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
card_view:cardBackgroundColor="@color/white"
|
||||
card_view:cardCornerRadius="5dp"
|
||||
>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/rel_selfie"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_selfie"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_cam_selfie"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/camera_icon_done"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_save_selfie"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorPrimary"
|
||||
android:text="@string/save"
|
||||
android:textSize="@dimen/store_entry_text_size"
|
||||
android:layout_centerInParent="true"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="20dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar1"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/percentage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_below="@+id/progressBar1"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/progressBar1"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:padding="10sp" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Store Visited"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dp"
|
||||
android:background="@color/white" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radiogrpvisit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/yes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Yes"
|
||||
android:textColor="#000000"
|
||||
android:background="@color/colorPrimary"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
|
||||
android:background="@color/white" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/no"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="No"
|
||||
android:textColor="#000000"
|
||||
android:background="@color/colorPrimary"/>
|
||||
</RadioGroup>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
android:id="@+id/relativelayout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginBottom="1sp"
|
||||
@@ -58,7 +59,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/geolistviewxml_storeico"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@mipmap/geopin" />
|
||||
android:background="@mipmap/geopin"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
>
|
||||
|
||||
<ListView
|
||||
<!-- <ListView
|
||||
android:id="@+id/list_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -72,7 +72,44 @@
|
||||
android:dividerHeight="2dp"
|
||||
android:drawSelectorOnTop="false"
|
||||
android:fastScrollEnabled="true"
|
||||
android:smoothScrollbar="true" />
|
||||
android:smoothScrollbar="true" />-->
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/drawer_layout_recycle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="5dp"
|
||||
>
|
||||
|
||||
</android.support.v7.widget.RecyclerView>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearlayout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="100"
|
||||
android:visibility="gone"
|
||||
|
||||
>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/sad_cloud"
|
||||
>
|
||||
|
||||
</View>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
android:orientation="vertical"
|
||||
android:weightSum="100">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -60,7 +64,7 @@
|
||||
|
||||
>
|
||||
|
||||
<ListView
|
||||
<!-- <ListView
|
||||
android:id="@+id/list_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -70,7 +74,21 @@
|
||||
android:dividerHeight="2dp"
|
||||
android:drawSelectorOnTop="false"
|
||||
android:fastScrollEnabled="true"
|
||||
android:smoothScrollbar="true" />
|
||||
android:smoothScrollbar="true" />-->
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/drawer_layout_recycle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="5dp"
|
||||
>
|
||||
|
||||
</android.support.v7.widget.RecyclerView>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -2,71 +2,84 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginRight="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_weight="35"
|
||||
|
||||
card_view:cardBackgroundColor="@color/colorOrange"
|
||||
card_view:cardCornerRadius="15dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/storenamelistview_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
|
||||
android:padding="10sp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/storelistviewxml_storeico"
|
||||
android:layout_width="wrap_content"
|
||||
<RelativeLayout
|
||||
android:id="@+id/storenamelistview_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginRight="6sp"
|
||||
android:background="@mipmap/store"
|
||||
android:paddingTop="5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/storelistviewxml_storename"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/storelistviewxml_storeico"
|
||||
android:layout_toRightOf="@+id/storelistviewxml_storeico"
|
||||
android:text="GSK MT ORANGE STORE"
|
||||
android:textColor="#1F3A6C"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
android:padding="10sp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/storelistviewxml_storeaddress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/storelistviewxml_storename"
|
||||
android:layout_below="@+id/storelistviewxml_storename"
|
||||
android:text="C 126, Okhla II, "
|
||||
android:textColor="#666666"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="normal" />
|
||||
<ImageView
|
||||
android:id="@+id/storelistviewxml_storeico"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginRight="6sp"
|
||||
android:background="@mipmap/store"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingTop="25sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/chkout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:focusable="false"
|
||||
android:visibility="invisible" />
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:id="@+id/storelistviewxml_storename"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/storelistviewxml_storeico"
|
||||
android:layout_toRightOf="@+id/storelistviewxml_storeico"
|
||||
android:text="GSK MT ORANGE STORE"
|
||||
android:textColor="#1F3A6C"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/storelistviewxml_storeaddress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/storelistviewxml_storename"
|
||||
android:layout_below="@+id/storelistviewxml_storename"
|
||||
android:text="C 126, Okhla II, "
|
||||
android:textColor="#666666"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="normal" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/chkout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:focusable="false"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:layout_alignBottom="@+id/storelistviewxml_storeico"
|
||||
android:layout_alignParentRight="true"
|
||||
|
||||
android:background="@mipmap/tick_c"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
</RelativeLayout>
|
||||
|
Before Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 14 KiB |
@@ -21,4 +21,8 @@
|
||||
<string name="menu_setting">ضبط</string>
|
||||
<string name="menu_services">خدمات</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
@@ -20,6 +20,12 @@
|
||||
<string name="menu_setting">Ayarlar</string>
|
||||
<string name="menu_services">Hizmetler</string>
|
||||
|
||||
|
||||
//changes after
|
||||
<string name="title_geo_tag_activity_upload_data">Store Uploaded</string>
|
||||
<string name="title_geo_tag_activity_geo_data">Store Geo Data Uploaded</string>
|
||||
<string name="title_geo_tag_activity_geo_already_done">Store Already Geotagged</string>
|
||||
|
||||
<string name="save">Sakla</string>
|
||||
|
||||
<string name="brand">Marka</string>
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
|
||||
<dimen name="text_size_normal">20sp</dimen>
|
||||
<dimen name="text_size_small">16sp</dimen>
|
||||
|
||||
<dimen name="store_entry_text_size">20sp</dimen>
|
||||
|
||||
<dimen name="text_size_xsmall">12sp</dimen>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
<string name="title_activity_store_list_geotag">Store List</string>
|
||||
|
||||
<string name="title_activity_store_geotag">Geo Tag</string>
|
||||
|
||||
|
||||
<string name="menu_daily_route_plan">Daily Route Plan</string>
|
||||
<string name="menu_daily_download">Daily Data Download</string>
|
||||
@@ -71,9 +73,30 @@
|
||||
<string name="msl_availability_availability">Availability</string>
|
||||
|
||||
<string name="stock_facing_reference_image">Reference Image</string>
|
||||
<string name="stock_facing_sku_name">SKU Name</string>
|
||||
<string name="stock_facing_stock">Stock</string>
|
||||
<string name="stock_facing_facing">Facing</string>
|
||||
<string name="stock_facing_faceup">Facing</string>
|
||||
<string name="stock_facing_sos_target">SOS Target</string>
|
||||
|
||||
|
||||
<string name="title_geo_tag_activity_upload_data">Store Uploaded</string>
|
||||
<string name="title_geo_tag_activity_geo_data">Store Geo Data Uploaded</string>
|
||||
<string name="title_geo_tag_activity_geo_already_done">Store Already Geotagged</string>
|
||||
|
||||
|
||||
|
||||
<string name="title_store_list_activity_store_already_done">Store Already Uploaded</string>
|
||||
<string name="title_store_list_activity_store_data_uploaded">Store Data Uploaded</string>
|
||||
<string name="title_store_list_activity_store_already_checkout">Store Already Checkout</string>
|
||||
<string name="title_store_list_activity_store_again_uploaded">Please Store data again Uploaded</string>
|
||||
<string name="title_store_list_activity_store_closed">Store Closed</string>
|
||||
|
||||
|
||||
<string name="save">SAVE</string>
|
||||
|
||||
<string name="title_store_list_checkout_current">Please checkout from current store</string>
|
||||
<string name="title_store_list_checkout_Already_filled">Data already filled</string>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -17,4 +17,7 @@
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<style name="AppTheme.NoActionBar.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||