|
|
@@ -121,7 +121,7 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
|
|
}
|
|
|
|
|
|
- setTitle("Order Detail");
|
|
|
+ setTitle(getString(R.string.detail_title));
|
|
|
|
|
|
if (getIntent() != null) {
|
|
|
mOrderID = getIntent().getStringExtra(IntentOrderIDKey);
|
|
|
@@ -153,7 +153,7 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
});
|
|
|
|
|
|
mEmptyView = findViewById(R.id.detail_empty_btn);
|
|
|
- mEmptyView.setText("There is no data\nPlease click to reload");
|
|
|
+ mEmptyView.setText(getString(R.string.empty_msg));
|
|
|
mEmptyView.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -285,7 +285,7 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
private void showProgressDialog() {
|
|
|
if (mProgressDialog == null) {
|
|
|
mProgressDialog = new ProgressDialog(this);
|
|
|
- mProgressDialog.setMessage("loading...");
|
|
|
+ mProgressDialog.setMessage(getString(R.string.loading));
|
|
|
mProgressDialog.setCancelable(false);
|
|
|
mProgressDialog.show();
|
|
|
}
|
|
|
@@ -303,9 +303,9 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- new AlertDialog.Builder(mCtx).setTitle("Warning")
|
|
|
+ new AlertDialog.Builder(mCtx).setTitle(getString(R.string.warning))
|
|
|
.setMessage(msg)
|
|
|
- .setPositiveButton("Ok",null)
|
|
|
+ .setPositiveButton(getString(R.string.btn_ok),null)
|
|
|
.show();
|
|
|
}
|
|
|
|
|
|
@@ -423,8 +423,8 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
new AlertDialog.Builder(mCtx)
|
|
|
.setTitle(actionModel.alertTitle)
|
|
|
.setMessage(actionModel.alertMsg)
|
|
|
- .setNegativeButton("Cancel",null)
|
|
|
- .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
|
|
+ .setNegativeButton(getString(R.string.btn_cancel),null)
|
|
|
+ .setPositiveButton(getString(R.string.btn_ok), new DialogInterface.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
handleAction(view,actionModel);
|
|
|
@@ -449,7 +449,7 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
if (mapIntent.resolveActivity(getPackageManager()) != null) {
|
|
|
startActivity(mapIntent);
|
|
|
} else {
|
|
|
- Toast.makeText(mCtx,"There is no google map",Toast.LENGTH_LONG).show();
|
|
|
+ Toast.makeText(mCtx,getString(R.string.alert_no_google_map),Toast.LENGTH_LONG).show();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -465,7 +465,7 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
if (mapIntent.resolveActivity(getPackageManager()) != null) {
|
|
|
startActivity(mapIntent);
|
|
|
} else {
|
|
|
- Toast.makeText(mCtx,"There is no google map",Toast.LENGTH_LONG).show();
|
|
|
+ Toast.makeText(mCtx,getString(R.string.alert_no_google_map),Toast.LENGTH_LONG).show();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -542,7 +542,7 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
// error
|
|
|
String errMsg = json.optString("err_msg");
|
|
|
if (errMsg == null || errMsg.length() == 0) {
|
|
|
- errMsg = "Sorry,there is something wrong";
|
|
|
+ errMsg = activity.getString(R.string.sorry);
|
|
|
}
|
|
|
activity.showWarningMsg(errMsg);
|
|
|
}
|
|
|
@@ -550,12 +550,12 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
// error
|
|
|
- String errMsg = "Sorry,there is something wrong";
|
|
|
+ String errMsg = activity.getString(R.string.sorry);
|
|
|
activity.showWarningMsg(errMsg);
|
|
|
}
|
|
|
} else {
|
|
|
// error
|
|
|
- String errMsg = "Sorry,there is something wrong";
|
|
|
+ String errMsg = activity.getString(R.string.sorry);
|
|
|
activity.showWarningMsg(errMsg);
|
|
|
}
|
|
|
activity.changeData();
|
|
|
@@ -582,13 +582,13 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
// error;
|
|
|
String errMsg = json.optString("err_msg");
|
|
|
if (errMsg == null || errMsg.length() == 0) {
|
|
|
- errMsg = "Sorry,there is something wrong";
|
|
|
+ errMsg = activity.getString(R.string.sorry);
|
|
|
}
|
|
|
activity.showWarningMsg(errMsg);
|
|
|
}
|
|
|
} else {
|
|
|
// error
|
|
|
- String errMsg = "Sorry,there is something wrong";
|
|
|
+ String errMsg = activity.getString(R.string.sorry);
|
|
|
activity.showWarningMsg(errMsg);
|
|
|
}
|
|
|
|
|
|
@@ -651,10 +651,10 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
|
|
|
DetailActionSelectionModel currentModel = models.get(0);
|
|
|
|
|
|
new AlertDialog.Builder(mCtx)
|
|
|
- .setTitle("Warning")
|
|
|
- .setMessage("the " + currentModel.actionTitle + " is not done,are you sure to update " + model.actionTitle + " now?")
|
|
|
- .setNegativeButton("Cancel",null)
|
|
|
- .setPositiveButton("YES", new DialogInterface.OnClickListener() {
|
|
|
+ .setTitle(getString(R.string.warning))
|
|
|
+ .setMessage(String.format(getString(R.string.not_done),currentModel.actionTitle,model.actionTitle))
|
|
|
+ .setNegativeButton(getString(R.string.btn_cancel),null)
|
|
|
+ .setPositiveButton(getString(R.string.btn_ok), new DialogInterface.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
if (popupWindow != null) {
|