mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Use add icon for add custom input style menu
Bug: 16805043 Change-Id: I9730a6aa5d761924457edaabcee25db930e20f02
This commit is contained in:
parent
da8cda0578
commit
f7d1dc2b5e
BIN
java/res/drawable-hdpi/ic_add_circle_wht_24dp.png
Normal file
BIN
java/res/drawable-hdpi/ic_add_circle_wht_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 436 B |
BIN
java/res/drawable-mdpi/ic_add_circle_wht_24dp.png
Normal file
BIN
java/res/drawable-mdpi/ic_add_circle_wht_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 305 B |
BIN
java/res/drawable-xhdpi/ic_add_circle_wht_24dp.png
Normal file
BIN
java/res/drawable-xhdpi/ic_add_circle_wht_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 466 B |
BIN
java/res/drawable-xxhdpi/ic_add_circle_wht_24dp.png
Normal file
BIN
java/res/drawable-xxhdpi/ic_add_circle_wht_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 684 B |
26
java/res/menu/add_style.xml
Normal file
26
java/res/menu/add_style.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2014, 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.
|
||||
*/
|
||||
-->
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/action_add_style"
|
||||
android:icon="@drawable/ic_add_circle_wht_24dp"
|
||||
android:title="@string/add_style"
|
||||
android:showAsAction="always" />
|
||||
</menu>
|
@ -63,7 +63,6 @@ public final class CustomInputStyleSettingsFragment extends PreferenceFragment {
|
||||
private AlertDialog mSubtypeEnablerNotificationDialog;
|
||||
private String mSubtypePreferenceKeyForSubtypeEnabler;
|
||||
|
||||
private static final int MENU_ADD_SUBTYPE = Menu.FIRST;
|
||||
private static final String KEY_IS_ADDING_NEW_SUBTYPE = "is_adding_new_subtype";
|
||||
private static final String KEY_IS_SUBTYPE_ENABLER_NOTIFICATION_DIALOG_OPEN =
|
||||
"is_subtype_enabler_notification_dialog_open";
|
||||
@ -581,14 +580,13 @@ public final class CustomInputStyleSettingsFragment extends PreferenceFragment {
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
|
||||
final MenuItem addSubtypeMenu = menu.add(0, MENU_ADD_SUBTYPE, 0, R.string.add_style);
|
||||
addSubtypeMenu.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||
inflater.inflate(R.menu.add_style, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(final MenuItem item) {
|
||||
final int itemId = item.getItemId();
|
||||
if (itemId == MENU_ADD_SUBTYPE) {
|
||||
if (itemId == R.id.action_add_style) {
|
||||
final SubtypePreference newSubtype =
|
||||
SubtypePreference.newIncompleteSubtypePreference(getActivity(), mSubtypeProxy);
|
||||
getPreferenceScreen().addPreference(newSubtype);
|
||||
|
Loading…
Reference in New Issue
Block a user