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" />
|
||||
<activity
|
||||
android:name=".dailyentry.CategoryPicture"
|
||||
android:label="@string/title_activity_category_picture"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_category_picture"
|
||||
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>
|
||||
|
||||
</manifest>
|
||||
@@ -630,22 +630,18 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
|
||||
public void updateCheckoutStatus(String id, String status) {
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
ContentValues values1 = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
values.put("CHECKOUT_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.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
Log.e("Exception", "checkOut Status" + ex.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -786,6 +782,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
sb.setRemark((((dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))))));
|
||||
}
|
||||
sb.setCheckOut_Image(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_CHECKOUT_IMAGE)));
|
||||
|
||||
|
||||
list.add(sb);
|
||||
dbcursor.moveToNext();
|
||||
@@ -1403,13 +1401,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
public long InsertCoverageData(CoverageBean data) {
|
||||
|
||||
//db.delete(CommonString1.TABLE_COVERAGE_DATA, "STORE_ID" + "='" + data.getStoreId() + "'", null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
values.put(CommonString.KEY_STORE_ID, data.getStoreId());
|
||||
values.put(CommonString.KEY_USER_ID, data.getUserId());
|
||||
values.put(CommonString.KEY_IN_TIME, data.getInTime());
|
||||
@@ -1425,6 +1420,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
||||
values.put(CommonString.KEY_REASON, data.getReason());
|
||||
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);
|
||||
|
||||
@@ -3182,21 +3178,18 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
//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();
|
||||
|
||||
try {
|
||||
|
||||
values.put(CommonString.KEY_OUT_TIME, out_time);
|
||||
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);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
Log.d("Exception in ", "checkOutTime! " + ex.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4171,7 +4164,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
" INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID" +
|
||||
" INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID" +
|
||||
" INNER JOIN CATEGORY_MASTER CA ON SB.CATEGORY_ID = CA.CATEGORY_ID" +
|
||||
" INNER JOIN MAPPING_SUB_CATEGORY_IMAGE_ALLOW MIA ON SB.SUB_CATEGORY_ID=MIA.SUB_CATEGORY_ID "+
|
||||
" INNER JOIN MAPPING_SUB_CATEGORY_IMAGE_ALLOW MIA ON SB.SUB_CATEGORY_ID=MIA.SUB_CATEGORY_ID " +
|
||||
" WHERE M.KEYACCOUNT_ID = '" + key_account_id + " 'AND M.STORETYPE_ID = '" + store_type_id + "' AND M.CLASS_ID = '" + class_id + "' AND CA.CATEGORY_ID = '" + categoryId + "'", null);
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ public class CommonString {
|
||||
public static final String KEY_REASON_ID = "REASON_ID";
|
||||
public static final String KEY_REASON = "REASON";
|
||||
public static final String KEY_COVERAGE_REMARK = "REMARK";
|
||||
public static final String KEY_CHECKOUT_IMAGE = "Checkout_Image";
|
||||
public static final String KEY_IMAGE = "IMAGE";
|
||||
public static final String KEY_IMAGE1 = "IMAGE1";
|
||||
public static final String KEY_IMAGE2 = "IMAGE2";
|
||||
@@ -126,7 +127,6 @@ public class CommonString {
|
||||
+ METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
|
||||
|
||||
|
||||
public static final String METHOD_UPLOAD_ASSET = "Upload_Stock_Availiablity_V1";
|
||||
public static final String METHOD_Get_DR_POSM_IMAGES = "GetImageNew";
|
||||
public static final String SOAP_ACTION_Get_DR_POSM_IMAGES = "http://tempuri.org/"
|
||||
@@ -135,7 +135,7 @@ public class CommonString {
|
||||
public static final String SOAP_ACTION_DR_STORE_IMAGES_GEO = "http://tempuri.org/"
|
||||
+ 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";
|
||||
|
||||
@@ -163,16 +163,23 @@ public class CommonString {
|
||||
public static final String TABLE_COVERAGE_DATA = "COVERAGE_DATA";
|
||||
|
||||
|
||||
public static final String CREATE_TABLE_COVERAGE_DATA = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_COVERAGE_DATA + " (" + KEY_ID
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ," + KEY_STORE_ID
|
||||
+ " VARCHAR,USER_ID VARCHAR, " + KEY_IN_TIME + " VARCHAR,"
|
||||
+ KEY_OUT_TIME + " VARCHAR," + KEY_VISIT_DATE + " VARCHAR,"
|
||||
+ KEY_LATITUDE + " VARCHAR," + KEY_LONGITUDE + " VARCHAR," + KEY_MERCHANDISER_ID + " VARCHAR,"
|
||||
+ KEY_COVERAGE_STATUS + " VARCHAR," + KEY_IMAGE + " VARCHAR,"
|
||||
public static final String CREATE_TABLE_COVERAGE_DATA = "CREATE TABLE IF NOT EXISTS " + TABLE_COVERAGE_DATA
|
||||
+ " ("
|
||||
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
+ KEY_STORE_ID + " VARCHAR,USER_ID VARCHAR, "
|
||||
+ KEY_IN_TIME + " VARCHAR,"
|
||||
+ KEY_OUT_TIME + " VARCHAR,"
|
||||
+ KEY_VISIT_DATE + " VARCHAR,"
|
||||
+ KEY_LATITUDE + " VARCHAR,"
|
||||
+ KEY_LONGITUDE + " VARCHAR,"
|
||||
+ KEY_MERCHANDISER_ID + " VARCHAR,"
|
||||
+ KEY_COVERAGE_STATUS + " VARCHAR,"
|
||||
+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_GEO_TAG + " VARCHAR,"
|
||||
+ KEY_REASON_ID + " VARCHAR," + KEY_COVERAGE_REMARK
|
||||
+ " VARCHAR," + KEY_REASON + " VARCHAR)";
|
||||
+ KEY_REASON_ID + " 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 "
|
||||
@@ -661,24 +668,21 @@ public class CommonString {
|
||||
public static final String TABLE_INSERT_BRAND_AVAIBILITY_DATA = "Camera_Not_Allowed";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_BRAND_AVAIBILITY_DATA = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_BRAND_AVAIBILITY_DATA
|
||||
+ "("
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
+ TABLE_INSERT_BRAND_AVAIBILITY_DATA
|
||||
+ "("
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ "COMMON_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "BRAND_NAME"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "BRAND_ID"
|
||||
+ " INTEGER"
|
||||
|
||||
+ ")";
|
||||
+ "COMMON_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "BRAND_NAME"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "BRAND_ID"
|
||||
+ " INTEGER"
|
||||
|
||||
+ ")";
|
||||
|
||||
|
||||
public static final String TABLE_INSERT_CATEGORY_PICTURE = "Stock_CATEGORY_PICTURE";
|
||||
@@ -711,7 +715,6 @@ public class CommonString {
|
||||
+ ")";
|
||||
|
||||
|
||||
|
||||
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 "
|
||||
|
||||
@@ -41,7 +41,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
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 SharedPreferences preferences = null;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
CoverageBean coverageBean;
|
||||
|
||||
String lat,lon;
|
||||
String lat, lon, checkOutImagePath = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -66,17 +66,18 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
|
||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
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();
|
||||
lon = coverageBean.getLongitude();
|
||||
if (lat==null || lat.equals("")){
|
||||
if (lat == null || lat.equals("")) {
|
||||
lat = "0.0";
|
||||
}
|
||||
if (lon==null || lon.equals("")){
|
||||
if (lon == null || lon.equals("")) {
|
||||
lon = "0.0";
|
||||
}
|
||||
/* FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
@@ -100,7 +101,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
// TODO Auto-generated method stub
|
||||
super.onPreExecute();
|
||||
|
||||
dialog = new Dialog(context);
|
||||
@@ -111,16 +111,12 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
||||
message = (TextView) dialog.findViewById(R.id.message);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected String doInBackground(Void... params) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
try {
|
||||
|
||||
//String result = "";
|
||||
data = new Data();
|
||||
|
||||
@@ -128,72 +124,52 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
data.name = "Checked out Data Uploading";
|
||||
publishProgress(data);
|
||||
|
||||
String onXML = "[STORE_CHECK_OUT_STATUS][USER_ID]"
|
||||
+ username
|
||||
+ "[/USER_ID]" + "[STORE_ID]"
|
||||
+ store_id
|
||||
+ "[/STORE_ID][LATITUDE]"
|
||||
+ lat
|
||||
+ "[/LATITUDE][LOGITUDE]"
|
||||
+ lon
|
||||
+ "[/LOGITUDE][CHECKOUT_DATE]"
|
||||
+ visit_date
|
||||
+ "[/CHECKOUT_DATE][CHECK_OUTTIME]"
|
||||
+ getCurrentTime()
|
||||
+ "[/CHECK_OUTTIME][CHECK_INTIME]"
|
||||
+ coverageBean.getInTime()
|
||||
+ "[/CHECK_INTIME][CREATED_BY]"
|
||||
+ username
|
||||
+ "[/CREATED_BY][/STORE_CHECK_OUT_STATUS]";
|
||||
String onXML =
|
||||
"[STORE_CHECK_OUT_STATUS]"
|
||||
+ "[USER_ID]" + username + "[/USER_ID]"
|
||||
+ "[STORE_ID]" + store_id + "[/STORE_ID]"
|
||||
+ "[LATITUDE]" + lat + "[/LATITUDE]"
|
||||
+ "[LOGITUDE]" + lon + "[/LOGITUDE]"
|
||||
+ "[CHECKOUT_DATE]" + visit_date + "[/CHECKOUT_DATE]"
|
||||
+ "[CHECK_OUTTIME]" + getCurrentTime() + "[/CHECK_OUTTIME]"
|
||||
+ "[CHECK_INTIME]" + coverageBean.getInTime() + "[/CHECK_INTIME]"
|
||||
+ "[CREATED_BY]" + username + "[/CREATED_BY]"
|
||||
+ "[/STORE_CHECK_OUT_STATUS]";
|
||||
|
||||
final String sos_xml = "[DATA]" + onXML
|
||||
+ "[/DATA]";
|
||||
final String sos_xml = "[DATA]" + onXML + "[/DATA]";
|
||||
|
||||
SoapObject request = new SoapObject(
|
||||
CommonString.NAMESPACE,
|
||||
"Upload_Store_ChecOut_Status");
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, "Upload_Store_ChecOut_Status");
|
||||
request.addProperty("onXML", sos_xml);
|
||||
/*request.addProperty("KEYS", "CHECKOUT_STATUS");
|
||||
request.addProperty("USERNAME", username);*/
|
||||
/*request.addProperty("KEYS", "CHECKOUT_STATUS");
|
||||
request.addProperty("USERNAME", username);*/
|
||||
//request.addProperty("MID", mid);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
||||
SoapEnvelope.VER11);
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||
CommonString.URL);
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(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();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_SUCCESS)) {
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
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";
|
||||
}
|
||||
|
||||
if (result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_FAILURE)) {
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||
return "Upload_Store_ChecOut_Status";
|
||||
}
|
||||
|
||||
|
||||
data.value = 100;
|
||||
data.name = "Checkout Done";
|
||||
publishProgress(data);
|
||||
|
||||
if (result.toString()
|
||||
.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
if (result.toString().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();
|
||||
editor.putString(CommonString.KEY_STORE_ID, "");
|
||||
@@ -213,15 +189,9 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
db.updateCheckoutStatus(store_id, CommonString.KEY_Y);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
if (result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_FALSE)) {
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||
return "Upload_Store_ChecOut_Status";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return CommonString.KEY_SUCCESS;
|
||||
|
||||
@@ -238,17 +208,15 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
} catch (IOException e) {
|
||||
|
||||
// counter++;
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
||||
// TODO Auto-generated method stub
|
||||
/*
|
||||
* if (counter < 10) { new
|
||||
/*
|
||||
* if (counter < 10) { new
|
||||
* BackgroundTask(CheckOutUploadActivity
|
||||
* .this).execute(); } else { message.showMessage();
|
||||
* counter =1; }
|
||||
@@ -256,9 +224,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -293,10 +259,9 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
finish();
|
||||
|
||||
}
|
||||
else if (!result.equals("")) {
|
||||
/*AlertMessage message = new AlertMessage(
|
||||
CheckOutStoreActivity.this, CommonString1.ERROR + result, "success", null);
|
||||
} else if (!result.equals("")) {
|
||||
/*AlertMessage message = new AlertMessage(
|
||||
CheckOutStoreActivity.this, CommonString1.ERROR + result, "success", null);
|
||||
message.showMessage();*/
|
||||
|
||||
Toast.makeText(getApplicationContext(), "Network Error Try Again", Toast.LENGTH_SHORT).show();
|
||||
@@ -316,13 +281,11 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
}
|
||||
|
||||
|
||||
private static boolean updateResources(Context context, String language) {
|
||||
|
||||
|
||||
|
||||
String lang;
|
||||
|
||||
@@ -337,7 +300,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||
}else{
|
||||
} else {
|
||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
+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);
|
||||
}
|
||||
}
|
||||
@@ -238,51 +238,42 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
|
||||
}*/
|
||||
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++) {
|
||||
|
||||
if (storeid.equals(coverage.get(i).getStoreId())) {
|
||||
statusleave=coverage.get(i).getStatus();
|
||||
if (storeid.equals(coverage.get(i).getStoreId())) {
|
||||
statusleave = coverage.get(i).getStatus();
|
||||
|
||||
|
||||
if(statusleave.equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)){
|
||||
if (statusleave.equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)) {
|
||||
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
viewHolder.imageview.setVisibility(View.VISIBLE);
|
||||
viewHolder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
|
||||
|
||||
}
|
||||
} else if (coverage.get(i).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(coverage.get(i).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 (coverage.get(i).getStatus().equalsIgnoreCase(CommonString.KEY_INVALID)) {
|
||||
|
||||
}
|
||||
else if(coverage.get(i).getStatus().equalsIgnoreCase(CommonString.KEY_INVALID)){
|
||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.green));
|
||||
} else {
|
||||
|
||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.green));
|
||||
}
|
||||
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
else {
|
||||
|
||||
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||
viewHolder.chkbtn.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* if (coverage.get(i).getInTime() != null) {
|
||||
|
||||
@@ -301,9 +292,9 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
} else {
|
||||
|
||||
viewHolder.Cardbtn.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
viewHolder.imageview.setVisibility(View.INVISIBLE);
|
||||
@@ -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();
|
||||
} 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();
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
@@ -368,7 +357,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (enteryflag) {
|
||||
showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS(),current.getGEO_TAG(),current);
|
||||
showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS(), current.getGEO_TAG(), current);
|
||||
}
|
||||
} else {
|
||||
Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
@@ -381,42 +370,33 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
viewHolder.chkbtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
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)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.ok,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(
|
||||
DialogInterface dialog, int id) {
|
||||
if (CheckNetAvailability()) {
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
if (CheckNetAvailability()) {
|
||||
/*Intent i = new Intent(StoreListActivity.this, CheckoutActivity.class);
|
||||
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(i);*/
|
||||
|
||||
Intent i = new Intent(StoreListActivity.this, CheckoutActivity.class);
|
||||
|
||||
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
|
||||
startActivity(i);
|
||||
} else {
|
||||
|
||||
Snackbar.make(recyclerView, R.string.nonetwork, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.closed,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(
|
||||
DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
Intent i = new Intent(StoreListActivity.this, StoreCheckoutImageActivity.class);
|
||||
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(i);
|
||||
} else {
|
||||
Snackbar.make(recyclerView, R.string.nonetwork, Snackbar.LENGTH_SHORT)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.closed, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -471,7 +451,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
void showMyDialog(final String storeCd, final String storeName, final String status, final String visitDate, final String checkout_status,final String GeotagStatus,final StoreBean current) {
|
||||
void showMyDialog(final String storeCd, final String storeName, final String status, final String visitDate, final String checkout_status, final String GeotagStatus, final StoreBean current) {
|
||||
dialog = new Dialog(this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(R.layout.dialogbox);
|
||||
@@ -485,7 +465,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
// find which radio button is selected
|
||||
if (checkedId == R.id.yes) {
|
||||
|
||||
if(!GeotagStatus.equalsIgnoreCase("N")){
|
||||
if (!GeotagStatus.equalsIgnoreCase("N")) {
|
||||
|
||||
editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
@@ -503,30 +483,29 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
editor.commit();
|
||||
|
||||
|
||||
boolean flag = true;
|
||||
if (coverage.size() > 0) {
|
||||
for (int i = 0; i < coverage.size(); i++) {
|
||||
if (store_id.equals(coverage.get(i).getStoreId())) {
|
||||
flag = false;
|
||||
break;
|
||||
boolean flag = true;
|
||||
if (coverage.size() > 0) {
|
||||
for (int i = 0; i < coverage.size(); i++) {
|
||||
if (store_id.equals(coverage.get(i).getStoreId())) {
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag == true) {
|
||||
if (flag == true) {
|
||||
|
||||
Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
dialog.cancel();
|
||||
} else {
|
||||
Intent in = new Intent(StoreListActivity.this, StoreWisePerformanceActivity.class);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
dialog.cancel();
|
||||
}
|
||||
|
||||
Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
dialog.cancel();
|
||||
} else {
|
||||
Intent in = new Intent(StoreListActivity.this, StoreWisePerformanceActivity.class);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
dialog.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
dialog.cancel();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||
@@ -549,7 +528,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
}else if (checkedId == R.id.no) {
|
||||
} else if (checkedId == R.id.no) {
|
||||
|
||||
dialog.cancel();
|
||||
|
||||
@@ -560,48 +539,47 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
|
||||
if (coverage.size() > 0) {
|
||||
|
||||
if (coverage.get(0).getStatus().equals(CommonString.KEY_INVALID) || coverage.get(0).getStatus().equals(CommonString.KEY_VALID)) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||
builder.setMessage(R.string.DELETE_ALERT_MESSAGE)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
if (coverage.get(0).getStatus().equals(CommonString.KEY_INVALID) || coverage.get(0).getStatus().equals(CommonString.KEY_VALID)) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||
builder.setMessage(R.string.DELETE_ALERT_MESSAGE)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
|
||||
|
||||
UpdateStore(store_id);
|
||||
UpdateStore(store_id);
|
||||
|
||||
|
||||
Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
|
||||
in.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(in);
|
||||
Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
|
||||
in.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(in);
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog,
|
||||
int id) {
|
||||
|
||||
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
|
||||
alert.show();
|
||||
}
|
||||
else{
|
||||
Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
|
||||
in.putExtra(CommonString.KEY_STORE_ID,current.getSTORE_ID());
|
||||
startActivity(in);
|
||||
}
|
||||
alert.show();
|
||||
} else {
|
||||
Intent in = new Intent(StoreListActivity.this, NonWorkingReason.class);
|
||||
in.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(in);
|
||||
}
|
||||
|
||||
}else {
|
||||
} else {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -656,7 +634,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||
}else{
|
||||
} else {
|
||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
@@ -217,6 +217,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
cdata.setImage(img_str);
|
||||
cdata.setRemark("");
|
||||
cdata.setStatus(CommonString.KEY_INVALID);
|
||||
cdata.setCheckOut_Image("");
|
||||
|
||||
database.InsertCoverageData(cdata);
|
||||
|
||||
@@ -277,18 +278,18 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
//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("الاستوديو") ) {
|
||||
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||
gallery_package = list.get(n).packageName;
|
||||
}
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
||||
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("الكاميرا")) {
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
|
||||
@@ -1,223 +1,231 @@
|
||||
package cpm.com.gskmtorange.GetterSetter;
|
||||
|
||||
public class CoverageBean
|
||||
{
|
||||
protected int MID;
|
||||
protected String process_id;
|
||||
public class CoverageBean {
|
||||
protected int MID;
|
||||
protected String process_id;
|
||||
|
||||
public String getGEO_TAG() {
|
||||
return GEO_TAG;
|
||||
}
|
||||
public String getGEO_TAG() {
|
||||
return GEO_TAG;
|
||||
}
|
||||
|
||||
public void setGEO_TAG(String GEO_TAG) {
|
||||
this.GEO_TAG = GEO_TAG;
|
||||
}
|
||||
public void setGEO_TAG(String GEO_TAG) {
|
||||
this.GEO_TAG = GEO_TAG;
|
||||
}
|
||||
|
||||
protected String GEO_TAG;
|
||||
public String getProcess_id() {
|
||||
return process_id;
|
||||
}
|
||||
protected String GEO_TAG;
|
||||
|
||||
public void setProcess_id(String process_id) {
|
||||
this.process_id = process_id;
|
||||
}
|
||||
public String getProcess_id() {
|
||||
return process_id;
|
||||
}
|
||||
|
||||
protected String storeId;
|
||||
protected String storename;
|
||||
|
||||
public String getStorename() {
|
||||
return storename;
|
||||
}
|
||||
public void setProcess_id(String process_id) {
|
||||
this.process_id = process_id;
|
||||
}
|
||||
|
||||
public void setStorename(String storename) {
|
||||
this.storename = storename;
|
||||
}
|
||||
protected String storeId;
|
||||
protected String storename;
|
||||
|
||||
protected String Remark;
|
||||
|
||||
public String getRemark() {
|
||||
return Remark;
|
||||
}
|
||||
public String getStorename() {
|
||||
return storename;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
Remark = remark;
|
||||
}
|
||||
public void setStorename(String storename) {
|
||||
this.storename = storename;
|
||||
}
|
||||
|
||||
protected String userId;
|
||||
protected String app_version;
|
||||
protected String image_allow;
|
||||
|
||||
public String getImage_allow() {
|
||||
return image_allow;
|
||||
}
|
||||
protected String Remark;
|
||||
|
||||
public void setImage_allow(String image_allow) {
|
||||
this.image_allow = image_allow;
|
||||
}
|
||||
public String getRemark() {
|
||||
return Remark;
|
||||
}
|
||||
|
||||
public String getApp_version() {
|
||||
return app_version;
|
||||
}
|
||||
public void setRemark(String remark) {
|
||||
Remark = remark;
|
||||
}
|
||||
|
||||
public void setApp_version(String app_version) {
|
||||
this.app_version = app_version;
|
||||
}
|
||||
protected String userId;
|
||||
protected String app_version;
|
||||
protected String image_allow;
|
||||
|
||||
protected String inTime;
|
||||
|
||||
protected String outTime;
|
||||
|
||||
protected String visitDate;
|
||||
|
||||
protected String keycontactId;
|
||||
|
||||
protected String isdDeploy;
|
||||
|
||||
protected String uploadStatus;
|
||||
|
||||
private String latitude;
|
||||
|
||||
private String longitude;
|
||||
|
||||
private String reasonid="";
|
||||
|
||||
private String sub_reasonId="";
|
||||
|
||||
public String getSub_reasonId() {
|
||||
return sub_reasonId;
|
||||
}
|
||||
public String getImage_allow() {
|
||||
return image_allow;
|
||||
}
|
||||
|
||||
public void setSub_reasonId(String sub_reasonId) {
|
||||
this.sub_reasonId = sub_reasonId;
|
||||
}
|
||||
public void setImage_allow(String image_allow) {
|
||||
this.image_allow = image_allow;
|
||||
}
|
||||
|
||||
private String reason="";
|
||||
|
||||
private String status="N";
|
||||
|
||||
private String image="";
|
||||
|
||||
public String getApp_version() {
|
||||
return app_version;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
public void setApp_version(String app_version) {
|
||||
this.app_version = app_version;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
protected String inTime;
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
protected String outTime;
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
protected String visitDate;
|
||||
|
||||
public int getMID() {
|
||||
return MID;
|
||||
}
|
||||
protected String keycontactId;
|
||||
|
||||
public void setMID(int mID) {
|
||||
MID = mID;
|
||||
}
|
||||
protected String isdDeploy;
|
||||
|
||||
public String getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
protected String uploadStatus;
|
||||
|
||||
public void setStoreId(String storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
private String latitude;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
private String longitude;
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
private String reasonid = "";
|
||||
|
||||
public String getInTime() {
|
||||
return inTime;
|
||||
}
|
||||
private String sub_reasonId = "";
|
||||
|
||||
public void setInTime(String inTime) {
|
||||
this.inTime = inTime;
|
||||
}
|
||||
public String getSub_reasonId() {
|
||||
return sub_reasonId;
|
||||
}
|
||||
|
||||
public String getOutTime() {
|
||||
return outTime;
|
||||
}
|
||||
public void setSub_reasonId(String sub_reasonId) {
|
||||
this.sub_reasonId = sub_reasonId;
|
||||
}
|
||||
|
||||
public void setOutTime(String outTime) {
|
||||
this.outTime = outTime;
|
||||
}
|
||||
private String reason = "";
|
||||
|
||||
public String getVisitDate() {
|
||||
return visitDate;
|
||||
}
|
||||
private String status = "N";
|
||||
|
||||
public void setVisitDate(String visitDate) {
|
||||
this.visitDate = visitDate;
|
||||
}
|
||||
private String image = "";
|
||||
|
||||
public String getKeycontactId() {
|
||||
return keycontactId;
|
||||
}
|
||||
|
||||
public void setKeycontactId(String keycontactId) {
|
||||
this.keycontactId = keycontactId;
|
||||
}
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public String getIsdDeploy() {
|
||||
return isdDeploy;
|
||||
}
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public void setIsdDeploy(String isdDeploy) {
|
||||
this.isdDeploy = isdDeploy;
|
||||
}
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getUploadStatus() {
|
||||
return uploadStatus;
|
||||
}
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setUploadStatus(String uploadStatus) {
|
||||
this.uploadStatus = uploadStatus;
|
||||
}
|
||||
public int getMID() {
|
||||
return MID;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
public void setMID(int mID) {
|
||||
MID = mID;
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
public String getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
public void setStoreId(String storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public String getReasonid() {
|
||||
return reasonid;
|
||||
}
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public void setReasonid(String reasonid) {
|
||||
this.reasonid = reasonid;
|
||||
}
|
||||
public String getInTime() {
|
||||
return inTime;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
public void setInTime(String inTime) {
|
||||
this.inTime = inTime;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getOutTime() {
|
||||
return outTime;
|
||||
}
|
||||
|
||||
public void setOutTime(String outTime) {
|
||||
this.outTime = outTime;
|
||||
}
|
||||
|
||||
public String getVisitDate() {
|
||||
return visitDate;
|
||||
}
|
||||
|
||||
public void setVisitDate(String visitDate) {
|
||||
this.visitDate = visitDate;
|
||||
}
|
||||
|
||||
public String getKeycontactId() {
|
||||
return keycontactId;
|
||||
}
|
||||
|
||||
public void setKeycontactId(String keycontactId) {
|
||||
this.keycontactId = keycontactId;
|
||||
}
|
||||
|
||||
public String getIsdDeploy() {
|
||||
return isdDeploy;
|
||||
}
|
||||
|
||||
public void setIsdDeploy(String isdDeploy) {
|
||||
this.isdDeploy = isdDeploy;
|
||||
}
|
||||
|
||||
public String getUploadStatus() {
|
||||
return uploadStatus;
|
||||
}
|
||||
|
||||
public void setUploadStatus(String uploadStatus) {
|
||||
this.uploadStatus = uploadStatus;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getReasonid() {
|
||||
return reasonid;
|
||||
}
|
||||
|
||||
public void setReasonid(String reasonid) {
|
||||
this.reasonid = reasonid;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
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_REMARK]" + coverageList.get(i).getRemark() + "[/REASON_REMARK]"
|
||||
+ "[CAMERA_ALLOWED]" + camera_allow + "[/CAMERA_ALLOWED]"
|
||||
+ "[CHECKOUT_IMAGE]" + coverageList.get(i).getCheckOut_Image() + "[/CHECKOUT_IMAGE]"
|
||||
+ "[/USER_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
|
||||
|
||||
for (int m = 0; m < t2PGetterSetters.size(); m++) {
|
||||
@@ -1685,7 +1713,6 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
}
|
||||
|
||||
|
||||
private static boolean updateResources(Context context, String language) {
|
||||
|
||||
/*String lang;
|
||||
|
||||
@@ -269,6 +269,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[REASON_ID]" + coverageList.get(i).getReasonid() + "[/REASON_ID]"
|
||||
+ "[REASON_REMARK]" + coverageList.get(i).getRemark() + "[/REASON_REMARK]"
|
||||
+ "[CAMERA_ALLOWED]" + camera_allow + "[/CAMERA_ALLOWED]"
|
||||
+ "[CHECKOUT_IMAGE]" + coverageList.get(i).getCheckOut_Image() + "[/CHECKOUT_IMAGE]"
|
||||
+ "[/USER_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
|
||||
|
||||
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_marginTop="2dp"
|
||||
android:layout_weight="35"
|
||||
|
||||
card_view:cardBackgroundColor="@color/colorOrange"
|
||||
card_view:cardCornerRadius="15dp">
|
||||
|
||||
@@ -34,7 +33,6 @@
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginRight="6sp"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingTop="25sp" />
|
||||
|
||||
@@ -66,10 +64,9 @@
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:focusable="false"
|
||||
android:background="@mipmap/checkout"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
android:focusable="false"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
@@ -78,8 +75,7 @@
|
||||
android:layout_alignBottom="@+id/storelistviewxml_storeico"
|
||||
android:layout_alignParentRight="true"
|
||||
|
||||
android:visibility="gone"
|
||||
/>
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
@@ -294,6 +294,7 @@
|
||||
<string name="stock_planogram_planogram_tracker">Planogram Tracker</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>
|
||||
|
||||
Reference in New Issue
Block a user