Merge branch 'master' into AShishNewBranch

This commit is contained in:
YadavendraSinghYaduvanshi
2017-01-12 18:45:26 +05:30
committed by GitHub
100 changed files with 3856 additions and 705 deletions
+18 -10
View File
@@ -14,7 +14,7 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@drawable/icon" android:icon="@drawable/gsklogo"
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
@@ -34,7 +34,7 @@
android:theme="@style/AppTheme.NoActionBar" /> android:theme="@style/AppTheme.NoActionBar" />
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:label="@string/app_name" android:label="@string/main_menu_activity_name"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" /> android:theme="@style/AppTheme.NoActionBar" />
<activity <activity
@@ -59,16 +59,15 @@
android:theme="@style/AppTheme.NoActionBar" /> android:theme="@style/AppTheme.NoActionBar" />
<activity <activity
android:name=".dailyentry.StoreimageActivity" android:name=".dailyentry.StoreimageActivity"
android:label="@string/title_activity_store_list_geotag"
android:screenOrientation="portrait"
android:configChanges="screenSize|orientation|keyboardHidden" android:configChanges="screenSize|orientation|keyboardHidden"
android:label="@string/title_activity_store_image"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" /> android:theme="@style/AppTheme.NoActionBar" />
<activity <activity
android:name=".GeoTag.GeoTagActivity" android:name=".GeoTag.GeoTagActivity"
android:label="@string/title_activity_store_geotag" android:label="@string/title_activity_store_geotag"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" /> android:theme="@style/AppTheme.NoActionBar" />
<meta-data <meta-data
android:name="com.google.android.maps.v2.API_KEY" android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyD02po19go2JMhXJeAnKDiZSiNloPsWqzI" /> android:value="AIzaSyD02po19go2JMhXJeAnKDiZSiNloPsWqzI" />
@@ -78,6 +77,7 @@
<activity <activity
android:name=".dailyentry.T2PComplianceActivity" android:name=".dailyentry.T2PComplianceActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:label="@string/title_activity_t2_pcompliance" android:label="@string/title_activity_t2_pcompliance"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" /> android:theme="@style/AppTheme.NoActionBar" />
@@ -120,26 +120,34 @@
android:theme="@style/AppTheme.NoActionBar" android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity
android:name=".gsk_dailyentry.StoreWisePerformanceActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<!-- Gagan End Declaration --> <!-- Gagan End Declaration -->
<activity <activity
android:name=".dailyentry.NonWorkingReason" android:name=".dailyentry.NonWorkingReason"
android:configChanges="screenSize|orientation|keyboardHidden"
android:label="@string/title_activity_Non_Work" android:label="@string/title_activity_Non_Work"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"/>
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity <activity
android:name=".dailyentry.AdditionalVisibility" android:name=".dailyentry.AdditionalVisibility"
android:configChanges="screenSize|orientation|keyboardHidden"
android:label="@string/title_activity_Additional_visibility" android:label="@string/title_activity_Additional_visibility"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"></activity> android:theme="@style/AppTheme.NoActionBar"/>
<activity <activity
android:name=".upload.UploadActivity" android:name=".upload.UploadActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:label="@string/title_activity_upload" android:label="@string/title_activity_upload"
/> android:screenOrientation="portrait" />
</application> </application>
@@ -15,7 +15,10 @@ import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
import cpm.com.gskmtorange.GetterSetter.CoverageBean; import cpm.com.gskmtorange.GetterSetter.CoverageBean;
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans; import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
import cpm.com.gskmtorange.GetterSetter.StoreBean; import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter; import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
@@ -32,9 +35,11 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.TableBean; import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
@@ -46,8 +51,8 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
public class GSKOrangeDB extends SQLiteOpenHelper { public class GSKOrangeDB extends SQLiteOpenHelper {
public static final String DATABASE_NAME = "GSK_ORANGE"; public static final String DATABASE_NAME = "GSK_ORANGE";
public static final int DATABASE_VERSION = 13; public static final int DATABASE_VERSION = 13;
private SQLiteDatabase db;
TableBean tableBean; TableBean tableBean;
private SQLiteDatabase db;
public GSKOrangeDB(Context context) { public GSKOrangeDB(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION); super(context, DATABASE_NAME, null, DATABASE_VERSION);
@@ -81,6 +86,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(TableBean.getMappingDisplayChecklist()); db.execSQL(TableBean.getMappingDisplayChecklist());
db.execSQL(TableBean.getMappingAdditionalPromotion()); db.execSQL(TableBean.getMappingAdditionalPromotion());
db.execSQL(TableBean.getMappingPromotion()); db.execSQL(TableBean.getMappingPromotion());
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY); db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY);
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_ADDITIONAL_VISIBILITY); db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_ADDITIONAL_VISIBILITY);
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_HEADER); db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_HEADER);
@@ -90,7 +96,23 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(CommonString.CREATE_TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE); db.execSQL(CommonString.CREATE_TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE);
db.execSQL(CommonString.CREATE_TABLE_INSERT_PROMO_SKU); db.execSQL(CommonString.CREATE_TABLE_INSERT_PROMO_SKU);
db.execSQL(TableBean.getStorePerformance());
//Gagan End //Gagan End
db.execSQL(CommonString.CREATE_TABLE_STORE_GEOTAGGING);
db.execSQL(CommonString.CREATE_TABLE_COVERAGE_DATA);
db.execSQL(TableBean.getDisplayChecklistMaster());
db.execSQL(TableBean.getMappingDisplayChecklist());
db.execSQL(TableBean.getNonWorkingReason());
db.execSQL(CommonString.CREATE_TABLE_INSERT_T2P_COMPLIANCE);
db.execSQL(CommonString.CREATE_TABLE_INSERT_T2P_GAPS);
db.execSQL(CommonString.CREATE_TABLE_INSERT_T2P_SKU);
db.execSQL(TableBean.getMappingPlanogram());
} }
@Override @Override
@@ -100,7 +122,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
public void deleteTableWithStoreID(String storeid) { public void deleteTableWithStoreID(String storeid) {
db.delete( CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null); db.delete(CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
} }
@@ -145,7 +167,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values.put("CAMERA_ALLOW", data.getCAMERA_ALLOW().get(i)); values.put("CAMERA_ALLOW", data.getCAMERA_ALLOW().get(i));
values.put("GEO_TAG", data.getGEO_TAG().get(i)); values.put("GEO_TAG", data.getGEO_TAG().get(i));
values.put("CHANNEL_ID", data.getCHANNEL_ID().get(i));
db.insert("JOURNEY_PLAN", null, values); db.insert("JOURNEY_PLAN", null, values);
@@ -256,7 +278,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
try { try {
dbcursor = db.rawQuery("SELECT * FROM(SELECT DISTINCT BR.BRAND_ID, SCM.SUB_CATEGORY||'-'||BR.BRAND AS BRAND FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.KEYACCOUNT_ID ='" + key_account_id + "' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = '" + class_id + "') As Brand", null);
dbcursor = db.rawQuery("SELECT * FROM(SELECT DISTINCT BR.BRAND_ID, SCM.SUB_CATEGORY||'-'||BR.BRAND AS BRAND FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.KEYACCOUNT_ID ='" + key_account_id + "' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = '" + class_id + "' AND BR.COMPANY_ID ='1' ORDER BY SCM.SUB_CATEGORY_SEQUENCE, BR.BRAND_SEQUENCE) As Brand", null);
if (dbcursor != null) { if (dbcursor != null) {
dbcursor.moveToFirst(); dbcursor.moveToFirst();
@@ -335,7 +358,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
Cursor dbcursor = null; Cursor dbcursor = null;
try { try {
dbcursor = db.rawQuery("SELECT * from JOURNEY_PLAN " + "where VISIT_DATE ='" + date + "'", null); dbcursor = db.rawQuery("SELECT * from JOURNEY_PLAN " +
"where VISIT_DATE ='" + date + "'", null);
if (dbcursor != null) { if (dbcursor != null) {
dbcursor.moveToFirst(); dbcursor.moveToFirst();
@@ -899,7 +923,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
cd.setMrp(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MRP"))); cd.setMrp(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MRP")));
cd.setSku_sequence(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_SEQUENCE"))); cd.setSku_sequence(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_SEQUENCE")));
cd.setMbq(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MBQ"))); cd.setMbq(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MBQ")));
cd.setToggleValue("0"); cd.setToggleValue("1");
list.add(cd); list.add(cd);
dbcursor.moveToNext(); dbcursor.moveToNext();
@@ -996,11 +1020,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
dbcursor.close(); dbcursor.close();
if (list.size() > 0) { return list.size() > 0;
return true;
} else {
return false;
}
} }
} catch (Exception e) { } catch (Exception e) {
Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString()); Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString());
@@ -1042,7 +1062,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
Cursor dbcursor = null; Cursor dbcursor = null;
try { try {
dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND " + dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND,BR.COMPANY_ID " +
"from MAPPING_STOCK M " + "from MAPPING_STOCK M " +
"inner join SKU_MASTER SK " + "inner join SKU_MASTER SK " +
"on M.SKU_ID=SK.SKU_ID " + "on M.SKU_ID=SK.SKU_ID " +
@@ -1053,13 +1073,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
"inner join CATEGORY_MASTER CA " + "inner join CATEGORY_MASTER CA " +
"on SB.CATEGORY_ID=CA.CATEGORY_ID " + "on SB.CATEGORY_ID=CA.CATEGORY_ID " +
"where CA.CATEGORY_ID='" + category_id + "' " + "where CA.CATEGORY_ID='" + category_id + "' " +
"order by SB.SUB_CATEGORY,BR.BRAND", null); "order by SB.SUB_CATEGORY,BR.COMPANY_ID,BR.BRAND", null);
if (dbcursor != null) { if (dbcursor != null) {
dbcursor.moveToFirst(); dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) { while (!dbcursor.isAfterLast()) {
Stock_FacingGetterSetter cd = new Stock_FacingGetterSetter(); Stock_FacingGetterSetter cd = new Stock_FacingGetterSetter();
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
cd.setSub_category_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID"))); cd.setSub_category_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
cd.setSub_category(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY"))); cd.setSub_category(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY")));
cd.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("BRAND_ID"))); cd.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("BRAND_ID")));
@@ -1137,6 +1158,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values1.put("Store_Id", storeId); values1.put("Store_Id", storeId);
values1.put("Category_Id", categoryId); values1.put("Category_Id", categoryId);
values1.put("COMPANY_ID", data1.getCompany_id());
values1.put("SUB_CATEGORY_ID", data1.getSub_category_id()); values1.put("SUB_CATEGORY_ID", data1.getSub_category_id());
values1.put("SUB_CATEGORY", data1.getSub_category()); values1.put("SUB_CATEGORY", data1.getSub_category());
values1.put("BRAND_ID", data1.getBrand_id()); values1.put("BRAND_ID", data1.getBrand_id());
@@ -1183,6 +1205,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
while (!dbcursor.isAfterLast()) { while (!dbcursor.isAfterLast()) {
Stock_FacingGetterSetter cd = new Stock_FacingGetterSetter(); Stock_FacingGetterSetter cd = new Stock_FacingGetterSetter();
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
cd.setSub_category_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID"))); cd.setSub_category_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
cd.setSub_category(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY"))); cd.setSub_category(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY")));
cd.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("BRAND_ID"))); cd.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("BRAND_ID")));
@@ -1291,11 +1314,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
dbcursor.close(); dbcursor.close();
if (list.size() > 0) { return list.size() > 0;
return true;
} else {
return false;
}
} }
} catch (Exception e) { } catch (Exception e) {
Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString()); Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString());
@@ -1457,9 +1476,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
public void InsertAdditionalPromoData(Promo_Compliance_DataGetterSetter data, String category_id) { public void InsertAdditionalPromoData(Promo_Compliance_DataGetterSetter data, String category_id) {
ContentValues values = new ContentValues();
try { try {
ContentValues values = new ContentValues();
values.put("STORE_ID", Integer.parseInt(data.getStore_id())); values.put("STORE_ID", Integer.parseInt(data.getStore_id()));
values.put("CATEGORY_ID", Integer.parseInt(category_id)); values.put("CATEGORY_ID", Integer.parseInt(category_id));
values.put("SKU_ID", Integer.parseInt(data.getSku_id())); values.put("SKU_ID", Integer.parseInt(data.getSku_id()));
@@ -1514,7 +1532,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
try { try {
db.beginTransaction(); db.beginTransaction();
for (int i = 0; i < promoSkuListData.size(); i++) { for (int i = 0; i < promoSkuListData.size(); i++) {
Promo_Compliance_DataGetterSetter data = promoSkuListData.get(i); Promo_Compliance_DataGetterSetter data = promoSkuListData.get(i);
@@ -1557,11 +1574,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
dbcursor.close(); dbcursor.close();
if (list.size() > 0) { return list.size() > 0;
return true;
} else {
return false;
}
} }
} catch (Exception e) { } catch (Exception e) {
Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString()); Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString());
@@ -1574,7 +1587,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
//Gagan End Method //Gagan End Method
//Non Working data //Non Working data
public void insertNonWorkingData(NonWorkingReasonGetterSetter data) { public void insertNonWorkingData(NonWorkingReasonGetterSetter data) {
db.delete("NON_WORKING_REASON", null, null); db.delete("NON_WORKING_REASON", null, null);
@@ -1657,9 +1670,11 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
Cursor dbcursor = null; Cursor dbcursor = null;
try { try {
dbcursor = db.rawQuery("SELECT * from JOURNEY_PLAN " + dbcursor = db.rawQuery("SELECT * from JOURNEY_PLAN " +
"where VISIT_DATE ='" + date + "' AND STORE_ID='" + store_id + "'", null); "where VISIT_DATE ='" + date + "' AND STORE_ID='" + store_id + "'", null);
if (dbcursor != null) { if (dbcursor != null) {
dbcursor.moveToFirst(); dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) { while (!dbcursor.isAfterLast()) {
@@ -1985,9 +2000,112 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
return list; return list;
} }
//Store wise Performance
public void InsertSTORE_PERFORMANCE(STORE_PERFORMANCE_MasterGetterSetter data) {
db.delete("STORE_PERFORMANCE", null, null);
ContentValues values = new ContentValues();
try {
for (int i = 0; i < data.getSTORE_ID().size(); i++) {
values.put("STORE_ID", data.getSTORE_ID().get(i));
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
values.put("PERIOD", data.getPERIOD().get(i));
values.put("MSL_AVAILABILITY", data.getMSL_AVAILABILITY().get(i));
values.put("SOS", data.getSOS().get(i));
values.put("T2P", data.getT2P().get(i));
values.put("PROMO", data.getPROMO().get(i));
values.put("OSS", data.getOSS().get(i));
values.put("ORDERID", data.getORDERID().get(i));
db.insert("STORE_PERFORMANCE", null, values);
}
} catch (Exception ex) {
Log.d("Exception ", " STORE_PERFORMANCE " + ex.toString());
}
}
//Category wise Performance
public ArrayList<CategoryWisePerformaceGetterSetter> getCategoryWisePerformance(String store_id, String category_id) {
ArrayList<CategoryWisePerformaceGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("Select * from STORE_PERFORMANCE " +
"where STORE_ID='" + store_id + "' and CATEGORY_ID='" + category_id + "'", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
CategoryWisePerformaceGetterSetter cd = new CategoryWisePerformaceGetterSetter();
cd.setStore_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STORE_ID")));
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY_ID")));
cd.setPeriod(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PERIOD")));
cd.setMsl_availability(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MSL_AVAILABILITY")));
cd.setSos(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SOS")));
cd.setT2p(dbcursor.getString(dbcursor.getColumnIndexOrThrow("T2P")));
cd.setPromo(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO")));
cd.setOss(dbcursor.getString(dbcursor.getColumnIndexOrThrow("OSS")));
cd.setOrder_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("ORDERID")));
list.add(cd);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
Log.d("Exception ", "getPromoComplianceSkuData!" + e.toString());
return list;
}
return list;
}
public ArrayList<StoreWisePerformaceGetterSetter> getStoreWisePerformance(String store_id) {
ArrayList<StoreWisePerformaceGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("Select PERIOD, ROUND(avg(MSL_AVAILABILITY),1) as MSL_AVAILABILITY,ROUND(avg(sos),1) as SOS ," +
" ROUND(avg(t2p),1) as T2P,ROUND(avg(pROMO),1) as PROMO,ROUND(SUM(oss),1) AS OSS " +
"from STORE_PERFORMANCE " +
"where STORE_ID='" + store_id + "' " +
"GROUP BY PERIOD " +
"ORDER BY ORDERID ", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
StoreWisePerformaceGetterSetter cd = new StoreWisePerformaceGetterSetter();
/* cd.setStore_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STORE_ID")));
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY_ID")));*/
cd.setPeriod(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PERIOD")));
cd.setMsl_availability(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MSL_AVAILABILITY")));
cd.setSos(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SOS")));
cd.setT2p(dbcursor.getString(dbcursor.getColumnIndexOrThrow("T2P")));
cd.setPromo(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO")));
cd.setOss(dbcursor.getString(dbcursor.getColumnIndexOrThrow("OSS")));
// cd.setOrder_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("ORDERID")));
list.add(cd);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
Log.d("Exception ", "getPromoComplianceSkuData!" + e.toString());
return list;
}
return list;
}
//Gagan end new code 1 //Gagan end new code 1
public void InsertStockDialog(AdditionalDialogGetterSetter data) { public void InsertStockDialog(AdditionalDialogGetterSetter data) {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
try { try {
@@ -1997,16 +2115,16 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values.put(CommonString.KEY_BRAND, data.getBrand()); values.put(CommonString.KEY_BRAND, data.getBrand());
values.put(CommonString.KEY_BRAND_ID, data.getBrand_id()); values.put(CommonString.KEY_BRAND_ID, data.getBrand_id());
// values.put(CommonString.KEY_DISPLAY_ID, data.getDisplay_id()); // values.put(CommonString.KEY_DISPLAY_ID, data.getDisplay_id());
values.put(CommonString.KEY_QUANTITY, data.getQuantity()); values.put(CommonString.KEY_QUANTITY, data.getQuantity());
values.put(CommonString.KEY_SKU_ID, data.getSku_id()); values.put(CommonString.KEY_SKU_ID, data.getSku_id());
values.put(CommonString.KEY_SKUNAME, data.getSku_name()); values.put(CommonString.KEY_SKUNAME, data.getSku_name());
// values.put(CommonString.UNIQUE_KEY_ID, data.getUnique_id()); // values.put(CommonString.UNIQUE_KEY_ID, data.getUnique_id());
// values.put(CommonString.KEY_CATEGORY_ID, data.getCategory_id()); // values.put(CommonString.KEY_CATEGORY_ID, data.getCategory_id());
// values.put(CommonString.KEY_PROCESS_ID, data.getProcess_id()); // values.put(CommonString.KEY_PROCESS_ID, data.getProcess_id());
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values); db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values);
@@ -2024,7 +2142,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
try { try {
cursordata = db.rawQuery("SELECT * FROM STOCK_DIALOG WHERE COMMON_ID = '"+keyid + "'", null); cursordata = db.rawQuery("SELECT * FROM STOCK_DIALOG WHERE COMMON_ID = '" + keyid + "'", null);
if (cursordata != null) { if (cursordata != null) {
cursordata.moveToFirst(); cursordata.moveToFirst();
@@ -2050,7 +2168,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
sb.setSku_id(cursordata.getString(cursordata sb.setSku_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_SKU_ID))); .getColumnIndexOrThrow(CommonString.KEY_SKU_ID)));
sb.setSku_name(cursordata.getString(cursordata sb.setSku_name(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_SKUNAME))); .getColumnIndexOrThrow(CommonString.KEY_SKUNAME)));
@@ -2098,8 +2216,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
public ArrayList<BrandMasterGetterSetter> getBrandMasterData(String store_id) { public ArrayList<BrandMasterGetterSetter> getBrandMasterData(String store_id) {
Cursor cursordata = null; Cursor cursordata = null;
ArrayList<BrandMasterGetterSetter> Data = new ArrayList<BrandMasterGetterSetter>(); ArrayList<BrandMasterGetterSetter> Data = new ArrayList<BrandMasterGetterSetter>();
@@ -2117,8 +2233,11 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
sb.setBRAND(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND"))); sb.setBRAND(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND")));
/*sb.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID"))); /*sb.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
sb.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
sb.setCOMPANY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("COMPANY_ID"))); sb.setCOMPANY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("COMPANY_ID")));
sb.setBRAND_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_SEQUENCE")));*/ sb.setBRAND_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_SEQUENCE")));*/
@@ -2139,7 +2258,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
public ArrayList<SkuMasterGetterSetter> getSKUMasterData(String store_id) { public ArrayList<SkuMasterGetterSetter> getSKUMasterData(String store_id) {
Cursor cursordata = null; Cursor cursordata = null;
ArrayList<SkuMasterGetterSetter> Data = new ArrayList<SkuMasterGetterSetter>(); ArrayList<SkuMasterGetterSetter> Data = new ArrayList<SkuMasterGetterSetter>();
@@ -2160,7 +2278,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
sb.setBRAND_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_ID"))); sb.setBRAND_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_ID")));
sb.setMRP(cursordata.getString(cursordata.getColumnIndexOrThrow("MRP"))); sb.setMRP(cursordata.getString(cursordata.getColumnIndexOrThrow("MRP")));
sb.setSKU_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("SKU_SEQUENCE"))); sb.setSKU_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("SKU_SEQUENCE")));
@@ -2180,7 +2297,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
public void InsertAdditionalData(AddittionalGetterSetter data,ArrayList<AdditionalDialogGetterSetter> dialog,String categoryId) { public void InsertAdditionalData(AddittionalGetterSetter data,ArrayList<AdditionalDialogGetterSetter> dialog,String categoryId) {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
ContentValues values1 = new ContentValues(); ContentValues values1 = new ContentValues();
try { try {
@@ -2193,11 +2312,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values.put("sku_name", data.getSku()); values.put("sku_name", data.getSku());
values.put("toggle_value", data.getBtn_toogle()); values.put("toggle_value", data.getBtn_toogle());
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, null, values);
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, null, values); for (int i = 0; i < dialog.size(); i++) {
for(int i=0;i<dialog.size();i++)
{
values1.put(CommonString.KEY_Common_ID, key_id); values1.put(CommonString.KEY_Common_ID, key_id);
values1.put(CommonString.KEY_STORE_ID, dialog.get(i).getStore_id()); values1.put(CommonString.KEY_STORE_ID, dialog.get(i).getStore_id());
values1.put("categoryId", categoryId); values1.put("categoryId", categoryId);
@@ -2209,6 +2326,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values1); db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values1);
} }
} catch (Exception ex) { } catch (Exception ex) {
@@ -2274,8 +2392,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
return productData; return productData;
} }
public void updateStoreStatus(String storeid, String visitdate, public void updateStoreStatus(String storeid, String visitdate,
String status) { String status) {
try { try {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
@@ -2284,6 +2403,65 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.update("JOURNEY_PLAN", values, CommonString.KEY_STORE_ID + "='" + storeid + "' AND " + CommonString.KEY_VISIT_DATE + "='" + visitdate + "'", null); db.update("JOURNEY_PLAN", values, CommonString.KEY_STORE_ID + "='" + storeid + "' AND " + CommonString.KEY_VISIT_DATE + "='" + visitdate + "'", null);
} catch (Exception e) { } catch (Exception e) {
}
}
public void InsertT2PData(ArrayList<T2PGetterSetter> data, String store_id, String category_id) {
db.delete(CommonString.TABLE_INSERT_T2P_COMPLIANCE, CommonString.KEY_STORE_ID + "='" + store_id + "' AND " + CommonString.KEY_CATEGORY_ID + "='" + category_id + "'", null);
long l = 0;
ContentValues values = new ContentValues();
ContentValues values1 = new ContentValues();
ContentValues values2 = new ContentValues();
try {
for (int i = 0; i < data.size(); i++) {
values.put(CommonString.KEY_STORE_ID, store_id);
values.put(CommonString.KEY_CATEGORY_ID, category_id);
values.put(CommonString.KEY_DISPLAY_ID, data.get(i).getDisplay_id());
values.put(CommonString.KEY_BRAND_ID, data.get(i).getBrand_id());
values.put(CommonString.KEY_BRAND, data.get(i).getBrand());
values.put(CommonString.KEY_DISPLAY, data.get(i).getDisplay());
values.put(CommonString.KEY_IMAGE, data.get(i).getImage());
values.put(CommonString.KEY_REMARK, data.get(i).getRemark());
values.put(CommonString.KEY_PRESENT, data.get(i).isPresent());
l = db.insert(CommonString.TABLE_INSERT_T2P_COMPLIANCE, null, values);
ArrayList<GapsChecklistGetterSetter> gaps = data.get(i).getGapsChecklist();
for (int j = 0; j < gaps.size(); j++) {
values1.put(CommonString.KEY_COMMON_ID, l);
values1.put(CommonString.KEY_CHECKLIST_ID, gaps.get(j).getChecklist_id());
values1.put(CommonString.KEY_DISPLAY_ID, gaps.get(j).getDisplay_id());
values1.put(CommonString.KEY_CHECKLIST, gaps.get(j).getChecklist());
values1.put(CommonString.KEY_PRESENT, gaps.get(j).isPresent());
db.insert(CommonString.TABLE_INSERT_T2P_GAPS, null, values1);
}
ArrayList<SkuGetterSetter> sku = data.get(i).getSkulist();
for (int k = 0; k < sku.size(); k++) {
values2.put(CommonString.KEY_COMMON_ID, l);
values2.put(CommonString.KEY_SKU_ID, sku.get(k).getSKU_ID());
values2.put(CommonString.KEY_BRAND_ID, sku.get(k).getBRAND_ID());
values2.put(CommonString.KEY_STOCK, sku.get(k).getSTOCK());
values2.put(CommonString.KEY_BRAND, sku.get(k).getBRAND());
values2.put(CommonString.KEY_SKU, sku.get(k).getSKU());
db.insert(CommonString.TABLE_INSERT_T2P_SKU, null, values2);
}
}
} catch (Exception ex) {
Log.d("Exception ", " in T2P_COMPLIANCE " + ex.toString());
} }
} }
@@ -2375,4 +2553,136 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
return productData; return productData;
} }
// get T2P Compliance data
public ArrayList<T2PGetterSetter> getT2pComplianceData(String store_id, String category_id) {
ArrayList<T2PGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
if(category_id == null){
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " +
CommonString.KEY_STORE_ID + "='" + store_id + "'", null);
}
else{
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " +
CommonString.KEY_STORE_ID + "='" + store_id + "' AND " +
CommonString.KEY_CATEGORY_ID + "='" + category_id + "'", null);
}
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
T2PGetterSetter tp = new T2PGetterSetter();
tp.setKey_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_ID)));
tp.setDisplay_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_DISPLAY_ID)));
tp.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
tp.setBrand(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
tp.setDisplay(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_DISPLAY)));
tp.setImage(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IMAGE)));
tp.setRemark(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_REMARK)));
tp.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_CATEGORY_ID)));
tp.setPresent((dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_PRESENT)).equalsIgnoreCase("1")));
list.add(tp);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
return list;
}
return list;
}
// get Gaps T2P data
public ArrayList<GapsChecklistGetterSetter> getGapsData(String common_id) {
ArrayList<GapsChecklistGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_GAPS + " where " +
CommonString.KEY_COMMON_ID + "='" + common_id + "'", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
GapsChecklistGetterSetter gp = new GapsChecklistGetterSetter();
gp.setDisplay_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_DISPLAY_ID)));
gp.setChecklist_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_CHECKLIST_ID)));
gp.setChecklist(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_CHECKLIST)));
gp.setPresent((dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_PRESENT)).equalsIgnoreCase("1")));
list.add(gp);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
return list;
}
return list;
}
// get T2P SKU data
public ArrayList<SkuGetterSetter> getT2PSKUData(String common_id) {
ArrayList<SkuGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_SKU + " where " +
CommonString.KEY_COMMON_ID + "='" + common_id + "'", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
SkuGetterSetter gp = new SkuGetterSetter();
gp.setSKU_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_SKU_ID)));
gp.setBRAND_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
gp.setSTOCK(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_STOCK)));
gp.setBRAND(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
gp.setSKU(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_SKU)));
list.add(gp);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
return list;
}
return list;
}
//Gagan start new code 2
public void InsertMAPPING_PLANOGRAM(MAPPING_PLANOGRAM_MasterGetterSetter data) {
db.delete("MAPPING_PLANOGRAM", null, null);
ContentValues values = new ContentValues();
try {
for (int i = 0; i < data.getKEYACCOUNT_ID().size(); i++) {
values.put("KEYACCOUNT_ID", data.getKEYACCOUNT_ID().get(i));
values.put("STORETYPE_ID", data.getSTORETYPE_ID().get(i));
values.put("CLASS_ID", data.getCLASS_ID().get(i));
values.put("PLANOGRAM_IMAGE", data.getPLANOGRAM_IMAGE().get(i));
values.put("IMAGE_PATH", data.getIMAGE_PATH().get(i));
db.insert("MAPPING_PLANOGRAM", null, values);
}
} catch (Exception ex) {
Log.d("Exception ", " MAPPING_PLANOGRAM " + ex.toString());
}
}
//Gagan end new code 2
} }
@@ -10,6 +10,8 @@ import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Color; import android.graphics.Color;
@@ -67,6 +69,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Locale;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
@@ -130,6 +133,9 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
username = preferences.getString(CommonString.KEY_USERNAME, null); username = preferences.getString(CommonString.KEY_USERNAME, null);
storeid = preferences.getString(CommonString.KEY_STORE_ID, null); storeid = preferences.getString(CommonString.KEY_STORE_ID, null);
storename = preferences.getString(CommonString.KEY_STORE_NAME, null); storename = preferences.getString(CommonString.KEY_STORE_NAME, null);
@@ -384,6 +390,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
/* checkPlayServices(); /* checkPlayServices();
// Resuming the periodic location updates // Resuming the periodic location updates
@@ -993,4 +1000,32 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
} }
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -3,6 +3,8 @@ package cpm.com.gskmtorange.GeoTag;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
@@ -23,6 +25,7 @@ import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.MainActivity; import cpm.com.gskmtorange.MainActivity;
@@ -68,6 +71,9 @@ public class GeoTagStoreList extends AppCompatActivity implements View.OnClickLi
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, ""); visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, "");
@@ -133,9 +139,9 @@ public class GeoTagStoreList extends AppCompatActivity implements View.OnClickLi
@Override @Override
public void onBackPressed() { public void onBackPressed() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
Intent intent = new Intent(GeoTagStoreList.this, MainActivity.class); /* Intent intent = new Intent(GeoTagStoreList.this, MainActivity.class);
startActivity(intent); startActivity(intent);*/
GeoTagStoreList.this.finish(); GeoTagStoreList.this.finish();
} }
@@ -291,13 +297,37 @@ public class GeoTagStoreList extends AppCompatActivity implements View.OnClickLi
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -115,6 +115,19 @@ public class LoginActivity extends AppCompatActivity {
setContentView(R.layout.activity_login); setContentView(R.layout.activity_login);
TextView tv_version = (TextView) findViewById(R.id.tv_version_code);
try {
app_ver =String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
// login_version.setText("Parinaam Version " + app_ver);
} catch (PackageManager.NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
tv_version.setText("Version/Versiyon - " + app_ver);
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
editor = preferences.edit(); editor = preferences.edit();
@@ -5,6 +5,8 @@ import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
@@ -33,6 +35,7 @@ import java.io.FileOutputStream;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList; import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
@@ -68,7 +71,11 @@ public class MainActivity extends AppCompatActivity
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
imageView = (ImageView) findViewById(R.id.img_main); imageView = (ImageView) findViewById(R.id.img_main);
@@ -122,6 +129,13 @@ public class MainActivity extends AppCompatActivity
navigationView.setNavigationItemSelectedListener(this); navigationView.setNavigationItemSelectedListener(this);
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
@Override @Override
public void onBackPressed() { public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
@@ -266,9 +280,9 @@ public class MainActivity extends AppCompatActivity
} else if (id == R.id.nav_setting) { } else if (id == R.id.nav_setting) {
startActivity(new Intent(MainActivity.this, CategoryListActivity.class)); //startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
} else if (id == R.id.nav_export) { } /*else if (id == R.id.nav_export) {
AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this); AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this);
builder1.setMessage("Are you sure you want to take the backup of your data") builder1.setMessage("Are you sure you want to take the backup of your data")
@@ -277,12 +291,12 @@ public class MainActivity extends AppCompatActivity
@SuppressWarnings("resource") @SuppressWarnings("resource")
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
try { try {
/*File file = new File(Environment *//*File file = new File(Environment
.getExternalStorageDirectory(), .getExternalStorageDirectory(),
"capital_backup"); "capital_backup");
if (!file.isDirectory()) { if (!file.isDirectory()) {
file.mkdir(); file.mkdir();
}*/ }*//*
File sd = Environment.getExternalStorageDirectory(); File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory(); File data = Environment.getDataDirectory();
@@ -325,7 +339,7 @@ public class MainActivity extends AppCompatActivity
}); });
AlertDialog alert1 = builder1.create(); AlertDialog alert1 = builder1.create();
alert1.show(); alert1.show();
} }*/
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START); drawer.closeDrawer(GravityCompat.START);
@@ -409,4 +423,31 @@ public class MainActivity extends AppCompatActivity
return flag; return flag;
} }
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -53,6 +53,16 @@ public class CommonString {
public static final String KEY_ID = "Id"; public static final String KEY_ID = "Id";
public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID"; public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID";
//KEYS RELATED TO T2P COMPLIANCE
public static final String KEY_DISPLAY = "DISPLAY";
public static final String KEY_REMARK = "REMARK";
public static final String KEY_PRESENT = "PRESENT";
public static final String KEY_COMMON_ID = "COMMON_ID";
public static final String KEY_CHECKLIST_ID = "CHECKLIST_ID";
public static final String KEY_CHECKLIST = "CHECKLIST";
public static final String KEY_SKU = "SKU";
public static final String KEY_STOCK = "STOCK";
public static final String KEY_BRAND = "BRAND"; public static final String KEY_BRAND = "BRAND";
public static final String KEY_BRAND_ID = "BRAND_ID"; public static final String KEY_BRAND_ID = "BRAND_ID";
public static final String KEY_DISPLAY_ID = "DISPLAY_ID"; public static final String KEY_DISPLAY_ID = "DISPLAY_ID";
@@ -225,6 +235,9 @@ public class CommonString {
+ "Category_Id" + "Category_Id"
+ " VARCHAR," + " VARCHAR,"
+ "COMPANY_ID"
+ " VARCHAR,"
+ "SUB_CATEGORY_ID" + "SUB_CATEGORY_ID"
+ " VARCHAR," + " VARCHAR,"
@@ -332,6 +345,7 @@ public class CommonString {
+ ")"; + ")";
public static final String TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "Additional_Promo_Compliance_Data"; public static final String TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "Additional_Promo_Compliance_Data";
public static final String CREATE_TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "CREATE TABLE IF NOT EXISTS " public static final String CREATE_TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "CREATE TABLE IF NOT EXISTS "
@@ -343,14 +357,11 @@ public class CommonString {
+ "STORE_ID" + "STORE_ID"
+ " INTEGER," + " INTEGER,"
+ "CATEGORY_ID" /*+ "SKU_ID"
+ " INTEGER,"
+ "SKU_ID"
+ " INTEGER," + " INTEGER,"
+ "SKU" + "SKU"
+ " VARCHAR," + " VARCHAR,"*/
+ "PROMO_ID" + "PROMO_ID"
+ " INTEGER," + " INTEGER,"
@@ -418,4 +429,53 @@ public class CommonString {
+ KEY_IMAGE + " VARCHAR)"; + KEY_IMAGE + " VARCHAR)";
//Tables related to T2p Compliance
public static final String TABLE_INSERT_T2P_COMPLIANCE = "T2P_COMPLIANCE";
public static final String CREATE_TABLE_INSERT_T2P_COMPLIANCE = "CREATE TABLE IF NOT EXISTS "
+ TABLE_INSERT_T2P_COMPLIANCE
+ "("
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
+ KEY_STORE_ID + " INTEGER,"
+ KEY_CATEGORY_ID + " INTEGER,"
+ KEY_BRAND_ID + " INTEGER,"
+ KEY_DISPLAY_ID + " INTEGER,"
+ KEY_BRAND + " VARCHAR,"
+ KEY_DISPLAY + " VARCHAR,"
+ KEY_IMAGE + " VARCHAR,"
+ KEY_REMARK + " VARCHAR,"
+ KEY_PRESENT + " VARCHAR"
+ ")";
public static final String TABLE_INSERT_T2P_GAPS = "T2P_GAPS";
public static final String CREATE_TABLE_INSERT_T2P_GAPS = "CREATE TABLE IF NOT EXISTS "
+ TABLE_INSERT_T2P_GAPS
+ "("
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
+ KEY_COMMON_ID + " INTEGER,"
+ KEY_CHECKLIST_ID + " INTEGER,"
+ KEY_DISPLAY_ID + " INTEGER,"
+ KEY_CHECKLIST + " VARCHAR,"
+ KEY_PRESENT + " VARCHAR"
+ ")";
public static final String TABLE_INSERT_T2P_SKU = "T2P_SKU";
public static final String CREATE_TABLE_INSERT_T2P_SKU = "CREATE TABLE IF NOT EXISTS "
+ TABLE_INSERT_T2P_SKU
+ "("
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
+ KEY_COMMON_ID + " INTEGER,"
+ KEY_SKU_ID + " INTEGER,"
+ KEY_BRAND_ID + " INTEGER,"
+ KEY_STOCK + " INTEGER,"
+ KEY_BRAND+ " VARCHAR,"
+ KEY_SKU + " VARCHAR"
+ ")";
} }
@@ -9,6 +9,8 @@ import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Color; import android.graphics.Color;
@@ -47,6 +49,7 @@ import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter; import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
@@ -114,6 +117,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
store_id = preferences.getString(CommonString.KEY_STORE_ID, null); store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
categoryName = getIntent().getStringExtra("categoryName"); categoryName = getIntent().getStringExtra("categoryName");
categoryId = getIntent().getStringExtra("categoryId"); categoryId = getIntent().getStringExtra("categoryId");
@@ -1247,5 +1251,38 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
return flag; return flag;
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -1,11 +1,14 @@
package cpm.com.gskmtorange.dailyentry; package cpm.com.gskmtorange.dailyentry;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@@ -32,6 +35,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.GetterSetter.CoverageBean; import cpm.com.gskmtorange.GetterSetter.CoverageBean;
@@ -90,6 +94,9 @@ public class NonWorkingReason extends AppCompatActivity implements
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
_UserId = preferences.getString(CommonString.KEY_USERNAME, ""); _UserId = preferences.getString(CommonString.KEY_USERNAME, "");
visit_date = preferences.getString(CommonString.KEY_DATE, null); visit_date = preferences.getString(CommonString.KEY_DATE, null);
store_id = preferences.getString(CommonString.KEY_STORE_ID, ""); store_id = preferences.getString(CommonString.KEY_STORE_ID, "");
@@ -108,7 +115,7 @@ public class NonWorkingReason extends AppCompatActivity implements
reason_adapter = new ArrayAdapter<CharSequence>(this, reason_adapter = new ArrayAdapter<CharSequence>(this,
android.R.layout.simple_spinner_item); android.R.layout.simple_spinner_item);
reason_adapter.add("Select Reason"); reason_adapter.add(getResources().getString(R.string.select_reason));
for (int i = 0; i < reasondata.size(); i++) { for (int i = 0; i < reasondata.size(); i++) {
reason_adapter.add(reasondata.get(i).getREASON().get(0)); reason_adapter.add(reasondata.get(i).getREASON().get(0));
@@ -463,4 +470,37 @@ public class NonWorkingReason extends AppCompatActivity implements
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -6,6 +6,8 @@ import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
@@ -33,6 +35,7 @@ import android.widget.Toast;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.GeoTag.GeoTagActivity; import cpm.com.gskmtorange.GeoTag.GeoTagActivity;
@@ -72,6 +75,9 @@ public class StoreListActivity extends AppCompatActivity {
getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, ""); visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, "");
db = new GSKOrangeDB(StoreListActivity.this); db = new GSKOrangeDB(StoreListActivity.this);
@@ -90,8 +96,6 @@ public class StoreListActivity extends AppCompatActivity {
startActivity(in); startActivity(in);
finish(); finish();
} }
}); });
@@ -102,6 +106,8 @@ public class StoreListActivity extends AppCompatActivity {
// TODO Auto-generated method stub // TODO Auto-generated method stub
super.onResume(); super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
storelist = db.getStoreData(date); storelist = db.getStoreData(date);
coverage=db.getCoverageData(date); coverage=db.getCoverageData(date);
@@ -457,6 +463,34 @@ public class StoreListActivity extends AppCompatActivity {
return result_flag; return result_flag;
} }
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
public void UpdateStore(String storeid) { public void UpdateStore(String storeid) {
db.open(); db.open();
@@ -2,11 +2,14 @@ package cpm.com.gskmtorange.dailyentry;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.location.Location; import android.location.Location;
@@ -34,12 +37,14 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.GetterSetter.CoverageBean; import cpm.com.gskmtorange.GetterSetter.CoverageBean;
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity; import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
/** /**
* Created by ashishc on 31-05-2016. * Created by ashishc on 31-05-2016.
@@ -81,6 +86,8 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
store_id = preferences.getString(CommonString.KEY_STORE_ID, null); store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
visit_date = preferences.getString(CommonString.KEY_DATE, null); visit_date = preferences.getString(CommonString.KEY_DATE, null);
@@ -198,7 +205,8 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
editor.commit();*/ editor.commit();*/
Intent in = new Intent(StoreimageActivity.this, CategoryListActivity.class); //Intent in = new Intent(StoreimageActivity.this, CategoryListActivity.class);
Intent in = new Intent(StoreimageActivity.this, StoreWisePerformanceActivity.class);
startActivity(in); startActivity(in);
finish(); finish();
} }
@@ -268,8 +276,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
intent.setPackage(defaultCameraPackage); intent.setPackage(defaultCameraPackage);
startActivityForResult(intent, 0); startActivityForResult(intent, 0);
} } catch (ActivityNotFoundException e) {
catch (ActivityNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
@@ -277,8 +284,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
intent.setPackage(gallery_package); intent.setPackage(gallery_package);
startActivityForResult(intent, 0); startActivityForResult(intent, 0);
} } catch (Exception e) {
catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@@ -341,6 +347,12 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
protected void onStart() { protected void onStart() {
mGoogleApiClient.connect(); mGoogleApiClient.connect();
super.onStart(); super.onStart();
@@ -351,4 +363,31 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
super.onStop(); super.onStop();
} }
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -4,12 +4,15 @@ import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@@ -17,6 +20,7 @@ import android.preference.PreferenceManager;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
@@ -47,8 +51,11 @@ import java.util.Calendar;
import java.util.List; import java.util.List;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.LoginActivity;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.fonts.FontManager;
import cpm.com.gskmtorange.fonts.TextDrawable;
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
@@ -64,29 +71,28 @@ public class T2PComplianceActivity extends AppCompatActivity {
T2PAdapter t2PAdapter; T2PAdapter t2PAdapter;
RecyclerView rec_t2p; RecyclerView rec_t2p;
String categoryName, categoryId, storeId; String categoryName, categoryId;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
private SharedPreferences preferences;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
String path = "", str = CommonString.FILE_PATH, _pathforcheck = "", img = ""; String path = "", str = CommonString.FILE_PATH, _pathforcheck = "", img = "";
int child_position = -1; int child_position = -1;
/** String error_msg;
* ATTENTION: This was auto-generated to implement the App Indexing API. private SharedPreferences preferences;
* See https://g.co/AppIndexing/AndroidStudio for more information.
*/
private GoogleApiClient client;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_t2_pcompliance); setContentView(R.layout.activity_t2_pcompliance);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//Intent data
categoryName = getIntent().getStringExtra("categoryName");
categoryId = getIntent().getStringExtra("categoryId");
// toolbar.setTitle(R.string.title_activity_t2_pcompliance + " - " + categoryName);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
db = new GSKOrangeDB(T2PComplianceActivity.this); db = new GSKOrangeDB(T2PComplianceActivity.this);
db.open(); db.open();
@@ -100,7 +106,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, ""); keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
class_id = preferences.getString(CommonString.KEY_CLASS_ID, ""); class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, ""); storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
rec_t2p = (RecyclerView) findViewById(R.id.rec_t2p); rec_t2p = (RecyclerView) findViewById(R.id.rec_t2p);
@@ -108,24 +114,47 @@ public class T2PComplianceActivity extends AppCompatActivity {
fab.setOnClickListener(new View.OnClickListener() { fab.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
Snackbar.make(view, "Data Saved", Snackbar.LENGTH_LONG)
.setAction("Action", null).show(); if (isValid()) {
finish();
db.InsertT2PData(t2PGetterSetters, store_id, categoryId);
Snackbar.make(view, "Data Saved", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
finish();
} else {
Snackbar.make(view, error_msg, Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
} }
}); });
t2PGetterSetters = db.getT2PDefaultData(store_id); t2PGetterSetters = db.getT2pComplianceData(store_id, categoryId);
if (t2PGetterSetters.size() == 0) {
t2PGetterSetters = db.getT2PDefaultData(store_id);
} else {
for (int i = 0; i < t2PGetterSetters.size(); i++) {
ArrayList<GapsChecklistGetterSetter> gapsList = db.getGapsData(t2PGetterSetters.get(i).getKey_id());
ArrayList<SkuGetterSetter> skuList = db.getT2PSKUData(t2PGetterSetters.get(i).getKey_id());
t2PGetterSetters.get(i).setGapsChecklist(gapsList);
t2PGetterSetters.get(i).setSkulist(skuList);
}
}
if (t2PGetterSetters.size() > 0) { if (t2PGetterSetters.size() > 0) {
for (int i = 0; i < t2PGetterSetters.size(); i++) { /* for (int i = 0; i < t2PGetterSetters.size(); i++) {
ArrayList<GapsChecklistGetterSetter> gapsChecklist = db.getGapsDefaultData(t2PGetterSetters.get(i).getDisplay_id()); ArrayList<GapsChecklistGetterSetter> gapsChecklist = db.getGapsDefaultData(t2PGetterSetters.get(i).getDisplay_id());
t2PGetterSetters.get(i).setGapsChecklist(gapsChecklist); t2PGetterSetters.get(i).setGapsChecklist(gapsChecklist);
} }*/
rec_t2p.setLayoutManager(new LinearLayoutManager(getApplicationContext())); rec_t2p.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
t2PAdapter = new T2PAdapter(t2PGetterSetters); t2PAdapter = new T2PAdapter(t2PGetterSetters);
@@ -133,9 +162,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
} }
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
} }
@Override @Override
@@ -168,11 +194,16 @@ public class T2PComplianceActivity extends AppCompatActivity {
holder.tv_brand.setText(mItem.getBrand()); holder.tv_brand.setText(mItem.getBrand());
holder.tv_display.setText(mItem.getDisplay().trim()); holder.tv_display.setText(mItem.getDisplay().trim());
//holder.tv_display.setTypeface(FontManager.getTypeface(getApplicationContext(),FontManager.FONTAWESOME));
/* Typeface iconFont = FontManager.getTypeface(getApplicationContext(), FontManager.FONTAWESOME);
FontManager.markAsIconContainer(findViewById(R.id.icons_container), iconFont);
*/
holder.btn_gaps.setOnClickListener(new View.OnClickListener() { holder.btn_gaps.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
showGapsDialog(mItem.getGapsChecklist()); showGapsDialog(mItem);
} }
}); });
@@ -181,26 +212,12 @@ public class T2PComplianceActivity extends AppCompatActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes")) { mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase(getResources().getString(R.string.yes)));
mItem.setPresent(true);
} else {
mItem.setPresent(false);
}
t2PAdapter.notifyDataSetChanged(); t2PAdapter.notifyDataSetChanged();
} }
}); });
holder.img_cam.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
_pathforcheck = "T2P_Image_" + store_id + "_" + mItem.getBrand_id() + mItem.getDisplay_id() + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
child_position = position;
path = str + _pathforcheck;
startCameraActivity();
}
});
holder.btn_sku.setOnClickListener(new View.OnClickListener() { holder.btn_sku.setOnClickListener(new View.OnClickListener() {
@Override @Override
@@ -216,14 +233,43 @@ public class T2PComplianceActivity extends AppCompatActivity {
} }
} }
if (mItem.getImage().equals("")) { if(camera_allow.equals("1")){
holder.img_cam.setBackgroundResource(R.drawable.cam_deactive);
} else { holder.img_cam.setOnClickListener(new View.OnClickListener() {
holder.img_cam.setBackgroundResource(R.drawable.cam_active); @Override
public void onClick(View v) {
_pathforcheck = "T2P_Image_" + store_id + "_" + mItem.getBrand_id() + mItem.getDisplay_id() + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
child_position = position;
path = str + _pathforcheck;
startCameraActivity();
}
});
if (mItem.getImage().equals("")) {
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
} else {
holder.img_cam.setBackgroundResource(R.mipmap.camera_green);
}
} }
else {
holder.img_cam.setBackgroundResource(R.mipmap.camera_grey);
}
holder.toggle_btn.setChecked(mItem.isPresent()); holder.toggle_btn.setChecked(mItem.isPresent());
if (mItem.getGapsChecklist().size() > 0) {
holder.btn_gaps.setBackgroundColor(getResources().getColor(R.color.green));
} else {
holder.btn_gaps.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
}
if (mItem.getSkulist().size() > 0) {
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.green));
} else {
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
}
} }
@@ -261,8 +307,17 @@ public class T2PComplianceActivity extends AppCompatActivity {
} }
} }
public void showGapsDialog(ArrayList<GapsChecklistGetterSetter> gapsChecklist) {
//ArrayList<GapsChecklistGetterSetter> gapsChecklist = db.getGapsDefaultData(display_id); public void showGapsDialog(final T2PGetterSetter t2p) {
final ArrayList<GapsChecklistGetterSetter> gapsChecklist;
if (t2p.getGapsChecklist().size() > 0) {
gapsChecklist = t2p.getGapsChecklist();
} else {
gapsChecklist = db.getGapsDefaultData(t2p.getDisplay_id());
}
final Dialog dialog = new Dialog(T2PComplianceActivity.this); final Dialog dialog = new Dialog(T2PComplianceActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
@@ -279,8 +334,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
t2p.setGapsChecklist(gapsChecklist);
dialog.cancel(); dialog.cancel();
t2PAdapter.notifyDataSetChanged();
} }
}); });
@@ -315,7 +371,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
final ArrayList<SkuGetterSetter> sku_list = new ArrayList<>(); final ArrayList<SkuGetterSetter> sku_list = new ArrayList<>();
if(skuAddedList.size()>0){ if (skuAddedList.size() > 0) {
rec_sku.setLayoutManager(new LinearLayoutManager(getApplicationContext())); rec_sku.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
SkuAddedAdapter skuAdapter = new SkuAddedAdapter(skuAddedList); SkuAddedAdapter skuAdapter = new SkuAddedAdapter(skuAddedList);
@@ -327,11 +383,10 @@ public class T2PComplianceActivity extends AppCompatActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if(brand_selected[0] ==null || sku_selected[0]==null || et_stock.getText().toString().equals("")){ if (brand_selected[0] == null || sku_selected[0] == null || et_stock.getText().toString().equals("")) {
Snackbar.make(v, getResources().getString(R.string.enter_the_values),Snackbar.LENGTH_SHORT).show(); Snackbar.make(v, getResources().getString(R.string.enter_the_values), Snackbar.LENGTH_SHORT).show();
} } else {
else{
SkuGetterSetter sku = new SkuGetterSetter(); SkuGetterSetter sku = new SkuGetterSetter();
sku.setBRAND_ID(brand_selected[0].getBRAND_ID().get(0)); sku.setBRAND_ID(brand_selected[0].getBRAND_ID().get(0));
sku.setBRAND(brand_selected[0].getBRAND().get(0)); sku.setBRAND(brand_selected[0].getBRAND().get(0));
@@ -349,7 +404,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
spinner_brand.setSelection(0); spinner_brand.setSelection(0);
SkuGetterSetter select = new SkuGetterSetter(); SkuGetterSetter select = new SkuGetterSetter();
select.setSKU("Select"); select.setSKU(getString(R.string.select));
sku_list.clear(); sku_list.clear();
sku_list.add(select); sku_list.add(select);
CustomSkuAdapter skuadapter = new CustomSkuAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, sku_list); CustomSkuAdapter skuadapter = new CustomSkuAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, sku_list);
@@ -360,7 +415,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
brand_selected[0] = null; brand_selected[0] = null;
sku_selected[0] = null; sku_selected[0] = null;
} }
} }
@@ -369,7 +423,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
btn_cancel.setOnClickListener(new View.OnClickListener() { btn_cancel.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
dialog.cancel(); dialog.cancel();
t2PAdapter.notifyDataSetChanged();
} }
}); });
@@ -380,7 +436,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
SkuGetterSetter select = new SkuGetterSetter(); SkuGetterSetter select = new SkuGetterSetter();
select.setSKU("Select"); select.setSKU(getString(R.string.select));
sku_list.add(select); sku_list.add(select);
CustomSkuAdapter skuadapter = new CustomSkuAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, sku_list); CustomSkuAdapter skuadapter = new CustomSkuAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, sku_list);
spinner_sku.setAdapter(skuadapter); spinner_sku.setAdapter(skuadapter);
@@ -394,18 +450,18 @@ public class T2PComplianceActivity extends AppCompatActivity {
sku_list.clear(); sku_list.clear();
brand_selected[0] = brandList.get(position); brand_selected[0] = brandList.get(position);
String brand_id = brandList.get(position).getBRAND_ID().get(0); String brand_id = brandList.get(position).getBRAND_ID().get(0);
ArrayList<SkuGetterSetter> temp_list = db.getSkuT2PData(storeType_id, class_id, keyAccount_id, brand_id); ArrayList<SkuGetterSetter> temp_list = db.getSkuT2PData(storeType_id, class_id, keyAccount_id, brand_id);
for (int k=0;k<temp_list.size();k++){ for (int k = 0; k < temp_list.size(); k++) {
sku_list.add(temp_list.get(k)); sku_list.add(temp_list.get(k));
} }
SkuGetterSetter select = new SkuGetterSetter(); SkuGetterSetter select = new SkuGetterSetter();
select.setSKU("Select"); select.setSKU(getString(R.string.select));
sku_list.add(0, select); sku_list.add(0, select);
// Create custom adapter object ( see below CustomSkuAdapter.java ) // Create custom adapter object ( see below CustomSkuAdapter.java )
CustomSkuAdapter skuadapter = new CustomSkuAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, sku_list); CustomSkuAdapter skuadapter = new CustomSkuAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, sku_list);
@@ -428,7 +484,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
@Override @Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if(position!=0){ if (position != 0) {
sku_selected[0] = sku_list.get(position); sku_selected[0] = sku_list.get(position);
} }
@@ -446,191 +502,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
} }
public class GapsAdapter extends RecyclerView.Adapter<GapsAdapter.ViewHolder> {
private ArrayList<GapsChecklistGetterSetter> list;
public GapsAdapter(ArrayList<GapsChecklistGetterSetter> gapsPList) {
list = gapsPList;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.gap_checklist_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
final GapsChecklistGetterSetter mItem = list.get(position);
holder.tv_checklist.setText(mItem.getChecklist());
holder.tb_present.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes")) {
mItem.setPresent(true);
}
}
});
holder.tb_present.setChecked(mItem.isPresent());
}
@Override
public int getItemCount() {
return list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public final View mView;
public final LinearLayout parentLayout;
public final TextView tv_checklist;
public final ToggleButton tb_present;
public ViewHolder(View view) {
super(view);
mView = view;
tv_checklist = (TextView) mView.findViewById(R.id.tv_checklist);
tb_present = (ToggleButton) mView.findViewById(R.id.btn_is_present);
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
}
}
}
public class CustomAdapter extends ArrayAdapter<String> {
private Activity activity;
private ArrayList data;
BrandMasterGetterSetter tempValues = null;
LayoutInflater inflater;
/*************
* CustomAdapter Constructor
*****************/
public CustomAdapter(
T2PComplianceActivity activitySpinner,
int textViewResourceId,
ArrayList objects
) {
super(activitySpinner, textViewResourceId, objects);
/********** Take passed values **********/
activity = activitySpinner;
data = objects;
/*********** Layout inflator to call external xml layout () **********************/
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
// This funtion called for each row ( Called data.size() times )
public View getCustomView(int position, View convertView, ViewGroup parent) {
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
/***** Get each Model object from Arraylist ********/
tempValues = null;
tempValues = (BrandMasterGetterSetter) data.get(position);
TextView label = (TextView) row.findViewById(R.id.tv_text);
if (position == 0) {
// Default selected Spinner item
label.setText("Select");
//sub.setText("");
} else {
// Set values for spinner each row
label.setText(tempValues.getBRAND().get(0));
}
return row;
}
}
public class CustomSkuAdapter extends ArrayAdapter<String> {
private Activity activity;
private ArrayList data;
SkuGetterSetter tempValues = null;
LayoutInflater inflater;
/*************
* CustomAdapter Constructor
*****************/
public CustomSkuAdapter(
T2PComplianceActivity activitySpinner,
int textViewResourceId,
ArrayList objects
) {
super(activitySpinner, textViewResourceId, objects);
/********** Take passed values **********/
activity = activitySpinner;
data = objects;
/*********** Layout inflator to call external xml layout () **********************/
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
// This funtion called for each row ( Called data.size() times )
public View getCustomView(int position, View convertView, ViewGroup parent) {
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
/***** Get each Model object from Arraylist ********/
tempValues = null;
tempValues = (SkuGetterSetter) data.get(position);
TextView label = (TextView) row.findViewById(R.id.tv_text);
if (position == 0) {
// Default selected Spinner item
label.setText("Select");
//sub.setText("");
} else {
// Set values for spinner each row
label.setText(tempValues.getSKU());
}
return row;
}
}
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will // Handle action bar item clicks here. The action bar will
@@ -736,6 +607,371 @@ public class T2PComplianceActivity extends AppCompatActivity {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
} }
public boolean isValid() {
boolean flag = true;
for (int i = 0; i < t2PGetterSetters.size(); i++) {
if (camera_allow.equals("1") && t2PGetterSetters.get(i).getImage().equals("")) {
flag = false;
error_msg = getResources().getString(R.string.click_image);
break;
} else if (t2PGetterSetters.get(i).getGapsChecklist().size() == 0) {
flag = false;
error_msg = getResources().getString(R.string.fill_gaps_data);
break;
} else if (t2PGetterSetters.get(i).getSkulist().size() == 0) {
flag = false;
error_msg = getResources().getString(R.string.fill_sku_data);
break;
}
}
return flag;
}
@Override
public void onBackPressed() {
//super.onBackPressed();
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(T2PComplianceActivity.this);
builder.setTitle("Parinaam");
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
finish();
}
})
.setNegativeButton("Cancel ", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
android.app.AlertDialog alert = builder.create();
alert.show();
}
public class T2PAdapter extends RecyclerView.Adapter<T2PAdapter.ViewHolder> {
private ArrayList<T2PGetterSetter> list;
public T2PAdapter(ArrayList<T2PGetterSetter> t2PList) {
list = t2PList;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.t2p_item_layout, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
final T2PGetterSetter mItem = list.get(position);
holder.tv_brand.setText(mItem.getBrand());
holder.tv_display.setText(mItem.getDisplay().trim());
//holder.tv_display.setTypeface(FontManager.getTypeface(getApplicationContext(),FontManager.FONTAWESOME));
/* Typeface iconFont = FontManager.getTypeface(getApplicationContext(), FontManager.FONTAWESOME);
FontManager.markAsIconContainer(findViewById(R.id.icons_container), iconFont);
*/
holder.btn_gaps.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showGapsDialog(mItem);
}
});
holder.toggle_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes"));
t2PAdapter.notifyDataSetChanged();
}
});
holder.btn_sku.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showSkuDialog(mItem.getSkulist());
}
});
if (!img.equalsIgnoreCase("")) {
if (position == child_position) {
mItem.setImage(img);
img = "";
}
}
if(camera_allow.equals("1")){
holder.img_cam.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
_pathforcheck = "T2P_Image_" + store_id + "_" + mItem.getBrand_id() + mItem.getDisplay_id() + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
child_position = position;
path = str + _pathforcheck;
startCameraActivity();
}
});
if (mItem.getImage().equals("")) {
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
} else {
holder.img_cam.setBackgroundResource(R.mipmap.camera_green);
}
}
else {
holder.img_cam.setBackgroundResource(R.mipmap.camera_grey);
}
holder.toggle_btn.setChecked(mItem.isPresent());
if (mItem.getGapsChecklist().size() > 0) {
holder.btn_gaps.setBackgroundColor(getResources().getColor(R.color.green));
} else {
holder.btn_gaps.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
}
if (mItem.getSkulist().size() > 0) {
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.green));
} else {
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
}
}
@Override
public int getItemCount() {
return list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public final View mView;
public final LinearLayout parentLayout;
public final TextView tv_brand, tv_display;
public final ImageView img_cam, img_remark;
public final Button btn_gaps, btn_sku, btn_ref_img;
public final ToggleButton toggle_btn;
public ViewHolder(View view) {
super(view);
mView = view;
tv_brand = (TextView) mView.findViewById(R.id.tv_brand);
tv_display = (TextView) mView.findViewById(R.id.tv_display);
img_cam = (ImageView) mView.findViewById(R.id.img_cam);
img_remark = (ImageView) mView.findViewById(R.id.img_remark);
btn_gaps = (Button) mView.findViewById(R.id.btn_gaps);
btn_sku = (Button) mView.findViewById(R.id.btn_sku);
btn_ref_img = (Button) mView.findViewById(R.id.btn_ref_image);
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
toggle_btn = (ToggleButton) mView.findViewById(R.id.toggle_btn);
}
}
}
public class GapsAdapter extends RecyclerView.Adapter<GapsAdapter.ViewHolder> {
private ArrayList<GapsChecklistGetterSetter> list;
public GapsAdapter(ArrayList<GapsChecklistGetterSetter> gapsPList) {
list = gapsPList;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.gap_checklist_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
final GapsChecklistGetterSetter mItem = list.get(position);
holder.tv_checklist.setText(mItem.getChecklist());
holder.tb_present.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes"));
}
});
holder.tb_present.setChecked(mItem.isPresent());
}
@Override
public int getItemCount() {
return list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public final View mView;
public final LinearLayout parentLayout;
public final TextView tv_checklist;
public final ToggleButton tb_present;
public ViewHolder(View view) {
super(view);
mView = view;
tv_checklist = (TextView) mView.findViewById(R.id.tv_checklist);
tb_present = (ToggleButton) mView.findViewById(R.id.btn_is_present);
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
}
}
}
public class CustomAdapter extends ArrayAdapter<String> {
BrandMasterGetterSetter tempValues = null;
LayoutInflater inflater;
private Activity activity;
private ArrayList data;
/*************
* CustomAdapter Constructor
*****************/
public CustomAdapter(
T2PComplianceActivity activitySpinner,
int textViewResourceId,
ArrayList objects
) {
super(activitySpinner, textViewResourceId, objects);
/********** Take passed values **********/
activity = activitySpinner;
data = objects;
/*********** Layout inflator to call external xml layout () **********************/
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
// This funtion called for each row ( Called data.size() times )
public View getCustomView(int position, View convertView, ViewGroup parent) {
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
/***** Get each Model object from Arraylist ********/
tempValues = null;
tempValues = (BrandMasterGetterSetter) data.get(position);
TextView label = (TextView) row.findViewById(R.id.tv_text);
if (position == 0) {
// Default selected Spinner item
label.setText("Select");
//sub.setText("");
} else {
// Set values for spinner each row
label.setText(tempValues.getBRAND().get(0));
}
return row;
}
}
public class CustomSkuAdapter extends ArrayAdapter<String> {
SkuGetterSetter tempValues = null;
LayoutInflater inflater;
private Activity activity;
private ArrayList data;
/*************
* CustomAdapter Constructor
*****************/
public CustomSkuAdapter(
T2PComplianceActivity activitySpinner,
int textViewResourceId,
ArrayList objects
) {
super(activitySpinner, textViewResourceId, objects);
/********** Take passed values **********/
activity = activitySpinner;
data = objects;
/*********** Layout inflator to call external xml layout () **********************/
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
// This funtion called for each row ( Called data.size() times )
public View getCustomView(int position, View convertView, ViewGroup parent) {
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
/***** Get each Model object from Arraylist ********/
tempValues = null;
tempValues = (SkuGetterSetter) data.get(position);
TextView label = (TextView) row.findViewById(R.id.tv_text);
if (position == 0) {
// Default selected Spinner item
label.setText("Select");
//sub.setText("");
} else {
// Set values for spinner each row
label.setText(tempValues.getSKU());
}
return row;
}
}
public class SkuAddedAdapter extends RecyclerView.Adapter<SkuAddedAdapter.ViewHolder> { public class SkuAddedAdapter extends RecyclerView.Adapter<SkuAddedAdapter.ViewHolder> {
private ArrayList<SkuGetterSetter> list; private ArrayList<SkuGetterSetter> list;
@@ -785,5 +1021,4 @@ public class T2PComplianceActivity extends AppCompatActivity {
} }
} }
} }
@@ -5,6 +5,8 @@ import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
@@ -24,6 +26,7 @@ import org.xmlpull.v1.XmlPullParserFactory;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
@@ -35,10 +38,12 @@ import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.TableBean; import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
@@ -46,15 +51,10 @@ import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
public class DownloadActivity extends AppCompatActivity { public class DownloadActivity extends AppCompatActivity {
private Dialog dialog;
private ProgressBar pb;
private TextView percentage, message;
Data data; Data data;
int eventType; int eventType;
GSKOrangeDB db; GSKOrangeDB db;
private SharedPreferences preferences = null;
String userId, culture_id; String userId, culture_id;
JourneyPlanGetterSetter jcpgettersetter; JourneyPlanGetterSetter jcpgettersetter;
SkuMasterGetterSetter skumastergettersetter; SkuMasterGetterSetter skumastergettersetter;
BrandMasterGetterSetter brandMasterGetterSetter; BrandMasterGetterSetter brandMasterGetterSetter;
@@ -68,6 +68,12 @@ public class DownloadActivity extends AppCompatActivity {
NonWorkingReasonGetterSetter nonWorkingReasonGetterSetter; NonWorkingReasonGetterSetter nonWorkingReasonGetterSetter;
MappingPromotionGetterSetter mappingPromotionGetterSetter; MappingPromotionGetterSetter mappingPromotionGetterSetter;
MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter mapping_additional_promotion_masterGetterSetter; MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter mapping_additional_promotion_masterGetterSetter;
STORE_PERFORMANCE_MasterGetterSetter store_performance_masterGetterSetter;
MAPPING_PLANOGRAM_MasterGetterSetter mapping_planogram_masterGetterSetter;
private Dialog dialog;
private ProgressBar pb;
private TextView percentage, message;
private SharedPreferences preferences = null;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -77,11 +83,32 @@ public class DownloadActivity extends AppCompatActivity {
db = new GSKOrangeDB(this); db = new GSKOrangeDB(this);
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
userId = preferences.getString(CommonString.KEY_USERNAME, null); userId = preferences.getString(CommonString.KEY_USERNAME, null);
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, ""); culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
new UploadTask(DownloadActivity.this).execute(); new UploadTask(DownloadActivity.this).execute();
} }
public void showAlert(String str) {
AlertDialog.Builder builder = new AlertDialog.Builder(DownloadActivity.this);
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, StorelistActivity.class);
activity.startActivity(i);
activity.finish();*/
}
});
AlertDialog alert = builder.create();
alert.show();
}
class Data { class Data {
int value; int value;
String name; String name;
@@ -116,7 +143,7 @@ public class DownloadActivity extends AppCompatActivity {
data = new Data(); data = new Data();
data.value = 10; data.value = 10;
data.name = "JCP Data Downloading"; data.name = "JCP "+getResources().getString(R.string.download_data);
publishProgress(data); publishProgress(data);
XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
@@ -135,7 +162,7 @@ public class DownloadActivity extends AppCompatActivity {
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL); HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
Object result = (Object) envelope.getResponse(); Object result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
//InputStream stream = new ByteArrayInputStream(result.toString().getBytes("UTF-8")); //InputStream stream = new ByteArrayInputStream(result.toString().getBytes("UTF-8"));
@@ -157,7 +184,7 @@ public class DownloadActivity extends AppCompatActivity {
} }
data.value = 10; data.value = 10;
data.name = "JCP Data Downloading"; data.name = "JCP "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -175,7 +202,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -193,7 +220,7 @@ public class DownloadActivity extends AppCompatActivity {
} }
data.value = 20; data.value = 20;
data.name = "SKU_MASTER Data Download"; data.name = "SKU_MASTER "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -211,7 +238,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -229,7 +256,7 @@ public class DownloadActivity extends AppCompatActivity {
} }
data.value = 30; data.value = 30;
data.name = "BRAND_MASTER Data Download"; data.name = "BRAND_MASTER "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -247,7 +274,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -264,7 +291,7 @@ public class DownloadActivity extends AppCompatActivity {
return "SUB_CATEGORY_MASTER"; return "SUB_CATEGORY_MASTER";
} }
data.value = 40; data.value = 40;
data.name = "SUB_CATEGORY_MASTER Data Download"; data.name = "SUB_CATEGORY_MASTER "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -282,7 +309,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -299,7 +326,7 @@ public class DownloadActivity extends AppCompatActivity {
return "CATEGORY_MASTER"; return "CATEGORY_MASTER";
} }
data.value = 50; data.value = 50;
data.name = "CATEGORY_MASTER Data Download"; data.name = "CATEGORY_MASTER "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -317,7 +344,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -334,7 +361,7 @@ public class DownloadActivity extends AppCompatActivity {
return "DISPLAY_MASTER"; return "DISPLAY_MASTER";
} }
data.value = 60; data.value = 60;
data.name = "DISPLAY_MASTER Data Download"; data.name = "DISPLAY_MASTER "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -352,7 +379,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -369,7 +396,7 @@ public class DownloadActivity extends AppCompatActivity {
return "MAPPING_STOCK"; return "MAPPING_STOCK";
} }
data.value = 80; data.value = 80;
data.name = "MAPPING_STOCK Data Download"; data.name = "MAPPING_STOCK "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -387,7 +414,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -404,7 +431,7 @@ public class DownloadActivity extends AppCompatActivity {
//return "MAPPING_T2P"; //return "MAPPING_T2P";
} }
data.value = 100; data.value = 100;
data.name = "MAPPING_T2P Data Download"; data.name = "MAPPING_T2P "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -421,7 +448,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -438,7 +465,7 @@ public class DownloadActivity extends AppCompatActivity {
return "DISPLAY_CHECKLIST_MASTER"; return "DISPLAY_CHECKLIST_MASTER";
} }
data.value = 100; data.value = 100;
data.name = "DISPLAY_CHECKLIST_MASTER Data Download"; data.name = "DISPLAY_CHECKLIST_MASTER "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -455,7 +482,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -472,7 +499,7 @@ public class DownloadActivity extends AppCompatActivity {
//return "MAPPING_DISPLAY_CHECKLIST"; //return "MAPPING_DISPLAY_CHECKLIST";
} }
data.value = 100; data.value = 100;
data.name = "MAPPING_DISPLAY_CHECKLIST Data Download"; data.name = "MAPPING_DISPLAY_CHECKLIST "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -490,7 +517,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -507,7 +534,7 @@ public class DownloadActivity extends AppCompatActivity {
return "NON_WORKING_REASON"; return "NON_WORKING_REASON";
} }
data.value = 100; data.value = 100;
data.name = "NON_WORKING_REASON Data Download"; data.name = "NON_WORKING_REASON "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -525,7 +552,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -542,7 +569,7 @@ public class DownloadActivity extends AppCompatActivity {
//return "MAPPING_PROMOTION"; //return "MAPPING_PROMOTION";
}*/ }*/
data.value = 100; data.value = 100;
data.name = "MAPPING_PROMOTION Data Download"; data.name = "MAPPING_PROMOTION "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
@@ -562,7 +589,7 @@ public class DownloadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (result.toString() != null) { if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -580,10 +607,83 @@ public class DownloadActivity extends AppCompatActivity {
//return "MAPPING_ADDITIONAL_PROMOTION"; //return "MAPPING_ADDITIONAL_PROMOTION";
}*/ }*/
data.value = 100; data.value = 100;
data.name = "MAPPING_ADDITIONAL_PROMOTION Data Download"; data.name = "MAPPING_ADDITIONAL_PROMOTION "+getResources().getString(R.string.download_data);
} }
publishProgress(data); publishProgress(data);
//STORE_PERFORMANCE
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
request.addProperty("UserName", userId);
request.addProperty("Type", "STORE_PERFORMANCE");
request.addProperty("cultureid", culture_id);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = envelope.getResponse();
if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString()));
xpp.next();
eventType = xpp.getEventType();
store_performance_masterGetterSetter = XMLHandlers.STORE_PERFORMANCEXMLHandler(xpp, eventType);
if (store_performance_masterGetterSetter.getSTORE_ID().size() > 0) {
String table_store_performace = store_performance_masterGetterSetter.getTable_STORE_PERFORMANCE();
if (table_store_performace != null) {
resultHttp = CommonString.KEY_SUCCESS;
TableBean.setStorePerformance(table_store_performace);
}
} else {
//return "STORE_PERFORMANCE";
}
data.value = 100;
data.name = "STORE_PERFORMANCE Data Download";
}
publishProgress(data);
//MAPPING_PLANOGRAM
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
request.addProperty("UserName", userId);
request.addProperty("Type", "MAPPING_PLANOGRAM");
request.addProperty("cultureid", culture_id);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = envelope.getResponse();
if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString()));
xpp.next();
eventType = xpp.getEventType();
mapping_planogram_masterGetterSetter = XMLHandlers.MAPPING_PLANOGRAM_XMLHandler(xpp, eventType);
if (mapping_planogram_masterGetterSetter.getKEYACCOUNT_ID().size() > 0) {
String table_mapping_planogram = mapping_planogram_masterGetterSetter.getTable_MAPPING_PLANOGRAM();
if (table_mapping_planogram != null) {
resultHttp = CommonString.KEY_SUCCESS;
TableBean.setMappingPlanogram(table_mapping_planogram);
}
} else {
//return "MAPPING_PLANOGRAM";
}
data.value = 100;
data.name = "MAPPING_PLANOGRAM Data Download";
}
publishProgress(data);
//Gagan end code //Gagan end code
@@ -605,6 +705,9 @@ public class DownloadActivity extends AppCompatActivity {
db.insertNonWorkingData(nonWorkingReasonGetterSetter); db.insertNonWorkingData(nonWorkingReasonGetterSetter);
db.InsertSTORE_PERFORMANCE(store_performance_masterGetterSetter);
db.InsertMAPPING_PLANOGRAM(mapping_planogram_masterGetterSetter);
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
/*final AlertMessage message = new AlertMessage( /*final AlertMessage message = new AlertMessage(
CompleteDownloadActivity.this, CompleteDownloadActivity.this,
@@ -681,4 +784,39 @@ public class DownloadActivity extends AppCompatActivity {
AlertDialog alert = builder.create(); AlertDialog alert = builder.create();
alert.show(); alert.show();
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -0,0 +1,18 @@
package cpm.com.gskmtorange.fonts;
import android.content.Context;
import android.graphics.Typeface;
/**
* Created by yadavendras on 11-01-2017.
*/
public class FontManager {
public static final String ROOT = "fonts/",
FONTAWESOME = ROOT + "fontawesome-webfont.ttf";
public static Typeface getTypeface(Context context, String font) {
return Typeface.createFromAsset(context.getAssets(), font);
}
}
@@ -0,0 +1,52 @@
package cpm.com.gskmtorange.fonts;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
/**
* Created by yadavendras on 11-01-2017.
*/
public class TextDrawable extends Drawable {
private final String text;
private final Paint paint;
public TextDrawable(String text) {
this.text = text;
this.paint = new Paint();
paint.setColor(Color.WHITE);
paint.setTextSize(22f);
paint.setAntiAlias(true);
paint.setFakeBoldText(true);
paint.setShadowLayer(6f, 0, 0, Color.BLACK);
paint.setStyle(Paint.Style.FILL);
paint.setTextAlign(Paint.Align.LEFT);
}
@Override
public void draw(Canvas canvas) {
canvas.drawText(text, 0, 0, paint);
}
@Override
public void setAlpha(int alpha) {
paint.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter cf) {
paint.setColorFilter(cf);
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
}
@@ -3,6 +3,8 @@ package cpm.com.gskmtorange.gsk_dailyentry;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
@@ -23,6 +25,7 @@ import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
@@ -37,9 +40,8 @@ public class CategoryListActivity extends AppCompatActivity {
CategoryListAdapter adapter; CategoryListAdapter adapter;
GSKOrangeDB db; GSKOrangeDB db;
private SharedPreferences preferences;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id; String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
private SharedPreferences preferences;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -52,6 +54,9 @@ public class CategoryListActivity extends AppCompatActivity {
db.open(); db.open();
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
store_id = preferences.getString(CommonString.KEY_STORE_ID, null); store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
visit_date = preferences.getString(CommonString.KEY_DATE, null); visit_date = preferences.getString(CommonString.KEY_DATE, null);
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
@@ -83,6 +88,8 @@ public class CategoryListActivity extends AppCompatActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
recyclerView = (RecyclerView) findViewById(R.id.recyclerView); recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
categoryList = new ArrayList<>(); categoryList = new ArrayList<>();
@@ -93,10 +100,36 @@ public class CategoryListActivity extends AppCompatActivity {
recyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2)); recyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
} }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@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) {
finish();
}
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public class CategoryListAdapter extends RecyclerView.Adapter<CategoryListAdapter.MyViewHolder> { public class CategoryListAdapter extends RecyclerView.Adapter<CategoryListAdapter.MyViewHolder> {
private LayoutInflater inflator;
List<CategoryGetterSetter> list = Collections.emptyList(); List<CategoryGetterSetter> list = Collections.emptyList();
Context context; Context context;
private LayoutInflater inflator;
public CategoryListAdapter(CategoryListActivity context, List<CategoryGetterSetter> list) { public CategoryListAdapter(CategoryListActivity context, List<CategoryGetterSetter> list) {
inflator = LayoutInflater.from(context); inflator = LayoutInflater.from(context);
@@ -123,19 +156,19 @@ public class CategoryListActivity extends AppCompatActivity {
&& db.checkStockAndFacingData(store_id, categoryData.getCategory_id()) && db.checkStockAndFacingData(store_id, categoryData.getCategory_id())
&& db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) { && db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) {
holder.categoryIcon.setImageResource(R.drawable.ohc_done); holder.categoryIcon.setImageResource(R.mipmap.oralcare_tick);
} else { } else {
holder.categoryIcon.setImageResource(R.drawable.ohc); holder.categoryIcon.setImageResource(R.mipmap.oral_care);
} }
} else if (categoryData.getCategory().equalsIgnoreCase("Wellness")) { } else if (categoryData.getCategory().equalsIgnoreCase("Wellness")) {
if (db.checkMsl_AvailabilityData(store_id, categoryData.getCategory_id()) if (db.checkMsl_AvailabilityData(store_id, categoryData.getCategory_id())
&& db.checkStockAndFacingData(store_id, categoryData.getCategory_id()) && db.checkStockAndFacingData(store_id, categoryData.getCategory_id())
&& db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) { && db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) {
holder.categoryIcon.setImageResource(R.drawable.pdr_done); holder.categoryIcon.setImageResource(R.mipmap.wellness_tick);
} else { } else {
holder.categoryIcon.setImageResource(R.drawable.pdr); holder.categoryIcon.setImageResource(R.mipmap.wellness);
} }
} else if (categoryData.getCategory().equalsIgnoreCase("Nutritionals")) { } else if (categoryData.getCategory().equalsIgnoreCase("Nutritionals")) {
@@ -143,9 +176,9 @@ public class CategoryListActivity extends AppCompatActivity {
&& db.checkStockAndFacingData(store_id, categoryData.getCategory_id()) && db.checkStockAndFacingData(store_id, categoryData.getCategory_id())
&& db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) { && db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) {
holder.categoryIcon.setImageResource(R.drawable.hfd_done); holder.categoryIcon.setImageResource(R.mipmap.nutritionals_tick);
} else { } else {
holder.categoryIcon.setImageResource(R.drawable.hfd); holder.categoryIcon.setImageResource(R.mipmap.nutritionals);
} }
} }
@@ -205,4 +238,34 @@ public class CategoryListActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -2,7 +2,11 @@ package cpm.com.gskmtorange.gsk_dailyentry;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
@@ -18,22 +22,29 @@ import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
public class CategoryWisePerformanceActivity extends AppCompatActivity { public class CategoryWisePerformanceActivity extends AppCompatActivity {
TextView txt_categoryName;
RecyclerView recyclerView; RecyclerView recyclerView;
Toolbar toolbar;
String categoryName = "", categoryId; String categoryName = "", categoryId;
ArrayList<CategoryWisePerformaceGetterSetter> categoryWisePerformanceList; ArrayList<CategoryWisePerformaceGetterSetter> categoryWisePerformanceList;
CategoryWisePerformaceAdapter adapter; CategoryWisePerformaceAdapter adapter;
private SharedPreferences preferences;
GSKOrangeDB db;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_category_wise_performance); setContentView(R.layout.activity_category_wise_performance);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
@@ -44,6 +55,10 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
categoryName = getIntent().getStringExtra("categoryName"); categoryName = getIntent().getStringExtra("categoryName");
categoryId = getIntent().getStringExtra("categoryId"); categoryId = getIntent().getStringExtra("categoryId");
preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
//txt_categoryName.setText(getResources().getString(R.string.title_activity_category_wise_performance) + " " + categoryName); //txt_categoryName.setText(getResources().getString(R.string.title_activity_category_wise_performance) + " " + categoryName);
toolbar.setTitle(getResources().getString(R.string.title_activity_category_wise_performance) + " " + categoryName); toolbar.setTitle(getResources().getString(R.string.title_activity_category_wise_performance) + " " + categoryName);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
@@ -60,12 +75,57 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
startActivity(intent); startActivity(intent);
} }
}); });
try {
setContentView(R.layout.activity_category_wise_performance);
toolbar = (Toolbar) findViewById(R.id.toolbar);
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
db = new GSKOrangeDB(this);
db.open();
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, "");
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
//Intent data
categoryName = getIntent().getStringExtra("categoryName");
categoryId = getIntent().getStringExtra("categoryId");
//txt_categoryName.setText(getResources().getString(R.string.title_activity_category_wise_performance) + " " + categoryName);
toolbar.setTitle(getResources().getString(R.string.title_activity_category_wise_performance) + " " + categoryName);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(CategoryWisePerformanceActivity.this, DailyDataMenuActivity.class);
intent.putExtra("categoryName", categoryName);
intent.putExtra("categoryId", categoryId);
startActivity(intent);
}
});
} catch (Resources.NotFoundException e) {
e.printStackTrace();
}
} }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
categoryWisePerformanceList = new ArrayList<>(); categoryWisePerformanceList = new ArrayList<>();
CategoryWisePerformaceGetterSetter data = new CategoryWisePerformaceGetterSetter(); CategoryWisePerformaceGetterSetter data = new CategoryWisePerformaceGetterSetter();
@@ -134,6 +194,17 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
adapter = new CategoryWisePerformaceAdapter(CategoryWisePerformanceActivity.this, categoryWisePerformanceList); adapter = new CategoryWisePerformaceAdapter(CategoryWisePerformanceActivity.this, categoryWisePerformanceList);
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext())); recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
try {
categoryWisePerformanceList = db.getCategoryWisePerformance(store_id, categoryId);
adapter = new CategoryWisePerformaceAdapter(CategoryWisePerformanceActivity.this, categoryWisePerformanceList);
recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
} catch (Exception e) {
e.printStackTrace();
}
} }
public class CategoryWisePerformaceAdapter extends RecyclerView.Adapter<CategoryWisePerformaceAdapter.MyViewHolder> { public class CategoryWisePerformaceAdapter extends RecyclerView.Adapter<CategoryWisePerformaceAdapter.MyViewHolder> {
@@ -158,11 +229,18 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
public void onBindViewHolder(CategoryWisePerformaceAdapter.MyViewHolder holder, int position) { public void onBindViewHolder(CategoryWisePerformaceAdapter.MyViewHolder holder, int position) {
final CategoryWisePerformaceGetterSetter categoryData = list.get(position); final CategoryWisePerformaceGetterSetter categoryData = list.get(position);
holder.txt_period.setText(categoryData.getPeriod()); if (categoryData.getPeriod().equalsIgnoreCase("LTM")) {
holder.txt_period.setText(getResources().getString(R.string.category_performance_ltm));
} else if (categoryData.getPeriod().equalsIgnoreCase("MTD")) {
holder.txt_period.setText(getResources().getString(R.string.category_performance_mtd));
} else if (categoryData.getPeriod().equalsIgnoreCase("LSV")) {
holder.txt_period.setText(getResources().getString(R.string.category_performance_lsv));
}
//holder.txt_period.setText(categoryData.getPeriod());
holder.txt_msl_availability.setText(categoryData.getMsl_availability());
holder.txt_sos.setText(categoryData.getSos()); holder.txt_sos.setText(categoryData.getSos());
holder.txt_t2p.setText(categoryData.getT2p()); holder.txt_t2p.setText(categoryData.getT2p());
holder.txt_promo.setText(categoryData.getPromo()); holder.txt_promo.setText(categoryData.getPromo());
holder.txt_msl_availability.setText(categoryData.getMsl_availability());
holder.txt_oss.setText(categoryData.getOss()); holder.txt_oss.setText(categoryData.getOss());
} }
@@ -186,7 +264,6 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
txt_oss = (TextView) itemView.findViewById(R.id.txt_oss); txt_oss = (TextView) itemView.findViewById(R.id.txt_oss);
} }
} }
} }
@Override @Override
@@ -207,4 +284,31 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -3,6 +3,7 @@ package cpm.com.gskmtorange.gsk_dailyentry;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@@ -22,6 +23,7 @@ import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
@@ -38,9 +40,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
GSKOrangeDB db; GSKOrangeDB db;
String categoryName = "", categoryId; String categoryName = "", categoryId;
private SharedPreferences preferences;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id; String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
private SharedPreferences preferences;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -58,6 +59,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
//preference data //preference data
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
store_id = preferences.getString(CommonString.KEY_STORE_ID, null); store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
visit_date = preferences.getString(CommonString.KEY_DATE, null); visit_date = preferences.getString(CommonString.KEY_DATE, null);
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
@@ -94,6 +98,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
try { try {
categoryList = new ArrayList<>(); categoryList = new ArrayList<>();
@@ -111,9 +117,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
//data.setCategory_name("Stock & Facing"); //data.setCategory_name("Stock & Facing");
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing)); data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
if (db.checkStockAndFacingData(store_id, categoryId)) { if (db.checkStockAndFacingData(store_id, categoryId)) {
data.setCategory_img(R.mipmap.stock_and_facing_done); data.setCategory_img(R.mipmap.stock_facing_done);
} else { } else {
data.setCategory_img(R.mipmap.stock_and_facing); data.setCategory_img(R.mipmap.stock_facing);
} }
categoryList.add(data); categoryList.add(data);
@@ -165,10 +171,36 @@ public class DailyDataMenuActivity extends AppCompatActivity {
} }
} }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@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) {
finish();
}
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public class DailyDataMenuAdapter extends RecyclerView.Adapter<DailyDataMenuAdapter.MyViewHolder> { public class DailyDataMenuAdapter extends RecyclerView.Adapter<DailyDataMenuAdapter.MyViewHolder> {
private LayoutInflater inflator;
List<DailyDataMenuGetterSetter> list = Collections.emptyList(); List<DailyDataMenuGetterSetter> list = Collections.emptyList();
Context context; Context context;
private LayoutInflater inflator;
public DailyDataMenuAdapter(Context context, List<DailyDataMenuGetterSetter> list) { public DailyDataMenuAdapter(Context context, List<DailyDataMenuGetterSetter> list) {
inflator = LayoutInflater.from(context); inflator = LayoutInflater.from(context);
@@ -275,5 +307,34 @@ public class DailyDataMenuActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -4,6 +4,7 @@ import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
@@ -34,6 +35,7 @@ import android.widget.ToggleButton;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
@@ -54,9 +56,8 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
GSKOrangeDB db; GSKOrangeDB db;
String categoryName, categoryId, storeId; String categoryName, categoryId, storeId;
private SharedPreferences preferences;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id; String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
private SharedPreferences preferences;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -74,6 +75,9 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
//preference data //preference data
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
store_id = preferences.getString(CommonString.KEY_STORE_ID, null); store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
visit_date = preferences.getString(CommonString.KEY_DATE, null); visit_date = preferences.getString(CommonString.KEY_DATE, null);
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
@@ -248,6 +252,25 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
} }
} }
@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) {
finish();
}
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public class ExpandableListAdapter extends BaseExpandableListAdapter { public class ExpandableListAdapter extends BaseExpandableListAdapter {
private Context _context; private Context _context;
private List<MSL_AvailabilityGetterSetter> _listDataHeader; private List<MSL_AvailabilityGetterSetter> _listDataHeader;
@@ -362,8 +385,8 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
holder.txt_mbq = (TextView) convertView.findViewById(R.id.txt_mbq); holder.txt_mbq = (TextView) convertView.findViewById(R.id.txt_mbq);
holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available); holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available);
holder.toggle_available.setTextOff("No"); /*holder.toggle_available.setTextOff("No");
holder.toggle_available.setTextOn("Yes"); holder.toggle_available.setTextOn("Yes");*/
convertView.setTag(holder); convertView.setTag(holder);
} else { } else {
@@ -437,4 +460,38 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -1,8 +1,11 @@
package cpm.com.gskmtorange.gsk_dailyentry; package cpm.com.gskmtorange.gsk_dailyentry;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
@@ -22,6 +25,7 @@ import android.widget.TextView;
import android.widget.ToggleButton; import android.widget.ToggleButton;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
@@ -73,6 +77,9 @@ public class PromoComplianceActivity extends AppCompatActivity {
//preference data //preference data
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
store_id = preferences.getString(CommonString.KEY_STORE_ID, null); store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
visit_date = preferences.getString(CommonString.KEY_DATE, null); visit_date = preferences.getString(CommonString.KEY_DATE, null);
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
@@ -433,4 +440,37 @@ public class PromoComplianceActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -1,14 +1,20 @@
package cpm.com.gskmtorange.gsk_dailyentry; package cpm.com.gskmtorange.gsk_dailyentry;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@@ -22,12 +28,16 @@ import android.support.v7.widget.CardView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView; import android.widget.AbsListView;
import android.widget.BaseExpandableListAdapter; import android.widget.BaseExpandableListAdapter;
import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ExpandableListView; import android.widget.ExpandableListView;
import android.widget.ImageView; import android.widget.ImageView;
@@ -44,35 +54,32 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
public class Stock_FacingActivity extends AppCompatActivity { public class Stock_FacingActivity extends AppCompatActivity {
static int child_position = -1;
ExpandableListView expandableListView; ExpandableListView expandableListView;
TextView txt_stockFacingName; TextView txt_stockFacingName;
ArrayList<Stock_FacingGetterSetter> headerDataList; ArrayList<Stock_FacingGetterSetter> headerDataList;
ArrayList<Stock_FacingGetterSetter> childDataList; ArrayList<Stock_FacingGetterSetter> childDataList;
List<Stock_FacingGetterSetter> hashMapListHeaderData; List<Stock_FacingGetterSetter> hashMapListHeaderData;
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> hashMapListChildData; HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> hashMapListChildData;
List<Integer> checkHeaderArray = new ArrayList<>(); List<Integer> checkHeaderArray = new ArrayList<>();
ExpandableListAdapter adapter; ExpandableListAdapter adapter;
GSKOrangeDB db; GSKOrangeDB db;
String categoryName, categoryId, Error_Message = ""; String categoryName, categoryId, Error_Message = "";
String path = "", str = "", _pathforcheck = "", img1 = "", img2 = ""; String path = "", str = "", _pathforcheck = "", img1 = "", img2 = "";
static int child_position = -1;
boolean isDialogOpen = true; boolean isDialogOpen = true;
boolean checkflag = true; boolean checkflag = true;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
private SharedPreferences preferences; private SharedPreferences preferences;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -90,6 +97,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
//preference data //preference data
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
store_id = preferences.getString(CommonString.KEY_STORE_ID, null); store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
visit_date = preferences.getString(CommonString.KEY_DATE, null); visit_date = preferences.getString(CommonString.KEY_DATE, null);
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
@@ -98,6 +108,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, ""); keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
class_id = preferences.getString(CommonString.KEY_CLASS_ID, ""); class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, ""); storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
categoryName = getIntent().getStringExtra("categoryName"); categoryName = getIntent().getStringExtra("categoryName");
categoryId = getIntent().getStringExtra("categoryId"); categoryId = getIntent().getStringExtra("categoryId");
@@ -269,6 +280,305 @@ public class Stock_FacingActivity extends AppCompatActivity {
} }
} }
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();
//Camera allow enable
if (camera_allow.equalsIgnoreCase("1")) {
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;
}
} else {
//Camera allow disable
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;
}
}
}
}
if (flag == false) {
checkflag = false;
break;
} else {
checkflag = true;
}
}
//expListView.invalidate();
adapter.notifyDataSetChanged();
return checkflag;
}
private void startCameraActivity1(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);*/
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, 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);*/
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();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.e("Stock & Facing", "resultCode: " + resultCode);
/*switch (resultCode) {
case 0:
Log.e("Stock & Facing", "User cancelled");
break;
case -1:
if (_pathforcheck != null && !_pathforcheck.equals("")) {
if (new File(str + _pathforcheck).exists()) {
img1 = _pathforcheck;
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;
}
super.onActivityResult(requestCode, resultCode, data);
}
public String getCurrentTime() {
Calendar m_cal = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
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 boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.planogram, menu);
return true;
}
@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) {
finish();
}
//Planogram Dialog
if (id == R.id.action_planogram) {
//final Dialog dialog = new Dialog(Stock_FacingActivity.this, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
final Dialog dialog = new Dialog(Stock_FacingActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
//dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.setContentView(R.layout.planogram_dialog_layout);
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
String planogram_image = "";
if (new File(str + planogram_image).exists()) {
Bitmap bmp = BitmapFactory.decodeFile(str + planogram_image);
img_planogram.setImageBitmap(bmp);
} else {
img_planogram.setBackgroundResource(R.drawable.sad_cloud);
}
/*if (new File(str + "Stock_Cam1_3_9_01122017_162052.jpg").exists()) {
Bitmap bmp = BitmapFactory.decodeFile(str + "Stock_Cam1_3_9_01122017_162052.jpg");
img_planogram.setImageBitmap(bmp);
} else {
img_planogram.setBackgroundResource(R.drawable.sad_cloud);
}*/
ImageView cancel = (ImageView) dialog.findViewById(R.id.img_cancel);
cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
return true;
}
return super.onOptionsItemSelected(item);
}
public class ExpandableListAdapter extends BaseExpandableListAdapter { public class ExpandableListAdapter extends BaseExpandableListAdapter {
private Context _context; private Context _context;
private List<Stock_FacingGetterSetter> _listDataHeader; private List<Stock_FacingGetterSetter> _listDataHeader;
@@ -306,71 +616,85 @@ public class Stock_FacingActivity extends AppCompatActivity {
} }
TextView txt_stockFaceupHeader = (TextView) convertView.findViewById(R.id.txt_stockFaceupHeader); TextView txt_stockFaceupHeader = (TextView) convertView.findViewById(R.id.txt_stockFaceupHeader);
TextView txt_sosHeader = (TextView) convertView.findViewById(R.id.txt_sosHeader);
LinearLayout lin_stockFaceupHeader = (LinearLayout) convertView.findViewById(R.id.lin_stockFaceupHeader); LinearLayout lin_stockFaceupHeader = (LinearLayout) convertView.findViewById(R.id.lin_stockFaceupHeader);
ImageView img_reference = (ImageView) convertView.findViewById(R.id.img_reference);
ImageView img_camera1 = (ImageView) convertView.findViewById(R.id.img_camera1); ImageView img_camera1 = (ImageView) convertView.findViewById(R.id.img_camera1);
ImageView img_camera2 = (ImageView) convertView.findViewById(R.id.img_camera2); ImageView img_camera2 = (ImageView) convertView.findViewById(R.id.img_camera2);
ImageView img_edit = (ImageView) convertView.findViewById(R.id.img_edit); //ImageView img_reference = (ImageView) convertView.findViewById(R.id.img_reference);
//ImageView img_edit = (ImageView) convertView.findViewById(R.id.img_edit);
txt_stockFaceupHeader.setTypeface(null, Typeface.BOLD); txt_stockFaceupHeader.setTypeface(null, Typeface.BOLD);
txt_stockFaceupHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand()); txt_stockFaceupHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
img_camera1.setOnClickListener(new View.OnClickListener() { if (headerTitle.getCompany_id().equals("1")) {
@Override txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
public void onClick(View v) {
//String date = new Date().toLocaleString().toString();
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
_pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
child_position = groupPosition;
path = str + _pathforcheck;
startCameraActivity1(groupPosition);
}
});
if (!img1.equalsIgnoreCase("")) {
if (groupPosition == child_position) {
headerTitle.setImage1(img1);
img1 = "";
}
}
if (headerTitle.getImage1().equals("")) {
img_camera1.setBackgroundResource(R.mipmap.camera);
} else { } else {
img_camera1.setBackgroundResource(R.mipmap.camera_done); txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
} }
//Camera allow enable
if (camera_allow.equalsIgnoreCase("1")) {
img_camera2.setOnClickListener(new View.OnClickListener() { img_camera1.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
//String date = new Date().toLocaleString().toString(); //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_Cam2_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg"; _pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
child_position = groupPosition; child_position = groupPosition;
path = str + _pathforcheck; path = str + _pathforcheck;
startCameraActivity2(groupPosition); startCameraActivity1(groupPosition);
}
});
if (!img1.equalsIgnoreCase("")) {
if (groupPosition == child_position) {
headerTitle.setImage1(img1);
img1 = "";
}
} }
});
if (!img2.equalsIgnoreCase("")) { if (headerTitle.getImage1().equals("")) {
if (groupPosition == child_position) { img_camera1.setBackgroundResource(R.mipmap.camera_orange);
headerTitle.setImage2(img2); } else {
img2 = ""; img_camera1.setBackgroundResource(R.mipmap.camera_green);
} }
}
if (headerTitle.getImage2().equals("")) {
img_camera2.setBackgroundResource(R.mipmap.camera); 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(':', '-');
_pathforcheck = "Stock_Cam2_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
child_position = groupPosition;
path = str + _pathforcheck;
startCameraActivity2(groupPosition);
}
});
if (!img2.equalsIgnoreCase("")) {
if (groupPosition == child_position) {
headerTitle.setImage2(img2);
img2 = "";
}
}
if (headerTitle.getImage2().equals("")) {
img_camera2.setBackgroundResource(R.mipmap.camera_orange);
} else {
img_camera2.setBackgroundResource(R.mipmap.camera_green);
}
} else { } else {
img_camera2.setBackgroundResource(R.mipmap.camera_done); //Camera allow disable
img_camera1.setBackgroundResource(R.mipmap.camera_grey);
img_camera2.setBackgroundResource(R.mipmap.camera_grey);
} }
if (!checkflag) { if (!checkflag) {
if (checkHeaderArray.contains(groupPosition)) { if (checkHeaderArray.contains(groupPosition)) {
txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark)); txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
@@ -787,4 +1111,38 @@ public class Stock_FacingActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -0,0 +1,173 @@
package cpm.com.gskmtorange.gsk_dailyentry;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.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.LinearLayout;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Collections;
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.CategoryWisePerformaceGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
public class StoreWisePerformanceActivity extends AppCompatActivity {
RecyclerView recyclerView;
Toolbar toolbar;
ArrayList<StoreWisePerformaceGetterSetter> storeWisePerformanceList;
StoreWisePerformaceAdapter adapter;
GSKOrangeDB db;
private SharedPreferences preferences;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
setContentView(R.layout.activity_store_wise_performance);
toolbar = (Toolbar) findViewById(R.id.toolbar);
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
db = new GSKOrangeDB(this);
db.open();
//preference data
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, "");
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
toolbar.setTitle(getResources().getString(R.string.title_activity_store_wise_performance));
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(StoreWisePerformanceActivity.this, CategoryListActivity.class);
startActivity(intent);
}
});
} catch (Resources.NotFoundException e) {
e.printStackTrace();
}
}
@Override
protected void onResume() {
super.onResume();
try {
storeWisePerformanceList = db.getStoreWisePerformance(store_id);
adapter = new StoreWisePerformaceAdapter(StoreWisePerformanceActivity.this, storeWisePerformanceList);
recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
} catch (Exception e) {
e.printStackTrace();
}
}
public class StoreWisePerformaceAdapter extends RecyclerView.Adapter<StoreWisePerformaceAdapter.MyViewHolder> {
Context context;
private LayoutInflater inflator;
List<StoreWisePerformaceGetterSetter> list = Collections.emptyList();
public StoreWisePerformaceAdapter(Context context, List<StoreWisePerformaceGetterSetter> list) {
inflator = LayoutInflater.from(context);
this.list = list;
this.context = context;
}
@Override
public StoreWisePerformaceAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
View view = inflator.inflate(R.layout.item_store_wise_performance, parent, false);
StoreWisePerformaceAdapter.MyViewHolder holder = new StoreWisePerformaceAdapter.MyViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(StoreWisePerformaceAdapter.MyViewHolder holder, int position) {
final StoreWisePerformaceGetterSetter categoryData = list.get(position);
if (categoryData.getPeriod().equalsIgnoreCase("LTM")) {
holder.txt_period.setText(getResources().getString(R.string.category_performance_ltm));
} else if (categoryData.getPeriod().equalsIgnoreCase("MTD")) {
holder.txt_period.setText(getResources().getString(R.string.category_performance_mtd));
} else if (categoryData.getPeriod().equalsIgnoreCase("LSV")) {
holder.txt_period.setText(getResources().getString(R.string.category_performance_lsv));
}
holder.txt_msl_availability.setText(categoryData.getMsl_availability());
holder.txt_sos.setText(categoryData.getSos());
holder.txt_t2p.setText(categoryData.getT2p());
holder.txt_promo.setText(categoryData.getPromo());
holder.txt_oss.setText(categoryData.getOss());
}
@Override
public int getItemCount() {
return list.size();
}
class MyViewHolder extends RecyclerView.ViewHolder {
TextView txt_period, txt_sos, txt_t2p, txt_promo, txt_msl_availability, txt_oss;
LinearLayout lay_menu;
public MyViewHolder(View itemView) {
super(itemView);
lay_menu = (LinearLayout) itemView.findViewById(R.id.lay_menu);
txt_period = (TextView) itemView.findViewById(R.id.txt_period);
txt_sos = (TextView) itemView.findViewById(R.id.txt_sos);
txt_t2p = (TextView) itemView.findViewById(R.id.txt_t2p);
txt_promo = (TextView) itemView.findViewById(R.id.txt_promo);
txt_msl_availability = (TextView) itemView.findViewById(R.id.txt_msl_availability);
txt_oss = (TextView) itemView.findViewById(R.id.txt_oss);
}
}
}
@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) {
finish();
}
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
@@ -3,6 +3,8 @@ package cpm.com.gskmtorange.upload;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.os.AsyncTask; import android.os.AsyncTask;
@@ -26,6 +28,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Locale;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
@@ -38,38 +41,38 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler; import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
public class UploadActivity extends AppCompatActivity { public class UploadActivity extends AppCompatActivity {
private Dialog dialog;
private ProgressBar pb;
private TextView percentage, message;
GSKOrangeDB db; GSKOrangeDB db;
ArrayList<CoverageBean> coverageList; ArrayList<CoverageBean> coverageList;
private FailureGetterSetter failureGetterSetter = null;
private SharedPreferences preferences;
String date, userId, app_version; String date, userId, app_version;
StoreBean storeData; StoreBean storeData;
String datacheck = ""; String datacheck = "";
String[] words; String[] words;
String validity; String validity;
int mid; int mid;
private int factor, k = 0;
String errormsg = "", Path; String errormsg = "", Path;
Data data; Data data;
ArrayList<MSL_AvailabilityGetterSetter> msl_availabilityList; ArrayList<MSL_AvailabilityGetterSetter> msl_availabilityList;
ArrayList<Stock_FacingGetterSetter> stock_facingHeaderList, stock_facingChildList; ArrayList<Stock_FacingGetterSetter> stock_facingHeaderList, stock_facingChildList;
ArrayList<Promo_Compliance_DataGetterSetter> promotionSkuList, additionalPromotionList; ArrayList<Promo_Compliance_DataGetterSetter> promotionSkuList, additionalPromotionList;
ArrayList<T2PGetterSetter> t2PGetterSetters;
ArrayList<AddittionalGetterSetter> additionalVisibilityList; ArrayList<AddittionalGetterSetter> additionalVisibilityList;
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList; ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
private Dialog dialog;
private ProgressBar pb;
private TextView percentage, message;
private FailureGetterSetter failureGetterSetter = null;
private SharedPreferences preferences;
private int factor, k = 0;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -79,6 +82,9 @@ public class UploadActivity extends AppCompatActivity {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences = PreferenceManager.getDefaultSharedPreferences(this);
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
date = preferences.getString(CommonString.KEY_DATE, null); date = preferences.getString(CommonString.KEY_DATE, null);
userId = preferences.getString(CommonString.KEY_USERNAME, null); userId = preferences.getString(CommonString.KEY_USERNAME, null);
app_version = preferences.getString(CommonString.KEY_VERSION, null); app_version = preferences.getString(CommonString.KEY_VERSION, null);
@@ -92,6 +98,85 @@ public class UploadActivity extends AppCompatActivity {
new UploadTask(this).execute(); new UploadTask(this).execute();
} }
public String UploadImage(String path, String folder_name) throws Exception {
errormsg = "";
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
BitmapFactory.decodeFile(Path + path, o);
// The new size we want to scale to
final int REQUIRED_SIZE = 1639;
// Find the correct scale value. It should be the power of 2.
int width_tmp = o.outWidth, height_tmp = o.outHeight;
int scale = 1;
while (true) {
if (width_tmp < REQUIRED_SIZE && height_tmp < REQUIRED_SIZE)
break;
width_tmp /= 2;
height_tmp /= 2;
scale *= 2;
}
// Decode with inSampleSize
BitmapFactory.Options o2 = new BitmapFactory.Options();
o2.inSampleSize = scale;
Bitmap bitmap = BitmapFactory.decodeFile(Path + path, o2);
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bao);
byte[] ba = bao.toByteArray();
String ba1 = Base64.encodeBytes(ba);
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_IMAGE);
String[] split = path.split("/");
String path1 = split[split.length - 1];
request.addProperty("img", ba1);
request.addProperty("name", path1);
request.addProperty("FolderName", folder_name);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
Object result = envelope.getResponse();
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
return CommonString.KEY_FALSE;
}
SAXParserFactory saxPF = SAXParserFactory.newInstance();
SAXParser saxP = saxPF.newSAXParser();
XMLReader xmlR = saxP.getXMLReader();
// for failure
FailureXMLHandler failureXMLHandler = new FailureXMLHandler();
xmlR.setContentHandler(failureXMLHandler);
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(result.toString()));
xmlR.parse(is);
failureGetterSetter = failureXMLHandler.getFailureGetterSetter();
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
errormsg = failureGetterSetter.getErrorMsg();
return CommonString.KEY_FAILURE;
}
} else {
new File(Path + path).delete();
}
return result.toString();
}
class Data { class Data {
int value; int value;
String name; String name;
@@ -180,7 +265,7 @@ public class UploadActivity extends AppCompatActivity {
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL); HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_STORE_COVERAGE, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_STORE_COVERAGE, envelope);
Object result = (Object) envelope.getResponse(); Object result = envelope.getResponse();
datacheck = result.toString(); datacheck = result.toString();
words = datacheck.split("\\;"); words = datacheck.split("\\;");
@@ -212,6 +297,7 @@ public class UploadActivity extends AppCompatActivity {
+ "[CATEGORY_ID]" + Integer.parseInt(msl_availabilityList.get(j).getCategory_id()) + "[/CATEGORY_ID]" + "[CATEGORY_ID]" + Integer.parseInt(msl_availabilityList.get(j).getCategory_id()) + "[/CATEGORY_ID]"
+ "[BRAND_ID]" + Integer.parseInt(msl_availabilityList.get(j).getBrand_id()) + "[/BRAND_ID]" + "[BRAND_ID]" + Integer.parseInt(msl_availabilityList.get(j).getBrand_id()) + "[/BRAND_ID]"
+ "[SKU_ID]" + Integer.parseInt(msl_availabilityList.get(j).getSku_id()) + "[/SKU_ID]" + "[SKU_ID]" + Integer.parseInt(msl_availabilityList.get(j).getSku_id()) + "[/SKU_ID]"
+ "[MBQ]" + Integer.parseInt(msl_availabilityList.get(j).getMbq()) + "[/MBQ]"
//+ "[SKU]" + msl_availabilityList.get(j).getSku() + "[/SKU]" //+ "[SKU]" + msl_availabilityList.get(j).getSku() + "[/SKU]"
+ "[TOGGLE_VALUE]" + Integer.parseInt(msl_availabilityList.get(j).getToggleValue()) + "[/TOGGLE_VALUE]" + "[TOGGLE_VALUE]" + Integer.parseInt(msl_availabilityList.get(j).getToggleValue()) + "[/TOGGLE_VALUE]"
+ "[/MSL_AVAILABILITY_DATA]"; + "[/MSL_AVAILABILITY_DATA]";
@@ -235,7 +321,7 @@ public class UploadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) { if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA; return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
@@ -304,7 +390,7 @@ public class UploadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) { if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA; return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
@@ -363,7 +449,7 @@ public class UploadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) { if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA; return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
@@ -422,7 +508,7 @@ public class UploadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) { if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA; return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
@@ -440,6 +526,7 @@ public class UploadActivity extends AppCompatActivity {
data.name = "Additional Promotion Data Uploading"; data.name = "Additional Promotion Data Uploading";
publishProgress(data); publishProgress(data);
////ashish open ////ashish open
//Additional Visibility Data //Additional Visibility Data
@@ -531,7 +618,7 @@ public class UploadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) { if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA; return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
@@ -545,17 +632,154 @@ public class UploadActivity extends AppCompatActivity {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA; return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
} }
} }
data.value = 35; data.value = 35;
data.name = "Additional Visibility Data"; data.name = "Additional Visibility Data";
publishProgress(data); publishProgress(data);
/////ashish close /////ashish close
//T2p Upload Data
String t2p_data_xml = "";
onXML = "";
t2PGetterSetters = db.getT2pComplianceData(coverageList.get(i).getStoreId(), null);
if (t2PGetterSetters.size() > 0) {
for (int i1 = 0; i1 < t2PGetterSetters.size(); i1++) {
ArrayList<GapsChecklistGetterSetter> gapsList = db.getGapsData(t2PGetterSetters.get(i).getKey_id());
ArrayList<SkuGetterSetter> skuList = db.getT2PSKUData(t2PGetterSetters.get(i).getKey_id());
String gaps_xml = "";
String gaps_child;
for (int l = 0; l < gapsList.size(); l++) {
String present = "";
if (gapsList.get(l).isPresent()) {
present = "1";
} else {
present = "0";
}
gaps_child = "[GAPS]"
+ "[MID]" + mid + "[/MID]"
+ "[USER_ID]" + userId + "[/USER_ID]"
+ "[CHECK_LIST_ID]"
+ gapsList.get(l).getChecklist_id()
+ "[/CHECK_LIST_ID]"
+ "[DISPLAY_ID]"
+ gapsList.get(l).getDisplay_id()
+ "[/DISPLAY_ID]"
+ "[PRESENT]"
+ present
+ "[/PRESENT]"
+ "[COMMON_ID]"
+ Integer.parseInt(t2PGetterSetters.get(i1).getKey_id())
+ "[/COMMON_ID]"
+ "[/GAPS]";
gaps_xml = gaps_xml + gaps_child;
}
String sku_xml = "";
String sku_child;
for (int k = 0; k < skuList.size(); k++) {
sku_child = "[SKU]"
+ "[MID]" + mid + "[/MID]"
+ "[USER_ID]" + userId + "[/USER_ID]"
+ "[SKU_ID]"
+ skuList.get(k).getSKU_ID()
+ "[/SKU_ID]"
+ "[BRAND_ID]"
+ skuList.get(k).getBRAND_ID()
+ "[/BRAND_ID]"
+ "[STOCK]"
+ skuList.get(k).getSTOCK()
+ "[/STOCK]"
+ "[COMMON_ID]"
+ Integer.parseInt(t2PGetterSetters.get(i1).getKey_id())
+ "[/COMMON_ID]"
+ "[/SKU]";
sku_xml = sku_xml + sku_child;
}
String present = "";
if (t2PGetterSetters.get(i1).isPresent()) {
present = "1";
} else {
present = "0";
}
onXML = "[T2P_DATA]"
+ "[MID]" + mid + "[/MID]"
+ "[USER_ID]" + userId + "[/USER_ID]"
+ "[CATEGORY_ID]"
+ Integer.parseInt(t2PGetterSetters.get(i1).getCategory_id())
+ "[/CATEGORY_ID]"
+ "[BRAND_ID]"
+ Integer.parseInt(t2PGetterSetters.get(i1).getBrand_id())
+ "[/BRAND_ID]"
+ "[DISPLAY_ID]"
+ Integer.parseInt(t2PGetterSetters.get(i1).getDisplay_id())
+ "[/DISPLAY_ID]"
+ "[COMMON_ID]"
+ Integer.parseInt(t2PGetterSetters.get(i1).getKey_id())
+ "[/COMMON_ID]"
+ "[IMAGE]"
+ t2PGetterSetters.get(i1).getImage()
+ "[/IMAGE]"
+ "[PRESENT]"
+ present
+ "[/PRESENT]"
+ "[GAPS_DATA]"
+ gaps_xml
+ "[/GAPS_DATA]"
+ "[SKU_DATA]"
+ sku_xml
+ "[/SKU_DATA]"
+ "[/T2P_DATA]";
t2p_data_xml = t2p_data_xml + onXML;
}
final String t2p_final_xml = "[DATA]" + t2p_data_xml + "[/DATA]";
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
request.addProperty("XMLDATA", t2p_final_xml);
request.addProperty("KEYS", "T2P_DATA");
request.addProperty("USERNAME", userId);
request.addProperty("MID", mid);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
result = envelope.getResponse();
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
}
if (result.toString().equalsIgnoreCase(CommonString.KEY_NO_DATA)) {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
}
if (result.toString().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
}
}
data.value = 40;
data.name = "T2P Data Uploading";
publishProgress(data);
//Image Upload //Image Upload
@@ -637,6 +861,31 @@ public class UploadActivity extends AppCompatActivity {
for(int m=0;m<t2PGetterSetters.size();m++){
if (t2PGetterSetters.get(m).getImage() != null && !t2PGetterSetters.get(m).getImage().equals("")) {
if (new File(CommonString.FILE_PATH + t2PGetterSetters.get(m).getImage()).exists()) {
try {
result = UploadImage(t2PGetterSetters.get(m).getImage(), "T2PImages");
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
return "T2PImages";
}
runOnUiThread(new Runnable() {
public void run() {
message.setText("T2P Images Uploaded");
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
// SET COVERAGE STATUS // SET COVERAGE STATUS
String final_xml = ""; String final_xml = "";
onXML = ""; onXML = "";
@@ -661,7 +910,7 @@ public class UploadActivity extends AppCompatActivity {
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_COVERAGE_STATUS, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_COVERAGE_STATUS, envelope);
result = (Object) envelope.getResponse(); result = envelope.getResponse();
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) { if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
return CommonString.METHOD_UPLOAD_COVERAGE_STATUS; return CommonString.METHOD_UPLOAD_COVERAGE_STATUS;
@@ -783,4 +1032,39 @@ public class UploadActivity extends AppCompatActivity {
return result.toString(); return result.toString();
} }
@Override
protected void onResume() {
super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
}
private static boolean updateResources(Context context, String language) {
String lang ;
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
lang = "TR";
}
Locale locale = new Locale(lang);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
}
} }
@@ -5,7 +5,23 @@ package cpm.com.gskmtorange.xmlGetterSetter;
*/ */
public class CategoryWisePerformaceGetterSetter { public class CategoryWisePerformaceGetterSetter {
String period, sos, t2p, promo, msl_availability, oss; String store_id, category_id, period, msl_availability, sos, t2p, promo, oss, order_id;
public String getStore_id() {
return store_id;
}
public void setStore_id(String store_id) {
this.store_id = store_id;
}
public String getCategory_id() {
return category_id;
}
public void setCategory_id(String category_id) {
this.category_id = category_id;
}
public String getPeriod() { public String getPeriod() {
return period; return period;
@@ -15,6 +31,14 @@ public class CategoryWisePerformaceGetterSetter {
this.period = period; this.period = period;
} }
public String getMsl_availability() {
return msl_availability;
}
public void setMsl_availability(String msl_availability) {
this.msl_availability = msl_availability;
}
public String getSos() { public String getSos() {
return sos; return sos;
} }
@@ -39,14 +63,6 @@ public class CategoryWisePerformaceGetterSetter {
this.promo = promo; this.promo = promo;
} }
public String getMsl_availability() {
return msl_availability;
}
public void setMsl_availability(String msl_availability) {
this.msl_availability = msl_availability;
}
public String getOss() { public String getOss() {
return oss; return oss;
} }
@@ -54,4 +70,12 @@ public class CategoryWisePerformaceGetterSetter {
public void setOss(String oss) { public void setOss(String oss) {
this.oss = oss; this.oss = oss;
} }
public String getOrder_id() {
return order_id;
}
public void setOrder_id(String order_id) {
this.order_id = order_id;
}
} }
@@ -0,0 +1,65 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.util.ArrayList;
/**
* Created by gagang on 12-01-2017.
*/
public class MAPPING_PLANOGRAM_MasterGetterSetter {
String table_MAPPING_PLANOGRAM;
ArrayList<String> KEYACCOUNT_ID = new ArrayList<>();
ArrayList<String> STORETYPE_ID = new ArrayList<>();
ArrayList<String> CLASS_ID = new ArrayList<>();
ArrayList<String> PLANOGRAM_IMAGE = new ArrayList<>();
ArrayList<String> IMAGE_PATH = new ArrayList<>();
public String getTable_MAPPING_PLANOGRAM() {
return table_MAPPING_PLANOGRAM;
}
public void setTable_MAPPING_PLANOGRAM(String table_MAPPING_PLANOGRAM) {
this.table_MAPPING_PLANOGRAM = table_MAPPING_PLANOGRAM;
}
public ArrayList<String> getKEYACCOUNT_ID() {
return KEYACCOUNT_ID;
}
public void setKEYACCOUNT_ID(String KEYACCOUNT_ID) {
this.KEYACCOUNT_ID.add(KEYACCOUNT_ID);
}
public ArrayList<String> getSTORETYPE_ID() {
return STORETYPE_ID;
}
public void setSTORETYPE_ID(String STORETYPE_ID) {
this.STORETYPE_ID.add(STORETYPE_ID);
}
public ArrayList<String> getCLASS_ID() {
return CLASS_ID;
}
public void setCLASS_ID(String CLASS_ID) {
this.CLASS_ID.add(CLASS_ID);
}
public ArrayList<String> getPLANOGRAM_IMAGE() {
return PLANOGRAM_IMAGE;
}
public void setPLANOGRAM_IMAGE(String PLANOGRAM_IMAGE) {
this.PLANOGRAM_IMAGE.add(PLANOGRAM_IMAGE);
}
public ArrayList<String> getIMAGE_PATH() {
return IMAGE_PATH;
}
public void setIMAGE_PATH(String IMAGE_PATH) {
this.IMAGE_PATH.add(IMAGE_PATH);
}
}
@@ -0,0 +1,101 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.util.ArrayList;
/**
* Created by gagang on 11-01-2017.
*/
public class STORE_PERFORMANCE_MasterGetterSetter {
String table_STORE_PERFORMANCE;
ArrayList<String> STORE_ID = new ArrayList<>();
ArrayList<String> CATEGORY_ID = new ArrayList<>();
ArrayList<String> PERIOD = new ArrayList<>();
ArrayList<String> SOS = new ArrayList<>();
ArrayList<String> T2P = new ArrayList<>();
ArrayList<String> PROMO = new ArrayList<>();
ArrayList<String> MSL_AVAILABILITY = new ArrayList<>();
ArrayList<String> OSS = new ArrayList<>();
ArrayList<String> ORDERID = new ArrayList<>();
public String getTable_STORE_PERFORMANCE() {
return table_STORE_PERFORMANCE;
}
public void setTable_STORE_PERFORMANCE(String table_STORE_PERFORMANCE) {
this.table_STORE_PERFORMANCE = table_STORE_PERFORMANCE;
}
public ArrayList<String> getSTORE_ID() {
return STORE_ID;
}
public void setSTORE_ID(String STORE_ID) {
this.STORE_ID.add(STORE_ID);
}
public ArrayList<String> getCATEGORY_ID() {
return CATEGORY_ID;
}
public void setCATEGORY_ID(String CATEGORY_ID) {
this.CATEGORY_ID.add(CATEGORY_ID);
}
public ArrayList<String> getPERIOD() {
return PERIOD;
}
public void setPERIOD(String PERIOD) {
this.PERIOD.add(PERIOD);
}
public ArrayList<String> getSOS() {
return SOS;
}
public void setSOS(String SOS) {
this.SOS.add(SOS);
}
public ArrayList<String> getT2P() {
return T2P;
}
public void setT2P(String t2P) {
this.T2P.add(t2P);
}
public ArrayList<String> getPROMO() {
return PROMO;
}
public void setPROMO(String PROMO) {
this.PROMO.add(PROMO);
}
public ArrayList<String> getMSL_AVAILABILITY() {
return MSL_AVAILABILITY;
}
public void setMSL_AVAILABILITY(String MSL_AVAILABILITY) {
this.MSL_AVAILABILITY.add(MSL_AVAILABILITY);
}
public ArrayList<String> getOSS() {
return OSS;
}
public void setOSS(String OSS) {
this.OSS.add(OSS);
}
public ArrayList<String> getORDERID() {
return ORDERID;
}
public void setORDERID(String ORDERID) {
this.ORDERID.add(ORDERID);
}
}
@@ -0,0 +1,81 @@
package cpm.com.gskmtorange.xmlGetterSetter;
/**
* Created by gagang on 23-12-2016.
*/
public class StoreWisePerformaceGetterSetter {
String store_id, category_id, period, msl_availability, sos, t2p, promo, oss, order_id;
public String getStore_id() {
return store_id;
}
public void setStore_id(String store_id) {
this.store_id = store_id;
}
public String getCategory_id() {
return category_id;
}
public void setCategory_id(String category_id) {
this.category_id = category_id;
}
public String getPeriod() {
return period;
}
public void setPeriod(String period) {
this.period = period;
}
public String getMsl_availability() {
return msl_availability;
}
public void setMsl_availability(String msl_availability) {
this.msl_availability = msl_availability;
}
public String getSos() {
return sos;
}
public void setSos(String sos) {
this.sos = sos;
}
public String getT2p() {
return t2p;
}
public void setT2p(String t2p) {
this.t2p = t2p;
}
public String getPromo() {
return promo;
}
public void setPromo(String promo) {
this.promo = promo;
}
public String getOss() {
return oss;
}
public void setOss(String oss) {
this.oss = oss;
}
public String getOrder_id() {
return order_id;
}
public void setOrder_id(String order_id) {
this.order_id = order_id;
}
}
@@ -8,7 +8,7 @@ import java.util.ArrayList;
public class T2PGetterSetter { public class T2PGetterSetter {
String brand_id, display_id, brand, display, image, remark; String brand_id, display_id, brand, display, image, remark, key_id, category_id;
boolean isPresent; boolean isPresent;
ArrayList<GapsChecklistGetterSetter> gapsChecklist = new ArrayList<>(); ArrayList<GapsChecklistGetterSetter> gapsChecklist = new ArrayList<>();
@@ -85,4 +85,20 @@ public class T2PGetterSetter {
public void setSkulist(ArrayList<SkuGetterSetter> skulist) { public void setSkulist(ArrayList<SkuGetterSetter> skulist) {
this.skulist = skulist; this.skulist = skulist;
} }
public String getKey_id() {
return key_id;
}
public void setKey_id(String key_id) {
this.key_id = key_id;
}
public String getCategory_id() {
return category_id;
}
public void setCategory_id(String category_id) {
this.category_id = category_id;
}
} }
@@ -21,6 +21,9 @@ public class TableBean {
//Gagan start code //Gagan start code
public static String MAPPING_ADDITIONAL_PROMOTION; public static String MAPPING_ADDITIONAL_PROMOTION;
public static String STORE_PERFORMANCE;
public static String MAPPING_PLANOGRAM;
//Gagan end code //Gagan end code
public static String getJourneyPlan() { public static String getJourneyPlan() {
@@ -129,5 +132,21 @@ public class TableBean {
MAPPING_ADDITIONAL_PROMOTION = mappingAdditionalPromotion; MAPPING_ADDITIONAL_PROMOTION = mappingAdditionalPromotion;
} }
public static String getStorePerformance() {
return STORE_PERFORMANCE;
}
public static void setStorePerformance(String storePerformance) {
STORE_PERFORMANCE = storePerformance;
}
public static String getMappingPlanogram() {
return MAPPING_PLANOGRAM;
}
public static void setMappingPlanogram(String mappingPlanogram) {
MAPPING_PLANOGRAM = mappingPlanogram;
}
//Gagan end code //Gagan end code
} }
@@ -14,10 +14,12 @@ import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
@@ -621,5 +623,89 @@ public class XMLHandlers {
return map; return map;
} }
public static STORE_PERFORMANCE_MasterGetterSetter STORE_PERFORMANCEXMLHandler(XmlPullParser xpp, int eventType) {
STORE_PERFORMANCE_MasterGetterSetter st = new STORE_PERFORMANCE_MasterGetterSetter();
try {
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
if (xpp.getEventType() == XmlPullParser.START_TAG) {
if (xpp.getName().equals("META_DATA")) {
st.setTable_STORE_PERFORMANCE(xpp.nextText());
}
if (xpp.getName().equals("STORE_ID")) {
st.setSTORE_ID(xpp.nextText());
}
if (xpp.getName().equals("CATEGORY_ID")) {
st.setCATEGORY_ID(xpp.nextText());
}
if (xpp.getName().equals("PERIOD")) {
st.setPERIOD(xpp.nextText());
}
if (xpp.getName().equals("SOS")) {
st.setSOS(xpp.nextText());
}
if (xpp.getName().equals("T2P")) {
st.setT2P(xpp.nextText());
}
if (xpp.getName().equals("PROMO")) {
st.setPROMO(xpp.nextText());
}
if (xpp.getName().equals("MSL_AVAILABILITY")) {
st.setMSL_AVAILABILITY(xpp.nextText());
}
if (xpp.getName().equals("OSS")) {
st.setOSS(xpp.nextText());
}
if (xpp.getName().equals("ORDERID")) {
st.setORDERID(xpp.nextText());
}
}
xpp.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return st;
}
public static MAPPING_PLANOGRAM_MasterGetterSetter MAPPING_PLANOGRAM_XMLHandler(XmlPullParser xpp, int eventType) {
MAPPING_PLANOGRAM_MasterGetterSetter st = new MAPPING_PLANOGRAM_MasterGetterSetter();
try {
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
if (xpp.getEventType() == XmlPullParser.START_TAG) {
if (xpp.getName().equals("META_DATA")) {
st.setTable_MAPPING_PLANOGRAM(xpp.nextText());
}
if (xpp.getName().equals("KEYACCOUNT_ID")) {
st.setKEYACCOUNT_ID(xpp.nextText());
}
if (xpp.getName().equals("STORETYPE_ID")) {
st.setSTORETYPE_ID(xpp.nextText());
}
if (xpp.getName().equals("CLASS_ID")) {
st.setCLASS_ID(xpp.nextText());
}
if (xpp.getName().equals("PLANOGRAM_IMAGE")) {
st.setPLANOGRAM_IMAGE(xpp.nextText());
}
if (xpp.getName().equals("IMAGE_PATH")) {
st.setIMAGE_PATH(xpp.nextText());
}
}
xpp.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return st;
}
//Gagan End Code //Gagan End Code
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@color/grey_background" /> <item android:state_checked="false" android:drawable="@drawable/toggle_grey" />
<item android:state_checked="true" android:drawable="@color/green" /> <item android:state_checked="true" android:drawable="@drawable/toggle_green" />
</selector> </selector>
@@ -1,80 +1,3 @@
<!--<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="cpm.com.gskmtorange.LoginActivity">
&lt;!&ndash; Login progress &ndash;&gt;
<ProgressBar
android:id="@+id/login_progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:visibility="gone" />
<ScrollView
android:id="@+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/email_login_form"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="@+id/userid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_userid"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/user_login_button"
style="?android:textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/action_sign_in"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
</LinearLayout>-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
@@ -119,7 +42,7 @@
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="45dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
@@ -207,11 +130,11 @@
<ImageView <ImageView
android:id="@+id/gsklogo" android:id="@+id/gsklogo"
android:layout_width="167dp" android:layout_width="115dp"
android:layout_height="113dp" android:layout_height="100dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@drawable/gsk_logo"></ImageView> android:background="@drawable/gsklogo"></ImageView>
</RelativeLayout> </RelativeLayout>
@@ -226,7 +149,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="Version" android:text="Version/Versiyon"
android:textSize="@dimen/text_size_normal" /> android:textSize="@dimen/text_size_normal" />
</RelativeLayout> </RelativeLayout>
@@ -34,10 +34,10 @@
<ImageView <ImageView
android:id="@+id/logo" android:id="@+id/logo"
android:layout_width="300dp" android:layout_width="153dp"
android:layout_height="204dp" android:layout_height="133dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:background="@drawable/gsk_logo" /> android:background="@drawable/gsklogo" />
</RelativeLayout> </RelativeLayout>
@@ -0,0 +1,33 @@
<?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">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_store_wise_performance" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@drawable/right_arrow" />
</android.support.design.widget.CoordinatorLayout>
@@ -24,5 +24,4 @@
<include layout="@layout/contentstoreimage" /> <include layout="@layout/contentstoreimage" />
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>
@@ -24,14 +24,123 @@
android:text="Category Performance" android:text="Category Performance"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:visibility="gone"/> android:visibility="gone" />
<android.support.v7.widget.RecyclerView <LinearLayout
android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingBottom="5dp" android:orientation="vertical">
android:paddingTop="5dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="30">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_period"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_msl_availability"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_sos"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_t2p"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_promo"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_oss"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#888" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="5dp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
@@ -21,7 +21,7 @@
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:paddingTop="10dp" android:paddingTop="10dp"
android:text="Daily Data Menu" android:text="@string/daily_activity_menu"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:visibility="gone"/> android:visibility="gone"/>
@@ -49,11 +49,12 @@
<ImageView <ImageView
android:id="@+id/img_main" android:id="@+id/img_main"
android:layout_width="match_parent" android:layout_width="153dp"
android:layout_height="200dp" android:layout_height="133dp"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:src="@drawable/gsk_logo" android:src="@drawable/gsklogo"
android:layout_centerInParent="true"
/> />
<WebView <WebView
@@ -13,7 +13,10 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView <TextView
android:id="@+id/txt_promoComplianceName" android:id="@+id/txt_promoComplianceName"
@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="@+id/content_category_wise_performance"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_category_wise_performance">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/txt_categoryName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF1710F"
android:paddingBottom="10dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Category Performance"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="30">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_period"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_msl_availability"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_sos"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_t2p"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_promo"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="@string/category_performance_oss"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#888" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="5dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
@@ -24,7 +24,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Click Store Front Image" android:text="@string/store_image"
android:textSize="@dimen/store_entry_text_size" android:textSize="@dimen/store_entry_text_size"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:textColor="@color/white" android:textColor="@color/white"
@@ -79,7 +79,7 @@
android:id="@+id/img_cam_selfie" android:id="@+id/img_cam_selfie"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@mipmap/camera_icon_done" android:background="@mipmap/camera_orange"
android:layout_centerInParent="true" android:layout_centerInParent="true"
/> />
@@ -28,7 +28,7 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:text="Downloading Data" android:text="@string/download_data"
android:textSize="@dimen/text_size_normal" android:textSize="@dimen/text_size_normal"
android:paddingBottom="20dp" android:paddingBottom="20dp"
android:textColor="@color/white" android:textColor="@color/white"
@@ -9,7 +9,7 @@
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Store Visited" android:text="@string/store_visited"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="25sp" /> android:textSize="25sp" />
@@ -28,7 +28,7 @@
android:id="@+id/yes" android:id="@+id/yes"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Yes" android:text="@string/yes"
android:textColor="#000000" android:textColor="#000000"
android:background="@color/colorPrimary"/> android:background="@color/colorPrimary"/>
@@ -42,7 +42,7 @@
android:id="@+id/no" android:id="@+id/no"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="No" android:text="@string/no"
android:textColor="#000000" android:textColor="#000000"
android:background="@color/colorPrimary"/> android:background="@color/colorPrimary"/>
</RadioGroup> </RadioGroup>
@@ -48,6 +48,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textOn="Yes" android:textOn="Yes"
android:textOff="No" android:textOff="No"
android:background="@drawable/toggle_selector_background"
android:layout_centerInParent="true"/> android:layout_centerInParent="true"/>
</RelativeLayout> </RelativeLayout>
@@ -15,7 +15,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" android:orientation="horizontal"
android:weightSum="30"> android:weightSum="30">
<!--android:background="#F1E9E9"-->
<TextView <TextView
android:id="@+id/txt_period" android:id="@+id/txt_period"
@@ -23,71 +22,15 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="5" android:layout_weight="5"
android:gravity="center" android:gravity="center"
android:paddingBottom="5dp" android:padding="5dp"
android:paddingTop="5dp"
android:text="Period" android:text="Period"
android:textColor="#000" android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="20sp" android:textColor="#000" />
android:textStyle="bold" />
<View <View
android:layout_width="1dp" android:layout_width="1dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#f2711f" /> android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_sos"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="SOS"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#f2711f" />
<TextView
android:id="@+id/txt_t2p"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="T2P"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#f2711f" />
<TextView
android:id="@+id/txt_promo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="Promo"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#f2711f" />
<TextView <TextView
android:id="@+id/txt_msl_availability" android:id="@+id/txt_msl_availability"
@@ -95,17 +38,63 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="5" android:layout_weight="5"
android:gravity="center" android:gravity="center"
android:paddingBottom="5dp" android:padding="5dp"
android:paddingTop="5dp"
android:text="MSL Availability" android:text="MSL Availability"
android:textColor="#000" android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="15sp" android:textColor="#000" />
android:textStyle="bold" />
<View <View
android:layout_width="1dp" android:layout_width="1dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#f2711f" /> android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_sos"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="SOS"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_t2p"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="T2P"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_promo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="Promo"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView <TextView
android:id="@+id/txt_oss" android:id="@+id/txt_oss"
@@ -113,12 +102,10 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="5" android:layout_weight="5"
android:gravity="center" android:gravity="center"
android:paddingBottom="5dp" android:padding="5dp"
android:paddingTop="5dp"
android:text="OSS" android:text="OSS"
android:textColor="#000" android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="15sp" android:textColor="#000" />
android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<View <View
@@ -91,9 +91,11 @@
<ToggleButton <ToggleButton
android:id="@+id/toggle_available" android:id="@+id/toggle_available"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="70dp"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/toggle_selector_background" /> android:background="@drawable/toggle_selector_background"
android:textOff="@string/no"
android:textOn="@string/yes" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@@ -23,57 +23,71 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1.5"
android:gravity="center_vertical" android:orientation="horizontal"
android:orientation="vertical" android:paddingTop="5dp"
android:paddingRight="10dp"> android:weightSum="2">
<!--android:gravity="center_vertical"-->
<TextView <TextView
android:id="@+id/txt_stockFaceupHeader" android:id="@+id/txt_stockFaceupHeader"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:paddingLeft="25dp" android:layout_weight="1.4"
android:paddingLeft="20dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:text="Brand Name " android:text="Brand Name"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" />
<TextView
android:id="@+id/txt_sosHeader"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".6"
android:paddingRight="5dp"
android:text="@string/stock_facing_sos"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" /> android:textColor="#222" />
</LinearLayout> </LinearLayout>
<!--Camera Images-->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight=".5"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <!--<ImageView
android:id="@+id/img_reference" android:id="@+id/img_reference"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:src="@mipmap/star" /> android:src="@mipmap/star" />-->
<ImageView <ImageView
android:id="@+id/img_camera1" android:id="@+id/img_camera1"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp" />
android:src="@drawable/ic_menu_camera" /> <!--android:src="@drawable/ic_menu_camera"-->
<ImageView <ImageView
android:id="@+id/img_camera2" android:id="@+id/img_camera2"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp" />
android:src="@drawable/ic_menu_camera" /> <!--android:src="@drawable/ic_menu_camera"-->
<ImageView <!--<ImageView
android:id="@+id/img_edit" android:id="@+id/img_edit"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:src="@mipmap/no_camera" /> android:src="@mipmap/no_camera" />-->
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
</LinearLayout> </LinearLayout>
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/lay_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="30">
<TextView
android:id="@+id/txt_period"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="Period"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_msl_availability"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="MSL Availability"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_sos"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="SOS"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_t2p"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="T2P"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_promo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="Promo"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />
<TextView
android:id="@+id/txt_oss"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:padding="5dp"
android:text="OSS"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#888" />
</LinearLayout>
</LinearLayout>
@@ -24,7 +24,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:src="@drawable/gsk_logo" /> android:src="@drawable/gsklogo" />
<TextView <TextView
android:id="@+id/nav_user_name" android:id="@+id/nav_user_name"
@@ -41,7 +41,7 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_marginLeft="3sp" android:layout_marginLeft="3sp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="Reason" android:text=""
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold" />
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- <android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
card_view:cardCornerRadius="20dp">-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--Title and Image-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#90888888"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:padding="10dp"
android:text="@string/stock_facing_planogram_dialog_title"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/white" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/img_planogram"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:src="@drawable/sad_cloud"/>
</LinearLayout>
</LinearLayout>
<!--Cancel Image-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_margin="5dp"
android:orientation="vertical">
<ImageView
android:id="@+id/img_cancel"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@mipmap/cancel" />
</LinearLayout>
</FrameLayout>
<!--</android.support.v7.widget.CardView>-->
</LinearLayout>
@@ -91,8 +91,9 @@
android:id="@+id/toggle_btn" android:id="@+id/toggle_btn"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textOn="Yes" android:textOn="@string/yes"
android:textOff="No" android:textOff="@string/no"
android:background="@drawable/toggle_selector_background"
android:layout_centerInParent="true"/> android:layout_centerInParent="true"/>
@@ -126,9 +127,10 @@
android:layout_height="50dp" android:layout_height="50dp"
android:text="@string/image" android:text="@string/image"
android:layout_weight="1" android:layout_weight="1"
android:layout_centerInParent="true" android:background="@mipmap/camera_orange"
android:background="@drawable/cam_active" android:padding="@dimen/custom_margin"
android:padding="@dimen/custom_margin"/> android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</RelativeLayout> </RelativeLayout>
@@ -136,7 +138,8 @@
<RelativeLayout <RelativeLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"> android:layout_weight="1"
android:visibility="gone">
<ImageView <ImageView
android:id="@+id/img_remark" android:id="@+id/img_remark"
@@ -130,7 +130,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/cancel"/> android:text="@string/closed"/>
</LinearLayout> </LinearLayout>
@@ -147,34 +147,34 @@
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView <!-- <android.support.v7.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:padding="10dp" android:padding="10dp"
card_view:cardBackgroundColor="@color/colorOrange" card_view:cardBackgroundColor="@color/colorOrange"
card_view:cardCornerRadius="20dp" card_view:cardCornerRadius="20dp"
> >
<LinearLayout <LinearLayout
android:id="@+id/list_layout" android:id="@+id/list_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="95" android:layout_weight="95"
android:visibility="gone" android:visibility="gone"
> >
<ListView <ListView
android:id="@+id/lv" android:id="@+id/lv"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:cacheColorHint="#00000000" android:cacheColorHint="#00000000"
android:choiceMode="singleChoice" android:choiceMode="singleChoice"
android:divider="#ff9933" android:divider="#ff9933"
android:dividerHeight="2dp" android:dividerHeight="2dp"
android:fastScrollEnabled="true" android:fastScrollEnabled="true"
android:smoothScrollbar="true"></ListView> android:smoothScrollbar="true"></ListView>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>-->
</LinearLayout> </LinearLayout>
@@ -4,28 +4,24 @@
<group android:checkableBehavior="single"> <group android:checkableBehavior="single">
<item <item
android:id="@+id/nav_route_plan" android:id="@+id/nav_route_plan"
android:icon="@drawable/ic_menu_gallery" android:icon="@mipmap/entry_grey"
android:title="@string/menu_daily_route_plan" /> android:title="@string/menu_daily_route_plan" />
<item <item
android:id="@+id/nav_download" android:id="@+id/nav_download"
android:icon="@drawable/ic_menu_slideshow" android:icon="@mipmap/download_grey"
android:title="@string/menu_daily_download" /> android:title="@string/menu_daily_download" />
<item <item
android:id="@+id/nav_upload" android:id="@+id/nav_upload"
android:icon="@drawable/ic_menu_send" android:icon="@mipmap/upload_grey"
android:title="@string/menu_upload_data" /> android:title="@string/menu_upload_data" />
<item <item
android:id="@+id/nav_geotag" android:id="@+id/nav_geotag"
android:icon="@drawable/ic_menu_manage" android:icon="@mipmap/geotag_grey"
android:title="@string/menu_geotag" /> android:title="@string/menu_geotag" />
<item
android:id="@+id/nav_export"
android:icon="@drawable/ic_menu_share"
android:title="@string/menu_export" />
<item <item
android:id="@+id/nav_exit" android:id="@+id/nav_exit"
android:icon="@drawable/ic_menu_send" android:icon="@mipmap/exit_grey"
android:title="@string/menu_exit" /> android:title="@string/menu_exit" />
</group> </group>
@@ -33,11 +29,11 @@
<menu> <menu>
<item <item
android:id="@+id/nav_setting" android:id="@+id/nav_setting"
android:icon="@drawable/ic_menu_manage" android:icon="@mipmap/settings_grey"
android:title="@string/menu_setting" /> android:title="@string/menu_setting" />
<item <item
android:id="@+id/nav_services" android:id="@+id/nav_services"
android:icon="@drawable/ic_menu_send" android:icon="@mipmap/services_grey"
android:title="@string/menu_services" /> android:title="@string/menu_services" />
</menu> </menu>
</item> </item>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_planogram"
android:icon="@mipmap/star"
android:orderInCategory="100"
android:title="planogram"
app:showAsAction="always" />
</menu>
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+77 -3
View File
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="prompt_email">E-posta</string> <string name="prompt_email">E-posta</string>
<string name="prompt_password">Şifre (isteğe bağlı)</string>
<string name="action_sign_in">Giriş yapın veya kayıt olun</string>
<string name="action_sign_in_short">oturum aç</string> <string name="action_sign_in_short">oturum aç</string>
<string name="error_invalid_email">Bu e-posta adresi geçersiz</string> <string name="error_invalid_email">Bu e-posta adresi geçersiz</string>
<string name="error_invalid_password">Bu şifre çok kısa</string> <string name="error_invalid_password">Bu şifre çok kısa</string>
@@ -26,6 +24,7 @@
<string name="title_geo_tag_activity_upload_data">Store Uploaded</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_data">Store Geo Data Uploaded</string>
<string name="title_geo_tag_activity_geo_already_done">Store Already Geotagged</string> <string name="title_geo_tag_activity_geo_already_done">Store Already Geotagged</string>
<string name="main_menu_activity_name">GSK Turuncu Mağaza</string>
<string name="save">Sakla</string> <string name="save">Sakla</string>
@@ -38,7 +37,7 @@
<string name="present">Teşhir var mı?</string> <string name="present">Teşhir var mı?</string>
<string name="add">Ekle</string> <string name="add">Ekle</string>
<string name="select">Seç</string> <string name="select">Seçiniz</string>
<string name="title_activity_t2_pcompliance">Kalıcı Teşhir</string> <string name="title_activity_t2_pcompliance">Kalıcı Teşhir</string>
@@ -46,5 +45,80 @@
<string name="no">Hayır</string> <string name="no">Hayır</string>
<string name="title_activity_upload">Veri Paylaş</string> <string name="title_activity_upload">Veri Paylaş</string>
<string name="download_data">Veri Indir</string>
<string name="store_visited">Mağaza ziyaret edildi mi?</string>
<string name="store_image">Mağaza girişinin fotoğrafını çekiniz</string>
<string name="title_activity_store_image">Mağaza Girişi Fotoğrafı</string>
<string name="title_activity_Non_Work">Çalışmama Sebebi</string>
<string name="reason">Sebep</string>
<string name="select_reason">Bir sebep seçiniz</string>
<string name="daily_activity_menu">Günlük Veri Menüsü</string>
<string name="daily_data_menu_msl_availability">Bulunurluk</string>
<string name="daily_data_menu_stock_facing">Raf Payı</string>
<string name="daily_data_menu_t2p">Kalıcı Teşhir</string>
<string name="daily_data_menu_additional_visibility">Ek Teşhir</string>
<string name="daily_data_menu_promo_compliance">Promosyon</string>
<string name="daily_data_menu_competition_tracking">Rakip Bilgisi</string>
<string name="daily_data_menu_additional_promotions">Competition Promo</string>
<string name="closed">kapalı</string>
<string name="title_activity_promo_compliance">Promosyon</string>
<!--Gagan Start Code -->
<string name="title_activity_category_list">Kategoriler</string>
<string name="title_activity_category_wise_performance">Kategori Performansı</string>
<string name="title_activity_daily_main_menu">Günlük Veri Menüsü</string>
<string name="title_activity_msl__availability">Bulunurluk</string>
<string name="title_activity_stock_facing">Raf Payı</string>
<string name="daily_data_menu_msl_availability">Bulunurluk</string>
<string name="daily_data_menu_stock_facing">Raf Payı</string>
<string name="daily_data_menu_t2p">Kalıcı Teşhir</string>
<string name="daily_data_menu_additional_visibility">Ek Teşhir</string>
<string name="daily_data_menu_promo_compliance">Promosyon</string>
<string name="daily_data_menu_competition_tracking">Rakip Bilgisi</string>
<string name="daily_data_menu_additional_promotions">Promosyon</string>
<string name="msl_availability_sku">Ürün Adı</string>
<string name="msl_availability_mbq">X</string>
<string name="msl_availability_availability">Bulunurluk</string>
<string name="stock_facing_reference_image">Örnek Fotoğraf</string>
<string name="stock_facing_sku_name">Ürün Adı</string>
<string name="stock_facing_stock">X</string>
<string name="stock_facing_faceup">Önyüz</string>
<string name="stock_facing_sos_target">Raf Payı Hedefi</string>
<string name="stock_facing_sos">Raf Payi</string>
<string name="title_activity_promo_compliance">Promosyon</string>
<string name="promo_compliance_additional_promo">Additional Promos</string>
<string name="promo_compliance_promo">Promos</string>
<string name="promo_compliance_promos_sku">Promosyon Ürünü</string>
<string name="promo_compliance_sku">Promosyon Ürünü</string>
<string name="promo_compliance_inStock">Ürün Bulunuyor</string>
<string name="promo_compliance_promoAnnouncer">Duyuru Var</string>
<string name="promo_compliance_runningPOS">Kasa Okuyor</string>
<string name="promo_compliance_add">Add</string>
<string name="category_performance_period">Zaman</string>
<string name="category_performance_msl_availability">Bulunurluk</string>
<string name="category_performance_sos">Raf Payi</string>
<string name="category_performance_t2p">Kalici Teshir</string>
<string name="category_performance_promo">Promosyon</string>
<string name="category_performance_oss">TMP</string>
<string name="category_performance_ltm">Son 3 Ay</string>
<string name="category_performance_mtd">Bu Ay</string>
<string name="category_performance_lsv">Son Ziyaret</string>
<string name="title_activity_store_wise_performance">Mağaza Performansı</string>
<!--Gagan End Code -->
<!--Gagan start new code 2-->
<string name="stock_facing_planogram_dialog_title">Planogram</string>
<!--Gagan end new code 2-->
</resources> </resources>
@@ -13,4 +13,5 @@
<color name="colorOrange">#FFE0B2</color> <color name="colorOrange">#FFE0B2</color>
</resources> </resources>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="fa_icon_areachart">&#xf1fe;</string>
<string name="fa_icon_piechart">&#xf200;</string>
<string name="fa_icon_linechart">&#xf201;</string>
</resources>
+43 -8
View File
@@ -1,5 +1,6 @@
<resources> <resources>
<string name="app_name">GSKMTOrange</string> <string name="app_name">GSK MT Orange</string>
<string name="main_menu_activity_name">GSK Orange Stores</string>
<string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string>
@@ -9,9 +10,9 @@
<!-- Strings related to login --> <!-- Strings related to login -->
<string name="prompt_email">E Mail</string> <string name="prompt_email">E Mail</string>
<string name="prompt_userid">User Id</string> <string name="prompt_userid">Username/Kullanıcı Adı</string>
<string name="prompt_password">Password</string> <string name="prompt_password">Password/Şifre</string>
<string name="action_sign_in">Login</string> <string name="action_sign_in">Login/Giriş Yap</string>
<string name="action_sign_in_short">Sign in</string> <string name="action_sign_in_short">Sign in</string>
<string name="error_invalid_email">This email address is invalid</string> <string name="error_invalid_email">This email address is invalid</string>
<string name="error_invalid_password">This password is too short</string> <string name="error_invalid_password">This password is too short</string>
@@ -34,9 +35,6 @@
<string name="select">Select</string> <string name="select">Select</string>
<string name="add">Add</string> <string name="add">Add</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="select_language">Please select language</string> <string name="select_language">Please select language</string>
<string name="title_activity_select_language">SelectLanguageActivity</string> <string name="title_activity_select_language">SelectLanguageActivity</string>
@@ -83,6 +81,7 @@
<string name="stock_facing_stock">Stock</string> <string name="stock_facing_stock">Stock</string>
<string name="stock_facing_faceup">Facing</string> <string name="stock_facing_faceup">Facing</string>
<string name="stock_facing_sos_target">SOS Target</string> <string name="stock_facing_sos_target">SOS Target</string>
<string name="stock_facing_sos">SOS</string>
<!--Gagan end code--> <!--Gagan end code-->
@@ -99,9 +98,14 @@
<string name="title_store_list_checkout_current">Please checkout from current store</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> <string name="title_store_list_checkout_Already_filled">Data already filled</string>
<string name="title_store_list_download_data">Please Download Data First</string> <string name="title_store_list_download_data">Please Download Data First</string>
<string name="enter_the_values">Enter the values</string> <string name="enter_the_values">Enter the values</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="title_activity_upload">Upload Data</string> <string name="title_activity_upload">Upload Data</string>
<string name="no_data_for_upload">No Data For Upload</string> <string name="no_data_for_upload">No Data For Upload</string>
<string name="first_checkout_store">First checkout of store</string> <string name="first_checkout_store">First checkout of store</string>
@@ -118,6 +122,18 @@
<string name="promo_compliance_runningPOS">Running on POS</string> <string name="promo_compliance_runningPOS">Running on POS</string>
<string name="promo_compliance_add">Add</string> <string name="promo_compliance_add">Add</string>
<string name="category_performance_period">Period</string>
<string name="category_performance_msl_availability">MSL Availability</string>
<string name="category_performance_sos">SOS</string>
<string name="category_performance_t2p">T2P</string>
<string name="category_performance_promo">Promo</string>
<string name="category_performance_oss">OSS</string>
<string name="category_performance_ltm">LTM</string>
<string name="category_performance_mtd">MTD</string>
<string name="category_performance_lsv">LSV</string>
<string name="title_activity_store_wise_performance">Store wise Performance</string>
<!--Gagan end new code 1--> <!--Gagan end new code 1-->
@@ -125,6 +141,25 @@
<string name="Display">Display</string> <string name="Display">Display</string>
<string name="Photo">Photo</string> <string name="Photo">Photo</string>
<string name="title_activity_Additional_visibility">Additional Visibility</string> <string name="title_activity_Additional_visibility">Additional Visibility</string>
<string name="title_activity_Non_Work">Non-Work Reason</string> <string name="title_activity_Non_Work">Non Working Reason</string>
<string name="closed">Close</string>
<string name="click_image">Please click image</string>
<string name="fill_sku_data">Please fill SKU data</string>
<string name="fill_gaps_data">Please fill GAP data</string>
<string name="data_will_be_lost">Want to proceed usaved data will be deleted</string>
<string name="download_data">Downloading Data</string>
<string name="store_visited">Store Visited</string>
<string name="store_image">Click Store Front Image</string>
<string name="title_activity_store_image">Store Front Image</string>
<string name="reason">Reason</string>
<string name="select_reason">Select Reason</string>
<string name="daily_activity_menu">Daily Data Menu</string>
<!--Gagan start new code 2-->
<string name="stock_facing_planogram_dialog_title">Planogram</string>
<!--Gagan end new code 2-->
</resources> </resources>