Merge pull request #32 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GG_Checkout_Image
Gg checkout image
This commit is contained in:
@@ -182,10 +182,17 @@
|
|||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.CategoryPicture"
|
android:name=".dailyentry.CategoryPicture"
|
||||||
android:label="@string/title_activity_category_picture"
|
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_category_picture"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"></activity>
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.StoreCheckoutImageActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="@string/title_activity_store_checkout_image"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -630,22 +630,18 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
|
|
||||||
public void updateCheckoutStatus(String id, String status) {
|
public void updateCheckoutStatus(String id, String status) {
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
ContentValues values1 = new ContentValues();
|
ContentValues values1 = new ContentValues();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
values.put("CHECKOUT_STATUS", status);
|
values.put("CHECKOUT_STATUS", status);
|
||||||
values1.put(CommonString.KEY_COVERAGE_STATUS, status);
|
values1.put(CommonString.KEY_COVERAGE_STATUS, status);
|
||||||
|
|
||||||
db.update(CommonString.TABLE_COVERAGE_DATA, values1, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
db.update(CommonString.TABLE_COVERAGE_DATA, values1, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||||
db.update(CommonString.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
db.update(CommonString.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
Log.e("Exception", "checkOut Status" + ex.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -786,6 +782,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
sb.setRemark((((dbcursor.getString(dbcursor
|
sb.setRemark((((dbcursor.getString(dbcursor
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))))));
|
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))))));
|
||||||
}
|
}
|
||||||
|
sb.setCheckOut_Image(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_CHECKOUT_IMAGE)));
|
||||||
|
|
||||||
|
|
||||||
list.add(sb);
|
list.add(sb);
|
||||||
dbcursor.moveToNext();
|
dbcursor.moveToNext();
|
||||||
@@ -1403,13 +1401,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long InsertCoverageData(CoverageBean data) {
|
public long InsertCoverageData(CoverageBean data) {
|
||||||
|
|
||||||
//db.delete(CommonString1.TABLE_COVERAGE_DATA, "STORE_ID" + "='" + data.getStoreId() + "'", null);
|
//db.delete(CommonString1.TABLE_COVERAGE_DATA, "STORE_ID" + "='" + data.getStoreId() + "'", null);
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
values.put(CommonString.KEY_STORE_ID, data.getStoreId());
|
values.put(CommonString.KEY_STORE_ID, data.getStoreId());
|
||||||
values.put(CommonString.KEY_USER_ID, data.getUserId());
|
values.put(CommonString.KEY_USER_ID, data.getUserId());
|
||||||
values.put(CommonString.KEY_IN_TIME, data.getInTime());
|
values.put(CommonString.KEY_IN_TIME, data.getInTime());
|
||||||
@@ -1425,6 +1420,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
||||||
values.put(CommonString.KEY_REASON, data.getReason());
|
values.put(CommonString.KEY_REASON, data.getReason());
|
||||||
values.put(CommonString.KEY_GEO_TAG, data.getGEO_TAG());
|
values.put(CommonString.KEY_GEO_TAG, data.getGEO_TAG());
|
||||||
|
values.put(CommonString.KEY_CHECKOUT_IMAGE, data.getCheckOut_Image());
|
||||||
|
|
||||||
return db.insert(CommonString.TABLE_COVERAGE_DATA, null, values);
|
return db.insert(CommonString.TABLE_COVERAGE_DATA, null, values);
|
||||||
|
|
||||||
@@ -3182,21 +3178,18 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//update out time
|
//update out time
|
||||||
public void updateCheckoutOuttime(String id, String out_time, String status) {
|
public void updateCheckoutOuttime(String id, String out_time, String status, String checkOutImagePath) {
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
values.put(CommonString.KEY_OUT_TIME, out_time);
|
values.put(CommonString.KEY_OUT_TIME, out_time);
|
||||||
values.put(CommonString.KEY_COVERAGE_STATUS, status);
|
values.put(CommonString.KEY_COVERAGE_STATUS, status);
|
||||||
|
values.put(CommonString.KEY_CHECKOUT_IMAGE, checkOutImagePath);
|
||||||
|
|
||||||
db.update(CommonString.TABLE_COVERAGE_DATA, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
db.update(CommonString.TABLE_COVERAGE_DATA, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception in ", "checkOutTime! " + ex.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public class CommonString {
|
|||||||
public static final String KEY_REASON_ID = "REASON_ID";
|
public static final String KEY_REASON_ID = "REASON_ID";
|
||||||
public static final String KEY_REASON = "REASON";
|
public static final String KEY_REASON = "REASON";
|
||||||
public static final String KEY_COVERAGE_REMARK = "REMARK";
|
public static final String KEY_COVERAGE_REMARK = "REMARK";
|
||||||
|
public static final String KEY_CHECKOUT_IMAGE = "Checkout_Image";
|
||||||
public static final String KEY_IMAGE = "IMAGE";
|
public static final String KEY_IMAGE = "IMAGE";
|
||||||
public static final String KEY_IMAGE1 = "IMAGE1";
|
public static final String KEY_IMAGE1 = "IMAGE1";
|
||||||
public static final String KEY_IMAGE2 = "IMAGE2";
|
public static final String KEY_IMAGE2 = "IMAGE2";
|
||||||
@@ -126,7 +127,6 @@ public class CommonString {
|
|||||||
+ METHOD_UPLOAD_STOCK_XML_DATA;
|
+ METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static final String METHOD_UPLOAD_ASSET = "Upload_Stock_Availiablity_V1";
|
public static final String METHOD_UPLOAD_ASSET = "Upload_Stock_Availiablity_V1";
|
||||||
public static final String METHOD_Get_DR_POSM_IMAGES = "GetImageNew";
|
public static final String METHOD_Get_DR_POSM_IMAGES = "GetImageNew";
|
||||||
public static final String SOAP_ACTION_Get_DR_POSM_IMAGES = "http://tempuri.org/"
|
public static final String SOAP_ACTION_Get_DR_POSM_IMAGES = "http://tempuri.org/"
|
||||||
@@ -135,7 +135,7 @@ public class CommonString {
|
|||||||
public static final String SOAP_ACTION_DR_STORE_IMAGES_GEO = "http://tempuri.org/"
|
public static final String SOAP_ACTION_DR_STORE_IMAGES_GEO = "http://tempuri.org/"
|
||||||
+ METHOD_Get_DR_STORE_IMAGES_GEO;
|
+ METHOD_Get_DR_STORE_IMAGES_GEO;
|
||||||
|
|
||||||
public static final String METHOD_UPLOAD_COVERAGE = "UPLOAD_COVERAGE";
|
public static final String METHOD_UPLOAD_COVERAGE = "UPLOAD_COVERAGENEW";
|
||||||
|
|
||||||
public static final String METHOD_UPLOAD_COVERAGE_STATUS = "UploadCoverage_Status";
|
public static final String METHOD_UPLOAD_COVERAGE_STATUS = "UploadCoverage_Status";
|
||||||
|
|
||||||
@@ -163,16 +163,23 @@ public class CommonString {
|
|||||||
public static final String TABLE_COVERAGE_DATA = "COVERAGE_DATA";
|
public static final String TABLE_COVERAGE_DATA = "COVERAGE_DATA";
|
||||||
|
|
||||||
|
|
||||||
public static final String CREATE_TABLE_COVERAGE_DATA = "CREATE TABLE IF NOT EXISTS "
|
public static final String CREATE_TABLE_COVERAGE_DATA = "CREATE TABLE IF NOT EXISTS " + TABLE_COVERAGE_DATA
|
||||||
+ TABLE_COVERAGE_DATA + " (" + KEY_ID
|
+ " ("
|
||||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ," + KEY_STORE_ID
|
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
+ " VARCHAR,USER_ID VARCHAR, " + KEY_IN_TIME + " VARCHAR,"
|
+ KEY_STORE_ID + " VARCHAR,USER_ID VARCHAR, "
|
||||||
+ KEY_OUT_TIME + " VARCHAR," + KEY_VISIT_DATE + " VARCHAR,"
|
+ KEY_IN_TIME + " VARCHAR,"
|
||||||
+ KEY_LATITUDE + " VARCHAR," + KEY_LONGITUDE + " VARCHAR," + KEY_MERCHANDISER_ID + " VARCHAR,"
|
+ KEY_OUT_TIME + " VARCHAR,"
|
||||||
+ KEY_COVERAGE_STATUS + " VARCHAR," + KEY_IMAGE + " VARCHAR,"
|
+ KEY_VISIT_DATE + " VARCHAR,"
|
||||||
|
+ KEY_LATITUDE + " VARCHAR,"
|
||||||
|
+ KEY_LONGITUDE + " VARCHAR,"
|
||||||
|
+ KEY_MERCHANDISER_ID + " VARCHAR,"
|
||||||
|
+ KEY_COVERAGE_STATUS + " VARCHAR,"
|
||||||
|
+ KEY_IMAGE + " VARCHAR,"
|
||||||
+ KEY_GEO_TAG + " VARCHAR,"
|
+ KEY_GEO_TAG + " VARCHAR,"
|
||||||
+ KEY_REASON_ID + " VARCHAR," + KEY_COVERAGE_REMARK
|
+ KEY_REASON_ID + " VARCHAR,"
|
||||||
+ " VARCHAR," + KEY_REASON + " VARCHAR)";
|
+ KEY_COVERAGE_REMARK + " VARCHAR,"
|
||||||
|
+ KEY_CHECKOUT_IMAGE + " VARCHAR,"
|
||||||
|
+ KEY_REASON + " VARCHAR)";
|
||||||
|
|
||||||
|
|
||||||
public static final String CREATE_TABLE_STORE_GEOTAGGING = "CREATE TABLE IF NOT EXISTS "
|
public static final String CREATE_TABLE_STORE_GEOTAGGING = "CREATE TABLE IF NOT EXISTS "
|
||||||
@@ -678,9 +685,6 @@ public class CommonString {
|
|||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static final String TABLE_INSERT_CATEGORY_PICTURE = "Stock_CATEGORY_PICTURE";
|
public static final String TABLE_INSERT_CATEGORY_PICTURE = "Stock_CATEGORY_PICTURE";
|
||||||
|
|
||||||
public static final String CREATE_TABLE_INSERT_CATEGORY_PICTURE = "CREATE TABLE IF NOT EXISTS "
|
public static final String CREATE_TABLE_INSERT_CATEGORY_PICTURE = "CREATE TABLE IF NOT EXISTS "
|
||||||
@@ -711,7 +715,6 @@ public class CommonString {
|
|||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static final String TABLE_INSERT_CATEGORY_PICTURE_LIST = "Stock_CATEGORY_PICTURE_LIST";
|
public static final String TABLE_INSERT_CATEGORY_PICTURE_LIST = "Stock_CATEGORY_PICTURE_LIST";
|
||||||
|
|
||||||
public static final String CREATE_TABLE_INSERT_CATEGORY_PICTURE_LIST = "CREATE TABLE IF NOT EXISTS "
|
public static final String CREATE_TABLE_INSERT_CATEGORY_PICTURE_LIST = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
private TextView percentage, message;
|
private TextView percentage, message;
|
||||||
private String username, visit_date, store_id, store_intime;;
|
private String username, visit_date, store_id, store_intime;
|
||||||
private Data data;
|
private Data data;
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
CoverageBean coverageBean;
|
CoverageBean coverageBean;
|
||||||
|
|
||||||
String lat,lon;
|
String lat, lon, checkOutImagePath = "";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -69,6 +69,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
updateResources(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);
|
||||||
|
|
||||||
coverageBean = db.getCoverageSpecificData(visit_date, store_id);
|
coverageBean = db.getCoverageSpecificData(visit_date, store_id);
|
||||||
lat = coverageBean.getLatitude();
|
lat = coverageBean.getLatitude();
|
||||||
@@ -100,7 +101,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onPreExecute();
|
super.onPreExecute();
|
||||||
|
|
||||||
dialog = new Dialog(context);
|
dialog = new Dialog(context);
|
||||||
@@ -111,16 +111,12 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||||
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
||||||
message = (TextView) dialog.findViewById(R.id.message);
|
message = (TextView) dialog.findViewById(R.id.message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(Void... params) {
|
protected String doInBackground(Void... params) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
//String result = "";
|
//String result = "";
|
||||||
data = new Data();
|
data = new Data();
|
||||||
|
|
||||||
@@ -128,72 +124,52 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
data.name = "Checked out Data Uploading";
|
data.name = "Checked out Data Uploading";
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
String onXML = "[STORE_CHECK_OUT_STATUS][USER_ID]"
|
String onXML =
|
||||||
+ username
|
"[STORE_CHECK_OUT_STATUS]"
|
||||||
+ "[/USER_ID]" + "[STORE_ID]"
|
+ "[USER_ID]" + username + "[/USER_ID]"
|
||||||
+ store_id
|
+ "[STORE_ID]" + store_id + "[/STORE_ID]"
|
||||||
+ "[/STORE_ID][LATITUDE]"
|
+ "[LATITUDE]" + lat + "[/LATITUDE]"
|
||||||
+ lat
|
+ "[LOGITUDE]" + lon + "[/LOGITUDE]"
|
||||||
+ "[/LATITUDE][LOGITUDE]"
|
+ "[CHECKOUT_DATE]" + visit_date + "[/CHECKOUT_DATE]"
|
||||||
+ lon
|
+ "[CHECK_OUTTIME]" + getCurrentTime() + "[/CHECK_OUTTIME]"
|
||||||
+ "[/LOGITUDE][CHECKOUT_DATE]"
|
+ "[CHECK_INTIME]" + coverageBean.getInTime() + "[/CHECK_INTIME]"
|
||||||
+ visit_date
|
+ "[CREATED_BY]" + username + "[/CREATED_BY]"
|
||||||
+ "[/CHECKOUT_DATE][CHECK_OUTTIME]"
|
+ "[/STORE_CHECK_OUT_STATUS]";
|
||||||
+ getCurrentTime()
|
|
||||||
+ "[/CHECK_OUTTIME][CHECK_INTIME]"
|
|
||||||
+ coverageBean.getInTime()
|
|
||||||
+ "[/CHECK_INTIME][CREATED_BY]"
|
|
||||||
+ username
|
|
||||||
+ "[/CREATED_BY][/STORE_CHECK_OUT_STATUS]";
|
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + onXML
|
final String sos_xml = "[DATA]" + onXML + "[/DATA]";
|
||||||
+ "[/DATA]";
|
|
||||||
|
|
||||||
SoapObject request = new SoapObject(
|
SoapObject request = new SoapObject(CommonString.NAMESPACE, "Upload_Store_ChecOut_Status");
|
||||||
CommonString.NAMESPACE,
|
|
||||||
"Upload_Store_ChecOut_Status");
|
|
||||||
request.addProperty("onXML", sos_xml);
|
request.addProperty("onXML", sos_xml);
|
||||||
/*request.addProperty("KEYS", "CHECKOUT_STATUS");
|
/*request.addProperty("KEYS", "CHECKOUT_STATUS");
|
||||||
request.addProperty("USERNAME", username);*/
|
request.addProperty("USERNAME", username);*/
|
||||||
//request.addProperty("MID", mid);
|
//request.addProperty("MID", mid);
|
||||||
|
|
||||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
SoapEnvelope.VER11);
|
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
CommonString.URL);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + "Upload_Store_ChecOut_Status", envelope);
|
||||||
|
|
||||||
androidHttpTransport.call(
|
|
||||||
CommonString.SOAP_ACTION+"Upload_Store_ChecOut_Status",
|
|
||||||
envelope);
|
|
||||||
Object result = (Object) envelope.getResponse();
|
Object result = (Object) envelope.getResponse();
|
||||||
|
|
||||||
if (!result.toString().equalsIgnoreCase(
|
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
CommonString.KEY_SUCCESS)) {
|
|
||||||
return "Upload_Store_ChecOut_Status";
|
return "Upload_Store_ChecOut_Status";
|
||||||
}
|
}
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_NO_DATA)) {
|
||||||
if (result.toString().equalsIgnoreCase(
|
|
||||||
CommonString.KEY_NO_DATA)) {
|
|
||||||
return "Upload_Store_ChecOut_Status";
|
return "Upload_Store_ChecOut_Status";
|
||||||
}
|
}
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||||
if (result.toString().equalsIgnoreCase(
|
|
||||||
CommonString.KEY_FAILURE)) {
|
|
||||||
return "Upload_Store_ChecOut_Status";
|
return "Upload_Store_ChecOut_Status";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
data.value = 100;
|
data.value = 100;
|
||||||
data.name = "Checkout Done";
|
data.name = "Checkout Done";
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
if (result.toString()
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
|
||||||
|
|
||||||
db.updateCheckoutOuttime(store_id, getCurrentTime(),CommonString.KEY_Y);
|
db.updateCheckoutOuttime(store_id, getCurrentTime(), 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, "");
|
||||||
@@ -213,15 +189,9 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
db.updateCheckoutStatus(store_id, CommonString.KEY_Y);
|
db.updateCheckoutStatus(store_id, CommonString.KEY_Y);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||||
|
|
||||||
|
|
||||||
if (result.toString().equalsIgnoreCase(
|
|
||||||
CommonString.KEY_FALSE)) {
|
|
||||||
return "Upload_Store_ChecOut_Status";
|
return "Upload_Store_ChecOut_Status";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return CommonString.KEY_SUCCESS;
|
return CommonString.KEY_SUCCESS;
|
||||||
|
|
||||||
@@ -238,13 +208,11 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
// counter++;
|
// counter++;
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
/*
|
/*
|
||||||
@@ -256,9 +224,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
@@ -293,8 +259,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
}
|
} else if (!result.equals("")) {
|
||||||
else if (!result.equals("")) {
|
|
||||||
/*AlertMessage message = new AlertMessage(
|
/*AlertMessage message = new AlertMessage(
|
||||||
CheckOutStoreActivity.this, CommonString1.ERROR + result, "success", null);
|
CheckOutStoreActivity.this, CommonString1.ERROR + result, "success", null);
|
||||||
message.showMessage();*/
|
message.showMessage();*/
|
||||||
@@ -319,11 +284,9 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
private static boolean updateResources(Context context, String language) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String lang;
|
String lang;
|
||||||
|
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
||||||
|
|||||||
+644
@@ -0,0 +1,644 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.android.gms.common.ConnectionResult;
|
||||||
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
|
import com.google.android.gms.location.LocationServices;
|
||||||
|
|
||||||
|
import org.ksoap2.SoapEnvelope;
|
||||||
|
import org.ksoap2.serialization.SoapObject;
|
||||||
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
|
import org.ksoap2.transport.HttpTransportSE;
|
||||||
|
import org.xml.sax.InputSource;
|
||||||
|
import org.xml.sax.XMLReader;
|
||||||
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InterruptedIOException;
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.SocketTimeoutException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import javax.xml.parsers.SAXParser;
|
||||||
|
import javax.xml.parsers.SAXParserFactory;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ashishc on 31-05-2016.
|
||||||
|
*/
|
||||||
|
public class StoreCheckoutImageActivity extends AppCompatActivity implements View.OnClickListener,
|
||||||
|
GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
|
||||||
|
|
||||||
|
String gallery_package = "";
|
||||||
|
Uri outputFileUri;
|
||||||
|
|
||||||
|
ImageView img_cam, img_clicked;
|
||||||
|
Button btn_save;
|
||||||
|
private Dialog dialog;
|
||||||
|
private TextView percentage, message;
|
||||||
|
private ProgressBar pb;
|
||||||
|
private FailureGetterSetter failureGetterSetter = null;
|
||||||
|
String _pathforcheck, _path, str;
|
||||||
|
|
||||||
|
String store_id, visit_date, username, intime, date, _UserId;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
AlertDialog alert;
|
||||||
|
String img_str, strflag;
|
||||||
|
private GSKOrangeDB database;
|
||||||
|
|
||||||
|
String lat, lon;
|
||||||
|
GoogleApiClient mGoogleApiClient;
|
||||||
|
ArrayList<CoverageBean> coverage_list;
|
||||||
|
Toolbar toolbar;
|
||||||
|
boolean ResultFlag = true;
|
||||||
|
String checkOutStore_id = "";
|
||||||
|
ArrayList<CoverageBean> coverage = new ArrayList<CoverageBean>();
|
||||||
|
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_store_checkout_image);
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
||||||
|
img_clicked = (ImageView) findViewById(R.id.img_cam_selfie);
|
||||||
|
|
||||||
|
btn_save = (Button) findViewById(R.id.btn_save_selfie);
|
||||||
|
|
||||||
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
|
||||||
|
checkOutStore_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
|
|
||||||
|
str = CommonString.FILE_PATH;
|
||||||
|
|
||||||
|
database = new GSKOrangeDB(this);
|
||||||
|
database.open();
|
||||||
|
|
||||||
|
coverage_list = database.getCoverageData(date);
|
||||||
|
|
||||||
|
img_cam.setOnClickListener(this);
|
||||||
|
img_clicked.setOnClickListener(this);
|
||||||
|
btn_save.setOnClickListener(this);
|
||||||
|
|
||||||
|
// Create an instance of GoogleAPIClient.
|
||||||
|
if (mGoogleApiClient == null) {
|
||||||
|
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
||||||
|
.addConnectionCallbacks(this)
|
||||||
|
.addOnConnectionFailedListener(this)
|
||||||
|
.addApi(LocationServices.API)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= 23 &&
|
||||||
|
ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
||||||
|
ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
// NavUtils.navigateUpFromSameTask(this);
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
||||||
|
startActivity(i);*/
|
||||||
|
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
int id = v.getId();
|
||||||
|
|
||||||
|
switch (id) {
|
||||||
|
case R.id.img_cam_selfie:
|
||||||
|
|
||||||
|
_pathforcheck = checkOutStore_id + "CHK_SI_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||||
|
intime = getCurrentTime();
|
||||||
|
|
||||||
|
startCameraActivity();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.btn_save_selfie:
|
||||||
|
|
||||||
|
if (img_str != null) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
||||||
|
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||||
|
|
||||||
|
Intent i = new Intent(StoreCheckoutImageActivity.this, CheckoutActivity.class);
|
||||||
|
i.putExtra(CommonString.KEY_STORE_ID, checkOutStore_id);
|
||||||
|
i.putExtra(CommonString.KEY_CHECKOUT_IMAGE, img_str);
|
||||||
|
startActivity(i);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getApplicationContext(), getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void startCameraActivity() {
|
||||||
|
try {
|
||||||
|
/*Log.i("MakeMachine", "startCameraActivity()");
|
||||||
|
File file = new File(_path);
|
||||||
|
Uri outputFileUri = Uri.fromFile(file);
|
||||||
|
|
||||||
|
Intent intent = new Intent(
|
||||||
|
MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
|
||||||
|
startActivityForResult(intent, 0);*/
|
||||||
|
|
||||||
|
Log.i("MakeMachine", "startCameraActivity()");
|
||||||
|
File file = new File(_path);
|
||||||
|
outputFileUri = Uri.fromFile(file);
|
||||||
|
|
||||||
|
String defaultCameraPackage = "";
|
||||||
|
final PackageManager packageManager = getPackageManager();
|
||||||
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
|
for (int n = 0; n < list.size(); n++) {
|
||||||
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
|
Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||||
|
Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||||
|
|
||||||
|
//temp value in case camera is gallery app above jellybean
|
||||||
|
String packag = list.get(n).loadLabel(packageManager).toString();
|
||||||
|
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||||
|
gallery_package = list.get(n).packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//com.android.gallery3d
|
||||||
|
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(defaultCameraPackage);
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(gallery_package);
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
Log.i("MakeMachine", "resultCode: " + resultCode);
|
||||||
|
switch (resultCode) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
Log.i("MakeMachine", "User cancelled");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case -1:
|
||||||
|
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||||
|
if (new File(str + _pathforcheck).exists()) {
|
||||||
|
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
||||||
|
img_cam.setImageBitmap(bmp);
|
||||||
|
|
||||||
|
img_clicked.setVisibility(View.GONE);
|
||||||
|
img_cam.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
img_str = _pathforcheck;
|
||||||
|
_pathforcheck = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrentTime() {
|
||||||
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
|
String cdate = formatter.format(m_cal.getTime());
|
||||||
|
|
||||||
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConnected(Bundle bundle) {
|
||||||
|
Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||||
|
if (mLastLocation != null) {
|
||||||
|
lat = String.valueOf(mLastLocation.getLatitude());
|
||||||
|
lon = String.valueOf(mLastLocation.getLongitude());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConnectionSuspended(int i) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConnectionFailed(ConnectionResult connectionResult) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
toolbar.setTitle(R.string.title_activity_store_checkout_image);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onStart() {
|
||||||
|
mGoogleApiClient.connect();
|
||||||
|
super.onStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onStop() {
|
||||||
|
mGoogleApiClient.disconnect();
|
||||||
|
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_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> {
|
||||||
|
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
GeoTagUpload(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPreExecute() {
|
||||||
|
|
||||||
|
super.onPreExecute();
|
||||||
|
|
||||||
|
dialog = new Dialog(context);
|
||||||
|
dialog.setContentView(R.layout.custom);
|
||||||
|
dialog.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
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) {
|
||||||
|
try {
|
||||||
|
GSKOrangeDB db = new GSKOrangeDB(StoreCheckoutImageActivity.this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
coverage = db.getCoverageWithStoreID_Data(store_id);
|
||||||
|
|
||||||
|
// uploading Geotag
|
||||||
|
|
||||||
|
SAXParserFactory saxPF = SAXParserFactory.newInstance();
|
||||||
|
SAXParser saxP = saxPF.newSAXParser();
|
||||||
|
XMLReader xmlR = saxP.getXMLReader();
|
||||||
|
|
||||||
|
|
||||||
|
String current_xml = "";
|
||||||
|
|
||||||
|
if (coverage.size() > 0) {
|
||||||
|
|
||||||
|
for (int i = 0; i < coverage.size(); i++) {
|
||||||
|
|
||||||
|
|
||||||
|
String onXML = "[Coverage_Intime][USER_ID]"
|
||||||
|
+ _UserId
|
||||||
|
+ "[/USER_ID]"
|
||||||
|
+ "[STORE_ID]"
|
||||||
|
+ coverage.get(i).getStoreId()
|
||||||
|
+ "[/STORE_ID]"
|
||||||
|
+ "[VISIT_DATE]"
|
||||||
|
+ coverage.get(i).getVisitDate()
|
||||||
|
+ "[/VISIT_DATE]"
|
||||||
|
+ "[IN_TIME]"
|
||||||
|
+ coverage.get(i).getInTime()
|
||||||
|
+ "[/IN_TIME]"
|
||||||
|
+ "[LATITUDE]"
|
||||||
|
+ coverage.get(i).getLatitude()
|
||||||
|
+ "[/LATITUDE]"
|
||||||
|
+ "[LONGITUDE ]"
|
||||||
|
+ coverage.get(i).getLongitude()
|
||||||
|
+ "[/LONGITUDE ]"
|
||||||
|
+ "[REASON_ID]"
|
||||||
|
+ coverage.get(i).getReasonid()
|
||||||
|
+ "[/REASON_ID]"
|
||||||
|
+ "[REMARK]"
|
||||||
|
+ coverage.get(i).getReason()
|
||||||
|
+ "[/REMARK][/Coverage_Intime]";
|
||||||
|
|
||||||
|
current_xml = current_xml + onXML;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
current_xml = "[DATA]" + current_xml
|
||||||
|
+ "[/DATA]";
|
||||||
|
|
||||||
|
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||||
|
CommonString.METHOD_UPLOAD_CURRENT_DATA);
|
||||||
|
//request.addProperty("MID", "0");
|
||||||
|
// request.addProperty("KEYS", "CURRENT_DATA");
|
||||||
|
// request.addProperty("USERNAME", username);
|
||||||
|
|
||||||
|
request.addProperty("onXML", current_xml);
|
||||||
|
|
||||||
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
||||||
|
SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||||
|
CommonString.URL);
|
||||||
|
androidHttpTransport.call(
|
||||||
|
CommonString.SOAP_ACTION_UPLOAD_CURRRENT_DATA, envelope);
|
||||||
|
Object result = (Object) envelope.getResponse();
|
||||||
|
|
||||||
|
if (result.toString().equalsIgnoreCase(
|
||||||
|
CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (result.toString().equalsIgnoreCase(
|
||||||
|
CommonString.KEY_FALSE)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_CURRENT_DATA;
|
||||||
|
}
|
||||||
|
|
||||||
|
// for failure
|
||||||
|
FailureXMLHandler failureXMLHandler = new FailureXMLHandler();
|
||||||
|
xmlR.setContentHandler(failureXMLHandler);
|
||||||
|
|
||||||
|
InputSource is = new InputSource();
|
||||||
|
is.setCharacterStream(new StringReader(result
|
||||||
|
.toString()));
|
||||||
|
xmlR.parse(is);
|
||||||
|
|
||||||
|
failureGetterSetter = failureXMLHandler
|
||||||
|
.getFailureGetterSetter();
|
||||||
|
|
||||||
|
if (failureGetterSetter.getStatus().equalsIgnoreCase(
|
||||||
|
CommonString.KEY_FAILURE)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_CURRENT_DATA + ","
|
||||||
|
+ failureGetterSetter.getErrorMsg();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return CommonString.KEY_SUCCESS;
|
||||||
|
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
|
||||||
|
ResultFlag = false;
|
||||||
|
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
|
||||||
|
} catch (SocketTimeoutException e) {
|
||||||
|
ResultFlag = false;
|
||||||
|
strflag = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
|
||||||
|
} catch (InterruptedIOException e) {
|
||||||
|
|
||||||
|
ResultFlag = false;
|
||||||
|
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
ResultFlag = false;
|
||||||
|
strflag = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
ResultFlag = false;
|
||||||
|
strflag = CommonString.MESSAGE_XmlPull;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
ResultFlag = false;
|
||||||
|
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ResultFlag) {
|
||||||
|
return CommonString.KEY_SUCCESS;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
return strflag;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostExecute(String result) {
|
||||||
|
super.onPostExecute(result);
|
||||||
|
|
||||||
|
dialog.dismiss();
|
||||||
|
|
||||||
|
if (result.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
dialog.dismiss();
|
||||||
|
|
||||||
|
Intent in = new Intent(StoreCheckoutImageActivity.this, StoreWisePerformanceActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
finish();
|
||||||
|
|
||||||
|
|
||||||
|
//showAlert(getString(R.string.data_downloaded_successfully));
|
||||||
|
} else {
|
||||||
|
|
||||||
|
GSKOrangeDB db = new GSKOrangeDB(StoreCheckoutImageActivity.this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
dialog.dismiss();
|
||||||
|
db.deleteTableWithStoreID(store_id);
|
||||||
|
|
||||||
|
showAlert(getString(R.string.datanotfound) + " " + result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showAlert(String str) {
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
||||||
|
builder.setTitle("Parinaam");
|
||||||
|
builder.setMessage(str).setCancelable(false)
|
||||||
|
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
|
||||||
|
finish();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -253,24 +253,17 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
|
||||||
}
|
} else if (coverage.get(i).getStatus().equalsIgnoreCase(CommonString.KEY_VALID)) {
|
||||||
|
|
||||||
else if(coverage.get(i).getStatus().equalsIgnoreCase(CommonString.KEY_VALID))
|
|
||||||
{
|
|
||||||
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
viewHolder.chkbtn.setVisibility(View.VISIBLE);
|
viewHolder.chkbtn.setVisibility(View.VISIBLE);
|
||||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
}
|
} else if (coverage.get(i).getStatus().equalsIgnoreCase(CommonString.KEY_INVALID)) {
|
||||||
else if(coverage.get(i).getStatus().equalsIgnoreCase(CommonString.KEY_INVALID)){
|
|
||||||
|
|
||||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||||
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.green));
|
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.green));
|
||||||
}
|
} 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);
|
||||||
@@ -280,8 +273,6 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if (coverage.get(i).getInTime() != null) {
|
/* if (coverage.get(i).getInTime() != null) {
|
||||||
@@ -333,9 +324,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
Snackbar.make(v, R.string.title_store_list_activity_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)) {
|
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)) {
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_already_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_already_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
}
|
} else if (checkleavestatus(store_id)) {
|
||||||
|
|
||||||
else if (checkleavestatus(store_id)) {
|
|
||||||
|
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_already_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_already_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
@@ -381,42 +370,33 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
viewHolder.chkbtn.setOnClickListener(new View.OnClickListener() {
|
viewHolder.chkbtn.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(
|
|
||||||
StoreListActivity.this);
|
|
||||||
builder.setMessage(R.string.wantcheckout)
|
builder.setMessage(R.string.wantcheckout)
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(R.string.ok,
|
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
new DialogInterface.OnClickListener() {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
public void onClick(
|
|
||||||
DialogInterface dialog, int id) {
|
|
||||||
if (CheckNetAvailability()) {
|
if (CheckNetAvailability()) {
|
||||||
|
/*Intent i = new Intent(StoreListActivity.this, CheckoutActivity.class);
|
||||||
|
|
||||||
Intent i = new Intent(StoreListActivity.this, CheckoutActivity.class);
|
|
||||||
|
|
||||||
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||||
|
startActivity(i);*/
|
||||||
|
|
||||||
|
Intent i = new Intent(StoreListActivity.this, StoreCheckoutImageActivity.class);
|
||||||
|
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
} else {
|
} else {
|
||||||
|
Snackbar.make(recyclerView, R.string.nonetwork, Snackbar.LENGTH_SHORT)
|
||||||
Snackbar.make(recyclerView, R.string.nonetwork, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.closed,
|
.setNegativeButton(R.string.closed, new DialogInterface.OnClickListener() {
|
||||||
new DialogInterface.OnClickListener() {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
public void onClick(
|
|
||||||
DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -525,8 +505,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||||
builder.setTitle(getResources().getString(R.string.dialog_title));
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
@@ -591,8 +570,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
|
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
|
Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
|
||||||
in.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
in.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
cdata.setImage(img_str);
|
cdata.setImage(img_str);
|
||||||
cdata.setRemark("");
|
cdata.setRemark("");
|
||||||
cdata.setStatus(CommonString.KEY_INVALID);
|
cdata.setStatus(CommonString.KEY_INVALID);
|
||||||
|
cdata.setCheckOut_Image("");
|
||||||
|
|
||||||
database.InsertCoverageData(cdata);
|
database.InsertCoverageData(cdata);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package cpm.com.gskmtorange.GetterSetter;
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
public class CoverageBean
|
public class CoverageBean {
|
||||||
{
|
|
||||||
protected int MID;
|
protected int MID;
|
||||||
protected String process_id;
|
protected String process_id;
|
||||||
|
|
||||||
@@ -14,6 +13,7 @@ public class CoverageBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected String GEO_TAG;
|
protected String GEO_TAG;
|
||||||
|
|
||||||
public String getProcess_id() {
|
public String getProcess_id() {
|
||||||
return process_id;
|
return process_id;
|
||||||
}
|
}
|
||||||
@@ -218,6 +218,14 @@ public class CoverageBean
|
|||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String CheckOut_Image = "";
|
||||||
|
|
||||||
|
|
||||||
|
public String getCheckOut_Image() {
|
||||||
|
return CheckOut_Image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckOut_Image(String checkOut_Image) {
|
||||||
|
CheckOut_Image = checkOut_Image;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-1
@@ -265,6 +265,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
+ "[REASON_ID]" + coverageList.get(i).getReasonid() + "[/REASON_ID]"
|
+ "[REASON_ID]" + coverageList.get(i).getReasonid() + "[/REASON_ID]"
|
||||||
+ "[REASON_REMARK]" + coverageList.get(i).getRemark() + "[/REASON_REMARK]"
|
+ "[REASON_REMARK]" + coverageList.get(i).getRemark() + "[/REASON_REMARK]"
|
||||||
+ "[CAMERA_ALLOWED]" + camera_allow + "[/CAMERA_ALLOWED]"
|
+ "[CAMERA_ALLOWED]" + camera_allow + "[/CAMERA_ALLOWED]"
|
||||||
|
+ "[CHECKOUT_IMAGE]" + coverageList.get(i).getCheckOut_Image() + "[/CHECKOUT_IMAGE]"
|
||||||
+ "[/USER_DATA]"
|
+ "[/USER_DATA]"
|
||||||
+ "[/DATA]";
|
+ "[/DATA]";
|
||||||
|
|
||||||
@@ -1541,6 +1542,33 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//CheckOut Store Image
|
||||||
|
if (coverageList.size() > 0) {
|
||||||
|
for (int i1 = 0; i1 < coverageList.size(); i1++) {
|
||||||
|
|
||||||
|
if (coverageList.get(i1).getCheckOut_Image() != null && !coverageList.get(i1).getCheckOut_Image().equals("")) {
|
||||||
|
if (new File(CommonString.FILE_PATH + coverageList.get(i1).getCheckOut_Image()).exists()) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
result = UploadImage(coverageList.get(i1).getCheckOut_Image(), "StoreImages");
|
||||||
|
|
||||||
|
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return "StoreImages";
|
||||||
|
}
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
message.setText("StoreImages Uploaded");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//T2p Images
|
//T2p Images
|
||||||
|
|
||||||
for (int m = 0; m < t2PGetterSetters.size(); m++) {
|
for (int m = 0; m < t2PGetterSetters.size(); m++) {
|
||||||
@@ -1685,7 +1713,6 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
private static boolean updateResources(Context context, String language) {
|
||||||
|
|
||||||
/*String lang;
|
/*String lang;
|
||||||
|
|||||||
@@ -269,6 +269,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
+ "[REASON_ID]" + coverageList.get(i).getReasonid() + "[/REASON_ID]"
|
+ "[REASON_ID]" + coverageList.get(i).getReasonid() + "[/REASON_ID]"
|
||||||
+ "[REASON_REMARK]" + coverageList.get(i).getRemark() + "[/REASON_REMARK]"
|
+ "[REASON_REMARK]" + coverageList.get(i).getRemark() + "[/REASON_REMARK]"
|
||||||
+ "[CAMERA_ALLOWED]" + camera_allow + "[/CAMERA_ALLOWED]"
|
+ "[CAMERA_ALLOWED]" + camera_allow + "[/CAMERA_ALLOWED]"
|
||||||
|
+ "[CHECKOUT_IMAGE]" + coverageList.get(i).getCheckOut_Image() + "[/CHECKOUT_IMAGE]"
|
||||||
+ "[/USER_DATA]"
|
+ "[/USER_DATA]"
|
||||||
+ "[/DATA]";
|
+ "[/DATA]";
|
||||||
|
|
||||||
@@ -1530,6 +1531,34 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//CheckOut Store Image
|
||||||
|
if (coverageList.size() > 0) {
|
||||||
|
for (int i1 = 0; i1 < coverageList.size(); i1++) {
|
||||||
|
|
||||||
|
if (coverageList.get(i1).getCheckOut_Image() != null && !coverageList.get(i1).getCheckOut_Image().equals("")) {
|
||||||
|
if (new File(CommonString.FILE_PATH + coverageList.get(i1).getCheckOut_Image()).exists()) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
result = UploadImage(coverageList.get(i1).getCheckOut_Image(), "StoreImages");
|
||||||
|
|
||||||
|
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return "StoreImages";
|
||||||
|
}
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
message.setText("StoreImages Uploaded");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//T2p Images
|
//T2p Images
|
||||||
|
|
||||||
for (int m = 0; m < t2PGetterSetters.size(); m++) {
|
for (int m = 0; m < t2PGetterSetters.size(); m++) {
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.StoreimageActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.NoActionBar.PopupOverlay" />
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/contentstore_checkout_image" />
|
||||||
|
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/grey_background"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
android:weightSum="10"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.StoreCheckoutImageActivity"
|
||||||
|
tools:showIn="@layout/activity_store_checkout_image">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:text="@string/store_checkout"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/store_entry_text_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- <RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imgloreal"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:src="@drawable/loreal"
|
||||||
|
android:layout_centerInParent="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>-->
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_weight="8"
|
||||||
|
card_view:cardBackgroundColor="@color/white"
|
||||||
|
card_view:cardCornerRadius="5dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rel_selfie"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_selfie"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_cam_selfie"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:background="@mipmap/camera_orange" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_save_selfie"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:text="@string/save"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/store_entry_text_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
android:layout_marginRight="2dp"
|
android:layout_marginRight="2dp"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
android:layout_weight="35"
|
android:layout_weight="35"
|
||||||
|
|
||||||
card_view:cardBackgroundColor="@color/colorOrange"
|
card_view:cardBackgroundColor="@color/colorOrange"
|
||||||
card_view:cardCornerRadius="15dp">
|
card_view:cardCornerRadius="15dp">
|
||||||
|
|
||||||
@@ -34,7 +33,6 @@
|
|||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_marginRight="6sp"
|
android:layout_marginRight="6sp"
|
||||||
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:paddingTop="25sp" />
|
android:paddingTop="25sp" />
|
||||||
|
|
||||||
@@ -66,10 +64,9 @@
|
|||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:focusable="false"
|
|
||||||
android:background="@mipmap/checkout"
|
android:background="@mipmap/checkout"
|
||||||
android:visibility="gone"
|
android:focusable="false"
|
||||||
/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView2"
|
||||||
@@ -78,8 +75,7 @@
|
|||||||
android:layout_alignBottom="@+id/storelistviewxml_storeico"
|
android:layout_alignBottom="@+id/storelistviewxml_storeico"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
|
|
||||||
android:visibility="gone"
|
android:visibility="gone" />
|
||||||
/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</android.support.v7.widget.CardView>
|
</android.support.v7.widget.CardView>
|
||||||
|
|||||||
@@ -294,6 +294,7 @@
|
|||||||
<string name="stock_planogram_planogram_tracker">Planogram Tracker</string>
|
<string name="stock_planogram_planogram_tracker">Planogram Tracker</string>
|
||||||
<string name="stock_planogram_position_on_shelf">Position on Shelf</string>
|
<string name="stock_planogram_position_on_shelf">Position on Shelf</string>
|
||||||
|
|
||||||
|
<!--Change 06-03-2017-->
|
||||||
|
<string name="title_activity_store_checkout_image">Store Check out Image</string>
|
||||||
|
<string name="store_checkout">Click Store CheckOut Image</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user