T2P upload data newss
This commit is contained in:
Generated
+1
-1
@@ -41,7 +41,7 @@
|
|||||||
<ConfirmationsSetting value="0" id="Add" />
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
@@ -148,6 +148,10 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.SettingsActivity"
|
android:name=".dailyentry.SettingsActivity"
|
||||||
android:label="@string/title_activity_settings"
|
android:label="@string/title_activity_settings"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CheckoutActivity"
|
||||||
|
android:label="@string/title_activity_checkout"
|
||||||
android:theme="@style/AppTheme.NoActionBar"></activity>
|
android:theme="@style/AppTheme.NoActionBar"></activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -527,12 +527,15 @@ 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();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
values.put("CHECKOUT_STATUS", status);
|
values.put("CHECKOUT_STATUS", status);
|
||||||
|
values1.put(CommonString.KEY_COVERAGE_STATUS, status);
|
||||||
|
|
||||||
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);
|
||||||
|
db.update(CommonString.TABLE_COVERAGE_DATA, values1, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
||||||
@@ -2720,4 +2723,84 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CoverageBean getCoverageSpecificData(String visitdate, String store_id) {
|
||||||
|
|
||||||
|
CoverageBean sb = new CoverageBean();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
dbcursor = db.rawQuery("SELECT * from " + CommonString.TABLE_COVERAGE_DATA + " where "
|
||||||
|
+ CommonString.KEY_VISIT_DATE + "='" + visitdate + "' AND " + CommonString.KEY_STORE_ID +" ='" + store_id +"'",
|
||||||
|
null);
|
||||||
|
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
// CoverageBean sb = new CoverageBean();
|
||||||
|
|
||||||
|
sb.setStoreId(dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_STORE_ID)));
|
||||||
|
sb.setUserId((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_USER_ID))));
|
||||||
|
sb.setInTime(((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_IN_TIME)))));
|
||||||
|
sb.setOutTime(((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_OUT_TIME)))));
|
||||||
|
sb.setVisitDate((((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_VISIT_DATE))))));
|
||||||
|
sb.setLatitude(((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_LATITUDE)))));
|
||||||
|
sb.setLongitude(((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_LONGITUDE)))));
|
||||||
|
sb.setStatus((((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_STATUS))))));
|
||||||
|
sb.setImage((((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_IMAGE))))));
|
||||||
|
sb.setReason((((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_REASON))))));
|
||||||
|
sb.setReasonid((((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_REASON_ID))))));
|
||||||
|
sb.setMID(Integer.parseInt(((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_ID))))));
|
||||||
|
if (dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK)) == null) {
|
||||||
|
sb.setRemark("");
|
||||||
|
} else {
|
||||||
|
sb.setRemark((((dbcursor.getString(dbcursor
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))))));
|
||||||
|
}
|
||||||
|
|
||||||
|
//list.add(sb);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return sb;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception get JCP!", e.toString());
|
||||||
|
return sb;
|
||||||
|
}
|
||||||
|
return sb;
|
||||||
|
}
|
||||||
|
|
||||||
|
//update out time
|
||||||
|
public void updateCheckoutOuttime(String id, String out_time) {
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
values.put(CommonString.KEY_OUT_TIME, out_time);
|
||||||
|
|
||||||
|
db.update(CommonString.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,366 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.ksoap2.SoapEnvelope;
|
||||||
|
import org.ksoap2.serialization.SoapObject;
|
||||||
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
|
import org.ksoap2.transport.HttpTransportSE;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
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.download.DownloadActivity;
|
||||||
|
|
||||||
|
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 Data data;
|
||||||
|
private SharedPreferences preferences = null;
|
||||||
|
|
||||||
|
GSKOrangeDB db;
|
||||||
|
String userId, culture_id;
|
||||||
|
|
||||||
|
CoverageBean coverageBean;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_checkout);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
db = new GSKOrangeDB(this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
|
||||||
|
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
String store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
|
|
||||||
|
coverageBean = db.getCoverageSpecificData(visit_date,store_id);
|
||||||
|
/* FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||||
|
.setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
|
||||||
|
new BackgroundTask(CheckoutActivity.this).execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class BackgroundTask extends AsyncTask<Void, Data, String> {
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
BackgroundTask(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPreExecute() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
super.onPreExecute();
|
||||||
|
|
||||||
|
dialog = new Dialog(context);
|
||||||
|
dialog.setContentView(R.layout.custom);
|
||||||
|
dialog.setTitle("Sending Checkout Data");
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Override
|
||||||
|
protected String doInBackground(Void... params) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
//String result = "";
|
||||||
|
data = new Data();
|
||||||
|
|
||||||
|
data.value = 20;
|
||||||
|
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]"
|
||||||
|
+ coverageBean.getLatitude()
|
||||||
|
+ "[/LATITUDE][LOGITUDE]"
|
||||||
|
+ coverageBean.getLongitude()
|
||||||
|
+ "[/LOGITUDE][CHECKOUT_DATE]"
|
||||||
|
+ visit_date
|
||||||
|
+ "[/CHECKOUT_DATE][CHECK_OUTTIME]"
|
||||||
|
+ getCurrentTime()
|
||||||
|
+ "[/CHECK_OUTTIME][CHECK_INTIME]"
|
||||||
|
+ store_intime
|
||||||
|
+ "[/CHECK_INTIME][CREATED_BY]"
|
||||||
|
+ username
|
||||||
|
+ "[/CREATED_BY][/STORE_CHECK_OUT_STATUS]";
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + onXML
|
||||||
|
+ "[/DATA]";
|
||||||
|
|
||||||
|
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("MID", mid);
|
||||||
|
|
||||||
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
||||||
|
SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||||
|
CommonString.URL);
|
||||||
|
|
||||||
|
androidHttpTransport.call(
|
||||||
|
CommonString.SOAP_ACTION+"Upload_Store_ChecOut_Status",
|
||||||
|
envelope);
|
||||||
|
Object result = (Object) envelope.getResponse();
|
||||||
|
|
||||||
|
if (!result.toString().equalsIgnoreCase(
|
||||||
|
CommonString.KEY_SUCCESS)) {
|
||||||
|
return "Upload_Store_ChecOut_Status";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.toString().equalsIgnoreCase(
|
||||||
|
CommonString.KEY_NO_DATA)) {
|
||||||
|
return "Upload_Store_ChecOut_Status";
|
||||||
|
}
|
||||||
|
|
||||||
|
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)) {
|
||||||
|
|
||||||
|
db.updateCheckoutOuttime(store_id, getCurrentTime());
|
||||||
|
|
||||||
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
editor.putString(CommonString.KEY_STORE_ID, "");
|
||||||
|
editor.putString(CommonString.KEY_STORE_NAME, "");
|
||||||
|
editor.putString(CommonString.KEY_VISIT_DATE, "");
|
||||||
|
editor.putString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||||
|
editor.putString(CommonString.KEY_CHECKOUT_STATUS, "");
|
||||||
|
editor.putString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
editor.putString(CommonString.KEY_EMP_ID, "");
|
||||||
|
editor.putString(CommonString.KEY_GEO_TAG, "");
|
||||||
|
editor.putString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
editor.putString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
editor.putString(CommonString.KEY_UPLOAD_STATUS, "");
|
||||||
|
|
||||||
|
editor.commit();
|
||||||
|
|
||||||
|
db.updateCheckoutStatus(store_id, CommonString.KEY_C);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (result.toString().equalsIgnoreCase(
|
||||||
|
CommonString.KEY_FALSE)) {
|
||||||
|
return "Upload_Store_ChecOut_Status";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return CommonString.KEY_SUCCESS;
|
||||||
|
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
// counter++;
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
/*
|
||||||
|
* if (counter < 10) { new
|
||||||
|
* BackgroundTask(CheckOutUploadActivity
|
||||||
|
* .this).execute(); } else { message.showMessage();
|
||||||
|
* counter =1; }
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onProgressUpdate(Data... values) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
pb.setProgress(values[0].value);
|
||||||
|
percentage.setText(values[0].value + "%");
|
||||||
|
message.setText(values[0].name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostExecute(String result) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
super.onPostExecute(result);
|
||||||
|
|
||||||
|
dialog.dismiss();
|
||||||
|
|
||||||
|
if (result.equals(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
|
showAlert(getString(R.string.checkout_successful));
|
||||||
|
|
||||||
|
finish();
|
||||||
|
|
||||||
|
} 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();
|
||||||
|
finish();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
int value;
|
||||||
|
String name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static boolean updateResources(Context context, String language) {
|
||||||
|
|
||||||
|
String lang ;
|
||||||
|
|
||||||
|
if(language.equalsIgnoreCase("English")){
|
||||||
|
lang = "EN";
|
||||||
|
}
|
||||||
|
else if(language.equalsIgnoreCase("UAE")) {
|
||||||
|
lang = "AR";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lang = "TR";
|
||||||
|
}
|
||||||
|
|
||||||
|
Locale locale = new Locale(lang);
|
||||||
|
Locale.setDefault(locale);
|
||||||
|
|
||||||
|
Resources resources = context.getResources();
|
||||||
|
|
||||||
|
Configuration configuration = resources.getConfiguration();
|
||||||
|
configuration.locale = locale;
|
||||||
|
|
||||||
|
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrentTime() {
|
||||||
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
|
String cdate = formatter.format(m_cal.getTime());
|
||||||
|
|
||||||
|
/* String intime = m_cal.get(Calendar.HOUR_OF_DAY) + ":"
|
||||||
|
+ m_cal.get(Calendar.MINUTE) + ":" + m_cal.get(Calendar.SECOND);*/
|
||||||
|
|
||||||
|
return cdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showAlert(String str) {
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(CheckoutActivity.this);
|
||||||
|
builder.setTitle("Parinaam");
|
||||||
|
builder.setMessage(str).setCancelable(false)
|
||||||
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||||
|
activity.startActivity(i);
|
||||||
|
activity.finish();*/
|
||||||
|
finish();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.CheckoutActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/content_checkout" />
|
||||||
|
|
||||||
|
<!-- <android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@android:drawable/ic_dialog_email" />-->
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/content_checkout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.CheckoutActivity"
|
||||||
|
tools:showIn="@layout/activity_checkout">
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -167,5 +167,7 @@
|
|||||||
|
|
||||||
<!-- TODO: Remove or change this placeholder text -->
|
<!-- TODO: Remove or change this placeholder text -->
|
||||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||||
|
<string name="title_activity_checkout">CheckoutActivity</string>
|
||||||
|
<string name="checkout_successful">Checkout Success</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user