ConfigListFragment: Restore the non-FAB add menu
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
416d3adda7
commit
85fc5e7ebf
@ -95,6 +95,9 @@ public class ConfigActivity extends BaseConfigActivity {
|
||||
case android.R.id.home:
|
||||
onBackPressed();
|
||||
return true;
|
||||
case R.id.menu_action_add:
|
||||
startActivity(new Intent(this, ConfigAddActivity.class));
|
||||
return true;
|
||||
case R.id.menu_action_edit:
|
||||
isEditing = true;
|
||||
switchToFragment(mainContainer, TAG_EDIT, true);
|
||||
|
@ -7,6 +7,7 @@ import android.util.Log;
|
||||
import android.view.ActionMode;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -27,6 +28,17 @@ import java.util.List;
|
||||
public class ConfigListFragment extends BaseConfigFragment {
|
||||
private ListView listView;
|
||||
|
||||
@Override
|
||||
public void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.config_list, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup parent,
|
||||
final Bundle savedInstanceState) {
|
||||
|
9
app/src/main/res/menu/config_list.xml
Normal file
9
app/src/main/res/menu/config_list.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/menu_action_add"
|
||||
android:alphabeticShortcut="n"
|
||||
android:icon="@drawable/ic_action_add"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/add" />
|
||||
</menu>
|
@ -4,6 +4,7 @@
|
||||
<item quantity="one">%d configuration selected</item>
|
||||
<item quantity="other">%d configurations selected</item>
|
||||
</plurals>
|
||||
<string name="add">Add</string>
|
||||
<string name="app_name">WireGuard</string>
|
||||
<string name="config_name">Configuration name</string>
|
||||
<string name="delete">Delete</string>
|
||||
|
Loading…
Reference in New Issue
Block a user