Update string.xml
This commit is contained in:
1 parent
5f5a8d026b
commit
d9f29c7b25
8 files changed
+117
-45
No files matched your search
@@ -41,35 +41,22 @@ public class DownloadLabelScene extends AbsDragSortScene implements AppbarScene.
|
||||
|
||||
private List<DownloadLabel> mDownloadLabels;
|
||||
|
||||
private boolean mChanged = false;
|
||||
|
||||
private static final int POSITION_ADD = 0;
|
||||
|
||||
@Override
|
||||
protected void onCreate(boolean rebirth) {
|
||||
super.onCreate(rebirth);
|
||||
|
||||
setTipText("No download label"); // TODO hardcode
|
||||
setTipText(getResources().getString(R.string.download_label_list_empty));
|
||||
|
||||
addAction(R.drawable.ic_plus_dark_x24);
|
||||
|
||||
setOnClickActionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy(boolean die) {
|
||||
super.onDestroy(die);
|
||||
|
||||
// notify update
|
||||
if (mChanged) {
|
||||
//Messenger.getInstance().notify(Constants.MESSENGER_ID_UPDATE_DOWNLOAD_LABEL, null);
|
||||
mChanged = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTitle() {
|
||||
return "Download label"; // TODO hardcode
|
||||
return getResources().getString(R.string.download_label);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,7 +66,7 @@ public class DownloadLabelScene extends AbsDragSortScene implements AppbarScene.
|
||||
}
|
||||
|
||||
|
||||
private class AddDownloadTagHelper implements SimpleDialog.OnCreateCustomViewListener,
|
||||
private class AddDownloadLabelHelper implements SimpleDialog.OnCreateCustomViewListener,
|
||||
SimpleDialog.OnClickListener {
|
||||
|
||||
private EditText mEditText;
|
||||
@@ -87,7 +74,7 @@ public class DownloadLabelScene extends AbsDragSortScene implements AppbarScene.
|
||||
@Override
|
||||
public void onCreateCustomView(final SimpleDialog dialog, View view) {
|
||||
FloatLabelEditText floatLabelEditText = (FloatLabelEditText) view.findViewById(R.id.float_label_edit_text);
|
||||
floatLabelEditText.setHint("Download label"); // TODO hardcode
|
||||
floatLabelEditText.setHint(getResources().getString(R.string.label));
|
||||
mEditText = (EditText) view.findViewById(R.id.edit_text);
|
||||
mEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
@@ -116,10 +103,10 @@ public class DownloadLabelScene extends AbsDragSortScene implements AppbarScene.
|
||||
if (which == SimpleDialog.POSITIVE) {
|
||||
String label = mEditText.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(label)) {
|
||||
Toast.makeText(getStageActivity(), "Empty label", Toast.LENGTH_SHORT).show(); // TODO hardcode
|
||||
Toast.makeText(getStageActivity(), R.string.empty_label, Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
} else if (containLabel(label)) {
|
||||
Toast.makeText(getStageActivity(), "The label already exists", Toast.LENGTH_SHORT).show(); // TODO hardcode
|
||||
Toast.makeText(getStageActivity(), R.string.label_exists, Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
} else {
|
||||
// Tell DownloadManager
|
||||
@@ -132,8 +119,6 @@ public class DownloadLabelScene extends AbsDragSortScene implements AppbarScene.
|
||||
mDownloadLabels.clear();
|
||||
mDownloadLabels.addAll(DBUtils.getAllDownloadLabelWithId());
|
||||
notifyDataSetChanged();
|
||||
|
||||
mChanged = true;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@@ -146,8 +131,8 @@ public class DownloadLabelScene extends AbsDragSortScene implements AppbarScene.
|
||||
public void onClickAction(int index) {
|
||||
switch (index) {
|
||||
case POSITION_ADD:
|
||||
AddDownloadTagHelper helper = new AddDownloadTagHelper();
|
||||
new SimpleDialog.Builder(getContext()).setTitle("Add download tag")
|
||||
AddDownloadLabelHelper helper = new AddDownloadLabelHelper();
|
||||
new SimpleDialog.Builder(getContext()).setTitle(R.string.add_download_label)
|
||||
.setCustomView(R.layout.dialog_edit_text, helper)
|
||||
.setPositiveButton(android.R.string.ok)
|
||||
.setOnButtonClickListener(helper).show(this);
|
||||
@@ -178,8 +163,6 @@ public class DownloadLabelScene extends AbsDragSortScene implements AppbarScene.
|
||||
modify.label = getData(fromPosition);
|
||||
modify.label2 = getData(toPosition);
|
||||
Messenger.getInstance().notify(Constants.MESSENGER_ID_MODIFY_DOWNLOAD_LABEL_FROM_SCENE, modify);
|
||||
|
||||
mChanged = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,8 +171,6 @@ public class DownloadLabelScene extends AbsDragSortScene implements AppbarScene.
|
||||
modify.ops = DownloadManager.DownloadLabelModify.OPS_REMOVE;
|
||||
modify.label = getData(position);
|
||||
Messenger.getInstance().notify(Constants.MESSENGER_ID_MODIFY_DOWNLOAD_LABEL_FROM_SCENE, modify);
|
||||
|
||||
mChanged = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -145,7 +145,7 @@ public class DownloadScene extends AppbarScene implements DrawerProvider,
|
||||
} else {
|
||||
label = mActivatedLabel;
|
||||
}
|
||||
setTitle("Download" + " - " + label); // TODO hardcode
|
||||
setTitle(getResources().getString(R.string.download_title, label));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -192,7 +192,7 @@ public class DownloadScene extends AppbarScene implements DrawerProvider,
|
||||
mOriginalFabLayoutPaddingBottom = mFabLayout.getPaddingBottom();
|
||||
|
||||
mRightDrawerView = new AppbarRecyclerView(getStageActivity());
|
||||
mRightDrawerView.setTitle("Label"); // TODO hardcode
|
||||
mRightDrawerView.setTitle(getResources().getString(R.string.label));
|
||||
mDownloadLabelAdapter = new DownloadLabelAdapter();
|
||||
mRightDrawerView.setAdapter(mDownloadLabelAdapter);
|
||||
mRightDrawerView.setOnItemClickListener(new DownloadTagClickListener());
|
||||
@@ -650,9 +650,9 @@ public class DownloadScene extends AppbarScene implements DrawerProvider,
|
||||
}
|
||||
|
||||
if (labels.isEmpty()) {
|
||||
Toast.makeText(getContext(), "No available label", Toast.LENGTH_SHORT).show(); // TODO hardcode
|
||||
Toast.makeText(getContext(), R.string.no_label_available, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
new SimpleDialog.Builder(getContext()).setTitle("Move to") // TODO hardcode
|
||||
new SimpleDialog.Builder(getContext()).setTitle(R.string.move_to)
|
||||
.setItems(labels.toArray(new String[labels.size()]),
|
||||
new MoveDownloadInfoListener(labels, hasDefaultLabel)).show(this);
|
||||
}
|
||||
|
||||
@@ -598,8 +598,8 @@ public class GalleryDetailScene extends Scene implements View.OnClickListener,
|
||||
DownloadLabelHelper helper = new DownloadLabelHelper();
|
||||
new ListViewCheckBoxDialog.Builder(getContext())
|
||||
.setListItems(helper.mLabels, helper)
|
||||
.setCheckBoxText("Remeber") // TODO hardcode
|
||||
.setTitle("Choose label") // TODO hardcode
|
||||
.setCheckBoxText(getResources().getString(R.string.remeber))
|
||||
.setTitle(R.string.choose_label)
|
||||
.setOnCloseListener(helper)
|
||||
.show(this);
|
||||
} else if (mRead == v) {
|
||||
|
||||
@@ -334,7 +334,7 @@ public final class GalleryListScene extends Scene implements ListSearchBar.Helpe
|
||||
mRightDrawerView.setAdapter(mQuickSearchAdapter);
|
||||
mRightDrawerView.setOnItemClickListener(new QuickSearchClickListener());
|
||||
mRightDrawerView.setHelper(this);
|
||||
mRightDrawerView.setTipText("No quick search"); // TODO hardcode
|
||||
mRightDrawerView.setTipText(getResources().getString(R.string.quick_search_list_empty));
|
||||
if (mQuickSearchAdapter.getItemCount() == 0) {
|
||||
mRightDrawerView.showTip(false);
|
||||
} else {
|
||||
@@ -605,12 +605,10 @@ public final class GalleryListScene extends Scene implements ListSearchBar.Helpe
|
||||
if (mode == ListUrlBuilder.MODE_NORMAL || mode == ListUrlBuilder.MODE_UPLOADER ||
|
||||
mode == ListUrlBuilder.MODE_TAG) {
|
||||
AddToQuickSearchHelper helper = new AddToQuickSearchHelper(mListUrlBuilder.clone());
|
||||
new SimpleDialog.Builder(getStageActivity()).setTitle("Add to quick search") // TODO hardcode
|
||||
new SimpleDialog.Builder(getStageActivity()).setTitle(R.string.add_to_quick_search)
|
||||
.setCustomView(R.layout.dialog_edit_text, helper)
|
||||
.setPositiveButton(android.R.string.ok)
|
||||
.setOnButtonClickListener(helper).show(this);
|
||||
} else {
|
||||
Toast.makeText(getStageActivity(), "Can't add", Toast.LENGTH_SHORT).show(); // TODO hardcode
|
||||
}
|
||||
}
|
||||
|
||||
@@ -864,7 +862,7 @@ public final class GalleryListScene extends Scene implements ListSearchBar.Helpe
|
||||
Messenger.getInstance().notify(Constants.MESSENGER_ID_UPDATE_QUICK_SEARCH, null);
|
||||
return true;
|
||||
} else {
|
||||
Toast.makeText(getStageActivity(), "Empty displayname", Toast.LENGTH_SHORT).show(); // TODO hardcode
|
||||
Toast.makeText(getStageActivity(), R.string.empty_displayname, Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
@@ -881,7 +879,7 @@ public final class GalleryListScene extends Scene implements ListSearchBar.Helpe
|
||||
// Set keyword from search bar
|
||||
builder.setKeyword(mSearchBar.getText());
|
||||
AddToQuickSearchHelper helper = new AddToQuickSearchHelper(builder);
|
||||
new SimpleDialog.Builder(getStageActivity()).setTitle("Add to quick search") // TODO hardcode
|
||||
new SimpleDialog.Builder(getStageActivity()).setTitle(R.string.add_to_quick_search)
|
||||
.setCustomView(R.layout.dialog_edit_text, helper)
|
||||
.setPositiveButton(android.R.string.ok)
|
||||
.setOnButtonClickListener(helper).show(this);
|
||||
|
||||
@@ -166,7 +166,7 @@ public class ModifyQuickSearchScene extends AppbarScene implements SearchLayout.
|
||||
setTitle(getName());
|
||||
return true;
|
||||
} else {
|
||||
Toast.makeText(getStageActivity(), "Empty displayname", Toast.LENGTH_SHORT).show(); // TODO hardcode
|
||||
Toast.makeText(getStageActivity(), R.string.empty_displayname, Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class QuickSearchScene extends AbsDragSortScene implements Messenger.Rece
|
||||
protected void onCreate(boolean rebirth) {
|
||||
super.onCreate(rebirth);
|
||||
|
||||
setTipText("No quick search"); // TODO hardcode
|
||||
setTipText(getResources().getString(R.string.quick_search_list_empty));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user