Planogram pdf and Category image mapping
This commit is contained in:
Generated
+1
-14
@@ -4,9 +4,6 @@
|
|||||||
<option name="VM_OPTIONS" value="-Xmx512m" />
|
<option name="VM_OPTIONS" value="-Xmx512m" />
|
||||||
<option name="MAX_HEAP_SIZE" value="1024" />
|
<option name="MAX_HEAP_SIZE" value="1024" />
|
||||||
</component>
|
</component>
|
||||||
<component name="EntryPointsManager">
|
|
||||||
<entry_points version="2.0" />
|
|
||||||
</component>
|
|
||||||
<component name="NullableNotNullManager">
|
<component name="NullableNotNullManager">
|
||||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||||
@@ -31,17 +28,7 @@
|
|||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<OptionsSetting value="true" id="Add" />
|
|
||||||
<OptionsSetting value="true" id="Remove" />
|
|
||||||
<OptionsSetting value="true" id="Checkout" />
|
|
||||||
<OptionsSetting value="true" id="Update" />
|
|
||||||
<OptionsSetting value="true" id="Status" />
|
|
||||||
<OptionsSetting value="true" id="Edit" />
|
|
||||||
<ConfirmationsSetting value="0" id="Add" />
|
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ android {
|
|||||||
disable 'MissingTranslation'
|
disable 'MissingTranslation'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
all*.exclude module: 'okio'
|
||||||
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cpm.com.gskmtorange"
|
applicationId "cpm.com.gskmtorange"
|
||||||
minSdkVersion 17
|
minSdkVersion 17
|
||||||
@@ -17,6 +21,7 @@ android {
|
|||||||
|
|
||||||
versionCode 11
|
versionCode 11
|
||||||
versionName "2.4"
|
versionName "2.4"
|
||||||
|
multiDexEnabled true
|
||||||
|
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@@ -44,5 +49,8 @@ dependencies {
|
|||||||
compile 'com.android.support:support-v4:24.2.1'
|
compile 'com.android.support:support-v4:24.2.1'
|
||||||
compile 'com.google.code.gson:gson:2.7'
|
compile 'com.google.code.gson:gson:2.7'
|
||||||
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
|
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
|
||||||
|
|
||||||
|
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.T2PComplianceActivity"
|
android:name=".dailyentry.T2PComplianceActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_t2_pcompliance"
|
android:label="@string/daily_data_menu_t2p"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
|
||||||
@@ -210,12 +210,17 @@
|
|||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
<activity android:name=".dailyentry.NoCameraActivity"
|
<activity
|
||||||
|
android:name=".dailyentry.NoCameraActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_create_self"
|
android:label="@string/title_activity_create_self"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" ></activity>
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PlanogramPDFActivity"
|
||||||
|
android:label="@string/title_activity_planogram_pdf"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"></activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -26,6 +26,7 @@ import cpm.com.gskmtorange.constant.CommonString;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryImagesAllowed;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||||
@@ -39,13 +40,16 @@ import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramCountrywiseGetterSetter;
|
||||||
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.MappingSubCategoryImageAllowGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.RowColumnGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||||
@@ -64,7 +68,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class GSKOrangeDB extends SQLiteOpenHelper {
|
public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||||
public static final String DATABASE_NAME = "GSK_ORANGE_DB12";
|
public static final String DATABASE_NAME = "GSK_ORANGE_DB14";
|
||||||
public static final int DATABASE_VERSION = 13;
|
public static final int DATABASE_VERSION = 13;
|
||||||
TableBean tableBean;
|
TableBean tableBean;
|
||||||
private SQLiteDatabase db;
|
private SQLiteDatabase db;
|
||||||
@@ -152,6 +156,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_CATEGORY_PICTURE);
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_CATEGORY_PICTURE);
|
||||||
|
|
||||||
db.execSQL(TableBean.getMappingSubCategoryImageAllow());
|
db.execSQL(TableBean.getMappingSubCategoryImageAllow());
|
||||||
|
db.execSQL(TableBean.getMappingCategoryImageAllow());
|
||||||
|
//db.execSQL(TableBean.getMappingCountrywisePlanogram());
|
||||||
db.execSQL(TableBean.getSkugroupMaster());
|
db.execSQL(TableBean.getSkugroupMaster());
|
||||||
|
|
||||||
//15-03-2017
|
//15-03-2017
|
||||||
@@ -203,6 +209,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE_LIST, "Store_Id='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE_LIST, "Store_Id='" + storeid + "'", null);
|
||||||
|
|
||||||
db.delete(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, "Store_Id='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, "Store_Id='" + storeid + "'", null);
|
||||||
|
|
||||||
|
db.delete(CommonString.TABLE_INSERT_NO_CAMERA_FACING_DATA, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteAllTables() {
|
public void deleteAllTables() {
|
||||||
@@ -234,6 +243,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE, null, null);
|
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE, null, null);
|
||||||
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE_LIST, null, null);
|
db.delete(CommonString.TABLE_INSERT_CATEGORY_PICTURE_LIST, null, null);
|
||||||
db.delete(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, null, null);
|
db.delete(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, null, null);
|
||||||
|
db.delete(CommonString.TABLE_INSERT_NO_CAMERA_FACING_DATA, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||||
@@ -3121,11 +3131,12 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> getMappingPlanogramData(String category_id) {
|
public ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> getMappingPlanogramData(String category_id, String store_type_id, String class_id) {
|
||||||
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> list = new ArrayList<>();
|
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> list = new ArrayList<>();
|
||||||
Cursor dbcursor = null;
|
Cursor dbcursor = null;
|
||||||
try {
|
try {
|
||||||
dbcursor = db.rawQuery("SELECT * FROM MAPPING_PLANOGRAM where CATEGORY_ID='" + category_id + "'", null);
|
dbcursor = db.rawQuery("SELECT * FROM MAPPING_PLANOGRAM where CATEGORY_ID='" + category_id + "' AND STORETYPE_ID ='" + store_type_id
|
||||||
|
+"' AND CLASS_ID ='" + class_id + "'", null);
|
||||||
|
|
||||||
if (dbcursor != null) {
|
if (dbcursor != null) {
|
||||||
dbcursor.moveToFirst();
|
dbcursor.moveToFirst();
|
||||||
@@ -4793,6 +4804,27 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MAPPING_CATEGORY_IMAGE_ALLOW
|
||||||
|
public void InsertMappingCategoryImageAllow(MappingCategoryImageAllowGetterSetter data) {
|
||||||
|
db.delete("MAPPING_CATEGORY_IMAGE_ALLOW", null, null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < data.getCATEGORY_ID().size(); i++) {
|
||||||
|
|
||||||
|
values.put("COUNTRY_ID", data.getCOUNTRY_ID().get(i));
|
||||||
|
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
|
||||||
|
values.put("IMAGE1_ALLOW", data.getIMAGE1_ALLOW().get(i));
|
||||||
|
values.put("IMAGE2_ALLOW", data.getIMAGE2_ALLOW().get(i));
|
||||||
|
values.put("IMAGE3_ALLOW", data.getIMAGE3_ALLOW().get(i));
|
||||||
|
values.put("IMAGE4_ALLOW", data.getIMAGE4_ALLOW().get(i));
|
||||||
|
|
||||||
|
db.insert("MAPPING_CATEGORY_IMAGE_ALLOW", null, values);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in MAPPING_CATEGORY_IMAGE_ALLOW " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//14-03-2017
|
//14-03-2017
|
||||||
//MSL_Availability_StockFacing
|
//MSL_Availability_StockFacing
|
||||||
@@ -5176,11 +5208,15 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
public void InsertNoCameraAddedData(
|
public void InsertNoCameraAddedData(
|
||||||
String storeId, String categoryId, String sub_category_id, int row_count, HashMap<Integer,
|
String storeId, String categoryId, String sub_category_id, int row_count, HashMap<Integer,
|
||||||
List<NoCameraDataGetterSetter>> hashMapRowData) {
|
List<NoCameraDataGetterSetter>> hashMapRowData) {
|
||||||
|
|
||||||
|
db.delete(CommonString.TABLE_INSERT_NO_CAMERA_FACING_DATA, " STORE_ID = '" + storeId
|
||||||
|
+ "' AND CATEGORY_ID = '" + categoryId + "' AND SUB_CATEGORY_ID = '" + sub_category_id + "'", null);
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
db.beginTransaction();
|
db.beginTransaction();
|
||||||
for (int i = 1; i < row_count; i++) {
|
for (int i = 1; i <=row_count; i++) {
|
||||||
|
|
||||||
for (int j = 0; j < hashMapRowData.get(i).size(); j++) {
|
for (int j = 0; j < hashMapRowData.get(i).size(); j++) {
|
||||||
NoCameraDataGetterSetter data = hashMapRowData.get(i).get(j);
|
NoCameraDataGetterSetter data = hashMapRowData.get(i).get(j);
|
||||||
@@ -5311,4 +5347,128 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
Log.d("Exception ", " in SKUGROUP_MASTER " + ex.toString());
|
Log.d("Exception ", " in SKUGROUP_MASTER " + ex.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//get Row and column count no camera
|
||||||
|
public ArrayList<RowColumnGetterSetter> getrowColumnNoCamera(String store_id, String category_id, String sub_category_id) {
|
||||||
|
|
||||||
|
ArrayList<RowColumnGetterSetter> list = new ArrayList<>();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
dbcursor = db.rawQuery("SELECT ROW_NO, MAX(COLUMN_NO) as COLUMN_NO FROM NO_CAMERA_FACING_DATA WHERE " +
|
||||||
|
"STORE_ID = '" + store_id + "' AND CATEGORY_ID = '" + category_id + "' AND SUB_CATEGORY_ID = '" + sub_category_id +
|
||||||
|
"' GROUP BY ROW_NO", null);
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
RowColumnGetterSetter rc = new RowColumnGetterSetter();
|
||||||
|
|
||||||
|
rc.setRow(dbcursor.getInt(dbcursor.getColumnIndexOrThrow("ROW_NO")));
|
||||||
|
rc.setColumn(dbcursor.getInt(dbcursor.getColumnIndexOrThrow("COLUMN_NO")));
|
||||||
|
|
||||||
|
list.add(rc);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception ", "get row column!" + e.toString());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get Sub group master for sub category id , row and column
|
||||||
|
|
||||||
|
public NoCameraDataGetterSetter getRowSkuGroupCamera(String store_id, String category_id, String sub_category_id, int row, int column) {
|
||||||
|
|
||||||
|
NoCameraDataGetterSetter column_data = new NoCameraDataGetterSetter();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
dbcursor = db.rawQuery("SELECT NC.SKU_GROUP_ID, SM.SKUGROUP_NAME, NC.FACING FROM NO_CAMERA_FACING_DATA NC " +
|
||||||
|
"INNER JOIN SKUGROUP_MASTER SM ON NC.SKU_GROUP_ID = SM.SKUGROUP_ID " +
|
||||||
|
"WHERE NC.STORE_ID = '"+store_id +"' AND NC.CATEGORY_ID = '"+ category_id +"' AND NC.SUB_CATEGORY_ID = '"+ sub_category_id +"' AND ROW_NO = '"
|
||||||
|
+ row +"' AND COLUMN_NO = '" + column + "'", null);
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
|
||||||
|
column_data.setSKUGROUP_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_GROUP_ID")));
|
||||||
|
column_data.setSKUGROUP_NAME(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKUGROUP_NAME")));
|
||||||
|
column_data.setFacing(dbcursor.getInt(dbcursor.getColumnIndexOrThrow("FACING")));
|
||||||
|
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return column_data;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception ", "get row column!" + e.toString());
|
||||||
|
return column_data;
|
||||||
|
}
|
||||||
|
return column_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Category Images Allowed
|
||||||
|
public ArrayList<CategoryImagesAllowed> getCategoryPictureAllowedData(String categoryId) {
|
||||||
|
Cursor cursordata = null;
|
||||||
|
ArrayList<CategoryImagesAllowed> imageAllowData = new ArrayList<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
cursordata = db.rawQuery("Select * from MAPPING_CATEGORY_IMAGE_ALLOW " + "where CATEGORY_ID ='" + categoryId + "'", null);
|
||||||
|
|
||||||
|
if (cursordata != null) {
|
||||||
|
cursordata.moveToFirst();
|
||||||
|
while (!cursordata.isAfterLast()) {
|
||||||
|
CategoryImagesAllowed sb = new CategoryImagesAllowed();
|
||||||
|
|
||||||
|
sb.setImg_cam1(cursordata.getString(cursordata
|
||||||
|
.getColumnIndexOrThrow("IMAGE1_ALLOW")).equals("1"));
|
||||||
|
sb.setImg_cam2(cursordata.getString(cursordata
|
||||||
|
.getColumnIndexOrThrow("IMAGE2_ALLOW")).equals("1"));
|
||||||
|
sb.setImg_cam3(cursordata.getString(cursordata
|
||||||
|
.getColumnIndexOrThrow("IMAGE3_ALLOW")).equals("1"));
|
||||||
|
sb.setImg_cam4(cursordata.getString(cursordata
|
||||||
|
.getColumnIndexOrThrow("IMAGE4_ALLOW")).equals("1"));
|
||||||
|
|
||||||
|
imageAllowData.add(sb);
|
||||||
|
cursordata.moveToNext();
|
||||||
|
}
|
||||||
|
cursordata.close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return imageAllowData;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//MAPPING_COUNTRYWISE_PLANOGRAM
|
||||||
|
public void InsertMappingCountrywisePlanogram(MappingPlanogramCountrywiseGetterSetter data) {
|
||||||
|
db.delete("MAPPING_COUNTRYWISE_PLANOGRAM", null, null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < data.getCOUNTRY_ID().size(); i++) {
|
||||||
|
|
||||||
|
values.put("COUNTRY_ID", data.getCOUNTRY_ID().get(i));
|
||||||
|
values.put("FILE_PATH", data.getFILE_PATH().get(i));
|
||||||
|
values.put("PLANOGRAM_URL", data.getPLANOGRAM_URL().get(i));
|
||||||
|
|
||||||
|
db.insert("MAPPING_COUNTRYWISE_PLANOGRAM", null, values);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in MAPPING_COUNTRYWISE_PLANOGRAM " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ import javax.xml.parsers.SAXParser;
|
|||||||
import javax.xml.parsers.SAXParserFactory;
|
import javax.xml.parsers.SAXParserFactory;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
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.GeotaggingBeans;
|
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
||||||
@@ -132,14 +133,16 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
*/
|
*/
|
||||||
private GoogleApiClient client;
|
private GoogleApiClient client;
|
||||||
|
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_geo_tag);
|
setContentView(R.layout.activity_geo_tag);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.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, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -255,7 +258,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
_pathforcheck = storeid +"GeoTag" + visitData.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = storeid +"GeoTag" + visitData.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||||
|
|
||||||
@@ -393,7 +396,8 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
toolbar.setTitle(getResources().getString(R.string.title_activity_store_geotag));
|
||||||
/* checkPlayServices();
|
/* checkPlayServices();
|
||||||
|
|
||||||
// Resuming the periodic location updates
|
// Resuming the periodic location updates
|
||||||
@@ -421,7 +425,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
stopLocationUpdates();
|
stopLocationUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public String getCurrentTime() {
|
/*public String getCurrentTimeNotUsed() {
|
||||||
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
@@ -449,7 +453,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
@@ -1072,50 +1076,4 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.util.Locale;
|
|||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
|
|
||||||
@@ -72,7 +73,7 @@ public class GeoTagStoreList extends AppCompatActivity implements View.OnClickLi
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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, "");
|
||||||
@@ -254,53 +255,9 @@ public class GeoTagStoreList extends AppCompatActivity implements View.OnClickLi
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(getString(R.string.title_activity_store_geotag));
|
toolbar.setTitle(getString(R.string.title_activity_store_geotag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
} else {
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
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.LoginGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
@@ -127,7 +128,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
tv_version.setText("Version/Versiyon - " + app_ver+"T1");
|
tv_version.setText("Version/Versiyon - " + app_ver+"T3");
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
@@ -175,7 +176,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
// Create a Folder for Images
|
// Create a Folder for Images
|
||||||
|
|
||||||
|
|
||||||
File file = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_IMAGES");
|
File file = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_IMAGES");
|
||||||
if (!file.isDirectory()) {
|
if (!file.isDirectory()) {
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
@@ -431,10 +431,10 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]"
|
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]"
|
||||||
+ userid + "[/USER_ID]" + "[PASSWORD]" + password
|
+ userid + "[/USER_ID]" + "[PASSWORD]" + password
|
||||||
+ "[/PASSWORD]" + "[IN_TIME]" + getCurrentTime()
|
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext())
|
||||||
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
||||||
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
||||||
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver
|
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver+"T3"
|
||||||
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
||||||
+ "[NETWORK_STATUS]" + "LoginStatus"
|
+ "[NETWORK_STATUS]" + "LoginStatus"
|
||||||
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
||||||
@@ -627,7 +627,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
Intent intent = new Intent(getBaseContext(),
|
Intent intent = new Intent(getBaseContext(),
|
||||||
MainActivity.class);
|
MainActivity.class);
|
||||||
@@ -672,7 +672,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public String getCurrentTime() {
|
/*public String getCurrentTimeNotUsed() {
|
||||||
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
@@ -695,7 +695,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
||||||
@@ -710,51 +710,5 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
return cdate;
|
return cdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}
|
|
||||||
else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,10 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
|||||||
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.FutureJCPActivity;
|
import cpm.com.gskmtorange.dailyentry.FutureJCPActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.PlanogramPDFActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.SettingsActivity;
|
import cpm.com.gskmtorange.dailyentry.SettingsActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
||||||
@@ -71,7 +73,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -132,7 +134,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
coverageList = db.getCoverageData(date);
|
coverageList = db.getCoverageData(date);
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(getString(R.string.main_menu_activity_name));
|
toolbar.setTitle(getString(R.string.main_menu_activity_name));
|
||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
@@ -303,6 +305,19 @@ public class MainActivity extends AppCompatActivity
|
|||||||
startActivity(startDownload);
|
startActivity(startDownload);
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}else if(id == R.id.nav_planogram){
|
||||||
|
|
||||||
|
if(checkNetIsAvailable()){
|
||||||
|
Intent planogram_pdf = new Intent(this, PlanogramPDFActivity.class);
|
||||||
|
startActivity(planogram_pdf);
|
||||||
|
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}else {
|
||||||
|
|
||||||
|
Snackbar.make(webView, getResources().getString(R.string.nonetwork), Snackbar.LENGTH_SHORT)
|
||||||
|
.setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
@@ -386,49 +401,4 @@ 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("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}
|
|
||||||
else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.google.gson.Gson;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
|
|
||||||
selected_flag = true;
|
selected_flag = true;
|
||||||
|
|
||||||
updateResources(getApplicationContext(), language.get(0));
|
CommonFunctions.updateLangResources(getApplicationContext(), language.get(0));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
@@ -110,7 +111,7 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
|
|
||||||
selected_flag = true;
|
selected_flag = true;
|
||||||
|
|
||||||
updateResources(getApplicationContext(), language.get(1));
|
CommonFunctions.updateLangResources(getApplicationContext(), language.get(1));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
@@ -124,49 +125,6 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
|||||||
@@ -27,12 +27,14 @@ public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> {
|
|||||||
|
|
||||||
List<NoCameraDataGetterSetter> data = Collections.emptyList();
|
List<NoCameraDataGetterSetter> data = Collections.emptyList();
|
||||||
private Listener listener;
|
private Listener listener;
|
||||||
|
RecyclerView rec;
|
||||||
|
|
||||||
public MyAdapter(Context context, List<NoCameraDataGetterSetter> data, Listener listener) {
|
public MyAdapter(Context context, List<NoCameraDataGetterSetter> data, Listener listener, RecyclerView rec) {
|
||||||
|
|
||||||
inflator = LayoutInflater.from(context);
|
inflator = LayoutInflater.from(context);
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
|
this.rec = rec;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +48,7 @@ public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(MyViewHolder holder, int position) {
|
public void onBindViewHolder(MyViewHolder holder, final int position) {
|
||||||
|
|
||||||
final NoCameraDataGetterSetter current = data.get(position);
|
final NoCameraDataGetterSetter current = data.get(position);
|
||||||
|
|
||||||
@@ -60,6 +62,15 @@ public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> {
|
|||||||
//holder.linear_parent.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
//holder.linear_parent.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
||||||
holder.linear_parent.setOnDragListener(new DragListener(listener));
|
holder.linear_parent.setOnDragListener(new DragListener(listener));
|
||||||
|
|
||||||
|
holder.linear_parent.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onLongClick(View view) {
|
||||||
|
listener.deleteItem(view, position, rec);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DragListener getDragInstance() {
|
public DragListener getDragInstance() {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
import cpm.com.gskmtorange.LoginActivity;
|
import cpm.com.gskmtorange.LoginActivity;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
|
||||||
public class AutoUpdateActivity extends AppCompatActivity {
|
public class AutoUpdateActivity extends AppCompatActivity {
|
||||||
@@ -58,7 +59,7 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
@@ -288,49 +289,5 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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,82 @@
|
|||||||
|
package cpm.com.gskmtorange.constant;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yadavendras on 13-11-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CommonFunctions {
|
||||||
|
|
||||||
|
public static boolean updateLangResources(Context context, String language) {
|
||||||
|
|
||||||
|
String lang;
|
||||||
|
|
||||||
|
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
||||||
|
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
||||||
|
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
||||||
|
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||||
|
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||||
|
lang = CommonString.KEY_RETURN_LANGUAGE_EGYPT;
|
||||||
|
}else{
|
||||||
|
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 static String getCurrentTimeWithLanguage(Context context) {
|
||||||
|
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
|
String cdate = formatter.format(m_cal.getTime());
|
||||||
|
SharedPreferences preferences = preferences = PreferenceManager.getDefaultSharedPreferences(context);;
|
||||||
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String arabicToenglish(String number) {
|
||||||
|
char[] chars = new char[number.length()];
|
||||||
|
for (int i = 0; i < number.length(); i++) {
|
||||||
|
char ch = number.charAt(i);
|
||||||
|
if (ch >= 0x0660 && ch <= 0x0669)
|
||||||
|
ch -= 0x0660 - '0';
|
||||||
|
else if (ch >= 0x06f0 && ch <= 0x06F9)
|
||||||
|
ch -= 0x06f0 - '0';
|
||||||
|
chars[i] = ch;
|
||||||
|
}
|
||||||
|
return new String(chars);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,9 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||||||
|
|
||||||
public class CommonString {
|
public class CommonString {
|
||||||
|
|
||||||
|
public static final String BACKUP_PATH = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
||||||
|
// String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
||||||
|
|
||||||
// webservice constants
|
// webservice constants
|
||||||
|
|
||||||
// preferenec keys
|
// preferenec keys
|
||||||
@@ -109,6 +112,7 @@ public class CommonString {
|
|||||||
public static final String KEY_NUMBER_OF_ROWS = "NUMBER_OF_ROWS";
|
public static final String KEY_NUMBER_OF_ROWS = "NUMBER_OF_ROWS";
|
||||||
public static final String KEY_SUB_CATEGORY = "SUB_CATEGORY";
|
public static final String KEY_SUB_CATEGORY = "SUB_CATEGORY";
|
||||||
public static final String KEY_SUB_CATEGORY_ID = "SUB_CATEGORY_ID";
|
public static final String KEY_SUB_CATEGORY_ID = "SUB_CATEGORY_ID";
|
||||||
|
public static final String KEY_FROM = "FROM";
|
||||||
|
|
||||||
public static final String KEY_NO_DATA = "NODATA";
|
public static final String KEY_NO_DATA = "NODATA";
|
||||||
|
|
||||||
@@ -216,6 +220,7 @@ public class CommonString {
|
|||||||
|
|
||||||
//File Path
|
//File Path
|
||||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/";
|
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/";
|
||||||
|
public static final String FILE_PATH_PDF = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_Planogram/";
|
||||||
|
|
||||||
|
|
||||||
//Table
|
//Table
|
||||||
@@ -770,7 +775,9 @@ public class CommonString {
|
|||||||
|
|
||||||
public static final String KEY_LANGUAGE_OMAN = "English";
|
public static final String KEY_LANGUAGE_OMAN = "English";
|
||||||
public static final String KEY_RETURE_LANGUAGE_OMAN = "EN";
|
public static final String KEY_RETURE_LANGUAGE_OMAN = "EN";
|
||||||
|
public static final String KEY_RETURN_LANGUAGE_EGYPT = "AR";
|
||||||
public static final String KEY_LANGUAGE_ARABIC_UAE = "ARABIC-UAE";
|
public static final String KEY_LANGUAGE_ARABIC_UAE = "ARABIC-UAE";
|
||||||
|
public static final String KEY_LANGUAGE_ARABIC_EGYPT = "ARABIC-EGYPT";
|
||||||
|
|
||||||
public static final String KEY_RETURE_LANGUAGE_UAE_ARABIC = "AR";
|
public static final String KEY_RETURE_LANGUAGE_UAE_ARABIC = "AR";
|
||||||
|
|
||||||
|
|||||||
+14
-45
@@ -52,6 +52,7 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
@@ -109,13 +110,15 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
String gallery_package = "";
|
String gallery_package = "";
|
||||||
Uri outputFileUri;
|
Uri outputFileUri;
|
||||||
|
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
////String brand_id,SKU_ID;
|
////String brand_id,SKU_ID;
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.additionalvisibilitylayout);
|
setContentView(R.layout.additionalvisibilitylayout);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
getSupportActionBar().setHomeButtonEnabled(true);
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
@@ -127,7 +130,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
store_type_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
store_type_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
key_account_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
key_account_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
@@ -750,10 +753,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btnimage.setOnClickListener(new View.OnClickListener() {
|
btnimage.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck1 = store_id + categoryId + "AdditionalImage1" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + categoryId + "AdditionalImage1" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
_path = CommonString.FILE_PATH + _pathforcheck1;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -762,10 +765,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btnimage1.setOnClickListener(new View.OnClickListener() {
|
btnimage1.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck2 = store_id + categoryId + "AdditionalImage2" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + categoryId + "AdditionalImage2" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
_path = CommonString.FILE_PATH + _pathforcheck2;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -774,10 +777,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btnimage2.setOnClickListener(new View.OnClickListener() {
|
btnimage2.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck3 = store_id + categoryId + "AdditionalImage3" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck3 = store_id + categoryId + "AdditionalImage3" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck3;
|
_path = CommonString.FILE_PATH + _pathforcheck3;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -813,7 +816,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
@@ -1667,44 +1670,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
toolbar.setTitle(getResources().getString(R.string.title_activity_Additional_visibility));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,8 +9,6 @@ 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;
|
||||||
@@ -36,15 +34,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.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||||
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.Stock_FacingGetterSetter;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.gsk_dailyentry.MSL_Availability_StockFacingActivity;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryImagesAllowed;
|
||||||
|
|
||||||
public class CategoryPicture extends AppCompatActivity {
|
public class CategoryPicture extends AppCompatActivity {
|
||||||
String _pathforcheck1, _pathforcheck2, _pathforcheck3, _pathforcheck4, Camerapath1, Camerapath2, _path, CaMpath, str, msg, categoryName, categoryId;
|
String _pathforcheck1, _pathforcheck2, _pathforcheck3, _pathforcheck4, Camerapath1, Camerapath2, _path, CaMpath, str, msg, categoryName, categoryId;
|
||||||
@@ -59,12 +56,15 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
int Adapterposition;
|
int Adapterposition;
|
||||||
ArrayList<CategoryPictureGetterSetter> listdat = new ArrayList<CategoryPictureGetterSetter>();
|
ArrayList<CategoryPictureGetterSetter> listdat = new ArrayList<CategoryPictureGetterSetter>();
|
||||||
CategoryAdapter adapteradditional;
|
CategoryAdapter adapteradditional;
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
|
ArrayList<CategoryImagesAllowed> categoryImagesAllowed = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_category_picture);
|
setContentView(R.layout.activity_category_picture);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
store_type_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
store_type_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
key_account_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
key_account_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
@@ -96,6 +96,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
|
|
||||||
|
|
||||||
adddata = db.getCategoryPictureData(store_id, categoryId);
|
adddata = db.getCategoryPictureData(store_id, categoryId);
|
||||||
|
categoryImagesAllowed = db.getCategoryPictureAllowedData(categoryId);
|
||||||
|
|
||||||
if (adddata.size() != 0) {
|
if (adddata.size() != 0) {
|
||||||
|
|
||||||
@@ -152,15 +153,22 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
adapteradditional = new CategoryPicture.CategoryAdapter(CategoryPicture.this, listdat);
|
adapteradditional = new CategoryPicture.CategoryAdapter(CategoryPicture.this, listdat);
|
||||||
listview.setAdapter(adapteradditional);
|
listview.setAdapter(adapteradditional);
|
||||||
|
|
||||||
|
if(categoryImagesAllowed.size()>0){
|
||||||
|
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam1(), im1);
|
||||||
|
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam2(), im2);
|
||||||
|
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam2(), im3);
|
||||||
|
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam3(), im4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(final View view) {
|
||||||
|
|
||||||
CategoryPictureGetterSetter CP = new CategoryPictureGetterSetter();
|
final CategoryPictureGetterSetter CP = new CategoryPictureGetterSetter();
|
||||||
|
|
||||||
CP.setCategoryImage1(img_str1);
|
CP.setCategoryImage1(img_str1);
|
||||||
CP.setCategoryImage2(img_str2);
|
CP.setCategoryImage2(img_str2);
|
||||||
@@ -169,15 +177,31 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
CP.setStore_ID(store_id);
|
CP.setStore_ID(store_id);
|
||||||
CP.setCamera_allow(camera_allow);
|
CP.setCamera_allow(camera_allow);
|
||||||
|
|
||||||
|
|
||||||
if (validateData(CP, listdat)) {
|
if (validateData(CP, listdat)) {
|
||||||
|
|
||||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
AlertDialog.Builder builder = new AlertDialog.Builder(CategoryPicture.this);
|
||||||
|
builder.setMessage(getResources().getString(R.string.check_save_message))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
||||||
finish();
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(view, "Please take image", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, R.string.title_activity_take_image, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -191,10 +215,10 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
|
||||||
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
_path = CommonString.FILE_PATH + _pathforcheck1;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
@@ -205,10 +229,10 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
_pathforcheck2 = store_id + "CategoryPicture2" + categoryId + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + "CategoryPicture2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
_path = CommonString.FILE_PATH + _pathforcheck2;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
@@ -218,10 +242,10 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
_pathforcheck3 = store_id + "CategoryPicture3" + categoryId + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck3 = store_id + "CategoryPicture3" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck3;
|
_path = CommonString.FILE_PATH + _pathforcheck3;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
@@ -231,10 +255,10 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
_pathforcheck4 = store_id + "CategoryPicture4" + categoryId + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck4 = store_id + "CategoryPicture4" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck4;
|
_path = CommonString.FILE_PATH + _pathforcheck4;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
@@ -255,7 +279,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
@@ -271,42 +295,6 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
return cdate;
|
return cdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
protected void startCameraActivity() {
|
||||||
try {
|
try {
|
||||||
@@ -505,11 +493,11 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
Adapterposition = position1;
|
Adapterposition = position1;
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + Camerapath1;
|
_path = CommonString.FILE_PATH + Camerapath1;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
@@ -524,10 +512,10 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
Camerapath2 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
Camerapath2 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
Adapterposition = position1;
|
Adapterposition = position1;
|
||||||
_path = CommonString.FILE_PATH + Camerapath2;
|
_path = CommonString.FILE_PATH + Camerapath2;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
}
|
}
|
||||||
@@ -656,4 +644,21 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
toolbar.setTitle(getResources().getString(R.string.title_activity_category_picture));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCamAllowImage(boolean isAllowed, ImageView img_cam){
|
||||||
|
|
||||||
|
if(isAllowed){
|
||||||
|
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
img_cam.setBackgroundResource(R.mipmap.camera_green);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ 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;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
|
|
||||||
@@ -51,12 +52,13 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
CoverageBean coverageBean;
|
CoverageBean coverageBean;
|
||||||
|
|
||||||
String lat, lon, checkOutImagePath = "";
|
String lat, lon, checkOutImagePath = "";
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_checkout);
|
setContentView(R.layout.activity_checkout);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
@@ -66,7 +68,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
checkOutImagePath = getIntent().getStringExtra(CommonString.KEY_CHECKOUT_IMAGE);
|
checkOutImagePath = getIntent().getStringExtra(CommonString.KEY_CHECKOUT_IMAGE);
|
||||||
@@ -131,7 +133,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
+ "[LATITUDE]" + lat + "[/LATITUDE]"
|
+ "[LATITUDE]" + lat + "[/LATITUDE]"
|
||||||
+ "[LOGITUDE]" + lon + "[/LOGITUDE]"
|
+ "[LOGITUDE]" + lon + "[/LOGITUDE]"
|
||||||
+ "[CHECKOUT_DATE]" + visit_date + "[/CHECKOUT_DATE]"
|
+ "[CHECKOUT_DATE]" + visit_date + "[/CHECKOUT_DATE]"
|
||||||
+ "[CHECK_OUTTIME]" + getCurrentTime() + "[/CHECK_OUTTIME]"
|
+ "[CHECK_OUTTIME]" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()) + "[/CHECK_OUTTIME]"
|
||||||
+ "[CHECK_INTIME]" + coverageBean.getInTime() + "[/CHECK_INTIME]"
|
+ "[CHECK_INTIME]" + coverageBean.getInTime() + "[/CHECK_INTIME]"
|
||||||
+ "[CREATED_BY]" + username + "[/CREATED_BY]"
|
+ "[CREATED_BY]" + username + "[/CREATED_BY]"
|
||||||
+ "[/STORE_CHECK_OUT_STATUS]";
|
+ "[/STORE_CHECK_OUT_STATUS]";
|
||||||
@@ -169,7 +171,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
db.updateCheckoutOuttime(store_id, getCurrentTime(), CommonString.KEY_Y, checkOutImagePath);
|
db.updateCheckoutOuttime(store_id, CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()), CommonString.KEY_Y, checkOutImagePath);
|
||||||
|
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
editor.putString(CommonString.KEY_STORE_ID, "");
|
editor.putString(CommonString.KEY_STORE_ID, "");
|
||||||
@@ -281,45 +283,11 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
toolbar.setTitle(getResources().getString(R.string.title_activity_checkout));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
/*public String getCurrentTimeNotUsed() {
|
||||||
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else {
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 String getCurrentTime() {
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
@@ -342,7 +310,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
MSL_AvailabilityStockFacingGetterSetter brand_selected;
|
MSL_AvailabilityStockFacingGetterSetter brand_selected;
|
||||||
int number_of_rows=0;
|
int number_of_rows=0;
|
||||||
RecyclerView rec_sub_category;
|
RecyclerView rec_sub_category;
|
||||||
|
static int FROM_DIALOG = 0;
|
||||||
|
static int FROM_CLICK = 1;
|
||||||
|
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> added_sub_category_list;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -97,7 +101,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
ArrayList<String> added_sub_category_list = new ArrayList<>();
|
added_sub_category_list = new ArrayList<>();
|
||||||
|
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId);
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId);
|
||||||
|
|
||||||
@@ -105,7 +109,10 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if(db.getNoCameraCategoryDataInserted(store_id, categoryId, sub_category_list.get(i).getSub_category_id()).size()>0){
|
if(db.getNoCameraCategoryDataInserted(store_id, categoryId, sub_category_list.get(i).getSub_category_id()).size()>0){
|
||||||
|
|
||||||
added_sub_category_list.add(sub_category_list.get(i).getSub_category());
|
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
||||||
|
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
||||||
|
added_sub_category_list.add(subCategory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,6 +125,13 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
public void showSkuDialog() {
|
public void showSkuDialog() {
|
||||||
|
|
||||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId);
|
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId);
|
||||||
@@ -147,17 +161,36 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
else if(number_of_rows==0){
|
else if(number_of_rows==0){
|
||||||
Snackbar.make(btn_create,"Please select number of rows",Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(btn_create,"Please select number of rows",Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
boolean sub_category_already_filled = false;
|
||||||
|
if(added_sub_category_list.size()>0){
|
||||||
|
for(int k=0;k<added_sub_category_list.size();k++){
|
||||||
|
if(added_sub_category_list.get(k).getSub_category_id().equals(brand_selected.getSub_category_id())){
|
||||||
|
sub_category_already_filled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sub_category_already_filled){
|
||||||
|
Snackbar.make(btn_create,"Sub Category already added",Snackbar.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Intent in = new Intent(getApplicationContext(), NoCameraActivity.class);
|
Intent in = new Intent(getApplicationContext(), NoCameraActivity.class);
|
||||||
in.putExtra("categoryName", categoryName);
|
in.putExtra("categoryName", categoryName);
|
||||||
in.putExtra("categoryId", categoryId);
|
in.putExtra("categoryId", categoryId);
|
||||||
in.putExtra(CommonString.KEY_NUMBER_OF_ROWS, number_of_rows);
|
in.putExtra(CommonString.KEY_NUMBER_OF_ROWS, number_of_rows);
|
||||||
in.putExtra(CommonString.KEY_SUB_CATEGORY, brand_selected);
|
in.putExtra(CommonString.KEY_SUB_CATEGORY, brand_selected);
|
||||||
|
in.putExtra(CommonString.KEY_FROM, FROM_DIALOG);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -380,6 +413,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
alert.show();*/
|
alert.show();*/
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
@@ -394,9 +428,9 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
public class SubcategoryAdapter extends RecyclerView.Adapter<SubcategoryAdapter.ViewHolder> {
|
public class SubcategoryAdapter extends RecyclerView.Adapter<SubcategoryAdapter.ViewHolder> {
|
||||||
|
|
||||||
private ArrayList<String> list;
|
private ArrayList<MSL_AvailabilityStockFacingGetterSetter> list;
|
||||||
|
|
||||||
public SubcategoryAdapter(ArrayList<String> skuList) {
|
public SubcategoryAdapter(ArrayList<MSL_AvailabilityStockFacingGetterSetter> skuList) {
|
||||||
list = skuList;
|
list = skuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,7 +444,21 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(final SubcategoryAdapter.ViewHolder holder, final int position) {
|
public void onBindViewHolder(final SubcategoryAdapter.ViewHolder holder, final int position) {
|
||||||
|
|
||||||
holder.tv_sub_category.setText(list.get(position));
|
holder.tv_sub_category.setText(list.get(position).getSub_category());
|
||||||
|
|
||||||
|
holder.parentLayout.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Intent in = new Intent(getApplicationContext(), NoCameraActivity.class);
|
||||||
|
in.putExtra("categoryName", categoryName);
|
||||||
|
in.putExtra("categoryId", categoryId);
|
||||||
|
in.putExtra(CommonString.KEY_NUMBER_OF_ROWS, 0);
|
||||||
|
in.putExtra(CommonString.KEY_SUB_CATEGORY, list.get(position));
|
||||||
|
in.putExtra(CommonString.KEY_FROM, FROM_CLICK);
|
||||||
|
startActivity(in);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -420,7 +468,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
public final View mView;
|
public final View mView;
|
||||||
//public final LinearLayout parentLayout;
|
public final LinearLayout parentLayout;
|
||||||
public final TextView tv_sub_category;
|
public final TextView tv_sub_category;
|
||||||
|
|
||||||
public ViewHolder(View view) {
|
public ViewHolder(View view) {
|
||||||
@@ -429,7 +477,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
mView = view;
|
mView = view;
|
||||||
|
|
||||||
tv_sub_category = (TextView) mView.findViewById(R.id.tv_sub_category);
|
tv_sub_category = (TextView) mView.findViewById(R.id.tv_sub_category);
|
||||||
//parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
|
parentLayout = (LinearLayout) mView.findViewById(R.id.linear_parent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import java.util.Calendar;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.messgae.AlertMessage;
|
import cpm.com.gskmtorange.messgae.AlertMessage;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||||
@@ -150,7 +151,7 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
||||||
progressDialog = new ProgressDialog(FutureJCPActivity.this);
|
progressDialog = new ProgressDialog(FutureJCPActivity.this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
// AsyncTask asyncTask = new AsyncTask<String, String, String>() {
|
// AsyncTask asyncTask = new AsyncTask<String, String, String>() {
|
||||||
@@ -327,40 +328,4 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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,9 @@ import android.app.Dialog;
|
|||||||
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.ActivityInfo;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
@@ -16,19 +19,26 @@ import android.support.v7.widget.LinearLayoutManager;
|
|||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.view.DragEvent;
|
import android.view.DragEvent;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -38,18 +48,21 @@ import cpm.com.gskmtorange.R;
|
|||||||
import cpm.com.gskmtorange.adapter.ListAdapter;
|
import cpm.com.gskmtorange.adapter.ListAdapter;
|
||||||
import cpm.com.gskmtorange.adapter.MyAdapter;
|
import cpm.com.gskmtorange.adapter.MyAdapter;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.gsk_dailyentry.Stock_FacingActivity;
|
||||||
import cpm.com.gskmtorange.listener.Listener;
|
import cpm.com.gskmtorange.listener.Listener;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DynamycIdsGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DynamycIdsGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.RowColumnGetterSetter;
|
||||||
|
|
||||||
public class NoCameraActivity extends AppCompatActivity implements Listener {
|
public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||||
|
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, str;
|
||||||
String categoryName, categoryId;
|
String categoryName, categoryId;
|
||||||
int number_of_rows;
|
int number_of_rows, FROM;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
LinearLayout linear_bottom_parent;
|
LinearLayout linear_bottom_parent;
|
||||||
ArrayList<DynamycIdsGetterSetter> ids = new ArrayList<>();
|
ArrayList<DynamycIdsGetterSetter> ids = new ArrayList<>();
|
||||||
@@ -91,19 +104,22 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//preference data
|
//preference data
|
||||||
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);
|
||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
|
||||||
|
str = CommonString.FILE_PATH;
|
||||||
|
|
||||||
//Intent data
|
//Intent data
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
number_of_rows = getIntent().getIntExtra(CommonString.KEY_NUMBER_OF_ROWS, 0);
|
number_of_rows = getIntent().getIntExtra(CommonString.KEY_NUMBER_OF_ROWS, 0);
|
||||||
|
FROM = getIntent().getIntExtra(CommonString.KEY_FROM, 0);
|
||||||
sub_category_data = (MSL_AvailabilityStockFacingGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_SUB_CATEGORY);
|
sub_category_data = (MSL_AvailabilityStockFacingGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_SUB_CATEGORY);
|
||||||
|
|
||||||
db = new GSKOrangeDB(NoCameraActivity.this);
|
db = new GSKOrangeDB(NoCameraActivity.this);
|
||||||
@@ -117,7 +133,10 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
//tvEmptyListTop.setOnDragListener(topListAdapter.getDragInstance());
|
//tvEmptyListTop.setOnDragListener(topListAdapter.getDragInstance());
|
||||||
rvTop.setOnDragListener(topListAdapter.getDragInstance());
|
rvTop.setOnDragListener(topListAdapter.getDragInstance());
|
||||||
|
|
||||||
for (int i = 1; i <= number_of_rows; i++) {
|
if(FROM==1){
|
||||||
|
ArrayList<RowColumnGetterSetter> rows_data = db.getrowColumnNoCamera(store_id, categoryId,sub_category_data.getSub_category_id());
|
||||||
|
number_of_rows = rows_data.size();
|
||||||
|
for(int i=1;i<=rows_data.size();i++){
|
||||||
|
|
||||||
DynamycIdsGetterSetter dynamic_ids = new DynamycIdsGetterSetter();
|
DynamycIdsGetterSetter dynamic_ids = new DynamycIdsGetterSetter();
|
||||||
|
|
||||||
@@ -175,6 +194,83 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
|
|
||||||
List<BrandMasterGetterSetter> bottomList = new ArrayList<>();
|
List<BrandMasterGetterSetter> bottomList = new ArrayList<>();
|
||||||
|
|
||||||
|
List<NoCameraDataGetterSetter> sku_group_master = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int j=1; j<=rows_data.get(i-1).getColumn(); j++){
|
||||||
|
NoCameraDataGetterSetter column_data = new NoCameraDataGetterSetter();
|
||||||
|
column_data = db.getRowSkuGroupCamera(store_id, categoryId,sub_category_data.getSub_category_id(), i, j);
|
||||||
|
sku_group_master.add(column_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MyAdapter adapter = new MyAdapter(getApplicationContext(), sku_group_master, this, rec_bottom);
|
||||||
|
rec_bottom.setAdapter(adapter);
|
||||||
|
|
||||||
|
tv.setOnDragListener(adapter.getDragInstance());
|
||||||
|
rec_bottom.setOnDragListener(adapter.getDragInstance());
|
||||||
|
|
||||||
|
setEmptyListBottom(false,tv.getId(),rec_bottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (int i = 1; i <= number_of_rows; i++) {
|
||||||
|
|
||||||
|
DynamycIdsGetterSetter dynamic_ids = new DynamycIdsGetterSetter();
|
||||||
|
|
||||||
|
// first Button
|
||||||
|
RelativeLayout rLayout = new RelativeLayout(getApplicationContext());
|
||||||
|
RelativeLayout.LayoutParams lprams = new RelativeLayout.LayoutParams(
|
||||||
|
RelativeLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||||
|
TextView tv = new TextView(getApplicationContext());
|
||||||
|
//tv.setHeight(60);
|
||||||
|
tv.setTextSize(20);
|
||||||
|
tv.setBackgroundColor(getResources().getColor(R.color.grey_textview));
|
||||||
|
tv.setText("Drop SKU Groups Here ");
|
||||||
|
tv.setPadding(5, 20, 0, 20);
|
||||||
|
tv.setLayoutParams(lprams);
|
||||||
|
int tv_id = View.generateViewId();
|
||||||
|
tv.setId(tv_id);
|
||||||
|
|
||||||
|
//set dynamic textview id to object
|
||||||
|
dynamic_ids.setTextview_id(tv_id);
|
||||||
|
|
||||||
|
RecyclerView rec_bottom = new RecyclerView(getApplicationContext());
|
||||||
|
int rec_id = View.generateViewId();
|
||||||
|
|
||||||
|
//set dynamic recycler id to object
|
||||||
|
dynamic_ids.setRecycler_id(rec_id);
|
||||||
|
|
||||||
|
rec_bottom.setLayoutParams(lprams);
|
||||||
|
rec_bottom.setPadding(0, 0, 0, 2);
|
||||||
|
|
||||||
|
rec_bottom.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
rec_bottom.setId(rec_id);
|
||||||
|
rec_bottom.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
|
||||||
|
RelativeLayout.LayoutParams lprams2 = new RelativeLayout.LayoutParams(
|
||||||
|
RelativeLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||||
|
lprams2.height = 2;
|
||||||
|
View view = new View(getApplicationContext());
|
||||||
|
view.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
view.setLayoutParams(lprams2);
|
||||||
|
|
||||||
|
rLayout.addView(tv);
|
||||||
|
rLayout.addView(rec_bottom);
|
||||||
|
rLayout.addView(view);
|
||||||
|
rLayout.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
|
||||||
|
linear_bottom_parent.addView(rLayout);
|
||||||
|
|
||||||
|
ids.add(dynamic_ids);
|
||||||
|
|
||||||
|
rec_bottom.setLayoutManager(new LinearLayoutManager(
|
||||||
|
this, LinearLayoutManager.HORIZONTAL, false));
|
||||||
|
|
||||||
|
List<BrandMasterGetterSetter> bottomList = new ArrayList<>();
|
||||||
|
|
||||||
/* bottomList.add("C");
|
/* bottomList.add("C");
|
||||||
bottomList.add("D");*/
|
bottomList.add("D");*/
|
||||||
|
|
||||||
@@ -184,12 +280,16 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
|
|
||||||
List<NoCameraDataGetterSetter> brands = new ArrayList<>();
|
List<NoCameraDataGetterSetter> brands = new ArrayList<>();
|
||||||
|
|
||||||
MyAdapter adapter = new MyAdapter(getApplicationContext(), brands, this);
|
MyAdapter adapter = new MyAdapter(getApplicationContext(), brands, this, rec_bottom);
|
||||||
rec_bottom.setAdapter(adapter);
|
rec_bottom.setAdapter(adapter);
|
||||||
|
|
||||||
tv.setOnDragListener(adapter.getDragInstance());
|
tv.setOnDragListener(adapter.getDragInstance());
|
||||||
rec_bottom.setOnDragListener(adapter.getDragInstance());
|
rec_bottom.setOnDragListener(adapter.getDragInstance());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -239,6 +339,99 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
rv.setVisibility(visibility ? View.GONE : View.VISIBLE);
|
rv.setVisibility(visibility ? View.GONE : View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteItem(View v, final int column_no, final RecyclerView rec) {
|
||||||
|
|
||||||
|
final Dialog dialog = new Dialog(NoCameraActivity.this);
|
||||||
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
dialog.setContentView(R.layout.no_camera_edit_or_delete_dialog);
|
||||||
|
|
||||||
|
final Button btn_edit = (Button) dialog.findViewById(R.id.btn_edit);
|
||||||
|
final Button btn_delete = (Button) dialog.findViewById(R.id.btn_delete);
|
||||||
|
|
||||||
|
btn_edit.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
final MyAdapter adapterMYTarget = (MyAdapter) rec.getAdapter();
|
||||||
|
final List<NoCameraDataGetterSetter> customListMyTarget = adapterMYTarget.getList();
|
||||||
|
|
||||||
|
final Dialog dialog_facing = new Dialog(NoCameraActivity.this);
|
||||||
|
dialog_facing.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
dialog_facing.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
dialog_facing.setContentView(R.layout.add_facing_custom_dialog);
|
||||||
|
//pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||||
|
//dialog.setCancelable(false);
|
||||||
|
final EditText et_facing = (EditText) dialog_facing.findViewById(R.id.et_facing);
|
||||||
|
|
||||||
|
final Button btn_ok = (Button) dialog_facing.findViewById(R.id.btn_ok);
|
||||||
|
|
||||||
|
btn_ok.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
String facing = et_facing.getText().toString();
|
||||||
|
|
||||||
|
if (facing.equals("")) {
|
||||||
|
Snackbar.make(btn_ok, R.string.please_facing, Snackbar.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
int facing_int = Integer.parseInt(facing);
|
||||||
|
customListMyTarget.get(column_no).setFacing(facing_int);
|
||||||
|
|
||||||
|
adapterMYTarget.updateList(customListMyTarget);
|
||||||
|
adapterMYTarget.notifyDataSetChanged();
|
||||||
|
dialog_facing.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//dialog.setCancelable(false);
|
||||||
|
dialog_facing.show();
|
||||||
|
|
||||||
|
dialog.cancel();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btn_delete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
dialog.cancel();
|
||||||
|
|
||||||
|
MyAdapter adapterMYTarget = (MyAdapter) rec.getAdapter();
|
||||||
|
List<NoCameraDataGetterSetter> customListMyTarget = adapterMYTarget.getList();
|
||||||
|
customListMyTarget.remove(column_no);
|
||||||
|
|
||||||
|
adapterMYTarget.updateList(customListMyTarget);
|
||||||
|
adapterMYTarget.notifyDataSetChanged();
|
||||||
|
if(customListMyTarget.size()==0){
|
||||||
|
|
||||||
|
int view_id = rec.getId();
|
||||||
|
int tv_id =0;
|
||||||
|
for (int i = 0; i < ids.size(); i++) {
|
||||||
|
|
||||||
|
if (ids.get(i).getRecycler_id() == view_id) {
|
||||||
|
tv_id = ids.get(i).getTextview_id();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tv_id!=0){
|
||||||
|
((TextView) findViewById(tv_id)).setVisibility(View.VISIBLE);
|
||||||
|
rec.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//dialog.setCancelable(false);
|
||||||
|
dialog.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addNUpdateRow(View v, int view_id, NoCameraDataGetterSetter parent_item) {
|
public void addNUpdateRow(View v, int view_id, NoCameraDataGetterSetter parent_item) {
|
||||||
|
|
||||||
@@ -291,6 +484,16 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
MenuInflater inflater = getMenuInflater();
|
||||||
|
inflater.inflate(R.menu.planogram, menu);
|
||||||
|
|
||||||
|
// return true so that the menu pop up is opened
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public void showAddFacingDialog(final MyAdapter adapterMYTarget, final List<NoCameraDataGetterSetter> customListMyTarget, final NoCameraDataGetterSetter parent_item) {
|
public void showAddFacingDialog(final MyAdapter adapterMYTarget, final List<NoCameraDataGetterSetter> customListMyTarget, final NoCameraDataGetterSetter parent_item) {
|
||||||
|
|
||||||
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
||||||
@@ -342,6 +545,59 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == R.id.action_planogram) {
|
||||||
|
|
||||||
|
final Dialog dialog = new Dialog(NoCameraActivity.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);
|
||||||
|
dialog.setCancelable(false);
|
||||||
|
|
||||||
|
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList = db.getMappingPlanogramData(categoryId, storeType_id, class_id);
|
||||||
|
|
||||||
|
//ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
||||||
|
WebView webView = (WebView) dialog.findViewById(R.id.webview);
|
||||||
|
webView.setWebViewClient(new MyWebViewClient());
|
||||||
|
|
||||||
|
webView.getSettings().setAllowFileAccess(true);
|
||||||
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
|
webView.getSettings().setBuiltInZoomControls(true);
|
||||||
|
|
||||||
|
String planogram_image = "";
|
||||||
|
if (mappingPlanogramList.size() > 0) {
|
||||||
|
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
||||||
|
}
|
||||||
|
if (!planogram_image.equals("")) {
|
||||||
|
if (new File(str + planogram_image).exists()) {
|
||||||
|
Bitmap bmp = BitmapFactory.decodeFile(str + planogram_image);
|
||||||
|
// img_planogram.setRotation(90);
|
||||||
|
//img_planogram.setImageBitmap(bmp);
|
||||||
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
|
|
||||||
|
String imagePath = "file://" + CommonString.FILE_PATH + "/" + planogram_image;
|
||||||
|
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||||
|
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
|
} /*else {
|
||||||
|
//webView.loadUrl(String.valueOf(R.drawable.sad_cloud));
|
||||||
|
|
||||||
|
//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) {
|
||||||
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home) {
|
||||||
|
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NoCameraActivity.this);
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NoCameraActivity.this);
|
||||||
@@ -396,4 +652,24 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class MyWebViewClient extends WebViewClient {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
|
view.loadUrl(url);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageFinished(WebView view, String url) {
|
||||||
|
super.onPageFinished(view, url);
|
||||||
|
view.clearCache(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||||
|
super.onPageStarted(view, url, favicon);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
import cpm.com.gskmtorange.messgae.AlertMessage;
|
import cpm.com.gskmtorange.messgae.AlertMessage;
|
||||||
@@ -130,7 +131,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -169,7 +170,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
|
|
||||||
camera.setOnClickListener(this);
|
camera.setOnClickListener(this);
|
||||||
save.setOnClickListener(this);
|
save.setOnClickListener(this);
|
||||||
@@ -362,7 +363,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
if (v.getId() == R.id.imgcam) {
|
if (v.getId() == R.id.imgcam) {
|
||||||
|
|
||||||
_pathforcheck = store_id + "NonWorking" + visit_date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "NonWorking" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||||
|
|
||||||
@@ -405,7 +406,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
cdata.setVisitDate(visit_date);
|
cdata.setVisitDate(visit_date);
|
||||||
cdata.setUserId(_UserId);
|
cdata.setUserId(_UserId);
|
||||||
cdata.setInTime(intime);
|
cdata.setInTime(intime);
|
||||||
cdata.setOutTime(getCurrentTime());
|
cdata.setOutTime(CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()));
|
||||||
cdata.setReason(reasonname);
|
cdata.setReason(reasonname);
|
||||||
cdata.setReasonid(reasonid);
|
cdata.setReasonid(reasonid);
|
||||||
cdata.setLatitude("0.0");
|
cdata.setLatitude("0.0");
|
||||||
@@ -437,7 +438,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
cdata.setVisitDate(visit_date);
|
cdata.setVisitDate(visit_date);
|
||||||
cdata.setUserId(_UserId);
|
cdata.setUserId(_UserId);
|
||||||
cdata.setInTime(intime);
|
cdata.setInTime(intime);
|
||||||
cdata.setOutTime(getCurrentTime());
|
cdata.setOutTime(CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()));
|
||||||
cdata.setReason(reasonname);
|
cdata.setReason(reasonname);
|
||||||
cdata.setReasonid(reasonid);
|
cdata.setReasonid(reasonid);
|
||||||
cdata.setLatitude("0.0");
|
cdata.setLatitude("0.0");
|
||||||
@@ -533,7 +534,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
@@ -571,45 +572,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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,348 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.NetworkInfo;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.ksoap2.SoapEnvelope;
|
||||||
|
import org.ksoap2.SoapFault;
|
||||||
|
import org.ksoap2.serialization.SoapObject;
|
||||||
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
|
import org.ksoap2.transport.HttpTransportSE;
|
||||||
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.ProtocolException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramCountrywiseGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||||
|
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||||
|
|
||||||
|
public class PlanogramPDFActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private Dialog dialog;
|
||||||
|
private ProgressBar pb;
|
||||||
|
private TextView percentage, message;
|
||||||
|
private Data data;
|
||||||
|
int eventType;
|
||||||
|
GSKOrangeDB db;
|
||||||
|
String userId, culture_id;
|
||||||
|
private SharedPreferences preferences = null;
|
||||||
|
FloatingActionButton fab;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_planogram_pdf);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if(checkNetIsAvailable()){
|
||||||
|
new DowloadAsync(getApplicationContext()).execute();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Snackbar.make(fab, getResources().getString(R.string.nonetwork), Snackbar.LENGTH_SHORT)
|
||||||
|
.setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
||||||
|
new DowloadAsync(getApplicationContext()).execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
//region Download doc
|
||||||
|
private class DowloadAsync extends AsyncTask<Void, Data, String> {
|
||||||
|
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
DowloadAsync(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPreExecute() {
|
||||||
|
super.onPreExecute();
|
||||||
|
|
||||||
|
dialog = new Dialog(PlanogramPDFActivity.this);
|
||||||
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
dialog.setContentView(R.layout.custom);
|
||||||
|
//dialog.setTitle("Download Files");
|
||||||
|
dialog.setCancelable(false);
|
||||||
|
dialog.show();
|
||||||
|
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||||
|
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
||||||
|
message = (TextView) dialog.findViewById(R.id.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String doInBackground(Void... params) {
|
||||||
|
|
||||||
|
data = new Data();
|
||||||
|
String resultHttp = "";
|
||||||
|
|
||||||
|
// JCP
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
XmlPullParserFactory factory = null;
|
||||||
|
factory = XmlPullParserFactory
|
||||||
|
.newInstance();
|
||||||
|
|
||||||
|
factory.setNamespaceAware(true);
|
||||||
|
XmlPullParser xpp = factory.newPullParser();
|
||||||
|
|
||||||
|
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||||
|
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "MAPPING_COUNTRYWISE_PLANOGRAM");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
|
||||||
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
||||||
|
SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||||
|
CommonString.URL);
|
||||||
|
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL,
|
||||||
|
envelope);
|
||||||
|
Object result = (Object) envelope.getResponse();
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
|
MappingPlanogramCountrywiseGetterSetter document = XMLHandlers.MAPPING_COUNTRYWISE_PLANOGRAM_XMLHandler(xpp, eventType);
|
||||||
|
|
||||||
|
if (document.getCOUNTRY_ID().size() > 0) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
String document_Table = document.getTable_MAPPING_COUNTRYWISE_PLANOGRAM();
|
||||||
|
TableBean.setMappingCountrywisePlanogram(document_Table);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return "HR_DOCUMENTS";
|
||||||
|
}
|
||||||
|
|
||||||
|
data.value = 10;
|
||||||
|
data.name = "JCP Data Downloading";
|
||||||
|
|
||||||
|
if(document.getCOUNTRY_ID().size()>0){
|
||||||
|
|
||||||
|
String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
|
||||||
|
File folder = new File(extStorageDirectory, "Planogram_Documents");
|
||||||
|
folder.mkdir();
|
||||||
|
|
||||||
|
boolean flag = downloadFile(document.getFILE_PATH().get(0), document.getPLANOGRAM_URL().get(0), folder);
|
||||||
|
|
||||||
|
if(flag)
|
||||||
|
return CommonString.KEY_SUCCESS+ ":"+ folder.getAbsolutePath()+"/"+document.getPLANOGRAM_URL().get(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* db.open();
|
||||||
|
db.InsertMappingCountrywisePlanogram(document);*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (SoapFault soapFault) {
|
||||||
|
soapFault.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultHttp;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostExecute(String result) {
|
||||||
|
super.onPostExecute(result);
|
||||||
|
|
||||||
|
dialog.cancel();
|
||||||
|
|
||||||
|
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
|
String file_path = result.substring(result.indexOf(":")+1);
|
||||||
|
|
||||||
|
File file = new File(file_path);
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.setDataAndType(Uri.fromFile(file),"application/pdf");
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getApplicationContext(), "Downloaded Failed", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
//finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onProgressUpdate(Data... values) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
pb.setProgress(values[0].value);
|
||||||
|
percentage.setText(values[0].value + "%");
|
||||||
|
message.setText(values[0].name);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
int value;
|
||||||
|
String name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean downloadFile(String fileUrl, String directory, File folder_path) {
|
||||||
|
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
final int MEGABYTE = 1024 * 1024;
|
||||||
|
URL url = new URL(fileUrl + directory);
|
||||||
|
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
|
||||||
|
urlConnection.setRequestMethod("GET");
|
||||||
|
urlConnection.getResponseCode();
|
||||||
|
urlConnection.connect();
|
||||||
|
|
||||||
|
if (urlConnection.getResponseCode() == 200) {
|
||||||
|
|
||||||
|
int length = urlConnection.getContentLength();
|
||||||
|
|
||||||
|
String size = new DecimalFormat("##.##")
|
||||||
|
.format((double) ((double) length / 1024))
|
||||||
|
+ " KB";
|
||||||
|
|
||||||
|
/* String PATH = Environment
|
||||||
|
.getExternalStorageDirectory()
|
||||||
|
+ "/GT_GSK_Images/";*/
|
||||||
|
|
||||||
|
if (!new File( folder_path.getPath()+"/" + directory).exists()
|
||||||
|
&& !size.equalsIgnoreCase("0 KB")) {
|
||||||
|
|
||||||
|
File outputFile = new File(folder_path,
|
||||||
|
directory);
|
||||||
|
FileOutputStream fos = new FileOutputStream(
|
||||||
|
outputFile);
|
||||||
|
InputStream is1 = (InputStream) urlConnection
|
||||||
|
.getInputStream();
|
||||||
|
|
||||||
|
int bytes = 0;
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int len1 = 0;
|
||||||
|
|
||||||
|
while ((len1 = is1.read(buffer)) != -1) {
|
||||||
|
|
||||||
|
bytes = (bytes + len1);
|
||||||
|
|
||||||
|
// data.value = (int) ((double) (((double)
|
||||||
|
// bytes) / length) * 100);
|
||||||
|
|
||||||
|
fos.write(buffer, 0, len1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fos.close();
|
||||||
|
is1.close();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
flag = false;
|
||||||
|
} catch (ProtocolException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
flag = false;
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
flag = false;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
|
||||||
|
// NavUtils.navigateUpFromSameTask(this);
|
||||||
|
finish();
|
||||||
|
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean checkNetIsAvailable() {
|
||||||
|
ConnectivityManager cm =
|
||||||
|
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
|
||||||
|
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||||
|
boolean isConnected = activeNetwork != null &&
|
||||||
|
activeNetwork.isConnectedOrConnecting();
|
||||||
|
return isConnected;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,18 +16,20 @@ import android.view.View;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.fragment.ServiceActivityFragment;
|
import cpm.com.gskmtorange.fragment.ServiceActivityFragment;
|
||||||
|
|
||||||
public class ServiceActivity extends AppCompatActivity {
|
public class ServiceActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_service);
|
setContentView(R.layout.activity_service);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
@@ -35,7 +37,7 @@ public class ServiceActivity extends AppCompatActivity {
|
|||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
/* ServiceActivityFragment fragment = new ServiceActivityFragment();
|
/* ServiceActivityFragment fragment = new ServiceActivityFragment();
|
||||||
getSupportFragmentManager().beginTransaction().add(R.id.fragment,fragment).commit();*/
|
getSupportFragmentManager().beginTransaction().add(R.id.fragment,fragment).commit();*/
|
||||||
@@ -79,44 +81,8 @@ public class ServiceActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
toolbar.setTitle(R.string.title_activity_service);
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
import cpm.com.gskmtorange.MainActivity;
|
import cpm.com.gskmtorange.MainActivity;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.fragment.SelectLanguageFragment;
|
import cpm.com.gskmtorange.fragment.SelectLanguageFragment;
|
||||||
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
||||||
@@ -49,7 +50,7 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
|
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
/* SettingsActivityFragment fragment = new SettingsActivityFragment();
|
/* SettingsActivityFragment fragment = new SettingsActivityFragment();
|
||||||
getSupportFragmentManager().beginTransaction().add(R.id.fragment,fragment).commit();*/
|
getSupportFragmentManager().beginTransaction().add(R.id.fragment,fragment).commit();*/
|
||||||
@@ -65,7 +66,7 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
updateResources(getApplicationContext(),selected_lang);
|
CommonFunctions.updateLangResources(getApplicationContext(),selected_lang);
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_LANGUAGE, selected_lang);
|
editor.putString(CommonString.KEY_LANGUAGE, selected_lang);
|
||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id);
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id);
|
||||||
@@ -132,43 +133,9 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(R.string.title_activity_settings);
|
toolbar.setTitle(R.string.title_activity_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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
-50
@@ -62,6 +62,7 @@ import javax.xml.parsers.SAXParserFactory;
|
|||||||
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.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
@@ -103,7 +104,7 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
setContentView(R.layout.activity_store_checkout_image);
|
setContentView(R.layout.activity_store_checkout_image);
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
@@ -183,9 +184,9 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
switch (id) {
|
switch (id) {
|
||||||
case R.id.img_cam_selfie:
|
case R.id.img_cam_selfie:
|
||||||
|
|
||||||
_pathforcheck = checkOutStore_id + "CHK_SI_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = checkOutStore_id + "CHK_SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
break;
|
||||||
@@ -316,7 +317,7 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
@@ -353,7 +354,7 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(R.string.title_activity_store_checkout_image);
|
toolbar.setTitle(R.string.title_activity_store_checkout_image);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,51 +368,6 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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 class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||||
@@ -77,7 +78,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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, "");
|
||||||
@@ -108,7 +109,7 @@ 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, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(getString(R.string.title_activity_store_list));
|
toolbar.setTitle(getString(R.string.title_activity_store_list));
|
||||||
db.open();
|
db.open();
|
||||||
storelist = db.getStoreData(date);
|
storelist = db.getStoreData(date);
|
||||||
@@ -193,8 +194,8 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
viewHolder.chkbtn.setBackgroundResource(R.mipmap.checkout);
|
viewHolder.chkbtn.setBackgroundResource(R.mipmap.checkout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
storeid = current.getSTORE_ID();
|
storeid = current.getSTORE_ID();
|
||||||
|
CoverageBean coverageObj = db.getCoverageSpecificData(date,storeid);
|
||||||
//viewHolder.txt.setText(current.txt);
|
//viewHolder.txt.setText(current.txt);
|
||||||
|
|
||||||
viewHolder.txt.setText(current.getSTORE_NAME());
|
viewHolder.txt.setText(current.getSTORE_NAME());
|
||||||
@@ -208,27 +209,50 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.tick);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.tick);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_Y)) {
|
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_Y)) {
|
||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_P)) {
|
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_P)) {
|
||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_L)) {
|
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_L)) {
|
||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)) {
|
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)) {
|
||||||
|
|
||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
|
}else if(coverageObj.getStatus()!=null && coverageObj.getStatus().equalsIgnoreCase(CommonString.KEY_VALID)){
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
|
viewHolder.chkbtn.setVisibility(View.VISIBLE);
|
||||||
|
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
}else if(coverageObj.getStatus()!=null && coverageObj.getStatus().equalsIgnoreCase(CommonString.KEY_INVALID)){
|
||||||
|
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.green));
|
||||||
|
|
||||||
|
}else if(coverageObj.getStatus()!=null && coverageObj.getStatus().equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)) {
|
||||||
|
|
||||||
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
|
|
||||||
}/* else if (checkleavestatus(storeid)) {
|
}/* else if (checkleavestatus(storeid)) {
|
||||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
@@ -237,7 +261,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
/*else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_INVALID)) {
|
/*else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_INVALID)) {
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
else if (coverage.size() > 0) {
|
/* else if (coverage.size() > 0) {
|
||||||
String statusleave = "";
|
String statusleave = "";
|
||||||
|
|
||||||
for (int i = 0; i < coverage.size(); i++) {
|
for (int i = 0; i < coverage.size(); i++) {
|
||||||
@@ -275,7 +299,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if (coverage.get(i).getInTime() != null) {
|
*//* if (coverage.get(i).getInTime() != null) {
|
||||||
|
|
||||||
if (coverage.get(i).getOutTime() == null) {
|
if (coverage.get(i).getOutTime() == null) {
|
||||||
|
|
||||||
@@ -290,11 +314,11 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}*/
|
}*//*
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
}*/ else {
|
||||||
|
|
||||||
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||||
@@ -606,50 +630,6 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ import javax.xml.parsers.SAXParser;
|
|||||||
import javax.xml.parsers.SAXParserFactory;
|
import javax.xml.parsers.SAXParserFactory;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
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;
|
||||||
@@ -120,7 +121,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
setContentView(R.layout.activity_storeimage);
|
setContentView(R.layout.activity_storeimage);
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
getSupportActionBar().setHomeButtonEnabled(true);
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
@@ -366,11 +367,11 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
case R.id.img_cam_selfie:
|
case R.id.img_cam_selfie:
|
||||||
|
|
||||||
_pathforcheck = store_id + "SI_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||||
|
|
||||||
intime = getCurrentTime();
|
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
@@ -527,15 +528,15 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
String cdate = formatter.format(m_cal.getTime());
|
String cdate = formatter.format(m_cal.getTime());
|
||||||
|
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)
|
||||||
cdate = arabicToenglish(cdate);
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)
|
||||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,7 +548,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(R.string.title_activity_store_image);
|
toolbar.setTitle(R.string.title_activity_store_image);
|
||||||
|
|
||||||
// Resuming the periodic location updates
|
// Resuming the periodic location updates
|
||||||
@@ -567,50 +568,6 @@ 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("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLocationChanged(Location location) {
|
public void onLocationChanged(Location location) {
|
||||||
|
|||||||
+7
-50
@@ -59,6 +59,7 @@ import java.util.Locale;
|
|||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
||||||
@@ -116,7 +117,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -217,7 +218,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -514,7 +515,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck = "T2P_Image_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
_pathforcheck = "T2P_Image_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
child_position = position;
|
child_position = position;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
@@ -543,7 +544,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck1 = "T2P_Image1_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
_pathforcheck1 = "T2P_Image1_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
child_position1 = position;
|
child_position1 = position;
|
||||||
path = str + _pathforcheck1;
|
path = str + _pathforcheck1;
|
||||||
|
|
||||||
@@ -572,7 +573,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck2 = "T2P_Image2_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
_pathforcheck2 = "T2P_Image2_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
child_position2 = position;
|
child_position2 = position;
|
||||||
path = str + _pathforcheck2;
|
path = str + _pathforcheck2;
|
||||||
|
|
||||||
@@ -961,7 +962,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
@@ -1457,50 +1458,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
} else {
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 showPlanogram(String planogram_image) {
|
public void showPlanogram(String planogram_image) {
|
||||||
|
|
||||||
final Dialog dialog = new Dialog(T2PComplianceActivity.this);
|
final Dialog dialog = new Dialog(T2PComplianceActivity.this);
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@ public class T2pBrand_Avaibility extends AppCompatActivity {
|
|||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -234,49 +235,6 @@ public class T2pBrand_Avaibility extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 class ValueAdapter extends RecyclerView.Adapter<T2pBrand_Avaibility.ValueAdapter.MyViewHolder> {
|
public class ValueAdapter extends RecyclerView.Adapter<T2pBrand_Avaibility.ValueAdapter.MyViewHolder> {
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ 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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
@@ -54,7 +55,9 @@ 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.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramCountrywiseGetterSetter;
|
||||||
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.MappingSubCategoryImageAllowGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||||
@@ -90,8 +93,10 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
ADDITIONAL_DISPLAY_MASTERGetterSetter additional_display_getter_setter;
|
ADDITIONAL_DISPLAY_MASTERGetterSetter additional_display_getter_setter;
|
||||||
MAPPING_SOS_TARGET_MasterGetterSetter mapping_sos_target_masterGetterSetter;
|
MAPPING_SOS_TARGET_MasterGetterSetter mapping_sos_target_masterGetterSetter;
|
||||||
MAPPING_PLANOGRAM_MasterGetterSetter mapping_planogram_masterGetterSetter;
|
MAPPING_PLANOGRAM_MasterGetterSetter mapping_planogram_masterGetterSetter;
|
||||||
|
MappingPlanogramCountrywiseGetterSetter mappingPlanogramCountrywiseGetterSetter;
|
||||||
ShelfMasterGetterSetter shelfMasterGetterSetter;
|
ShelfMasterGetterSetter shelfMasterGetterSetter;
|
||||||
MappingSubCategoryImageAllowGetterSetter mappingSubCategoryImageAllowGetterSetter;
|
MappingSubCategoryImageAllowGetterSetter mappingSubCategoryImageAllowGetterSetter;
|
||||||
|
MappingCategoryImageAllowGetterSetter mappingCategoryImageAllowGetterSetter;
|
||||||
SkuGroupMasterGetterSetter skuGroupMasterGetterSetter;
|
SkuGroupMasterGetterSetter skuGroupMasterGetterSetter;
|
||||||
|
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
@@ -114,7 +119,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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, "");
|
||||||
@@ -887,8 +892,74 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
//MAPPING_CATEGORY_IMAGE_ALLOW
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "MAPPING_CATEGORY_IMAGE_ALLOW");
|
||||||
|
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();
|
||||||
|
mappingCategoryImageAllowGetterSetter = XMLHandlers.mappingCategoryImageAllowXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
|
String table_category_img_allow = mappingCategoryImageAllowGetterSetter.getTable_MAPPING_CATEGORY_IMAGE_ALLOW();
|
||||||
|
if (table_category_img_allow != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setMappingCategoryImageAllow(table_category_img_allow);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mappingCategoryImageAllowGetterSetter.getCATEGORY_ID().size() > 0) {
|
||||||
|
data.value = 97;
|
||||||
|
data.name = "MAPPING_CATEGORY_IMAGE_ALLOW " + getResources().getString(R.string.download_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
/* //MAPPING_COUNTRYWISE_PLANOGRAM
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "MAPPING_COUNTRYWISE_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();
|
||||||
|
mappingPlanogramCountrywiseGetterSetter = XMLHandlers.MAPPING_COUNTRYWISE_PLANOGRAM_XMLHandler(xpp, eventType);
|
||||||
|
|
||||||
|
String table_mapping_planogram = mappingPlanogramCountrywiseGetterSetter.getTable_MAPPING_COUNTRYWISE_PLANOGRAM();
|
||||||
|
if (table_mapping_planogram != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setMappingCountrywisePlanogram(table_mapping_planogram);
|
||||||
|
}
|
||||||
|
if (mappingPlanogramCountrywiseGetterSetter.getCOUNTRY_ID().size() > 0) {
|
||||||
|
data.value = 92;
|
||||||
|
data.name = "MAPPING_COUNTRYWISE_PLANOGRAM Data Download";
|
||||||
|
} else {
|
||||||
|
//return "MAPPING_COUNTRYWISE_PLANOGRAM";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishProgress(data);*/
|
||||||
|
|
||||||
//Images DownLoads
|
//Images DownLoads
|
||||||
|
|
||||||
@@ -897,8 +968,9 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
for (int i = 0; i < mapping_planogram_masterGetterSetter.getIMAGE_PATH().size(); i++) {
|
for (int i = 0; i < mapping_planogram_masterGetterSetter.getIMAGE_PATH().size(); i++) {
|
||||||
//publishing image download
|
//publishing image download
|
||||||
data.value = data.value + 1;
|
|
||||||
if (data.value < 100) {
|
if (data.value < 100) {
|
||||||
|
data.value = data.value + 1;
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -955,8 +1027,9 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
for (int i = 0; i < displayMasterGetterSetter.getIMAGE_URL().size(); i++) {
|
for (int i = 0; i < displayMasterGetterSetter.getIMAGE_URL().size(); i++) {
|
||||||
//publishing image download
|
//publishing image download
|
||||||
data.value = data.value + 1;
|
|
||||||
if (data.value < 100) {
|
if (data.value < 100) {
|
||||||
|
data.value = data.value + 1;
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,6 +1079,120 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MAPPING_PLANOGRAM Image save into folder
|
||||||
|
if (mapping_planogram_masterGetterSetter != null) {
|
||||||
|
|
||||||
|
for (int i = 0; i < mapping_planogram_masterGetterSetter.getIMAGE_PATH().size(); i++) {
|
||||||
|
//publishing image download
|
||||||
|
|
||||||
|
if (data.value < 100) {
|
||||||
|
data.value = data.value + 1;
|
||||||
|
publishProgress(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
String image_name = mapping_planogram_masterGetterSetter.getPLANOGRAM_IMAGE().get(i);
|
||||||
|
String path = mapping_planogram_masterGetterSetter.getIMAGE_PATH().get(i);
|
||||||
|
|
||||||
|
if (!image_name.equalsIgnoreCase("NA") && !image_name.equalsIgnoreCase("")) {
|
||||||
|
URL url = new URL(path + "/" + image_name);
|
||||||
|
HttpURLConnection c = (HttpURLConnection) url.openConnection();
|
||||||
|
c.setRequestMethod("GET");
|
||||||
|
c.getResponseCode();
|
||||||
|
c.connect();
|
||||||
|
|
||||||
|
if (c.getResponseCode() == 200) {
|
||||||
|
int length = c.getContentLength();
|
||||||
|
|
||||||
|
String size = new DecimalFormat("##.##").format((double) length / 1024) + " KB";
|
||||||
|
|
||||||
|
//String PATH = Environment.getExternalStorageDirectory() + "/Download/GT_GSK_Images/";
|
||||||
|
String PATH = CommonString.FILE_PATH;
|
||||||
|
File file = new File(PATH);
|
||||||
|
if (!file.isDirectory()) {
|
||||||
|
file.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Environment.getExternalStorageDirectory() + "/GT_GSK_Images/" + _pathforcheck1;
|
||||||
|
if (!new File(PATH + image_name).exists() && !size.equalsIgnoreCase("0 KB")) {
|
||||||
|
File outputFile = new File(file, image_name);
|
||||||
|
FileOutputStream fos = new FileOutputStream(outputFile);
|
||||||
|
InputStream is1 = c.getInputStream();
|
||||||
|
|
||||||
|
int bytes = 0;
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int len1 = 0;
|
||||||
|
|
||||||
|
while ((len1 = is1.read(buffer)) != -1) {
|
||||||
|
bytes = (bytes + len1);
|
||||||
|
// data.value = (int) ((double) (((double)
|
||||||
|
// bytes) / length) * 100);
|
||||||
|
fos.write(buffer, 0, len1);
|
||||||
|
}
|
||||||
|
fos.close();
|
||||||
|
is1.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//MAPPING_COUNTRYWISE_PLANOGRAM file save into folder
|
||||||
|
/*if (mappingPlanogramCountrywiseGetterSetter != null) {
|
||||||
|
|
||||||
|
for (int i = 0; i < mappingPlanogramCountrywiseGetterSetter.getFILE_PATH().size(); i++) {
|
||||||
|
//publishing image download
|
||||||
|
|
||||||
|
if (data.value < 100) {
|
||||||
|
data.value = data.value + 1;
|
||||||
|
publishProgress(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
String file_name = mappingPlanogramCountrywiseGetterSetter.getPLANOGRAM_URL().get(i);
|
||||||
|
String path = mappingPlanogramCountrywiseGetterSetter.getFILE_PATH().get(i);
|
||||||
|
|
||||||
|
if (!file_name.equalsIgnoreCase("NA") && !file_name.equalsIgnoreCase("")) {
|
||||||
|
URL url = new URL(path + "/" + file_name);
|
||||||
|
HttpURLConnection c = (HttpURLConnection) url.openConnection();
|
||||||
|
c.setRequestMethod("GET");
|
||||||
|
c.getResponseCode();
|
||||||
|
c.connect();
|
||||||
|
|
||||||
|
if (c.getResponseCode() == 200) {
|
||||||
|
int length = c.getContentLength();
|
||||||
|
|
||||||
|
String size = new DecimalFormat("##.##").format((double) length / 1024) + " KB";
|
||||||
|
|
||||||
|
//String PATH = Environment.getExternalStorageDirectory() + "/Download/GT_GSK_Images/";
|
||||||
|
String PATH = CommonString.FILE_PATH_PDF;
|
||||||
|
File file = new File(PATH);
|
||||||
|
if (!file.isDirectory()) {
|
||||||
|
file.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Environment.getExternalStorageDirectory() + "/GT_GSK_Images/" + _pathforcheck1;
|
||||||
|
if (!new File(PATH + file_name).exists() && !size.equalsIgnoreCase("0 KB")) {
|
||||||
|
File outputFile = new File(file, file_name);
|
||||||
|
FileOutputStream fos = new FileOutputStream(outputFile);
|
||||||
|
InputStream is1 = c.getInputStream();
|
||||||
|
|
||||||
|
int bytes = 0;
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int len1 = 0;
|
||||||
|
|
||||||
|
while ((len1 = is1.read(buffer)) != -1) {
|
||||||
|
bytes = (bytes + len1);
|
||||||
|
// data.value = (int) ((double) (((double)
|
||||||
|
// bytes) / length) * 100);
|
||||||
|
fos.write(buffer, 0, len1);
|
||||||
|
}
|
||||||
|
fos.close();
|
||||||
|
is1.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
db.InsertJCP(jcpgettersetter);
|
db.InsertJCP(jcpgettersetter);
|
||||||
db.InsertCategory(categoryMasterGetterSetter);
|
db.InsertCategory(categoryMasterGetterSetter);
|
||||||
@@ -1029,6 +1216,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
db.InsertSHELF_MASTER(shelfMasterGetterSetter);
|
db.InsertSHELF_MASTER(shelfMasterGetterSetter);
|
||||||
|
|
||||||
db.InsertMappingSubCategoryImageAllow(mappingSubCategoryImageAllowGetterSetter);
|
db.InsertMappingSubCategoryImageAllow(mappingSubCategoryImageAllowGetterSetter);
|
||||||
|
db.InsertMappingCategoryImageAllow(mappingCategoryImageAllowGetterSetter);
|
||||||
|
// db.InsertMappingCountrywisePlanogram(mappingPlanogramCountrywiseGetterSetter);
|
||||||
db.InsertSkuGroupMaster(skuGroupMasterGetterSetter);
|
db.InsertSkuGroupMaster(skuGroupMasterGetterSetter);
|
||||||
|
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
@@ -1118,52 +1307,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
toolbar.setTitle(getString(R.string.main_menu_activity_name));
|
toolbar.setTitle(getString(R.string.main_menu_activity_name));
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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,7 +4,6 @@ import android.content.Context;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
|
||||||
@@ -20,11 +19,11 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
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.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,7 +162,7 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
//selected_flag = true;
|
//selected_flag = true;
|
||||||
onButtonPressed(language.get(0),culture_id.get(0),login_data.getNOTICE_URL().get(0));
|
onButtonPressed(language.get(0),culture_id.get(0),login_data.getNOTICE_URL().get(0));
|
||||||
|
|
||||||
updateResources(getActivity(), language.get(0));
|
CommonFunctions.updateLangResources(getActivity(), language.get(0));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
@@ -181,7 +180,7 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
|
|
||||||
onButtonPressed(language.get(1),culture_id.get(1),login_data.getNOTICE_URL().get(1));
|
onButtonPressed(language.get(1),culture_id.get(1),login_data.getNOTICE_URL().get(1));
|
||||||
|
|
||||||
updateResources(getActivity(), language.get(1));
|
CommonFunctions.updateLangResources(getActivity(), language.get(1));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
@@ -225,46 +224,4 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
//return ;
|
//return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+98
-1
@@ -1,10 +1,13 @@
|
|||||||
package cpm.com.gskmtorange.fragment;
|
package cpm.com.gskmtorange.fragment;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.support.v7.util.SortedList;
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
@@ -14,21 +17,39 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.squareup.okhttp.MediaType;
|
||||||
|
import com.squareup.okhttp.MultipartBuilder;
|
||||||
|
import com.squareup.okhttp.RequestBody;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
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 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.dailyentry.ServiceActivity;
|
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
||||||
|
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.messgae.AlertMessage;
|
||||||
|
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
||||||
|
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
||||||
|
import retrofit.Call;
|
||||||
|
import retrofit.Callback;
|
||||||
|
import retrofit.Response;
|
||||||
|
import retrofit.Retrofit;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A placeholder fragment containing a simple view.
|
* A placeholder fragment containing a simple view.
|
||||||
*/
|
*/
|
||||||
public class ServiceActivityFragment extends Fragment {
|
public class ServiceActivityFragment extends Fragment {
|
||||||
|
String result = "";
|
||||||
|
boolean isvalid = false;
|
||||||
|
|
||||||
public ServiceActivityFragment() {
|
public ServiceActivityFragment() {
|
||||||
}
|
}
|
||||||
@@ -143,7 +164,7 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showExportDialog(){
|
public void showExportDialog(){
|
||||||
|
String path;
|
||||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity());
|
||||||
builder1.setMessage(R.string.Areyou_sure_take_backup)
|
builder1.setMessage(R.string.Areyou_sure_take_backup)
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
@@ -187,6 +208,27 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
dst.close();
|
dst.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//usk
|
||||||
|
// File dir = new File(CommonString.BACKUP_PATH);
|
||||||
|
File dir = new File(CommonString.BACKUP_PATH);
|
||||||
|
|
||||||
|
ArrayList<String> list = new ArrayList();
|
||||||
|
list = getFileNames(dir.listFiles());
|
||||||
|
if (list.size() > 0) {
|
||||||
|
for (int i1 = 0; i1 < list.size(); i1++) {
|
||||||
|
if (list.get(i1).contains("gsk_orange_backup")) {
|
||||||
|
File originalFile = new File(CommonString.BACKUP_PATH + list.get(i1));
|
||||||
|
Object result = uploadBackup(getActivity(), originalFile.getName(), "DBBackup");
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.databasexported), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println(e.getMessage());
|
System.out.println(e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -200,4 +242,59 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
AlertDialog alert1 = builder1.create();
|
AlertDialog alert1 = builder1.create();
|
||||||
alert1.show();
|
alert1.show();
|
||||||
}
|
}
|
||||||
|
public ArrayList<String> getFileNames(File[] file) {
|
||||||
|
ArrayList<String> arrayFiles = new ArrayList<String>();
|
||||||
|
if (file.length > 0) {
|
||||||
|
for (int i = 0; i < file.length; i++)
|
||||||
|
arrayFiles.add(file[i].getName());
|
||||||
|
}
|
||||||
|
return arrayFiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String uploadBackup(final Context context, String file_name, String folder_name) {
|
||||||
|
RequestBody body1;
|
||||||
|
result = "";
|
||||||
|
isvalid = false;
|
||||||
|
final File originalFile = new File(CommonString.BACKUP_PATH + file_name);
|
||||||
|
RequestBody photo = RequestBody.create(MediaType.parse("application/octet-stream"), originalFile);
|
||||||
|
body1 = new MultipartBuilder().type(MultipartBuilder.FORM)
|
||||||
|
.addFormDataPart("file", originalFile.getName(), photo)
|
||||||
|
.addFormDataPart("Foldername", folder_name)
|
||||||
|
.build();
|
||||||
|
Retrofit adapter = new Retrofit.Builder()
|
||||||
|
.baseUrl(CommonString.URL+"/")
|
||||||
|
.addConverterFactory(new StringConverterFactory())
|
||||||
|
.build();
|
||||||
|
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||||
|
Call<String> call = api.getUploadImage(body1);
|
||||||
|
call.enqueue(new Callback<String>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Response<String> response) {
|
||||||
|
if (response.toString() != null) {
|
||||||
|
if (response.body().contains(CommonString.KEY_SUCCESS)) {
|
||||||
|
isvalid = true;
|
||||||
|
result = CommonString.KEY_SUCCESS;
|
||||||
|
originalFile.delete();
|
||||||
|
} else {
|
||||||
|
result = "Servererror!";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result = "Servererror!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable t) {
|
||||||
|
isvalid = true;
|
||||||
|
if (t instanceof UnknownHostException) {
|
||||||
|
result = AlertMessage.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
} else {
|
||||||
|
result = AlertMessage.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
}
|
||||||
|
Toast.makeText(context, originalFile.getName() + " not uploaded", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-47
@@ -29,6 +29,7 @@ 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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -89,7 +90,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||||
categoryList = new ArrayList<>();
|
categoryList = new ArrayList<>();
|
||||||
@@ -270,51 +271,6 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 updateStatus() {
|
public void updateStatus() {
|
||||||
//Update Checkout Status
|
//Update Checkout Status
|
||||||
boolean flag_filled = false;
|
boolean flag_filled = false;
|
||||||
|
|||||||
+3
-46
@@ -26,6 +26,7 @@ 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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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,7 +99,7 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
try {
|
try {
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
categoryWisePerformanceList = db.getCategoryWisePerformance(store_id, categoryId);
|
categoryWisePerformanceList = db.getCategoryWisePerformance(store_id, categoryId);
|
||||||
|
|
||||||
adapter = new CategoryWisePerformaceAdapter(CategoryWisePerformanceActivity.this, categoryWisePerformanceList);
|
adapter = new CategoryWisePerformaceAdapter(CategoryWisePerformanceActivity.this, categoryWisePerformanceList);
|
||||||
@@ -191,48 +192,4 @@ public class CategoryWisePerformanceActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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
-45
@@ -28,6 +28,7 @@ import java.util.Locale;
|
|||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
||||||
import cpm.com.gskmtorange.dailyentry.CategoryPicture;
|
import cpm.com.gskmtorange.dailyentry.CategoryPicture;
|
||||||
@@ -65,7 +66,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -103,7 +104,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
categoryList = new ArrayList<>();
|
categoryList = new ArrayList<>();
|
||||||
@@ -423,49 +424,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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
-47
@@ -39,6 +39,7 @@ 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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||||
|
|
||||||
@@ -76,7 +77,7 @@ 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, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -226,7 +227,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareList() {
|
private void prepareList() {
|
||||||
@@ -365,7 +366,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
|||||||
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" + headerTitle.getBrand_cd() + "_" + store_cd + "_" + visit_date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = "Stock" + headerTitle.getBrand_cd() + "_" + store_cd + "_" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
child_position = groupPosition;
|
child_position = groupPosition;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
@@ -489,48 +490,4 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+76
-60
@@ -55,6 +55,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
@@ -117,7 +118,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -184,7 +185,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
builder.setMessage(Error_Message)
|
builder.setMessage(Error_Message)
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
expandableListView.smoothScrollToPosition(scrollPosition);
|
expandableListView.smoothScrollToPosition(scrollPosition);
|
||||||
|
|
||||||
@@ -204,6 +205,9 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||||
|
|
||||||
|
expandableListView.invalidate();
|
||||||
|
|
||||||
int lastItem = firstVisibleItem + visibleItemCount;
|
int lastItem = firstVisibleItem + visibleItemCount;
|
||||||
|
|
||||||
if (firstVisibleItem == 0) {
|
if (firstVisibleItem == 0) {
|
||||||
@@ -224,7 +228,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
getCurrentFocus().clearFocus();
|
getCurrentFocus().clearFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
//expandableListView.invalidateViews();
|
expandableListView.invalidateViews();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -324,7 +328,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
dialog.setCancelable(false);
|
dialog.setCancelable(false);
|
||||||
|
|
||||||
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList = db.getMappingPlanogramData(categoryId);
|
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList = db.getMappingPlanogramData(categoryId, storeType_id, class_id);
|
||||||
|
|
||||||
//ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
//ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
||||||
WebView webView = (WebView) dialog.findViewById(R.id.webview);
|
WebView webView = (WebView) dialog.findViewById(R.id.webview);
|
||||||
@@ -444,7 +448,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = "Stock_Camera1_" + store_id + "_" + categoryId
|
_pathforcheck = "Stock_Camera1_" + store_id + "_" + categoryId
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(3);
|
startCameraActivity(3);
|
||||||
@@ -455,7 +459,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = "Stock_Camera2_" + store_id + "_" + categoryId
|
_pathforcheck = "Stock_Camera2_" + store_id + "_" + categoryId
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(4);
|
startCameraActivity(4);
|
||||||
@@ -466,7 +470,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = "Stock_Camera3_" + store_id + "_" + categoryId
|
_pathforcheck = "Stock_Camera3_" + store_id + "_" + categoryId
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(5);
|
startCameraActivity(5);
|
||||||
@@ -477,7 +481,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = "Stock_Camera4_" + store_id + "_" + categoryId
|
_pathforcheck = "Stock_Camera4_" + store_id + "_" + categoryId
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(6);
|
startCameraActivity(6);
|
||||||
@@ -546,7 +550,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareList() {
|
private void prepareList() {
|
||||||
@@ -819,7 +823,6 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
|
|
||||||
|
|
||||||
holder.txt_mbq.setVisibility(View.VISIBLE);
|
holder.txt_mbq.setVisibility(View.VISIBLE);
|
||||||
holder.toggle_available.setVisibility(View.VISIBLE);
|
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||||
@@ -833,9 +836,8 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
holder.stock_view.setVisibility(View.VISIBLE);
|
holder.stock_view.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
|
||||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
|
||||||
|
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
holder.txt_mbq.setVisibility(View.GONE);
|
holder.txt_mbq.setVisibility(View.GONE);
|
||||||
holder.toggle_available.setVisibility(View.GONE);
|
holder.toggle_available.setVisibility(View.GONE);
|
||||||
holder.facing.setVisibility(View.VISIBLE);
|
holder.facing.setVisibility(View.VISIBLE);
|
||||||
@@ -843,6 +845,21 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
holder.stock_view.setVisibility(View.GONE);
|
holder.stock_view.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(childData.getCompany_id().equals("1")){
|
||||||
|
|
||||||
|
if(childData.getMust_have().equals("1")){
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.blue));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
/* if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
} else {
|
} else {
|
||||||
@@ -911,8 +928,9 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (!edStock.equals("")) {
|
if (!edStock.equals("")) {
|
||||||
String stock = edStock;
|
String stock = edStock;
|
||||||
|
int mbq = Integer.parseInt(childData.getMbq());
|
||||||
if (Integer.parseInt(stock) >= 0 && Integer.parseInt(stock) < Integer.parseInt(childData.getMbq())) {
|
if(mbq!=0){
|
||||||
|
if (Integer.parseInt(stock) >= 0 && Integer.parseInt(stock) < mbq) {
|
||||||
|
|
||||||
if (!childData.getFacing().equals("")) {
|
if (!childData.getFacing().equals("")) {
|
||||||
if (Integer.parseInt(stock) >= 0 && Double.parseDouble(childData.getFacing()) <= Integer.parseInt(stock)) {
|
if (Integer.parseInt(stock) >= 0 && Double.parseDouble(childData.getFacing()) <= Integer.parseInt(stock)) {
|
||||||
@@ -952,6 +970,26 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(Integer.parseInt(stock) > 0){
|
||||||
|
if (isDialogOpen) {
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_stock))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
finalHolder.stock.setText("");
|
||||||
|
dialog.dismiss();
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
childData.setStock("");
|
childData.setStock("");
|
||||||
}
|
}
|
||||||
@@ -1006,8 +1044,9 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
alert.show();
|
alert.show();
|
||||||
} else {*/
|
} else {*/
|
||||||
if (edFaceup != null && !edFaceup.equals("")) {
|
if (edFaceup != null && !edFaceup.equals("")) {
|
||||||
|
int mbq = Integer.parseInt(childData.getMbq());
|
||||||
if (Double.parseDouble(edFaceup) >= 0 && Double.parseDouble(edFaceup) < Integer.parseInt(childData.getMbq())) {
|
if(mbq!=0){
|
||||||
|
if (Double.parseDouble(edFaceup) >= 0 && Double.parseDouble(edFaceup) < mbq) {
|
||||||
if (!childData.getStock().equals("")) {
|
if (!childData.getStock().equals("")) {
|
||||||
|
|
||||||
//if (edFaceup != null && !edFaceup.equals("")) {
|
//if (edFaceup != null && !edFaceup.equals("")) {
|
||||||
@@ -1059,6 +1098,27 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if(Double.parseDouble(edFaceup) > 0){
|
||||||
|
if (isDialogOpen) {
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_faceing))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
finalHolder.facing.setText("");
|
||||||
|
dialog.dismiss();
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//}
|
//}
|
||||||
} else{
|
} else{
|
||||||
isFill = true;
|
isFill = true;
|
||||||
@@ -1195,50 +1255,6 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
View stock_view;
|
View stock_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
} else {
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("LongLogTag")
|
@SuppressLint("LongLogTag")
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+11
-53
@@ -47,6 +47,7 @@ import java.util.logging.StreamHandler;
|
|||||||
|
|
||||||
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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
|
||||||
@@ -78,50 +79,6 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
String error_msg;
|
String error_msg;
|
||||||
Promo_Compliance_DataGetterSetter cd;
|
Promo_Compliance_DataGetterSetter cd;
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
} else {
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -152,7 +109,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -194,15 +151,15 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
cd.setIn_stock("1");
|
cd.setIn_stock("1");
|
||||||
img_addPromotion.setBackgroundResource(R.mipmap.camera_orange);
|
|
||||||
|
|
||||||
if (camera_allow.equals("1")) {
|
if (camera_allow.equals("1")) {
|
||||||
|
img_addPromotion.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
img_addPromotion.setOnClickListener(new View.OnClickListener() {
|
img_addPromotion.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck = "AddPromo_Image_" + store_id + categoryId + "_"
|
_pathforcheck = "AddPromo_Image_" + store_id + categoryId + "_"
|
||||||
+ visit_date.replace("/", "") + "_" +
|
+ visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(2);
|
startCameraActivity(2);
|
||||||
@@ -391,7 +348,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
Snackbar.make(view, getResources().getString(R.string.please_select_answer), Snackbar.LENGTH_LONG)
|
Snackbar.make(view, getResources().getString(R.string.title_activity_select_dropdown), Snackbar.LENGTH_LONG)
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -465,7 +422,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareList() {
|
private void prepareList() {
|
||||||
@@ -596,14 +553,15 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
case 1:
|
case 1:
|
||||||
data.setIn_stock("1");
|
data.setIn_stock("1");
|
||||||
img_promotion.setClickable(true);
|
img_promotion.setClickable(true);
|
||||||
img_promotion.setBackgroundResource(R.mipmap.camera_orange);
|
|
||||||
if (camera_allow.equals("1")) {
|
if (camera_allow.equals("1")) {
|
||||||
|
|
||||||
|
img_promotion.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
img_promotion.setOnClickListener(new View.OnClickListener() {
|
img_promotion.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck = "Promo_Image_" + store_id + categoryId + "_" + data.getSku_id() +
|
_pathforcheck = "Promo_Image_" + store_id + categoryId + "_" + data.getSku_id() +
|
||||||
data.getPromo_id() + visit_date.replace("/", "") + "_" +
|
data.getPromo_id() + visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
//child_position = position;
|
//child_position = position;
|
||||||
child_position = finalI;
|
child_position = finalI;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
@@ -652,7 +610,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck = "Promo_Image_" + store_id + categoryId + "_" + data.getSku_id() +
|
_pathforcheck = "Promo_Image_" + store_id + categoryId + "_" + data.getSku_id() +
|
||||||
data.getPromo_id() + visit_date.replace("/", "") + "_" +
|
data.getPromo_id() + visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
//child_position = position;
|
//child_position = position;
|
||||||
child_position = finalI;
|
child_position = finalI;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
@@ -1085,7 +1043,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
|
|||||||
+3
-45
@@ -52,6 +52,7 @@ 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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
@@ -82,49 +83,6 @@ public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity {
|
|||||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> addSkuChildList;
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> addSkuChildList;
|
||||||
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> addSkuHashMapChildData;
|
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> addSkuHashMapChildData;
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -142,7 +100,7 @@ public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity {
|
|||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -916,6 +874,6 @@ public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-54
@@ -66,6 +66,7 @@ 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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||||
@@ -105,49 +106,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
||||||
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -175,7 +133,7 @@ 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, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -431,7 +389,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = "Stock_Camera1_" + store_id + "_" + categoryId
|
_pathforcheck = "Stock_Camera1_" + store_id + "_" + categoryId
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(3);
|
startCameraActivity(3);
|
||||||
@@ -442,7 +400,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = "Stock_Camera2_" + store_id + "_" + categoryId
|
_pathforcheck = "Stock_Camera2_" + store_id + "_" + categoryId
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(4);
|
startCameraActivity(4);
|
||||||
@@ -453,7 +411,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = "Stock_Camera3_" + store_id + "_" + categoryId
|
_pathforcheck = "Stock_Camera3_" + store_id + "_" + categoryId
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(5);
|
startCameraActivity(5);
|
||||||
@@ -464,7 +422,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = "Stock_Camera4_" + store_id + "_" + categoryId
|
_pathforcheck = "Stock_Camera4_" + store_id + "_" + categoryId
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(6);
|
startCameraActivity(6);
|
||||||
@@ -1126,7 +1084,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public String getCurrentTime() {
|
/*public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
||||||
String cdate = formatter.format(m_cal.getTime());
|
String cdate = formatter.format(m_cal.getTime());
|
||||||
@@ -1148,7 +1106,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
||||||
@@ -1213,7 +1171,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
dialog.setCancelable(false);
|
dialog.setCancelable(false);
|
||||||
|
|
||||||
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList = db.getMappingPlanogramData(categoryId);
|
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList = db.getMappingPlanogramData(categoryId, storeType_id, class_id);
|
||||||
|
|
||||||
//ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
//ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
||||||
WebView webView = (WebView) dialog.findViewById(R.id.webview);
|
WebView webView = (WebView) dialog.findViewById(R.id.webview);
|
||||||
@@ -1315,7 +1273,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||||
@@ -1397,7 +1355,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||||
|
|
||||||
_pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id()
|
_pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id()
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
child_position = groupPosition;
|
child_position = groupPosition;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
@@ -1426,7 +1384,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
//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()
|
_pathforcheck = "Stock_Cam2_" + store_id + "_" + headerTitle.getBrand_id()
|
||||||
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||||
child_position = groupPosition;
|
child_position = groupPosition;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
|
|||||||
+3
-45
@@ -26,6 +26,7 @@ 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.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
||||||
@@ -41,49 +42,6 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
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;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -99,7 +57,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -133,7 +91,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
try {
|
try {
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
storeWisePerformanceList = db.getStoreWisePerformance(store_id);
|
storeWisePerformanceList = db.getStoreWisePerformance(store_id);
|
||||||
|
|
||||||
|
|||||||
@@ -19,4 +19,5 @@ public interface Listener {
|
|||||||
void setEmptyListBottom(boolean visibility, int tv, RecyclerView rv);
|
void setEmptyListBottom(boolean visibility, int tv, RecyclerView rv);
|
||||||
void addNUpdateRow(View v, int view_id, NoCameraDataGetterSetter parent_item);
|
void addNUpdateRow(View v, int view_id, NoCameraDataGetterSetter parent_item);
|
||||||
void smoothScrollToRow(View v, DragEvent event);
|
void smoothScrollToRow(View v, DragEvent event);
|
||||||
|
void deleteItem(View v, int column_no, RecyclerView rec);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ public class AlertMessage {
|
|||||||
|
|
||||||
public static final String MESSAGE_DATA_NOT = "Data Not Uploaded , ";
|
public static final String MESSAGE_DATA_NOT = "Data Not Uploaded , ";
|
||||||
|
|
||||||
|
public static final String MESSAGE_SOCKETEXCEPTION = "Network Communication Failure. Check Your Network Connection";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private Exception exception;
|
private Exception exception;
|
||||||
String value;
|
String value;
|
||||||
private String data, condition,exceptionString;
|
private String data, condition,exceptionString;
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package cpm.com.gskmtorange.retrofit;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by jeevanp on 19-05-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface PostApi {
|
||||||
|
/* @POST("Uploadimages")
|
||||||
|
Call<String> getUploadImage(@Body RequestBody reqesBody);*/
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package cpm.com.gskmtorange.retrofit;
|
||||||
|
|
||||||
|
|
||||||
|
import com.squareup.okhttp.RequestBody;
|
||||||
|
|
||||||
|
import retrofit.Call;
|
||||||
|
import retrofit.http.Body;
|
||||||
|
import retrofit.http.POST;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by jeevanp on 05-10-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface PostApiForFile {
|
||||||
|
@POST("Uploadimages")
|
||||||
|
Call<String> getUploadImage(@Body RequestBody reqesBody);
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package cpm.com.gskmtorange.retrofit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.squareup.okhttp.MediaType;
|
||||||
|
import com.squareup.okhttp.RequestBody;
|
||||||
|
import com.squareup.okhttp.ResponseBody;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
|
import retrofit.Converter;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by jeevanp on 19-05-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class StringConverterFactory implements Converter.Factory {
|
||||||
|
public StringConverterFactory() {
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Converter<String> get(Type type) {
|
||||||
|
Class<?> cls = (Class<?>) type;
|
||||||
|
if (String.class.isAssignableFrom(cls)) {
|
||||||
|
return new StringConverter();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class StringConverter implements Converter<String> {
|
||||||
|
private static final MediaType PLAIN_TEXT = MediaType.parse("text/plain; charset=UTF-8");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String fromBody(ResponseBody body) throws IOException {
|
||||||
|
return new String(body.bytes());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RequestBody toBody(String value) {
|
||||||
|
return RequestBody.create(PLAIN_TEXT, convertToBytes(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static byte[] convertToBytes(String string) {
|
||||||
|
try {
|
||||||
|
return string.getBytes("UTF-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+3
-45
@@ -44,6 +44,7 @@ import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
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.GapsChecklistGetterSetter;
|
||||||
@@ -100,7 +101,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -1514,52 +1515,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
} else {
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 showAlert(String str) {
|
public void showAlert(String str) {
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
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.GapsChecklistGetterSetter;
|
||||||
@@ -103,7 +104,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(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);
|
||||||
@@ -420,6 +421,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
//MSL_Availability_StockFacing
|
//MSL_Availability_StockFacing
|
||||||
String mslAvailability_stockFacing_xml = "";
|
String mslAvailability_stockFacing_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
|
db.open();
|
||||||
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerData(coverageList.get(i).getStoreId());
|
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if (msl_availabilityStockFacingList.size() > 0) {
|
if (msl_availabilityStockFacingList.size() > 0) {
|
||||||
@@ -476,6 +478,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
//Promo Compliance - Promotion Data
|
//Promo Compliance - Promotion Data
|
||||||
String promoition_data_xml = "";
|
String promoition_data_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
|
db.open();
|
||||||
promotionSkuList = db.getPromoComplianceSkuServerUploadData(coverageList.get(i).getStoreId());
|
promotionSkuList = db.getPromoComplianceSkuServerUploadData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if (promotionSkuList.size() > 0) {
|
if (promotionSkuList.size() > 0) {
|
||||||
@@ -528,6 +531,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
//Promo Compliance -Additional Promotion Data
|
//Promo Compliance -Additional Promotion Data
|
||||||
String additional_promoition_data_xml = "";
|
String additional_promoition_data_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
|
db.open();
|
||||||
additionalPromotionList = db.getAdditionalPromotionServerUploadData(coverageList.get(i).getStoreId());
|
additionalPromotionList = db.getAdditionalPromotionServerUploadData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if (additionalPromotionList.size() > 0) {
|
if (additionalPromotionList.size() > 0) {
|
||||||
@@ -584,6 +588,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
String onXMLdIALOG = "";
|
String onXMLdIALOG = "";
|
||||||
String imageV1, imageV2, imageV3;
|
String imageV1, imageV2, imageV3;
|
||||||
|
|
||||||
|
db.open();
|
||||||
additionalVisibilityList = db.getAdditionalStockUpload(coverageList.get(i).getStoreId());
|
additionalVisibilityList = db.getAdditionalStockUpload(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if (additionalVisibilityList.size() > 0) {
|
if (additionalVisibilityList.size() > 0) {
|
||||||
@@ -679,6 +684,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
//T2p Upload Data
|
//T2p Upload Data
|
||||||
String t2p_data_xml = "";
|
String t2p_data_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
|
db.open();
|
||||||
t2PGetterSetters = db.getT2pComplianceData(coverageList.get(i).getStoreId(), null);
|
t2PGetterSetters = db.getT2pComplianceData(coverageList.get(i).getStoreId(), null);
|
||||||
|
|
||||||
if (t2PGetterSetters.size() > 0) {
|
if (t2PGetterSetters.size() > 0) {
|
||||||
@@ -797,6 +803,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
//Stock Facing Planogram Tracker
|
//Stock Facing Planogram Tracker
|
||||||
String stock_facing_planogram_xml = "";
|
String stock_facing_planogram_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
|
db.open();
|
||||||
stockFacingPlanogramDataList = db.getStockAndFacingPlanogramServerUploadData(coverageList.get(i).getStoreId());
|
stockFacingPlanogramDataList = db.getStockAndFacingPlanogramServerUploadData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if (stockFacingPlanogramDataList.size() > 0) {
|
if (stockFacingPlanogramDataList.size() > 0) {
|
||||||
@@ -851,6 +858,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
String CategoryLISTDATA = "";
|
String CategoryLISTDATA = "";
|
||||||
String image1, image2, image3, image4;
|
String image1, image2, image3, image4;
|
||||||
|
|
||||||
|
db.open();
|
||||||
adddata = db.getCategoryPictureUpload(coverageList.get(i).getStoreId());
|
adddata = db.getCategoryPictureUpload(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if (adddata.size() > 0) {
|
if (adddata.size() > 0) {
|
||||||
@@ -938,6 +946,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
||||||
|
db.open();
|
||||||
ArrayList<NoCameraDataGetterSetter> nocamera_data_list = db.getNoCameraCategoryStoreWiseDataInserted(coverageList.get(i).getStoreId());
|
ArrayList<NoCameraDataGetterSetter> nocamera_data_list = db.getNoCameraCategoryStoreWiseDataInserted(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if(nocamera_data_list.size()>0){
|
if(nocamera_data_list.size()>0){
|
||||||
@@ -1064,7 +1073,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
for (int J = 0; J < adddata.size(); J++) {
|
for (int J = 0; J < adddata.size(); J++) {
|
||||||
|
|
||||||
String KeyID = adddata.get(J).getKEY_ID();
|
String KeyID = adddata.get(J).getKEY_ID();
|
||||||
|
db.open();
|
||||||
listdat = db.getCategoryPictureListUploaded(KeyID);
|
listdat = db.getCategoryPictureListUploaded(KeyID);
|
||||||
|
|
||||||
if (listdat.size() > 0) {
|
if (listdat.size() > 0) {
|
||||||
@@ -1556,61 +1565,18 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(getString(R.string.title_activity_upload));
|
toolbar.setTitle(getString(R.string.title_activity_upload));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
|
||||||
|
|
||||||
/*String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase("English")) {
|
|
||||||
lang = "EN";
|
|
||||||
} else if (language.equalsIgnoreCase("ARABIC-KSA")) {
|
|
||||||
lang = "AR";
|
|
||||||
} else {
|
|
||||||
lang = "TR";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String lang;
|
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_TURKISH)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
|
||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
|
||||||
}else{
|
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 showAlert(String str) {
|
public void showAlert(String str) {
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(UploadActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(UploadActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(str).setCancelable(false)
|
builder.setMessage(str).setCancelable(false)
|
||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||||
|
|||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yadavendras on 02-01-2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CategoryImagesAllowed {
|
||||||
|
|
||||||
|
boolean img_cam1, img_cam2, img_cam3, img_cam4;
|
||||||
|
|
||||||
|
public boolean isImg_cam1() {
|
||||||
|
return img_cam1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImg_cam1(boolean img_cam1) {
|
||||||
|
this.img_cam1 = img_cam1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isImg_cam2() {
|
||||||
|
return img_cam2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImg_cam2(boolean img_cam2) {
|
||||||
|
this.img_cam2 = img_cam2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isImg_cam3() {
|
||||||
|
return img_cam3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImg_cam3(boolean img_cam3) {
|
||||||
|
this.img_cam3 = img_cam3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isImg_cam4() {
|
||||||
|
return img_cam4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImg_cam4(boolean img_cam4) {
|
||||||
|
this.img_cam4 = img_cam4;
|
||||||
|
}
|
||||||
|
}
|
||||||
+76
@@ -0,0 +1,76 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yadavendras on 30-12-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MappingCategoryImageAllowGetterSetter {
|
||||||
|
|
||||||
|
String table_MAPPING_CATEGORY_IMAGE_ALLOW;
|
||||||
|
|
||||||
|
ArrayList<String> COUNTRY_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> CATEGORY_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> IMAGE1_ALLOW = new ArrayList<>();
|
||||||
|
ArrayList<String> IMAGE2_ALLOW = new ArrayList<>();
|
||||||
|
ArrayList<String> IMAGE3_ALLOW = new ArrayList<>();
|
||||||
|
ArrayList<String> IMAGE4_ALLOW = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
public String getTable_MAPPING_CATEGORY_IMAGE_ALLOW() {
|
||||||
|
return table_MAPPING_CATEGORY_IMAGE_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTable_MAPPING_CATEGORY_IMAGE_ALLOW(String table_MAPPING_CATEGORY_IMAGE_ALLOW) {
|
||||||
|
this.table_MAPPING_CATEGORY_IMAGE_ALLOW = table_MAPPING_CATEGORY_IMAGE_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getCOUNTRY_ID() {
|
||||||
|
return COUNTRY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCOUNTRY_ID(String COUNTRY_ID) {
|
||||||
|
this.COUNTRY_ID.add(COUNTRY_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> getIMAGE1_ALLOW() {
|
||||||
|
return IMAGE1_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIMAGE1_ALLOW(String IMAGE1_ALLOW) {
|
||||||
|
this.IMAGE1_ALLOW.add(IMAGE1_ALLOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getIMAGE2_ALLOW() {
|
||||||
|
return IMAGE2_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIMAGE2_ALLOW(String IMAGE2_ALLOW) {
|
||||||
|
this.IMAGE2_ALLOW.add(IMAGE2_ALLOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getIMAGE3_ALLOW() {
|
||||||
|
return IMAGE3_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIMAGE3_ALLOW(String IMAGE3_ALLOW) {
|
||||||
|
this.IMAGE3_ALLOW.add(IMAGE3_ALLOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getIMAGE4_ALLOW() {
|
||||||
|
return IMAGE4_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIMAGE4_ALLOW(String IMAGE4_ALLOW) {
|
||||||
|
this.IMAGE4_ALLOW.add(IMAGE4_ALLOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yadavendras on 05-01-2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MappingPlanogramCountrywiseGetterSetter {
|
||||||
|
|
||||||
|
String table_MAPPING_COUNTRYWISE_PLANOGRAM;
|
||||||
|
|
||||||
|
ArrayList<String> COUNTRY_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> FILE_PATH = new ArrayList<>();
|
||||||
|
ArrayList<String> PLANOGRAM_URL = new ArrayList<>();
|
||||||
|
|
||||||
|
public String getTable_MAPPING_COUNTRYWISE_PLANOGRAM() {
|
||||||
|
return table_MAPPING_COUNTRYWISE_PLANOGRAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTable_MAPPING_COUNTRYWISE_PLANOGRAM(String table_MAPPING_COUNTRYWISE_PLANOGRAM) {
|
||||||
|
this.table_MAPPING_COUNTRYWISE_PLANOGRAM = table_MAPPING_COUNTRYWISE_PLANOGRAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getCOUNTRY_ID() {
|
||||||
|
return COUNTRY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCOUNTRY_ID(String COUNTRY_ID) {
|
||||||
|
this.COUNTRY_ID.add(COUNTRY_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getFILE_PATH() {
|
||||||
|
return FILE_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFILE_PATH(String FILE_PATH) {
|
||||||
|
this.FILE_PATH.add(FILE_PATH);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getPLANOGRAM_URL() {
|
||||||
|
return PLANOGRAM_URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPLANOGRAM_URL(String PLANOGRAM_URL) {
|
||||||
|
this.PLANOGRAM_URL.add(PLANOGRAM_URL);
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
@@ -27,6 +27,7 @@ public class NoCameraDataGetterSetter {
|
|||||||
|
|
||||||
String CATEGORY_ID;
|
String CATEGORY_ID;
|
||||||
String SUB_CATEGORY_ID;
|
String SUB_CATEGORY_ID;
|
||||||
|
String SUB_CATEGORY;
|
||||||
int facing, row_no, column_no;
|
int facing, row_no, column_no;
|
||||||
|
|
||||||
public int getFacing() {
|
public int getFacing() {
|
||||||
@@ -68,4 +69,12 @@ public class NoCameraDataGetterSetter {
|
|||||||
public void setSUB_CATEGORY_ID(String SUB_CATEGORY_ID) {
|
public void setSUB_CATEGORY_ID(String SUB_CATEGORY_ID) {
|
||||||
this.SUB_CATEGORY_ID = SUB_CATEGORY_ID;
|
this.SUB_CATEGORY_ID = SUB_CATEGORY_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSUB_CATEGORY() {
|
||||||
|
return SUB_CATEGORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSUB_CATEGORY(String SUB_CATEGORY) {
|
||||||
|
this.SUB_CATEGORY = SUB_CATEGORY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yadavendras on 30-10-2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class RowColumnGetterSetter {
|
||||||
|
|
||||||
|
int row, column;
|
||||||
|
|
||||||
|
public int getRow() {
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRow(int row) {
|
||||||
|
this.row = row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColumn() {
|
||||||
|
return column;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumn(int column) {
|
||||||
|
this.column = column;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,6 +28,10 @@ public class TableBean {
|
|||||||
public static String MAPPING_SUB_CATEGORY_IMAGE_ALLOW;
|
public static String MAPPING_SUB_CATEGORY_IMAGE_ALLOW;
|
||||||
public static String SKUGROUP_MASTER;
|
public static String SKUGROUP_MASTER;
|
||||||
|
|
||||||
|
//YSY
|
||||||
|
public static String MAPPING_CATEGORY_IMAGE_ALLOW;
|
||||||
|
public static String MAPPING_COUNTRYWISE_PLANOGRAM;
|
||||||
|
|
||||||
|
|
||||||
public static String getAdditionalDisplay() {
|
public static String getAdditionalDisplay() {
|
||||||
return ADDITIONAL_DISPLAY;
|
return ADDITIONAL_DISPLAY;
|
||||||
@@ -197,4 +201,20 @@ public class TableBean {
|
|||||||
public static void setSkugroupMaster(String skugroupMaster) {
|
public static void setSkugroupMaster(String skugroupMaster) {
|
||||||
SKUGROUP_MASTER = skugroupMaster;
|
SKUGROUP_MASTER = skugroupMaster;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getMappingCategoryImageAllow() {
|
||||||
|
return MAPPING_CATEGORY_IMAGE_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMappingCategoryImageAllow(String mappingCategoryImageAllow) {
|
||||||
|
MAPPING_CATEGORY_IMAGE_ALLOW = mappingCategoryImageAllow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getMappingCountrywisePlanogram() {
|
||||||
|
return MAPPING_COUNTRYWISE_PLANOGRAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMappingCountrywisePlanogram(String mappingCountrywisePlanogram) {
|
||||||
|
MAPPING_COUNTRYWISE_PLANOGRAM = mappingCountrywisePlanogram;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ 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.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramCountrywiseGetterSetter;
|
||||||
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.MappingSubCategoryImageAllowGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||||
@@ -856,6 +858,46 @@ public class XMLHandlers {
|
|||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MAPPING_CATEGORY_IMAGE_ALLOW
|
||||||
|
public static MappingCategoryImageAllowGetterSetter mappingCategoryImageAllowXMLHandler(XmlPullParser xpp, int eventType) {
|
||||||
|
MappingCategoryImageAllowGetterSetter st = new MappingCategoryImageAllowGetterSetter();
|
||||||
|
|
||||||
|
try {
|
||||||
|
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||||
|
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||||
|
|
||||||
|
if (xpp.getName().equals("META_DATA")) {
|
||||||
|
st.setTable_MAPPING_CATEGORY_IMAGE_ALLOW(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("COUNTRY_ID")) {
|
||||||
|
st.setCOUNTRY_ID(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("CATEGORY_ID")) {
|
||||||
|
st.setCATEGORY_ID(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("IMAGE1_ALLOW")) {
|
||||||
|
st.setIMAGE1_ALLOW(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("IMAGE2_ALLOW")) {
|
||||||
|
st.setIMAGE2_ALLOW(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("IMAGE3_ALLOW")) {
|
||||||
|
st.setIMAGE3_ALLOW(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("IMAGE4_ALLOW")) {
|
||||||
|
st.setIMAGE4_ALLOW(xpp.nextText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xpp.next();
|
||||||
|
}
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return st;
|
||||||
|
}
|
||||||
|
|
||||||
//SKUGROUP_MASTER
|
//SKUGROUP_MASTER
|
||||||
public static SkuGroupMasterGetterSetter skuGroupMasterXMLHandler(XmlPullParser xpp, int eventType) {
|
public static SkuGroupMasterGetterSetter skuGroupMasterXMLHandler(XmlPullParser xpp, int eventType) {
|
||||||
SkuGroupMasterGetterSetter st = new SkuGroupMasterGetterSetter();
|
SkuGroupMasterGetterSetter st = new SkuGroupMasterGetterSetter();
|
||||||
@@ -893,4 +935,35 @@ public class XMLHandlers {
|
|||||||
}
|
}
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MAPPING_COUNTRYWISE_PLANOGRAM
|
||||||
|
public static MappingPlanogramCountrywiseGetterSetter MAPPING_COUNTRYWISE_PLANOGRAM_XMLHandler(XmlPullParser xpp, int eventType) {
|
||||||
|
MappingPlanogramCountrywiseGetterSetter st = new MappingPlanogramCountrywiseGetterSetter();
|
||||||
|
|
||||||
|
try {
|
||||||
|
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||||
|
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||||
|
|
||||||
|
if (xpp.getName().equals("META_DATA")) {
|
||||||
|
st.setTable_MAPPING_COUNTRYWISE_PLANOGRAM(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("COUNTRY_ID")) {
|
||||||
|
st.setCOUNTRY_ID(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("FILE_PATH")) {
|
||||||
|
st.setFILE_PATH(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("PLANOGRAM_URL")) {
|
||||||
|
st.setPLANOGRAM_URL(xpp.nextText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xpp.next();
|
||||||
|
}
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return st;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<include layout="@layout/content_category_picture" />
|
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -31,4 +29,6 @@
|
|||||||
android:layout_margin="@dimen/fab_margin"
|
android:layout_margin="@dimen/fab_margin"
|
||||||
app:srcCompat="@drawable/save_icon" />
|
app:srcCompat="@drawable/save_icon" />
|
||||||
|
|
||||||
|
<include layout="@layout/content_category_picture" />
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.PlanogramPDFActivity">
|
||||||
|
|
||||||
|
<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_planogram_pdf" />
|
||||||
|
|
||||||
|
<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="@mipmap/download_grey" />
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:background="@drawable/camera_orange_star_green" />
|
android:background="@mipmap/camera_orange" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout 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"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.PlanogramPDFActivity"
|
||||||
|
tools:showIn="@layout/activity_planogram_pdf">
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:paddingBottom="20dp"
|
android:paddingBottom="20dp"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:text="@string/uploaddata"
|
android:text="@string/download_data"
|
||||||
android:textSize="@dimen/text_size_small" />
|
android:textSize="@dimen/text_size_small" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<?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="fill_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:layout_width="300dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
card_view:cardBackgroundColor="@color/colorPrimary"
|
||||||
|
card_view:cardCornerRadius="10dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/text_size_normal"
|
||||||
|
android:text="@string/select_option"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_centerInParent="true">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_edit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/edit"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:id="@+id/btn_delete"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/delete"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -24,6 +24,11 @@
|
|||||||
android:icon="@drawable/ic_date_range_black"
|
android:icon="@drawable/ic_date_range_black"
|
||||||
android:title="@string/future_route_plan" />
|
android:title="@string/future_route_plan" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_planogram"
|
||||||
|
android:icon="@mipmap/ic_view_quilt_black_48dp"
|
||||||
|
android:title="@string/category_performance_PLANOGRAM" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_exit"
|
android:id="@+id/nav_exit"
|
||||||
android:icon="@mipmap/exit_grey"
|
android:icon="@mipmap/exit_grey"
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 140 B |
@@ -65,7 +65,7 @@
|
|||||||
<string name="menu_setting">Settings</string>
|
<string name="menu_setting">Settings</string>
|
||||||
<string name="menu_services">Services</string>
|
<string name="menu_services">Services</string>
|
||||||
|
|
||||||
<string name="title_activity_t2_pcompliance">T2P - Monthly Visibility</string>
|
<string name="title_activity_t2_pcompliance">Visibility/T2P</string>
|
||||||
|
|
||||||
<!--Gagan start code-->
|
<!--Gagan start code-->
|
||||||
<string name="title_activity_category_list">Category List</string>
|
<string name="title_activity_category_list">Category List</string>
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
<string name="daily_data_menu_msl_availability">SKU Availability</string>
|
<string name="daily_data_menu_msl_availability">SKU Availability</string>
|
||||||
<string name="daily_data_menu_stock_facing">Stock and Facing</string>
|
<string name="daily_data_menu_stock_facing">Stock and Facing</string>
|
||||||
<string name="daily_data_menu_t2p">T2P - Monthly Visibility</string>
|
<string name="daily_data_menu_t2p">Visibility/T2P</string>
|
||||||
<string name="daily_data_menu_additional_visibility">Additional Visibility</string>
|
<string name="daily_data_menu_additional_visibility">Additional Visibility</string>
|
||||||
<string name="daily_data_menu_promo_compliance">Promo Compliance</string>
|
<string name="daily_data_menu_promo_compliance">Promo Compliance</string>
|
||||||
<string name="daily_data_menu_competition_tracking">Competition Visibility</string>
|
<string name="daily_data_menu_competition_tracking">Competition Visibility</string>
|
||||||
@@ -225,6 +225,9 @@
|
|||||||
<string name="export_database">Export Database</string>
|
<string name="export_database">Export Database</string>
|
||||||
<string name="data_exported_successfully">Database Exported Successfully</string>
|
<string name="data_exported_successfully">Database Exported Successfully</string>
|
||||||
|
|
||||||
|
<string name="databasexported">Database Exported And Uploaded Successfully</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="uploadeddata">Uploaded Data</string>
|
<string name="uploadeddata">Uploaded Data</string>
|
||||||
|
|
||||||
<string name="previous_data_upload">Please Upload Previous Data First</string>
|
<string name="previous_data_upload">Please Upload Previous Data First</string>
|
||||||
@@ -322,6 +325,9 @@
|
|||||||
<string name="enter_facing">Enter Facing</string>
|
<string name="enter_facing">Enter Facing</string>
|
||||||
<string name="please_facing">Please fill Facing</string>
|
<string name="please_facing">Please fill Facing</string>
|
||||||
<string name="please_add_subgroup_facing">Please add atleast one Sub Group to every row</string>
|
<string name="please_add_subgroup_facing">Please add atleast one Sub Group to every row</string>
|
||||||
|
<string name="edit">Edit</string>
|
||||||
|
<string name="select_option">Select an option</string>
|
||||||
|
<string name="title_activity_planogram_pdf">Planogram Document</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user