diff --git a/.idea/gradle.xml b/.idea/gradle.xml index ae388c2..06d66eb 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -10,8 +10,8 @@ diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/MainActivity.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/MainActivity.java index 5bc4db5..1f8d951 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/MainActivity.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/MainActivity.java @@ -19,6 +19,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; import androidx.fragment.app.Fragment; import com.cringe_studios.cringe_authenticator.databinding.ActivityMainBinding; @@ -158,8 +159,11 @@ public class MainActivity extends BaseActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { - if(NavigationUtil.getCurrentFragment(this) instanceof MenuFragment) { - getMenuInflater().inflate(R.menu.menu_groups, menu); + Fragment fragment = NavigationUtil.getCurrentFragment(this); + if(fragment instanceof MenuFragment) { + MenuFragment frag = (MenuFragment) fragment; + getMenuInflater().inflate(frag.isEditing() ? R.menu.menu_groups_edit : R.menu.menu_groups, menu); + if(frag.isEditing() && frag.hasSelectedMultipleItems()) menu.removeItem(R.id.action_edit_group); return true; } @@ -184,7 +188,16 @@ public class MainActivity extends BaseActivity { @Override public void onBackPressed() { - if(!(NavigationUtil.getCurrentFragment(this) instanceof HomeFragment)) { + Fragment fragment = NavigationUtil.getCurrentFragment(this); + if(fragment instanceof MenuFragment) { + MenuFragment menuFragment = (MenuFragment) fragment; + if(menuFragment.isEditing()) { + menuFragment.finishEditing(); + return; + } + } + + if(!(fragment instanceof HomeFragment)) { NavigationUtil.navigate(this, HomeFragment.class, null); } } @@ -256,12 +269,24 @@ public class MainActivity extends BaseActivity { } public void addGroup(MenuItem item) { - DialogUtil.showCreateGroupDialog(getLayoutInflater(), null, group -> { - Fragment frag = NavigationUtil.getCurrentFragment(this); - if(frag instanceof MenuFragment) { - ((MenuFragment) frag).addGroup(group); - } - }, null); + Fragment frag = NavigationUtil.getCurrentFragment(this); + if(frag instanceof MenuFragment) { + ((MenuFragment) frag).addGroup(); + } + } + + public void editGroup(MenuItem item) { + Fragment frag = NavigationUtil.getCurrentFragment(this); + if(frag instanceof MenuFragment) { + ((MenuFragment) frag).editGroup(); + } + } + + public void deleteGroup(MenuItem item) { + Fragment frag = NavigationUtil.getCurrentFragment(this); + if(frag instanceof MenuFragment) { + ((MenuFragment) frag).removeSelectedGroups(); + } } @Override diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/GroupFragment.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/GroupFragment.java index dcec588..8ead607 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/GroupFragment.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/GroupFragment.java @@ -1,5 +1,6 @@ package com.cringe_studios.cringe_authenticator.fragment; +import android.content.ClipData; import android.os.Bundle; import android.os.Handler; import android.os.Looper; @@ -9,6 +10,8 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.RecyclerView; import com.cringe_studios.cringe_authenticator.R; import com.cringe_studios.cringe_authenticator.crypto.CryptoException; diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/MenuFragment.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/MenuFragment.java index 3bdd609..da897de 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/MenuFragment.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/MenuFragment.java @@ -7,10 +7,14 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.RecyclerView; import com.cringe_studios.cringe_authenticator.R; import com.cringe_studios.cringe_authenticator.databinding.FragmentMenuBinding; import com.cringe_studios.cringe_authenticator.grouplist.GroupListAdapter; +import com.cringe_studios.cringe_authenticator.grouplist.GroupListItem; import com.cringe_studios.cringe_authenticator.util.DialogUtil; import com.cringe_studios.cringe_authenticator.util.FabUtil; import com.cringe_studios.cringe_authenticator.util.NavigationUtil; @@ -36,12 +40,11 @@ public class MenuFragment extends NamedFragment { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { binding = FragmentMenuBinding.inflate(inflater); - groupListAdapter = new GroupListAdapter(requireContext(), group -> { + groupListAdapter = new GroupListAdapter(requireContext(), binding.menuItems, group -> { Bundle bundle = new Bundle(); bundle.putString(GroupFragment.BUNDLE_GROUP, group); NavigationUtil.navigate(this, GroupFragment.class, bundle); - }, this::showGroupDialog); - + }, () -> SettingsUtil.setGroups(requireContext(), groupListAdapter.getItems())); binding.menuItems.setAdapter(groupListAdapter); loadGroups(); @@ -84,10 +87,43 @@ public class MenuFragment extends NamedFragment { } } - public void addGroup(String groupName) { - String id = UUID.randomUUID().toString(); - SettingsUtil.addGroup(requireContext(), id, groupName); - groupListAdapter.add(id); + public void addGroup() { + DialogUtil.showCreateGroupDialog(getLayoutInflater(), null, groupName -> { + String id = UUID.randomUUID().toString(); + SettingsUtil.addGroup(requireContext(), id, groupName); + groupListAdapter.add(id); + }, null); + } + + public void editGroup() { + if(!groupListAdapter.isEditing()) return; + + List items = groupListAdapter.getSelectedGroups(); + if(items.size() != 1) return; + + String group = items.get(0).getGroupId(); + + DialogUtil.showCreateGroupDialog(getLayoutInflater(), SettingsUtil.getGroupName(requireContext(), group), newName -> { // TODO: edit group dialog (with "Edit Group" title) + renameGroup(group, newName); + groupListAdapter.finishEditing(); + }, null); + } + + public void removeSelectedGroups() { + if(!groupListAdapter.isEditing()) return; + + new StyledDialogBuilder(requireContext()) + .setTitle(R.string.group_delete_title) + .setMessage("Delete selected groups?") + .setPositiveButton(R.string.yes, (d, w) -> { + for(GroupListItem item : groupListAdapter.getSelectedGroups()) { + removeGroup(item.getGroupId()); + } + + groupListAdapter.finishEditing(); + }) + .setNegativeButton(R.string.no, (d, w) -> {}) + .show(); } public void removeGroup(String group) { @@ -100,6 +136,18 @@ public class MenuFragment extends NamedFragment { groupListAdapter.update(group); } + public boolean isEditing() { + return groupListAdapter.isEditing(); + } + + public void finishEditing() { + groupListAdapter.finishEditing(); + } + + public boolean hasSelectedMultipleItems() { + return groupListAdapter.getSelectedGroups().size() > 1; + } + @Override public void onDestroyView() { super.onDestroyView(); diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/SettingsFragment.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/SettingsFragment.java index 1760161..ff911c2 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/SettingsFragment.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/SettingsFragment.java @@ -77,12 +77,8 @@ public class SettingsFragment extends NamedFragment { binding.settingsEnableEncryption.setChecked(SettingsUtil.isDatabaseEncrypted(requireContext())); binding.settingsEnableEncryption.setOnCheckedChangeListener((view, checked) -> { - if(!OTPDatabase.isDatabaseLoaded()) { - // TODO: prompt user - } - if(checked) { - DialogUtil.showInputPasswordDialog(requireContext(), password -> { + DialogUtil.showInputPasswordDialog(requireContext(), password -> { CryptoParameters params = CryptoParameters.createNew(); Log.d("Crypto", "Created new crypto params"); diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListAdapter.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListAdapter.java index 3fa3dde..bd66371 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListAdapter.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListAdapter.java @@ -1,5 +1,7 @@ package com.cringe_studios.cringe_authenticator.grouplist; +import android.app.Activity; +import android.app.Application; import android.content.Context; import android.os.Handler; import android.os.Looper; @@ -7,19 +9,29 @@ import android.view.LayoutInflater; import android.view.ViewGroup; import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; import androidx.core.util.Consumer; +import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.RecyclerView; +import com.cringe_studios.cringe_authenticator.BaseActivity; +import com.cringe_studios.cringe_authenticator.MainActivity; import com.cringe_studios.cringe_authenticator.databinding.MenuItemBinding; +import com.cringe_studios.cringe_authenticator.otplist.OTPListItem; import com.cringe_studios.cringe_authenticator.util.SettingsUtil; +import org.bouncycastle.jcajce.provider.symmetric.ARC4; + import java.util.ArrayList; +import java.util.Collections; import java.util.List; public class GroupListAdapter extends RecyclerView.Adapter { private Context context; + private RecyclerView recyclerView; + private LayoutInflater inflater; private List items; @@ -28,15 +40,20 @@ public class GroupListAdapter extends RecyclerView.Adapter { private Consumer navigateToGroup; - private Consumer showMenuCallback; + private Runnable saveGroups; - public GroupListAdapter(Context context, Consumer navigateToGroup, Consumer showMenuCallback) { + private boolean editing; + + public GroupListAdapter(Context context, RecyclerView recyclerView, Consumer navigateToGroup, Runnable saveGroups) { this.context = context; + this.recyclerView = recyclerView; this.navigateToGroup = navigateToGroup; - this.showMenuCallback = showMenuCallback; + this.saveGroups = saveGroups; this.inflater = LayoutInflater.from(context); this.items = new ArrayList<>(); this.handler = new Handler(Looper.getMainLooper()); + + attachTouchHelper(recyclerView); } @NonNull @@ -50,12 +67,31 @@ public class GroupListAdapter extends RecyclerView.Adapter { public void onBindViewHolder(@NonNull GroupListItem holder, int position) { String group = items.get(position); + holder.setGroupId(group); + holder.getBinding().button.setText(SettingsUtil.getGroupName(context, group)); - holder.getBinding().button.setOnClickListener(view -> navigateToGroup.accept(group)); - holder.getBinding().button.setOnLongClickListener(view -> { + holder.getBinding().button.setOnClickListener(view -> { + if(!editing) { + navigateToGroup.accept(group); + }else { + holder.setSelected(!holder.isSelected()); + if(getSelectedGroups().isEmpty()) editing = false; + ((BaseActivity) context).invalidateMenu(); + } + }); + /*holder.getBinding().button.setOnLongClickListener(view -> { showMenuCallback.accept(group); return true; + });*/ + + holder.getBinding().button.setOnLongClickListener(view -> { + if(editing) return true; + + holder.setSelected(true); + editing = true; + ((BaseActivity) context).invalidateMenu(); + return true; }); } @@ -64,6 +100,10 @@ public class GroupListAdapter extends RecyclerView.Adapter { return items.size(); } + public List getItems() { + return items; + } + public void add(String group) { items.add(group); notifyItemInserted(items.size() - 1); @@ -82,4 +122,57 @@ public class GroupListAdapter extends RecyclerView.Adapter { notifyItemChanged(index); } + public boolean isEditing() { + return editing; + } + + public void finishEditing() { + if(!editing) return; + + editing = false; + for(GroupListItem item : getSelectedGroups()) { + item.setSelected(false); + } + + ((BaseActivity) context).invalidateMenu(); + } + + public List getSelectedGroups() { + List selected = new ArrayList<>(); + for(int i = 0; i < items.size(); i++) { + GroupListItem vh = (GroupListItem) recyclerView.findViewHolderForAdapterPosition(i); + if(vh == null) continue; + if(vh.isSelected()) selected.add(vh); + } + return selected; + } + + private void attachTouchHelper(RecyclerView view) { + new ItemTouchHelper(new TouchHelperCallback()).attachToRecyclerView(view); + } + + private class TouchHelperCallback extends ItemTouchHelper.Callback { + + @Override + public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) { + return makeMovementFlags(ItemTouchHelper.UP | ItemTouchHelper.DOWN, 0); + } + + @Override + public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) { + Collections.swap(items, viewHolder.getAdapterPosition(), target.getAdapterPosition()); + notifyItemMoved(viewHolder.getAdapterPosition(), target.getAdapterPosition()); + saveGroups.run(); + return true; + } + + @Override + public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {} + + @Override + public boolean isLongPressDragEnabled() { + return editing; + } + } + } diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListItem.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListItem.java index cad9058..3451867 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListItem.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/grouplist/GroupListItem.java @@ -1,14 +1,24 @@ package com.cringe_studios.cringe_authenticator.grouplist; +import android.content.res.ColorStateList; +import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; +import android.os.Build; + import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import com.cringe_studios.cringe_authenticator.R; import com.cringe_studios.cringe_authenticator.databinding.MenuItemBinding; public class GroupListItem extends RecyclerView.ViewHolder { private MenuItemBinding binding; + private String groupId; + + private boolean selected; + public GroupListItem(@NonNull MenuItemBinding binding) { super(binding.getRoot()); this.binding = binding; @@ -17,4 +27,27 @@ public class GroupListItem extends RecyclerView.ViewHolder { public MenuItemBinding getBinding() { return binding; } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + public String getGroupId() { + return groupId; + } + + public void setSelected(boolean selected) { + this.selected = selected; + + if(selected) { + binding.menuItemBackground.setBackground(new ColorDrawable(0xFFFF00FF)); + }else { + binding.menuItemBackground.setBackground(null); + } + } + + public boolean isSelected() { + return selected; + } + } diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/util/NavigationUtil.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/util/NavigationUtil.java index 6d2a33a..6a5b877 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/util/NavigationUtil.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/util/NavigationUtil.java @@ -21,6 +21,7 @@ public class NavigationUtil { ActionBar bar = activity.getSupportActionBar(); navigate(manager, fragment, () -> { if(bar != null) bar.setTitle(fragment.getName()); + activity.invalidateMenu(); }); } @@ -47,10 +48,6 @@ public class NavigationUtil { return getCurrentFragment(activity.getSupportFragmentManager()); } - public static Fragment getCurrentFragment(Fragment currentFragment) { - return getCurrentFragment(currentFragment.getParentFragment().getChildFragmentManager()); - } - public static Fragment getCurrentFragment(FragmentManager manager) { return manager.findFragmentById(R.id.nav_host_fragment_content_main); } diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/util/SettingsUtil.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/util/SettingsUtil.java index 9b989f2..3bf979f 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/util/SettingsUtil.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/util/SettingsUtil.java @@ -47,6 +47,15 @@ public class SettingsUtil { return Arrays.asList(GSON.fromJson(prefs.getString("groups", "[]"), String[].class)); } + /** + * Only for reordering groups. Don't add/delete groups with this! + * @param groups Groups + */ + public static void setGroups(Context ctx, List groups) { + SharedPreferences prefs = ctx.getSharedPreferences(GROUPS_PREFS_NAME, Context.MODE_PRIVATE); + prefs.edit().putString("groups", GSON.toJson(groups)).apply(); + } + public static void addGroup(Context ctx, String group, String groupName) { List groups = new ArrayList<>(getGroups(ctx)); groups.add(group); diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/util/ThemeUtil.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/util/ThemeUtil.java index dbc90fc..b47ddf8 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/util/ThemeUtil.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/util/ThemeUtil.java @@ -1,6 +1,7 @@ package com.cringe_studios.cringe_authenticator.util; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; import com.cringe_studios.cringe_authenticator.R; @@ -13,6 +14,9 @@ public class ThemeUtil { }else { activity.setTheme(R.style.Theme_CringeAuthenticator_Blue_Green); } + + // TODO: use settings + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); } } diff --git a/app/src/main/res/drawable/baseline_add_24.xml b/app/src/main/res/drawable/baseline_add_24.xml index 89633bb..e728fdb 100644 --- a/app/src/main/res/drawable/baseline_add_24.xml +++ b/app/src/main/res/drawable/baseline_add_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/baseline_close_24.xml b/app/src/main/res/drawable/baseline_close_24.xml index 844b6b6..5f3c691 100644 --- a/app/src/main/res/drawable/baseline_close_24.xml +++ b/app/src/main/res/drawable/baseline_close_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/baseline_delete_24.xml b/app/src/main/res/drawable/baseline_delete_24.xml index de011dd..eba82ef 100644 --- a/app/src/main/res/drawable/baseline_delete_24.xml +++ b/app/src/main/res/drawable/baseline_delete_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/baseline_edit_24.xml b/app/src/main/res/drawable/baseline_edit_24.xml index 1c9bd3e..1074059 100644 --- a/app/src/main/res/drawable/baseline_edit_24.xml +++ b/app/src/main/res/drawable/baseline_edit_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/baseline_home_24.xml b/app/src/main/res/drawable/baseline_home_24.xml index 5a870f5..7b6a9a4 100644 --- a/app/src/main/res/drawable/baseline_home_24.xml +++ b/app/src/main/res/drawable/baseline_home_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/baseline_menu_24.xml b/app/src/main/res/drawable/baseline_menu_24.xml index 543cee9..f4363fa 100644 --- a/app/src/main/res/drawable/baseline_menu_24.xml +++ b/app/src/main/res/drawable/baseline_menu_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/baseline_qr_code_scanner_24.xml b/app/src/main/res/drawable/baseline_qr_code_scanner_24.xml index 32822c8..4d85a1e 100644 --- a/app/src/main/res/drawable/baseline_qr_code_scanner_24.xml +++ b/app/src/main/res/drawable/baseline_qr_code_scanner_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/baseline_settings_24.xml b/app/src/main/res/drawable/baseline_settings_24.xml index 298a5a1..1e35d48 100644 --- a/app/src/main/res/drawable/baseline_settings_24.xml +++ b/app/src/main/res/drawable/baseline_settings_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/baseline_visibility_24.xml b/app/src/main/res/drawable/baseline_visibility_24.xml index b923c39..8619441 100644 --- a/app/src/main/res/drawable/baseline_visibility_24.xml +++ b/app/src/main/res/drawable/baseline_visibility_24.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b84f38d..d680b80 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -29,7 +29,6 @@ android:layout_marginEnd="@dimen/fab_margin" android:layout_marginBottom="16dp" app:srcCompat="@drawable/baseline_edit_24" - app:tint="@color/white" android:backgroundTint="?attr/colorTheme1" android:visibility="gone" /> @@ -41,7 +40,6 @@ android:layout_marginEnd="@dimen/fab_margin" android:layout_marginBottom="16dp" app:srcCompat="@drawable/baseline_qr_code_scanner_24" - app:tint="@color/white" android:backgroundTint="?attr/colorTheme1" android:visibility="gone" /> @@ -54,8 +52,7 @@ android:layout_marginBottom="16dp" android:backgroundTint="?attr/colorTheme1" android:visibility="gone" - app:srcCompat="@drawable/baseline_compare_24" - app:tint="@color/white" /> + app:srcCompat="@drawable/baseline_compare_24" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 722c0af..866574d 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -17,6 +17,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:srcCompat="@drawable/cringeauth_white" /> + app:srcCompat="@drawable/cringeauth_white" + app:tint="?android:attr/textColor" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_menu.xml b/app/src/main/res/layout/fragment_menu.xml index 98e5064..923b88f 100644 --- a/app/src/main/res/layout/fragment_menu.xml +++ b/app/src/main/res/layout/fragment_menu.xml @@ -8,8 +8,7 @@ + android:layout_height="match_parent">