mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-19 12:18:59 +00:00
Update String resources
This commit is contained in:
parent
68538c58d6
commit
d2e7b0fe26
6 changed files with 27 additions and 19 deletions
|
|
@ -7,12 +7,11 @@
|
|||
<EditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/tagEditText" android:layout_gravity="center_horizontal"
|
||||
android:text="test_tag"/>
|
||||
android:id="@+id/tagEditText" android:layout_gravity="center_horizontal"/>
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Delete"
|
||||
android:text="@string/edit_tag_btn_delete"
|
||||
android:textColor="@color/white"
|
||||
android:id="@+id/btnDelete"
|
||||
android:drawableEnd="@drawable/ic_action_delete_white_24"
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:text="Edit"/>
|
||||
android:text="@string/edit_tag_btn_edit"/>
|
||||
</LinearLayout>
|
||||
|
|
@ -26,13 +26,13 @@
|
|||
android:paddingRight="@dimen/material_drawer_vertical_padding"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/material_drawer_item_section_text"
|
||||
android:text="Filter by Tag"/>
|
||||
android:text="@string/filter_drawer_filter_tags"/>
|
||||
<Button
|
||||
android:id="@+id/btnEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:text="Edit" />
|
||||
android:text="@string/edit_tag_btn_edit" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -376,4 +376,12 @@ To start, which parts of your life do you want to improve?</string>
|
|||
<string name="gems_plural">gold</string>
|
||||
<string name="chat_message_copied">Message copied to Clipboard</string>
|
||||
<string name="copy_chat_message">Copy to clipboard</string>
|
||||
<string name="edit_tag_title">Edit Tag</string>
|
||||
<string name="edit_tag_btn_edit">Edit</string>
|
||||
<string name="edit_tag_btn_done">Done</string>
|
||||
<string name="edit_tag_btn_delete">Delete</string>
|
||||
<string name="confirm_delete_tag_title">Are you sure?</string>
|
||||
<string name="confirm_delete_tag_message">Do you really want to delete?</string>
|
||||
<string name="filter_drawer_edit_tags">Edit Tags</string>
|
||||
<string name="filter_drawer_filter_tags">Filter by Tags</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -458,10 +458,10 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
|
||||
}
|
||||
//endregion Events
|
||||
|
||||
public void fillTagFilterDrawer(List<Tag> tagList) {
|
||||
if (this.tagsHelper != null) {
|
||||
List<IDrawerItem> items = new ArrayList<>();
|
||||
//items.add(new SectionDrawerItem().withName("Filter by Tag"));
|
||||
items.add(new EditTagsSectionDrawer());
|
||||
items.add(new EditTextDrawer());
|
||||
for (Tag t : tagList) {
|
||||
|
|
@ -481,7 +481,7 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
List<IDrawerItem> items = new ArrayList<>();
|
||||
|
||||
if(this.editingTags) {
|
||||
items.add(new EditTagsSectionDrawer().withEditing(this.editingTags).withName("Edit Tags"));
|
||||
items.add(new EditTagsSectionDrawer().withEditing(this.editingTags).withName(getString(R.string.filter_drawer_edit_tags)));
|
||||
items.add(new EditTextDrawer());
|
||||
for (Tag t : tagList) {
|
||||
items.add(new EditTagsDrawerItem()
|
||||
|
|
@ -491,7 +491,7 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
}
|
||||
this.activity.fillFilterDrawer(items);
|
||||
}else {
|
||||
items.add(new EditTagsSectionDrawer().withEditing(this.editingTags).withName("Filter by Tags"));
|
||||
items.add(new EditTagsSectionDrawer().withEditing(this.editingTags).withName(getString(R.string.filter_drawer_filter_tags)));
|
||||
items.add(new EditTextDrawer());
|
||||
for (Tag t : tagList) {
|
||||
items.add(new SwitchDrawerItem()
|
||||
|
|
@ -525,9 +525,10 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
}
|
||||
|
||||
public void removeTagFilterDrawerItem(Tag t) {
|
||||
//Have to add 2 for the Drawer components that reside above the actual tags' ui component.
|
||||
int pos = tags.indexOf(t) + 2;
|
||||
tags.remove(t);
|
||||
//Have to add 2 for the Drawer components that reside above the actual tags' ui components.
|
||||
|
||||
this.activity.removeFilterDrawerItem(pos);
|
||||
}
|
||||
|
||||
|
|
@ -535,6 +536,7 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
|
||||
if (this.tagsHelper != null) {
|
||||
|
||||
//Add 2 for the same reason as above
|
||||
int pos = tags.indexOf(t) + 2;
|
||||
IDrawerItem item = null;
|
||||
|
||||
|
|
@ -612,8 +614,8 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
}
|
||||
|
||||
AlertDialog alert = new AlertDialog.Builder(this.activity)
|
||||
.setTitle("Edit Tag")
|
||||
.setPositiveButton("Save", (dialog, which) -> {
|
||||
.setTitle(getString(R.string.edit_tag_title))
|
||||
.setPositiveButton(getString(R.string.save_changes), (dialog, which) -> {
|
||||
EditText tet = (EditText)editTagDialogView.findViewById(R.id.tagEditText);
|
||||
String newTagName = tet.getText().toString();
|
||||
if(!newTagName.equals("")) {
|
||||
|
|
@ -622,7 +624,7 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
EventBus.getDefault().post(new UpdateTagCommand(tag, uuid));
|
||||
}
|
||||
})
|
||||
.setNeutralButton("Go Back", (dialog, which) -> {
|
||||
.setNeutralButton(getString(R.string.dialog_go_back), (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
})
|
||||
.create();
|
||||
|
|
@ -633,13 +635,13 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
|
||||
public void showDeleteTagDialog(AlertDialog d, Tag tag) {
|
||||
AlertDialog alert2 = new AlertDialog.Builder(this.activity)
|
||||
.setTitle("Are you sure?").setMessage("Do you really want to delete?")
|
||||
.setPositiveButton("Yes",(dialog,which) -> {
|
||||
.setTitle(getString(R.string.confirm_delete_tag_title)).setMessage(getString(R.string.confirm_delete_tag_message))
|
||||
.setPositiveButton(getString(R.string.yes),(dialog,which) -> {
|
||||
EventBus.getDefault().post(new DeleteTagCommand(tag));
|
||||
dialog.dismiss();
|
||||
d.dismiss();
|
||||
})
|
||||
.setNegativeButton("No",(dialog, which) -> {
|
||||
.setNegativeButton(getString(R.string.no),(dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
})
|
||||
.create();
|
||||
|
|
@ -647,6 +649,5 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
}
|
||||
|
||||
//TODO: Fix Keyboard dismissal.
|
||||
//TODO: Update Strings resources.
|
||||
//TODO: Check code for redundancies/improvements
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,9 +132,9 @@ public class EditTagsSectionDrawer extends AbstractDrawerItem<EditTagsSectionDra
|
|||
viewHolder.editing = this.editing;
|
||||
|
||||
if(this.editing) {
|
||||
viewHolder.btnEdit.setText("Done");
|
||||
viewHolder.btnEdit.setText(ctx.getString(R.string.edit_tag_btn_done));
|
||||
}else {
|
||||
viewHolder.btnEdit.setText("Edit");
|
||||
viewHolder.btnEdit.setText(ctx.getString(R.string.edit_tag_btn_edit));
|
||||
}
|
||||
|
||||
ViewHelper.SetBackgroundTint(viewHolder.btnEdit, ContextCompat.getColor(ctx, R.color.brand));
|
||||
|
|
|
|||
Loading…
Reference in a new issue