Merge branch 'master' into GG_StorePerformance

This commit is contained in:
YadavendraSinghYaduvanshi
2017-01-12 10:07:23 +05:30
committed by GitHub
34 changed files with 3203 additions and 203 deletions
+2
View File
@@ -3,6 +3,8 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" filepath="$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" />
<module fileurl="file://$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" filepath="$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" />
<module fileurl="file://$PROJECT_DIR$/GSKORANGEV1.iml" filepath="$PROJECT_DIR$/GSKORANGEV1.iml" />
<module fileurl="file://$PROJECT_DIR$/GSKORANGEV1.iml" filepath="$PROJECT_DIR$/GSKORANGEV1.iml" />
</modules>
</component>
+11 -3
View File
@@ -68,7 +68,6 @@
android:label="@string/title_activity_store_geotag"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyD02po19go2JMhXJeAnKDiZSiNloPsWqzI" />
@@ -80,6 +79,7 @@
android:name=".dailyentry.T2PComplianceActivity"
android:label="@string/title_activity_t2_pcompliance"
android:screenOrientation="portrait"
android:configChanges="screenSize|orientation|keyboardHidden"
android:theme="@style/AppTheme.NoActionBar" />
<!-- Gagan Start Declaration -->
@@ -130,12 +130,20 @@
<activity
android:name=".dailyentry.NonWorkingReason"
android:label="@string/title_activity_t2_pcompliance"
android:label="@string/title_activity_Non_Work"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar"/>
<activity
android:name=".dailyentry.AdditionalVisibility"
android:label="@string/title_activity_Additional_visibility"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"/>
<activity
android:name=".upload.UploadActivity"
android:label="@string/title_activity_upload" />
</application>
</manifest>
@@ -11,11 +11,13 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
@@ -76,13 +78,20 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(TableBean.getDisplayMaster());
db.execSQL(TableBean.getMappingStock());
db.execSQL(TableBean.getMappingT2p());
db.execSQL(TableBean.getNonWorkingReason());
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.getMappingAdditionalPromotion());
db.execSQL(TableBean.getMappingPromotion());
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY);
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_CHILD);
db.execSQL(CommonString.CREATE_TABLE_STOCK_DIALOG);
db.execSQL(CommonString.CREATE_TABLE_STOCK_ADDITIONAL_STOCK_DATA);
db.execSQL(CommonString.CREATE_TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE);
db.execSQL(CommonString.CREATE_TABLE_INSERT_PROMO_SKU);
@@ -97,6 +106,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
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);
}
@Override
@@ -104,7 +117,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL("DROP TABLE IF EXISTS " + TableBean.getJourneyPlan());
}
public void deleteTableWithStoreID(String storeid, String process_id) {
public void deleteTableWithStoreID(String storeid) {
db.delete( CommonString.TABLE_COVERAGE_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
}
public void deleteAllTables() {
@@ -1462,9 +1478,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
}
public void InsertAdditionalPromoData(Promo_Compliance_DataGetterSetter data, String category_id) {
ContentValues values = new ContentValues();
try {
ContentValues values = new ContentValues();
values.put("STORE_ID", Integer.parseInt(data.getStore_id()));
values.put("CATEGORY_ID", Integer.parseInt(category_id));
values.put("SKU_ID", Integer.parseInt(data.getSku_id()));
@@ -1493,7 +1508,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
Promo_Compliance_DataGetterSetter cd = new Promo_Compliance_DataGetterSetter();
cd.setStore_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STORE_ID")));
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY_ID")));
cd.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
@@ -1503,7 +1517,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
cd.setIn_stock(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IN_STOCK_VALUE")));
cd.setPromo_announcer(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO_ANNOUNCER_VALUE")));
cd.setRunning_pos(dbcursor.getString(dbcursor.getColumnIndexOrThrow("RUNNING_POS_VALUE")));
list.add(cd);
dbcursor.moveToNext();
}
@@ -1517,11 +1530,11 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
return list;
}
public void InsertPromoSkuData(ArrayList<Promo_Compliance_DataGetterSetter> promoSkuListData, String category_id) {
ContentValues values = new ContentValues();
try {
db.beginTransaction();
for (int i = 0; i < promoSkuListData.size(); i++) {
Promo_Compliance_DataGetterSetter data = promoSkuListData.get(i);
@@ -1581,7 +1594,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
//Gagan End Method
//Non Working data
//Non Working data
public void insertNonWorkingData(NonWorkingReasonGetterSetter data) {
db.delete("NON_WORKING_REASON", null, null);
@@ -1664,8 +1677,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
Cursor dbcursor = null;
try {
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) {
dbcursor.moveToFirst();
@@ -2097,4 +2111,459 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
//Gagan end new code 1
public void InsertStockDialog(AdditionalDialogGetterSetter data) {
ContentValues values = new ContentValues();
try {
values.put(CommonString.KEY_STORE_ID, data.getStore_id());
values.put(CommonString.KEY_BRAND, data.getBrand());
values.put(CommonString.KEY_BRAND_ID, data.getBrand_id());
// values.put(CommonString.KEY_DISPLAY_ID, data.getDisplay_id());
values.put(CommonString.KEY_QUANTITY, data.getQuantity());
values.put(CommonString.KEY_SKU_ID, data.getSku_id());
values.put(CommonString.KEY_SKUNAME, data.getSku_name());
// values.put(CommonString.UNIQUE_KEY_ID, data.getUnique_id());
// values.put(CommonString.KEY_CATEGORY_ID, data.getCategory_id());
// values.put(CommonString.KEY_PROCESS_ID, data.getProcess_id());
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values);
} catch (Exception ex) {
Log.d("Database Exception ", ex.getMessage());
}
}
public ArrayList<AdditionalDialogGetterSetter> getDialogStock(String keyid) {
Cursor cursordata = null;
ArrayList<AdditionalDialogGetterSetter> productData = new ArrayList<AdditionalDialogGetterSetter>();
try {
cursordata = db.rawQuery("SELECT * FROM STOCK_DIALOG WHERE COMMON_ID = '"+keyid + "'", null);
if (cursordata != null) {
cursordata.moveToFirst();
while (!cursordata.isAfterLast()) {
AdditionalDialogGetterSetter sb = new AdditionalDialogGetterSetter();
sb.setKEY_ID(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_ID)));
sb.setBrand_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
sb.setBrand(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
sb.setQuantity(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_QUANTITY)));
sb.setSku_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_SKU_ID)));
sb.setSku_name(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_SKUNAME)));
productData.add(sb);
cursordata.moveToNext();
}
cursordata.close();
}
} catch (Exception ex) {
}
return productData;
}
public void deletedialogStockEntry(String id) {
try {
db.delete(CommonString.TABLE_INSERT_STOCK_DIALOG, "Id" + "='" + id + "'", null);
} catch (Exception e) {
System.out.println("" + e);
}
}
public void deleteStockEntry(String id) {
try {
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, "KEY_ID" + "='" + id + "'", null);
} catch (Exception e) {
System.out.println("" + e);
}
}
public ArrayList<BrandMasterGetterSetter> getBrandMasterData(String store_id) {
Cursor cursordata = null;
ArrayList<BrandMasterGetterSetter> Data = new ArrayList<BrandMasterGetterSetter>();
try {
cursordata = db.rawQuery("SELECT * FROM BRAND_MASTER ", null);
if (cursordata != null) {
cursordata.moveToFirst();
while (!cursordata.isAfterLast()) {
BrandMasterGetterSetter sb = new BrandMasterGetterSetter();
sb.setBRAND_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_ID")));
sb.setBRAND(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND")));
sb.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
sb.setCOMPANY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("COMPANY_ID")));
sb.setBRAND_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_SEQUENCE")));
Data.add(sb);
cursordata.moveToNext();
}
cursordata.close();
}
} catch (Exception ex) {
}
return Data;
}
public ArrayList<SkuMasterGetterSetter> getSKUMasterData(String store_id) {
Cursor cursordata = null;
ArrayList<SkuMasterGetterSetter> Data = new ArrayList<SkuMasterGetterSetter>();
try {
cursordata = db.rawQuery("SELECT * FROM SKU_MASTER ", null);
if (cursordata != null) {
cursordata.moveToFirst();
while (!cursordata.isAfterLast()) {
SkuMasterGetterSetter sb = new SkuMasterGetterSetter();
sb.setSKU_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SKU_ID")));
sb.setSKU(cursordata.getString(cursordata.getColumnIndexOrThrow("SKU")));
sb.setBRAND_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_ID")));
sb.setMRP(cursordata.getString(cursordata.getColumnIndexOrThrow("MRP")));
sb.setSKU_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("SKU_SEQUENCE")));
Data.add(sb);
cursordata.moveToNext();
}
cursordata.close();
}
} catch (Exception ex) {
}
return Data;
}
public void InsertAdditionalData(AddittionalGetterSetter data,ArrayList<AdditionalDialogGetterSetter> dialog) {
ContentValues values = new ContentValues();
ContentValues values1 = new ContentValues();
try {
values.put("Store_Id", data.getStore_id());
values.put("brand_name", data.getBrand());
values.put("brand_id", data.getBrand_id());
values.put("image_url", data.getImage());
values.put("sku_id", data.getSku_id());
values.put("sku_name", data.getSku());
values.put("toggle_value", data.getBtn_toogle());
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, null, values);
for(int i=0;i<dialog.size();i++)
{
values1.put(CommonString.KEY_Common_ID, key_id);
values1.put(CommonString.KEY_STORE_ID, dialog.get(i).getStore_id());
values1.put(CommonString.KEY_BRAND, dialog.get(i).getBrand());
values1.put(CommonString.KEY_BRAND_ID, dialog.get(i).getBrand_id());
values1.put(CommonString.KEY_QUANTITY, dialog.get(i).getQuantity());
values1.put(CommonString.KEY_SKU_ID, dialog.get(i).getSku_id());
values1.put(CommonString.KEY_SKUNAME, dialog.get(i).getSku_name());
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values1);
}
} catch (Exception ex) {
Log.d("Database Exception ", ex.getMessage());
}
}
public ArrayList<AddittionalGetterSetter> getAdditionalStock(String store_id) {
Cursor cursordata = null;
ArrayList<AddittionalGetterSetter> productData = new ArrayList<AddittionalGetterSetter>();
try {
cursordata = db.rawQuery("SELECT * FROM Stock_Additional_visibility WHERE Store_Id = '"+store_id + "'", null);
if (cursordata != null) {
cursordata.moveToFirst();
while (!cursordata.isAfterLast()) {
AddittionalGetterSetter sb = new AddittionalGetterSetter();
sb.setKey_id(cursordata.getString(cursordata
.getColumnIndexOrThrow("KEY_ID")));
sb.setStore_id(cursordata.getString(cursordata
.getColumnIndexOrThrow("Store_Id")));
sb.setBrand_id(cursordata.getString(cursordata
.getColumnIndexOrThrow("brand_id")));
sb.setBrand(cursordata.getString(cursordata
.getColumnIndexOrThrow("brand_name")));
sb.setImage(cursordata.getString(cursordata
.getColumnIndexOrThrow("image_url")));
sb.setSku_id(cursordata.getString(cursordata
.getColumnIndexOrThrow("sku_id")));
sb.setSku(cursordata.getString(cursordata
.getColumnIndexOrThrow("sku_name")));
sb.setBtn_toogle(cursordata.getString(cursordata
.getColumnIndexOrThrow("toggle_value")));
productData.add(sb);
cursordata.moveToNext();
}
cursordata.close();
}
} catch (Exception ex) {
}
return productData;
}
public void updateStoreStatus(String storeid, String visitdate,
String status) {
try {
ContentValues values = new ContentValues();
values.put(CommonString.KEY_CHECKOUT_STATUS, status);
db.update("JOURNEY_PLAN", values, CommonString.KEY_STORE_ID + "='" + storeid + "' AND " + CommonString.KEY_VISIT_DATE + "='" + visitdate + "'", null);
} 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());
}
}
// get T2P Compliance data
public ArrayList<T2PGetterSetter> getT2pComplianceData(String store_id, String common_id) {
ArrayList<T2PGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " +
CommonString.KEY_STORE_ID + "='" + store_id + "' AND " +
CommonString.KEY_CATEGORY_ID + "='" + common_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.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;
}
}
@@ -0,0 +1,234 @@
package cpm.com.gskmtorange.GetterSetter;
public class AdditionalDialogGetterSetter {
public String Display_id,display,brand_id,brand, trg_quantity, image1, image2, category_id,
image3, BEFORE_QTY, camera1, camera2, camera3, AFTER_QTY, store_id, stock_count, question_id, question, answer, type,
KEY_ID, unique_id,image_url, sku_id,quantity, process_id, sku_name, stock_flag;
public String getStock_flag() {
return stock_flag;
}
public void setStock_flag(String stock_flag) {
this.stock_flag = stock_flag;
}
public String getSku_name() {
return sku_name;
}
public void setSku_name(String sku_name) {
this.sku_name = sku_name;
}
public String getProcess_id() {
return process_id;
}
public void setProcess_id(String process_id) {
this.process_id = process_id;
}
public String getSku_id() {
return sku_id;
}
public void setSku_id(String sku_id) {
this.sku_id = sku_id;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getImage_url() {
return image_url;
}
public void setImage_url(String image_url) {
this.image_url = image_url;
}
public String getUnique_id() {
return unique_id;
}
public void setUnique_id(String unique_id) {
this.unique_id = unique_id;
}
public String getKEY_ID() {
return KEY_ID;
}
public void setKEY_ID(String kEY_ID) {
KEY_ID = kEY_ID;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCategory_id() {
return category_id;
}
public void setCategory_id(String category_id) {
this.category_id = category_id;
}
public String getQuestion_id() {
return question_id;
}
public void setQuestion_id(String question_id) {
this.question_id = question_id;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getStock_count() {
return stock_count;
}
public void setStock_count(String stock_count) {
this.stock_count = stock_count;
}
public String getStore_id() {
return store_id;
}
public void setStore_id(String store_id) {
this.store_id = store_id;
}
public String getCamera1() {
return camera1;
}
public void setCamera1(String camera1) {
this.camera1 = camera1;
}
public String getCamera2() {
return camera2;
}
public void setCamera2(String camera2) {
this.camera2 = camera2;
}
public String getCamera3() {
return camera3;
}
public void setCamera3(String camera3) {
this.camera3 = camera3;
}
public String getDisplay_id() {
return Display_id;
}
public void setDisplay_id(String display_id) {
Display_id = display_id;
}
public String getDisplay() {
return display;
}
public void setDisplay(String display) {
this.display = display;
}
public String getBrand_id() {
return brand_id;
}
public void setBrand_id(String brand_id) {
this.brand_id = brand_id;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getTrg_quantity() {
return trg_quantity;
}
public void setTrg_quantity(String trg_quantity) {
this.trg_quantity = trg_quantity;
}
public String getImage1() {
return image1;
}
public void setImage1(String image1) {
this.image1 = image1;
}
public String getImage2() {
return image2;
}
public void setImage2(String image2) {
this.image2 = image2;
}
public String getImage3() {
return image3;
}
public void setImage3(String image3) {
this.image3 = image3;
}
public String getBEFORE_QTY() {
return BEFORE_QTY;
}
public void setBEFORE_QTY(String bEFORE_QTY) {
BEFORE_QTY = bEFORE_QTY;
}
public String getAFTER_QTY() {
return AFTER_QTY;
}
public void setAFTER_QTY(String aFTER_QTY) {
AFTER_QTY = aFTER_QTY;
}
}
@@ -0,0 +1,80 @@
package cpm.com.gskmtorange.GetterSetter;
/**
* Created by ashishc on 09-01-2017.
*/
public class AddittionalGetterSetter {
public String getBrand() {
return Brand;
}
public void setBrand(String brand) {
Brand = brand;
}
public String getBrand_id() {
return Brand_id;
}
public void setBrand_id(String brand_id) {
Brand_id = brand_id;
}
public String getSku() {
return Sku;
}
public void setSku(String sku) {
Sku = sku;
}
public String getSku_id() {
return Sku_id;
}
public void setSku_id(String sku_id) {
Sku_id = sku_id;
}
public String getStore_id() {
return Store_id;
}
public void setStore_id(String store_id) {
Store_id = store_id;
}
public String getImage() {
return Image;
}
public void setImage(String image) {
Image = image;
}
String Brand,Brand_id,Sku,Sku_id,Store_id,Image;
public String getKey_id() {
return key_id;
}
public void setKey_id(String key_id) {
this.key_id = key_id;
}
String key_id;
public String getBtn_toogle() {
return btn_toogle;
}
public void setBtn_toogle(String btn_toogle) {
this.btn_toogle = btn_toogle;
}
String btn_toogle;
}
@@ -39,6 +39,8 @@ import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
import cpm.com.gskmtorange.download.DownloadActivity;
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
@@ -230,7 +232,7 @@ public class MainActivity extends AppCompatActivity
}
} else if (id == R.id.nav_geotag) {
db.open();
storelist = db.getStoreData(date);
@@ -246,6 +248,14 @@ public class MainActivity extends AppCompatActivity
} else if (id == R.id.nav_exit) {
Intent startDownload = new Intent(this,AdditionalVisibility.class);
startActivity(startDownload);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
} else if (id == R.id.nav_services) {
/*Intent startDownload = new Intent(this,T2PComplianceActivity.class);
@@ -26,6 +26,8 @@ public class CommonString {
public static final String KEY_LOGIN_DATA = "LOGIN_DATA";
public static final String KEY_CULTURE_ID = "CULTURE_ID";
public static final String KEY_STORE_ID = "STORE_ID";
public static final String KEY_Common_ID = "COMMON_ID";
public static final String KEY_STORE_NAME = "STORE_NAME";
public static final String KEY_VISIT_DATE = "VISIT_DATE";
public static final String KEY_CAMERA_ALLOW = "CAMERA_ALLOW";
@@ -47,11 +49,33 @@ public class CommonString {
public static final String KEY_REASON = "REASON";
public static final String KEY_COVERAGE_REMARK = "REMARK";
public static final String KEY_IMAGE = "IMAGE";
public static final String KEY_ID = "Id";
public static final String KEY_IMAGE_URL = "IMAGE_URL";
public static final String KEY_ID = "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_ID = "BRAND_ID";
public static final String KEY_DISPLAY_ID = "DISPLAY_ID";
public static final String KEY_QUANTITY = "QUANTITY";
public static final String KEY_SKU_ID = "SKU_ID";
public static final String KEY_SKUNAME = "SKUNAME";
public static final String UNIQUE_KEY_ID = "UNIQUE_KEY_ID";
public static final String KEY_CATEGORY_ID = "CATEGORY_ID";
public static final String KEY_PROCESS_ID = "PROCESS_ID";
public static final String KEY_JOURNEY_PLAN = "JOURNEY_PLAN";
public static final String TABLE_INSERT_STOCK_DIALOG = "STOCK_DIALOG";
public static final String KEY_P = "P";
public static final String KEY_D = "D";
@@ -271,6 +295,54 @@ public class CommonString {
+ ")";
public static final String CREATE_TABLE_STOCK_DIALOG = "CREATE TABLE "
+ TABLE_INSERT_STOCK_DIALOG + " (" + KEY_ID
+ " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_STORE_ID + " VARCHAR,"
+ KEY_BRAND_ID + " VARCHAR," + KEY_BRAND + " VARCHAR,"
+ KEY_DISPLAY_ID +" VARCHAR,"
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + KEY_Common_ID + " VARCHAR,"
+ KEY_CATEGORY_ID + " VARCHAR,"
+ KEY_SKUNAME + " VARCHAR,"
+ KEY_PROCESS_ID + " VARCHAR)";
public static final String TABLE_INSERT_STOCK_ADDITIONAL = "Stock_Additional_visibility";
public static final String CREATE_TABLE_INSERT_STOCK_ADDITIONAL_VISIBILITY = "CREATE TABLE IF NOT EXISTS "
+ TABLE_INSERT_STOCK_ADDITIONAL
+ "("
+ "KEY_ID"
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
+ "Store_Id"
+ " VARCHAR,"
+ "brand_name"
+ " VARCHAR,"
+ "brand_id"
+ " VARCHAR,"
+ "image_url"
+ " VARCHAR,"
+ "sku_id"
+ " VARCHAR,"
+ "sku_name"
+ " VARCHAR,"
+ "toggle_value"
+ " VARCHAR,"
+ "IMAGE2"
+ " VARCHAR"
+ ")";
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 "
@@ -282,14 +354,11 @@ public class CommonString {
+ "STORE_ID"
+ " INTEGER,"
+ "CATEGORY_ID"
+ " INTEGER,"
+ "SKU_ID"
/*+ "SKU_ID"
+ " INTEGER,"
+ "SKU"
+ " VARCHAR,"
+ " VARCHAR,"*/
+ "PROMO_ID"
+ " INTEGER,"
@@ -346,4 +415,64 @@ public class CommonString {
+ ")";
//Gagan Code End
public static final String TABLE_INSERT_STOCK_ADDITIONAL_DATA = "ADDITIONAL_STOCK_DATA";
public static final String CREATE_TABLE_STOCK_ADDITIONAL_STOCK_DATA = "CREATE TABLE "
+ TABLE_INSERT_STOCK_ADDITIONAL_DATA + " (" + KEY_ID
+ " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_STORE_ID + " VARCHAR,"
+ KEY_BRAND_ID + " VARCHAR," + KEY_BRAND + " VARCHAR,"
+ KEY_SKU_ID + " VARCHAR,"
+ KEY_SKUNAME + " 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"
+ ")";
}
File diff suppressed because it is too large Load Diff
@@ -42,6 +42,7 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.download.DownloadActivity;
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
/**
* Created by ashishc on 29-12-2016.
@@ -250,7 +251,6 @@ public class StoreListActivity extends AppCompatActivity {
store_id = current.getSTORE_ID();
if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_U)) {
Snackbar.make(v, R.string.title_store_list_activity_store_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
@@ -361,13 +361,29 @@ public class StoreListActivity extends AppCompatActivity {
public void onCheckedChanged(RadioGroup group, int checkedId) {
// find which radio button is selected
if (checkedId == R.id.yes) {
Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
startActivity(in);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
dialog.cancel();
boolean flag=true;
if(coverage.size()>0) {
for (int i = 0; i < coverage.size(); i++) {
if (store_id.equals(coverage.get(i).getStoreId())) {
flag=false;
break;
}
}
}
if(flag==true)
{
Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
startActivity(in);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
dialog.cancel();
}
else
{
Intent in=new Intent(StoreListActivity.this,CategoryListActivity.class);
startActivity(in);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
dialog.cancel();
}
} else if (checkedId == R.id.no) {
@@ -383,6 +399,9 @@ public class StoreListActivity extends AppCompatActivity {
int id) {
UpdateStore(store_id);
Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
startActivity(in);
@@ -404,8 +423,6 @@ public class StoreListActivity extends AppCompatActivity {
} else {
Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
startActivity(in);
}
@@ -439,5 +456,12 @@ public class StoreListActivity extends AppCompatActivity {
return result_flag;
}
public void UpdateStore(String storeid) {
db.open();
db.deleteTableWithStoreID(storeid);
db.updateStoreStatus(storeid, storelist.get(0).getVISIT_DATE(), "N");
}
}
@@ -4,12 +4,15 @@ import android.app.Activity;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@@ -17,6 +20,7 @@ import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@@ -47,8 +51,11 @@ import java.util.Calendar;
import java.util.List;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.LoginActivity;
import cpm.com.gskmtorange.R;
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.GapsChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
@@ -64,29 +71,31 @@ public class T2PComplianceActivity extends AppCompatActivity {
T2PAdapter t2PAdapter;
RecyclerView rec_t2p;
String categoryName, categoryId, storeId;
String categoryName, categoryId;
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 = "";
int child_position = -1;
/**
* ATTENTION: This was auto-generated to implement the App Indexing API.
* See https://g.co/AppIndexing/AndroidStudio for more information.
*/
private GoogleApiClient client;
String error_msg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_t2_pcompliance);
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);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
db = new GSKOrangeDB(T2PComplianceActivity.this);
db.open();
@@ -108,24 +117,47 @@ public class T2PComplianceActivity extends AppCompatActivity {
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Data Saved", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
finish();
if (isValid()) {
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) {
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());
t2PGetterSetters.get(i).setGapsChecklist(gapsChecklist);
}
}*/
rec_t2p.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
t2PAdapter = new T2PAdapter(t2PGetterSetters);
@@ -133,9 +165,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
@@ -168,11 +197,16 @@ public class T2PComplianceActivity extends AppCompatActivity {
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.getGapsChecklist());
showGapsDialog(mItem);
}
});
@@ -181,11 +215,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
if (((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes")) {
mItem.setPresent(true);
} else {
mItem.setPresent(false);
}
mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes"));
t2PAdapter.notifyDataSetChanged();
}
@@ -217,13 +247,24 @@ public class T2PComplianceActivity extends AppCompatActivity {
}
if (mItem.getImage().equals("")) {
holder.img_cam.setBackgroundResource(R.drawable.cam_deactive);
holder.img_cam.setBackgroundResource(R.mipmap.camera);
} else {
holder.img_cam.setBackgroundResource(R.drawable.cam_active);
holder.img_cam.setBackgroundResource(R.mipmap.camera_done);
}
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 +302,16 @@ 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);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
@@ -279,8 +328,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
t2p.setGapsChecklist(gapsChecklist);
dialog.cancel();
t2PAdapter.notifyDataSetChanged();
}
});
@@ -315,7 +365,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
final ArrayList<SkuGetterSetter> sku_list = new ArrayList<>();
if(skuAddedList.size()>0){
if (skuAddedList.size() > 0) {
rec_sku.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
SkuAddedAdapter skuAdapter = new SkuAddedAdapter(skuAddedList);
@@ -327,11 +377,10 @@ public class T2PComplianceActivity extends AppCompatActivity {
@Override
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();
}
else{
Snackbar.make(v, getResources().getString(R.string.enter_the_values), Snackbar.LENGTH_SHORT).show();
} else {
SkuGetterSetter sku = new SkuGetterSetter();
sku.setBRAND_ID(brand_selected[0].getBRAND_ID().get(0));
sku.setBRAND(brand_selected[0].getBRAND().get(0));
@@ -360,7 +409,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
brand_selected[0] = null;
sku_selected[0] = null;
}
}
@@ -369,7 +417,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
btn_cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.cancel();
t2PAdapter.notifyDataSetChanged();
}
});
@@ -394,13 +444,13 @@ public class T2PComplianceActivity extends AppCompatActivity {
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);
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));
}
@@ -428,7 +478,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if(position!=0){
if (position != 0) {
sku_selected[0] = sku_list.get(position);
}
@@ -470,9 +520,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
holder.tb_present.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes")) {
mItem.setPresent(true);
}
mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes"));
}
});
@@ -786,4 +836,46 @@ public class T2PComplianceActivity extends AppCompatActivity {
}
}
public boolean isValid() {
boolean flag = true;
for (int i = 0; i < t2PGetterSetters.size(); i++) {
if (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) {
/* Intent i = new Intent(activity, StorelistActivity.class);
activity.startActivity(i);
activity.finish();*/
}
});
android.app.AlertDialog alert = builder.create();
alert.show();
}
}
@@ -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;
}
}
@@ -31,6 +31,8 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.R;
@@ -66,6 +68,8 @@ public class UploadActivity extends AppCompatActivity {
ArrayList<MSL_AvailabilityGetterSetter> msl_availabilityList;
ArrayList<Stock_FacingGetterSetter> stock_facingHeaderList, stock_facingChildList;
ArrayList<Promo_Compliance_DataGetterSetter> promotionSkuList, additionalPromotionList;
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -436,6 +440,117 @@ public class UploadActivity extends AppCompatActivity {
data.name = "Additional Promotion Data Uploading";
publishProgress(data);
////ashish open
//Additional Visibility Data
String additional_visibility_data_xml = "";
String additional_visibility_dialog_xml = "";
onXML = "";
String onXMLdIALOG = "";
additionalVisibilityList = db.getAdditionalStock(coverageList.get(i).getStoreId());
if (additionalVisibilityList.size() > 0) {
for (int J = 0; J < additionalVisibilityList.size(); J++) {
String KeyID = additionalVisibilityList.get(J).getKey_id();
additionalVisibilitySkuList = db.getDialogStock(KeyID);
for (int k = 0; k < additionalVisibilitySkuList.size(); k++) {
onXMLdIALOG = "[VISIBILITY_DAILOG]"
+ "[MID]" + mid + "[/MID]"
+ "[USER_ID]"
+ userId
+ "[/USER_ID]"
+ "[KEY_ID]"
+ additionalVisibilitySkuList.get(k).getKEY_ID()
+ "[/KEY_ID]"
/* + "[DIALOG_BRAND_ID]"
+ additionalVisibilitySkuList.get(k).getBrand_id()
+ "[/DIALOG_BRAND_ID]"*/
+ "[SKU_ID]"
+ additionalVisibilitySkuList.get(k).getSku_id()
+ "[/SKU_ID]"
+ "[QUANTITY]"
+ additionalVisibilitySkuList.get(k).getQuantity()
+ "[/QUANTITY]"
+ "[/VISIBILITY_DAILOG]";
additional_visibility_dialog_xml = additional_visibility_dialog_xml + onXMLdIALOG;
}
onXML = "[ADDITIONAL_VISIBILITY_DATA]"
+ "[MID]" + mid + "[/MID]"
+ "[USER_ID]"
+ userId
+ "[/USER_ID]"
+ "[KEY_ID]"
+ additionalVisibilityList.get(J).getKey_id()
+ "[/KEY_ID]"
+ "[ADDITIONAL_DISPLAY]"
+ additionalVisibilityList.get(J).getBtn_toogle()
+ "[/ADDITIONAL_DISPLAY]"
+ "[BRAND_ID]"
+ additionalVisibilityList.get(J).getBrand_id()
+ "[/BRAND_ID]"
+ "[IMAGE_URL]"
+ additionalVisibilityList.get(J).getImage()
+ "[/IMAGE_URL]"
+ "[DISPLAY_ID]"
+ additionalVisibilityList.get(J).getSku_id()
+ "[/DISPLAY_ID]"
+ "[SKU_LIST]"
+ additional_visibility_dialog_xml
+ "[/SKU_LIST]"
+ "[/ADDITIONAL_VISIBILITY_DATA]";
additional_visibility_data_xml = additional_visibility_data_xml + onXML;
}
final String sos_xml = "[DATA]" + additional_visibility_data_xml + "[/DATA]";
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
request.addProperty("XMLDATA", sos_xml);
request.addProperty("KEYS", "ADDITIONAL_VISIBILITY_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 = (Object) 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 = 35;
data.name = "Additional Visibility Data";
publishProgress(data);
/////ashish close
//Image Upload
@@ -24,6 +24,19 @@ public class JourneyPlanGetterSetter {
ArrayList<String> CLASS_ID = new ArrayList<String>();
ArrayList<String> CAMERA_ALLOW = new ArrayList<String>();
public ArrayList<String> getCHANNEL_ID() {
return CHANNEL_ID;
}
public void setCHANNEL_ID(String CHANNEL_ID) {
this.CHANNEL_ID.add(CHANNEL_ID);
}
ArrayList<String> CHANNEL_ID = new ArrayList<String>();
public ArrayList<String> getCHECKOUT_STATUS() {
return CHECKOUT_STATUS;
}
@@ -8,7 +8,7 @@ import java.util.ArrayList;
public class T2PGetterSetter {
String brand_id, display_id, brand, display, image, remark;
String brand_id, display_id, brand, display, image, remark, key_id;
boolean isPresent;
ArrayList<GapsChecklistGetterSetter> gapsChecklist = new ArrayList<>();
@@ -85,4 +85,12 @@ public class T2PGetterSetter {
public void setSkulist(ArrayList<SkuGetterSetter> skulist) {
this.skulist = skulist;
}
public String getKey_id() {
return key_id;
}
public void setKey_id(String key_id) {
this.key_id = key_id;
}
}
@@ -175,6 +175,11 @@ public class XMLHandlers {
jcpGetterSetter.setGEO_TAG(xpp.nextText());
}
if (xpp.getName().equals("CHANNEL_ID")) {
jcpGetterSetter.setCHANNEL_ID(xpp.nextText());
}
}
xpp.next();
}
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="100">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="184dp"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:weightSum="100">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_weight="10"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:weightSum="25">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:text="Brand Name"
android:textStyle="bold" />
<TextView
android:id="@+id/brand_name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="15"
android:inputType="text">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_weight="10"
android:orientation="horizontal"
android:weightSum="25">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:text="SKU Name"
android:textStyle="bold" />
<TextView
android:id="@+id/display_name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="15">
</TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/third"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_weight="10"
android:orientation="horizontal"
android:weightSum="25">
<TextView
android:id="@+id/facing"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:text="Quantity"
android:textStyle="bold" />
<TextView
android:id="@+id/qty_bought"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="15"
android:inputType="number">
</TextView>
</LinearLayout>
<!-- </LinearLayout> -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="10"
android:weightSum="25">
<Button
android:id="@+id/delete_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="10"
android:background="@color/grey_background"
android:layout_marginLeft="30dp"
android:text="Delete" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="100">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="184dp"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:weightSum="100">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="10dp"
android:layout_weight="10"
android:orientation="horizontal"
android:weightSum="25">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:text="Brand Name"
android:textStyle="bold" />
<TextView
android:id="@+id/brand_name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="15"
android:inputType="text">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_weight="10"
android:orientation="horizontal"
android:weightSum="25">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:text="SKU Name"
android:textStyle="bold" />
<TextView
android:id="@+id/display_name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="15">
</TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/third"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_weight="10"
android:orientation="horizontal"
android:visibility="gone"
android:weightSum="25">
<TextView
android:id="@+id/facing"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:text="Quantity"
android:textStyle="bold" />
<TextView
android:id="@+id/qty_bought"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="15"
android:inputType="number">
</TextView>
</LinearLayout>
<!-- </LinearLayout> -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="10"
android:weightSum="25">
<Button
android:id="@+id/delete_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_weight="10"
android:background="@color/grey_background"
android:text="Delete" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -0,0 +1,180 @@
<?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="300dp"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
card_view:cardBackgroundColor="@color/colorPrimary"
card_view:cardCornerRadius="20dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="15dp"
android:paddingBottom="20dp"
android:paddingLeft="5dp"
android:text="@string/sku"
android:textColor="@color/white"
android:textSize="@dimen/text_size_normal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:id="@+id/tv_brand"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/brand" />
<Spinner
android:id="@+id/spinner_brand"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/sku" />
<Spinner
android:id="@+id/spinner_sku"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/stock" />
<EditText
android:id="@+id/et_stock"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:inputType="number" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:padding="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="horizontal">
<Button
android:id="@+id/btn_add"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/add"/>
<Button
android:id="@+id/btn_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/cancel"/>
</LinearLayout>
</RelativeLayout>
<!-- <android.support.v7.widget.RecyclerView
android:background="@color/grey_background"
android:id="@+id/rec_sku"
android:layout_width="match_parent"
android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>-->
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
card_view:cardBackgroundColor="@color/colorOrange"
card_view:cardCornerRadius="20dp"
>
<LinearLayout
android:id="@+id/list_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="95"
android:visibility="gone"
>
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:choiceMode="singleChoice"
android:divider="#ff9933"
android:dividerHeight="2dp"
android:fastScrollEnabled="true"
android:smoothScrollbar="true"></ListView>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
@@ -7,31 +7,8 @@
android:fitsSystemWindows="true"
tools:context="cpm.com.gskmtorange.dailyentry.AdditionalVisibility">
<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/contentadditionalvisibility" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_menu_save"
app:backgroundTint="@color/colorPrimary"
/>
@@ -1,92 +1,250 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey_background"
android:paddingBottom="@dimen/custom_margin"
android:paddingLeft="@dimen/custom_margin"
android:paddingRight="@dimen/custom_margin"
android:paddingTop="@dimen/custom_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
android:orientation="vertical"
android:weightSum="100">
<android.support.v7.widget.RecyclerView
android:id="@+id/rec_store_data"
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
android:theme="@style/AppTheme.AppBarOverlay">
<LinearLayout
android:id="@+id/no_data_lay"
<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>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="0dp"
android:layout_weight="60"
android:background="@color/grey_background"
android:orientation="vertical"
android:weightSum="8">
card_view:cardCornerRadius="20dp"
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
card_view:cardBackgroundColor="@color/white"
card_view:cardCornerRadius="5dp">
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/grey_background"
android:weightSum="100">
<TextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="No data available"
android:textSize="25sp"
android:textStyle="bold" />
</android.support.v7.widget.CardView>
android:layout_height="0dp"
android:layout_weight="8"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="2">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/AdditionalDisplay" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_centerInParent="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_weight="4"
android:background="@drawable/sad_cloud"
android:id="@+id/imageView3" />
<ToggleButton
android:id="@+id/btntoggle"
android:layout_width="0dp"
android:layout_height="wrap_content"
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
android:layout_weight=".5" />
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
card_view:cardBackgroundColor="@color/white"
card_view:cardCornerRadius="5dp">
</LinearLayout>
<TextView
<LinearLayout
android:id="@+id/tv_brandlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Please download data"
android:textSize="25sp"
android:textStyle="bold" />
</android.support.v7.widget.CardView>
android:layout_height="0dp"
android:layout_weight="40"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
</LinearLayout>
<TextView
android:id="@+id/tv_brand"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/brand"
android:textStyle="bold" />
</RelativeLayout>
<Spinner
android:id="@+id/spinner_Brand1"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:id="@+id/tv_displaylayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="40"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/Display"
android:textStyle="bold" />
<Spinner
android:id="@+id/spinner_SkuMaster"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="2"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/tv_cameralayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="15"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/grey_background">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/Photo"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/grey_background">
<ImageView
android:id="@+id/btn_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/new_camera" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/grey_background">
<ImageView
android:id="@+id/btn_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@mipmap/new_no_camera"
android:inputType="number" />
</RelativeLayout>
</LinearLayout>
<!--<RelativeLayout
android:id="@+id/tv_skulayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8"
android:background="@color/grey_background"
android:padding="5dp">
</RelativeLayout>-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9"
android:background="@color/grey_background"
android:padding="5dp">
<Button
android:id="@+id/btn_sku"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@color/colorPrimary"
android:text="@string/sku" />
<Button
android:id="@+id/btadd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@color/colorPrimary"
android:text="@string/add" />
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_weight="40"
android:padding="10dp"
card_view:cardBackgroundColor="@color/colorOrange"
card_view:cardCornerRadius="20dp"
>
<ListView
android:id="@+id/listviewlv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:choiceMode="singleChoice"
android:divider="#ff9933"
android:dividerHeight="2dp"
android:fastScrollEnabled="true"
android:smoothScrollbar="true"></ListView>
</android.support.v7.widget.CardView>
</LinearLayout>
@@ -29,6 +29,8 @@
android:textColor="@color/black"
android:textStyle="bold"
android:gravity="center_vertical"
android:paddingTop="2dp"
android:paddingBottom="@dimen/custom_margin"
android:padding="10dp"
android:textSize="@dimen/text_size_xsmall"
android:paddingLeft="@dimen/custom_margin"/>
@@ -38,4 +40,7 @@
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
@@ -48,6 +48,7 @@
android:layout_height="wrap_content"
android:textOn="Yes"
android:textOff="No"
android:background="@drawable/toggle_selector_background"
android:layout_centerInParent="true"/>
</RelativeLayout>
@@ -93,6 +93,7 @@
android:layout_height="wrap_content"
android:textOn="Yes"
android:textOff="No"
android:background="@drawable/toggle_selector_background"
android:layout_centerInParent="true"/>
@@ -1,10 +1,9 @@
<?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:orientation="vertical"
android:layout_width="300dp"
android:layout_height="match_parent"
>
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
@@ -27,20 +26,19 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="15dp"
android:paddingBottom="20dp"
android:paddingLeft="5dp"
android:text="@string/sku"
android:textSize="@dimen/text_size_normal"
android:paddingBottom="20dp"
android:textColor="@color/white"
/>
android:textSize="@dimen/text_size_normal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3"
android:background="@color/grey_background"
android:padding="5dp">
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:id="@+id/tv_brand"
@@ -48,77 +46,72 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/brand"
android:paddingLeft="5dp"/>
android:paddingLeft="5dp"
android:text="@string/brand" />
<Spinner
android:id="@+id/spinner_brand"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"/>
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3"
android:background="@color/grey_background"
android:padding="5dp">
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/sku"
android:paddingLeft="5dp"/>
android:paddingLeft="5dp"
android:text="@string/sku" />
<Spinner
android:id="@+id/spinner_sku"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"/>
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3"
android:background="@color/grey_background"
android:padding="5dp">
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/stock"
android:paddingLeft="5dp"/>
android:paddingLeft="5dp"
android:text="@string/stock" />
<EditText
android:id="@+id/et_stock"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:inputType="number"/>
android:inputType="number" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="@color/grey_background">
android:background="@color/grey_background"
android:padding="10dp">
<LinearLayout
android:layout_width="wrap_content"
@@ -137,8 +130,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/cancel"/>
android:text="@string/closed"/>
</LinearLayout>
@@ -155,4 +147,34 @@
</android.support.v7.widget.CardView>
</LinearLayout>
<!-- <android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
card_view:cardBackgroundColor="@color/colorOrange"
card_view:cardCornerRadius="20dp"
>
<LinearLayout
android:id="@+id/list_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="95"
android:visibility="gone"
>
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:choiceMode="singleChoice"
android:divider="#ff9933"
android:dividerHeight="2dp"
android:fastScrollEnabled="true"
android:smoothScrollbar="true"></ListView>
</LinearLayout>
</android.support.v7.widget.CardView>-->
</LinearLayout>
@@ -12,7 +12,7 @@
android:title="@string/menu_daily_download" />
<item
android:id="@+id/nav_upload"
android:icon="@drawable/ic_menu_send"
android:icon="@drawable/ic_menu_manage"
android:title="@string/menu_upload_data" />
<item
android:id="@+id/nav_geotag"
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

@@ -13,4 +13,5 @@
<color name="colorOrange">#FFE0B2</color>
</resources>
+1 -1
View File
@@ -7,7 +7,7 @@
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="custom_margin">5dp</dimen>
<dimen name="custom_margin">10dp</dimen>
<dimen name="text_size_normal">20sp</dimen>
<dimen name="text_size_small">16sp</dimen>
@@ -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>
+18 -2
View File
@@ -34,8 +34,6 @@
<string name="select">Select</string>
<string name="add">Add</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="title_activity_select_language">SelectLanguageActivity</string>
@@ -98,9 +96,14 @@
<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_download_data">Please Download Data First</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="no_data_for_upload">No Data For Upload</string>
<string name="first_checkout_store">First checkout of store</string>
@@ -132,4 +135,17 @@
<!--Gagan end new code 1-->
<string name="AdditionalDisplay">Is there any Additional Display</string>
<string name="Display">Display</string>
<string name="Photo">Photo</string>
<string name="title_activity_Additional_visibility">Additional Visibility</string>
<string name="title_activity_Non_Work">Non-Work 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>
</resources>