0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 20:03:05 +02:00

Added Toolbar for TagsDialog.

* Removed old resources related to the TagsDialog;
* Added Dialog for adding a tag. However, if the SearchActionItem is expanded and is not empty, the user can add the typed tag by clicking the AddTagActionItem;
* The EditTexts in the Dialog for adding a tag and in the SearchView have a filter that doesn't allow the user to type spaces or commas;
* There is no more "knowsHowToAddTag" shared preference;
* Shows a Snackbar for new tags and when the tag already exists. For each case, a different message is shown;
* If the user tries to add a tag that already exists, it is simply checked for him;
* Empty tags are not added and no message is shown;
* The Toolbar uses the same style as the app-wide toolbar;
* The select all action selects or deselects only the tags being displayed;
* The SearchQuery hint is `Add/filter tags` when the dialog type is `TYPE_ADD_TAG`, otherwise it is `Filter tags`;
* The add menu action only is shown if the dialog is of the type `TYPE_ADD_TAG`.
This commit is contained in:
Bruno Azevedo 2015-06-14 13:13:25 -03:00
parent 5fcaca3514
commit cf68df1acf
20 changed files with 216 additions and 190 deletions

View File

@ -1,34 +1,37 @@
package com.ichi2.anki.dialogs; package com.ichi2.anki.dialogs;
import android.app.Dialog; import android.app.Dialog;
import android.content.SharedPreferences;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.DialogFragment; import android.support.v4.app.DialogFragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.text.Editable; import android.text.Editable;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.InputType;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CheckedTextView; import android.widget.CheckedTextView;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Filter; import android.widget.Filter;
import android.widget.Filterable; import android.widget.Filterable;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog; import com.afollestad.materialdialogs.MaterialDialog;
import com.ichi2.anki.AnkiDroidApp; import com.ichi2.anki.AnkiActivity;
import com.ichi2.anki.R; import com.ichi2.anki.R;
import java.util.ArrayList; import java.util.ArrayList;
@ -55,15 +58,22 @@ public class TagsDialog extends DialogFragment {
private TreeSet<String> mCurrentTags; private TreeSet<String> mCurrentTags;
private ArrayList<String> mAllTags; private ArrayList<String> mAllTags;
private String mPositiveText;
private String mDialogTitle; private String mDialogTitle;
private TagsDialogListener mTagsDialogListener = null; private TagsDialogListener mTagsDialogListener = null;
private TagsArrayAdapter mTagsArrayAdapter; private TagsArrayAdapter mTagsArrayAdapter;
private int mSelectedOption = -1; private int mSelectedOption = -1;
private Toolbar mToolbar;
private SearchView mToolbarSearchView;
private MenuItem mToolbarSearchItem;
private MenuItem mToolbarAddItem;
private TextView mNoTagsTextView;
private RecyclerView mTagsListRecyclerView;
private RadioGroup mOptionsGroup; private RadioGroup mOptionsGroup;
private CheckBox mCheckAllCheckBox;
private EditText mAddFilterEditText; private MaterialDialog mDialog;
private ImageView mAddTagImageView;
public static TagsDialog newInstance(int type, ArrayList<String> checked_tags, public static TagsDialog newInstance(int type, ArrayList<String> checked_tags,
ArrayList<String> all_tags) { ArrayList<String> all_tags) {
@ -92,6 +102,12 @@ public class TagsDialog extends DialogFragment {
mAllTags = new ArrayList<String>(); mAllTags = new ArrayList<String>();
mAllTags.addAll(getArguments().getStringArrayList(ALL_TAGS_KEY)); mAllTags.addAll(getArguments().getStringArrayList(ALL_TAGS_KEY));
for (String tag : mCurrentTags) {
if (!mAllTags.contains(tag)) {
mAllTags.add(tag);
}
}
setCancelable(true); setCancelable(true);
} }
@ -102,83 +118,20 @@ public class TagsDialog extends DialogFragment {
View tagsDialogView = LayoutInflater.from(getActivity()) View tagsDialogView = LayoutInflater.from(getActivity())
.inflate(R.layout.tags_dialog, null, false); .inflate(R.layout.tags_dialog, null, false);
final RecyclerView tagsListRecyclerView = (RecyclerView) tagsDialogView.findViewById(R.id.tags_dialog_tags_list); mTagsListRecyclerView = (RecyclerView) tagsDialogView.findViewById(R.id.tags_dialog_tags_list);
tagsListRecyclerView.requestFocus(); mTagsListRecyclerView.requestFocus();
tagsListRecyclerView.setHasFixedSize(true); mTagsListRecyclerView.setHasFixedSize(true);
RecyclerView.LayoutManager tagsListLayout = new LinearLayoutManager(getActivity()); RecyclerView.LayoutManager tagsListLayout = new LinearLayoutManager(getActivity());
tagsListRecyclerView.setLayoutManager(tagsListLayout); mTagsListRecyclerView.setLayoutManager(tagsListLayout);
mTagsArrayAdapter = new TagsArrayAdapter(); mTagsArrayAdapter = new TagsArrayAdapter();
tagsListRecyclerView.setAdapter(mTagsArrayAdapter); mTagsListRecyclerView.setAdapter(mTagsArrayAdapter);
mAddFilterEditText = (EditText) tagsDialogView.findViewById(R.id.tags_dialog_filter_edittext);
mAddFilterEditText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
/* Filter the tag list based on user input */
TagsArrayAdapter adapter = (TagsArrayAdapter) tagsListRecyclerView.getAdapter();
adapter.getFilter().filter(s.toString());
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void afterTextChanged(Editable s) {
}
});
InputFilter filter = new InputFilter() {
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
int dend) {
for (int i = start; i < end; i++) {
if (source.charAt(i) == ' ' || source.charAt(i) == ',') {
return "";
}
}
return null;
}
};
mAddFilterEditText.setFilters(new InputFilter[]{filter});
mAddFilterEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
/* Show a hint message about the add tag tick button when TextEdit gets focus if the tick button
* is actually shown, and the user has not previously learned how to add a new tag */
SharedPreferences prefs = AnkiDroidApp.getSharedPrefs(getActivity());
if (mAddTagImageView.isShown() && hasFocus && !prefs.getBoolean("knowsHowToAddTag", false)) {
Toast.makeText(getActivity(), R.string.tag_editor_add_hint, Toast.LENGTH_SHORT).show();
}
}
});
mAddTagImageView = (ImageView) tagsDialogView.findViewById(R.id.tags_dialog_add_tag_imageview);
mAddTagImageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String tag = mAddFilterEditText.getText().toString();
if (!TextUtils.isEmpty(tag)) {
mAddFilterEditText.setText("");
if (mCurrentTags.contains(tag)) {
return;
} else if (!mAllTags.contains(tag)) {
mAllTags.add(tag);
mTagsArrayAdapter.mTagsList.add(tag);
mTagsArrayAdapter.sortData();
}
mCurrentTags.add(tag);
mTagsArrayAdapter.notifyDataSetChanged();
// Show a toast to let the user know the tag was added successfully
Resources res = getResources();
Toast.makeText(getActivity(), res.getString(R.string.tag_editor_add_feedback, tag, res.getString(R.string.select)), Toast.LENGTH_LONG).show();
// Remember that the user has learned how to add a new tag
SharedPreferences prefs = AnkiDroidApp.getSharedPrefs(getActivity());
prefs.edit().putBoolean("knowsHowToAddTag", true).commit();
}
}
});
mNoTagsTextView = (TextView) tagsDialogView.findViewById(R.id.tags_dialog_no_tags_textview);
if (mAllTags.isEmpty()) {
mNoTagsTextView.setVisibility(View.VISIBLE);
}
mOptionsGroup = (RadioGroup) tagsDialogView.findViewById(R.id.tags_dialog_options_radiogroup); mOptionsGroup = (RadioGroup) tagsDialogView.findViewById(R.id.tags_dialog_options_radiogroup);
for (int i = 0; i < mOptionsGroup.getChildCount(); i++) { for (int i = 0; i < mOptionsGroup.getChildCount(); i++) {
mOptionsGroup.getChildAt(i).setId(i); mOptionsGroup.getChildAt(i).setId(i);
@ -193,10 +146,21 @@ public class TagsDialog extends DialogFragment {
} }
}); });
adjustDialogFromType(); switch (mType) {
case TYPE_ADD_TAG:
mDialogTitle = getResources().getString(R.string.card_details_tags);
mOptionsGroup.setVisibility(View.GONE);
mPositiveText = getString(R.string.dialog_ok);
break;
default:
mDialogTitle = getResources().getString(R.string.studyoptions_limit_select_tags);
mPositiveText = getString(R.string.select);
}
adjustToolbar(tagsDialogView);
MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity()) MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity())
.positiveText(res.getString(R.string.select)) .positiveText(mPositiveText)
.negativeText(res.getString(R.string.dialog_cancel)) .negativeText(res.getString(R.string.dialog_cancel))
.customView(tagsDialogView, false) .customView(tagsDialogView, false)
.callback(new MaterialDialog.ButtonCallback() { .callback(new MaterialDialog.ButtonCallback() {
@ -206,53 +170,134 @@ public class TagsDialog extends DialogFragment {
.onPositive(new ArrayList<String>(mCurrentTags), mSelectedOption); .onPositive(new ArrayList<String>(mCurrentTags), mSelectedOption);
} }
}); });
MaterialDialog dialog = builder.build(); mDialog = builder.build();
View customTitleView = LayoutInflater.from(getActivity()) mDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
.inflate(R.layout.tags_dialog_title, null, false); return mDialog;
TextView titleTV = (TextView) customTitleView.findViewById(R.id.tags_dialog_title_textview); }
titleTV.setText(mDialogTitle);
mCheckAllCheckBox = (CheckBox) customTitleView.findViewById(R.id.tags_dialog_all_checkbox); private void adjustToolbar(View tagsDialogView) {
mCheckAllCheckBox.setOnClickListener(new View.OnClickListener() { mToolbar = (Toolbar) tagsDialogView.findViewById(R.id.tags_dialog_toolbar);
mToolbar.setTitle(mDialogTitle);
mToolbar.inflateMenu(R.menu.tags_dialog_menu);
final InputFilter addTagFilter = new InputFilter() {
@Override @Override
public void onClick(View view) { public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
int dend) {
for (int i = start; i < end; i++) {
if (source.charAt(i) == ' ' || source.charAt(i) == ',') {
return "";
}
}
return null;
}
};
mToolbarAddItem = mToolbar.getMenu().findItem(R.id.tags_dialog_action_add);
mToolbarAddItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
String query = mToolbarSearchView.getQuery().toString();
if (MenuItemCompat.isActionViewExpanded(mToolbarSearchItem) && !TextUtils.isEmpty(query)) {
addTag(query);
} else {
MaterialDialog.Builder addTagBuilder = new MaterialDialog.Builder(getActivity())
.title(getString(R.string.add_tag))
.negativeText(R.string.dialog_cancel)
.positiveText(R.string.dialog_ok)
.inputType(InputType.TYPE_CLASS_TEXT)
.input(R.string.tag_name, R.string.empty_string, new MaterialDialog.InputCallback() {
@Override
public void onInput(MaterialDialog dialog, CharSequence input) {
addTag(input.toString());
}
});
final MaterialDialog addTagDialog = addTagBuilder.build();
EditText inputET = addTagDialog.getInputEditText();
inputET.setFilters(new InputFilter[]{addTagFilter});
addTagDialog.show();
}
return true;
}
});
mToolbarSearchItem = mToolbar.getMenu().findItem(R.id.tags_dialog_action_filter);
mToolbarSearchView = (SearchView) MenuItemCompat.getActionView(mToolbarSearchItem);
EditText queryET = (EditText) mToolbarSearchView.findViewById(R.id.search_src_text);
queryET.setFilters(new InputFilter[]{addTagFilter});
mToolbarSearchView.setQueryHint(getString(R.string.filter_tags));
mToolbarSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
mToolbarSearchView.clearFocus();
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
TagsArrayAdapter adapter = (TagsArrayAdapter) mTagsListRecyclerView.getAdapter();
adapter.getFilter().filter(newText);
return true;
}
});
MenuItem checkAllItem = mToolbar.getMenu().findItem(R.id.tags_dialog_action_select_all);
checkAllItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
boolean changed = false; boolean changed = false;
for (String tag : mTagsArrayAdapter.mTagsList) { if (mCurrentTags.containsAll(mTagsArrayAdapter.mTagsList)) {
if (mCheckAllCheckBox.isChecked() && !mCurrentTags.contains(tag)) { mCurrentTags.removeAll(mTagsArrayAdapter.mTagsList);
mCurrentTags.add(tag); changed = true;
changed = true; } else {
} else if (!mCheckAllCheckBox.isChecked() && mCurrentTags.contains(tag)) { for (String tag : mTagsArrayAdapter.mTagsList) {
mCurrentTags.remove(tag); if (!mCurrentTags.contains(tag)) {
changed = true; mCurrentTags.add(tag);
changed = true;
}
} }
} }
if (changed) { if (changed) {
mTagsArrayAdapter.notifyDataSetChanged(); mTagsArrayAdapter.notifyDataSetChanged();
} }
return true;
} }
}); });
mCheckAllCheckBox.setChecked(mCurrentTags.containsAll(mTagsArrayAdapter.mTagsList));
LinearLayout titleLayout = (LinearLayout) dialog.getView().findViewById(R.id.titleFrame);
titleLayout.removeAllViews();
titleLayout.addView(customTitleView);
titleLayout.setVisibility(View.VISIBLE);
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
return dialog;
}
private void adjustDialogFromType() {
switch (mType) { switch (mType) {
case TYPE_ADD_TAG: case TYPE_ADD_TAG:
mDialogTitle = getResources().getString(R.string.card_details_tags); mToolbarSearchView.setQueryHint(getString(R.string.add_new_filter_tags));
mOptionsGroup.setVisibility(View.GONE);
mAddFilterEditText.setHint(R.string.add_new_filter_tags);
break; break;
default: default:
mDialogTitle = getResources().getString(R.string.studyoptions_limit_select_tags); mToolbarAddItem.setVisible(false);
mAddTagImageView.setVisibility(View.GONE); }
mAddFilterEditText.setHint(R.string.filter_tags); }
public void addTag(String tag) {
if (!TextUtils.isEmpty(tag)) {
String feedbackText = "";
if (!mAllTags.contains(tag)) {
mAllTags.add(tag);
if (mNoTagsTextView.getVisibility() == View.VISIBLE) {
mNoTagsTextView.setVisibility(View.GONE);
}
mTagsArrayAdapter.mTagsList.add(tag);
mTagsArrayAdapter.sortData();
feedbackText = getString(R.string.tag_editor_add_feedback, tag, mPositiveText);
} else {
feedbackText = getString(R.string.tag_editor_add_feedback_existing, tag);
}
if (!mCurrentTags.contains(tag)) {
mCurrentTags.add(tag);
}
mTagsArrayAdapter.notifyDataSetChanged();
// Show a snackbar to let the user know the tag was added successfully
Snackbar.make(mDialog.getView().findViewById(R.id.tags_dialog_snackbar),
feedbackText, Snackbar.LENGTH_LONG).show();
} }
} }
@ -363,9 +408,6 @@ public class TagsDialog extends DialogFragment {
mTagsList.addAll(mFilteredTags); mTagsList.addAll(mFilteredTags);
sortData(); sortData();
notifyDataSetChanged(); notifyDataSetChanged();
//if all tags being displayed are checked, then check the checkall checkbox.
mCheckAllCheckBox.setChecked(mCurrentTags.containsAll(mTagsList));
} }
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_addtag_normal" android:state_pressed="false"/>
<item android:drawable="@drawable/ic_addtag_pressed" android:state_pressed="true"/>
</selector>

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/white_btn_radio_on" android:state_checked="true" android:state_window_focused="false"/>
<item android:drawable="@drawable/blue_btn_radio_off" android:state_checked="false" android:state_window_focused="false"/>
<item android:drawable="@drawable/white_btn_radio_on" android:state_checked="true" android:state_pressed="true"/>
<item android:drawable="@drawable/blue_btn_radio_off" android:state_checked="false" android:state_pressed="true"/>
<item android:drawable="@drawable/white_btn_radio_on" android:state_checked="true" android:state_focused="true"/>
<item android:drawable="@drawable/blue_btn_radio_off" android:state_checked="false" android:state_focused="true"/>
<item android:drawable="@drawable/blue_btn_radio_off" android:state_checked="false"/>
<item android:drawable="@drawable/white_btn_radio_on" android:state_checked="true"/>
</selector>

View File

@ -4,28 +4,22 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<FrameLayout android:id="@+id/tags_dialog_add_filter_frame" <include layout="@layout/tags_dialog_title"
android:layout_width="fill_parent" android:id="@+id/tags_dialog_toolbar"/>
<TextView android:id="@+id/tags_dialog_no_tags_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"> android:layout_centerHorizontal="true"
<EditText android:id="@+id/tags_dialog_filter_edittext" android:layout_below="@id/tags_dialog_toolbar"
android:layout_width="fill_parent" android:text="@string/no_tags"
android:layout_height="wrap_content"/> android:visibility="gone"/>
<ImageView android:id="@+id/tags_dialog_add_tag_imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
android:layout_gravity="end|center_vertical"
android:clickable="true"
android:src="@drawable/ic_addtag"/>
</FrameLayout>
<RadioGroup android:id="@+id/tags_dialog_options_radiogroup" <RadioGroup android:id="@+id/tags_dialog_options_radiogroup"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_above="@id/tags_dialog_add_filter_frame" android:layout_alignParentBottom="true"
android:orientation="horizontal"> android:orientation="horizontal">
<RadioButton <RadioButton
@ -47,5 +41,13 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@id/tags_dialog_options_radiogroup" android:layout_above="@id/tags_dialog_options_radiogroup"
android:layout_below="@id/tags_dialog_toolbar"
android:background="@color/white_background"/> android:background="@color/white_background"/>
<android.support.design.widget.CoordinatorLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:id="@+id/tags_dialog_snackbar"/>
</RelativeLayout> </RelativeLayout>

View File

@ -1,24 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
<TextView android:background="?attr/colorPrimary"
android:id="@+id/tags_dialog_title_textview" android:layout_alignParentTop="true"
android:layout_width="match_parent" app:theme="@style/ActionBar"
android:layout_height="wrap_content" app:popupTheme="@style/ActionBar.Popup">
android:textSize="@dimen/md_title_textsize"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_centerVertical="true"/>
<CheckBox android:id="@+id/tags_dialog_all_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@drawable/abc_btn_check_material"/>
</RelativeLayout> </android.support.v7.widget.Toolbar>

View File

@ -8,7 +8,7 @@
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:paddingBottom="5dp" android:paddingBottom="5dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:background="@drawable/abc_item_background_holo_light" android:background="?attr/selectableItemBackground"
android:textColor="@color/material_grey_800" android:textColor="@color/material_grey_800"
android:textSize="16sp" android:textSize="16sp"
android:checkMark="@drawable/abc_btn_check_material" android:checkMark="@drawable/abc_btn_check_material"

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ankidroid="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/tags_dialog_action_filter"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/filter_tags"
ankidroid:actionViewClass="android.support.v7.widget.SearchView"
ankidroid:showAsAction="always|collapseActionView"/>
<item
android:id="@+id/tags_dialog_action_add"
android:icon="@drawable/ic_add_white_24dp"
android:title="@string/add_tag"
ankidroid:showAsAction="ifRoom"/>
<item
android:id="@+id/tags_dialog_action_select_all"
android:icon="@drawable/ic_select_all_white_24dp"
android:title="@string/check_all_tags"
ankidroid:showAsAction="ifRoom"/>
</menu>

View File

@ -28,8 +28,12 @@
<string name="CardEditorModel">Type:</string> <string name="CardEditorModel">Type:</string>
<string name="CardEditorTags">Tags: %1$s</string> <string name="CardEditorTags">Tags: %1$s</string>
<string name="CardEditorCards">Cards: %1$s</string> <string name="CardEditorCards">Cards: %1$s</string>
<string name="tag_name">Tag name</string>
<string name="add_new_filter_tags">Add/filter tags</string> <string name="add_new_filter_tags">Add/filter tags</string>
<string name="add_tag">Add tag</string>
<string name="check_all_tags">Check/uncheck all tags</string>
<string name="filter_tags">Filter tags</string> <string name="filter_tags">Filter tags</string>
<string name="no_tags">You haven\'t added any tags yet.</string>
<string name="sdcard_missing_message">Switch off USB storage to access your decks</string> <string name="sdcard_missing_message">Switch off USB storage to access your decks</string>
<!-- Reviewer.java --> <!-- Reviewer.java -->
@ -148,8 +152,8 @@
<string name="sched_end">(end)</string> <string name="sched_end">(end)</string>
<string name="sched_unbury_button">To see them now, touch the \"Unbury\" button.</string> <string name="sched_unbury_button">To see them now, touch the \"Unbury\" button.</string>
<string name="sched_has_buried">Some related or buried cards were delayed until tomorrow.</string> <string name="sched_has_buried">Some related or buried cards were delayed until tomorrow.</string>
<string name="tag_editor_add_hint">Use tick mark on the right to add new tag</string> <string name="tag_editor_add_feedback">Press \"%2$s\" to confirm adding \"%1$s\"</string>
<string name="tag_editor_add_feedback">Press \"%2$s\" button to confirm adding \"%1$s\"</string> <string name="tag_editor_add_feedback_existing">Existing tag \"%1$s\" selected</string>
<string name="lookup_hint">After copying the text, tap anywhere on the flashcard to show the search icon</string> <string name="lookup_hint">After copying the text, tap anywhere on the flashcard to show the search icon</string>
<string name="add_content_showcase_text">To get started, tap the + button to add some new study material.\n\n Press \'Help\' to see the manual.</string> <string name="add_content_showcase_text">To get started, tap the + button to add some new study material.\n\n Press \'Help\' to see the manual.</string>
</resources> </resources>