mirror of
https://github.com/SSimco/Cemu.git
synced 2024-11-23 05:19:40 +00:00
Refactored UI code
This commit is contained in:
parent
82f0a24e80
commit
c68665a1b4
@ -276,7 +276,7 @@ public class EmulationFragment extends Fragment implements PopupMenu.OnMenuItemC
|
||||
toastMessage(R.string.input_mode_default);
|
||||
});
|
||||
settingsMenu = new PopupMenu(requireContext(), binding.emulationSettingsButton);
|
||||
settingsMenu.getMenuInflater().inflate(R.menu.menu_emulation_in_game, settingsMenu.getMenu());
|
||||
settingsMenu.getMenuInflater().inflate(R.menu.emulation, settingsMenu.getMenu());
|
||||
settingsMenu.setOnMenuItemClickListener(EmulationFragment.this);
|
||||
binding.emulationSettingsButton.setOnClickListener(v -> settingsMenu.show());
|
||||
var menu = settingsMenu.getMenu();
|
||||
|
@ -12,6 +12,8 @@ import androidx.recyclerview.widget.DiffUtil;
|
||||
import androidx.recyclerview.widget.ListAdapter;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@ -103,7 +105,7 @@ public class GameAdapter extends ListAdapter<Game, GameAdapter.ViewHolder> {
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView icon;
|
||||
TextView text;
|
||||
ImageView favoriteIcon;
|
||||
MaterialCardView favoriteIcon;
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
@ -1,11 +1,10 @@
|
||||
package info.cemu.Cemu.gameview;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuInflater;
|
||||
@ -16,6 +15,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.navigation.fragment.NavHostFragment;
|
||||
@ -24,6 +24,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.FragmentGamesBinding;
|
||||
@ -64,13 +65,14 @@ public class GamesFragment extends Fragment {
|
||||
currentGamePaths = gamePaths;
|
||||
NativeGameTitles.reloadGameTitles();
|
||||
}
|
||||
gameAdapter.setFilterText(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(@NonNull ContextMenu menu, @NonNull View v, @Nullable ContextMenu.ContextMenuInfo menuInfo) {
|
||||
super.onCreateContextMenu(menu, v, menuInfo);
|
||||
MenuInflater inflater = requireActivity().getMenuInflater();
|
||||
inflater.inflate(R.menu.menu_game, menu);
|
||||
inflater.inflate(R.menu.game, menu);
|
||||
Game selectedGame = gameAdapter.getSelectedGame();
|
||||
menu.findItem(R.id.favorite).setChecked(selectedGame.isFavorite());
|
||||
menu.findItem(R.id.remove_shader_caches).setEnabled(NativeGameTitles.titleHasShaderCacheFiles(selectedGame.titleId()));
|
||||
@ -125,7 +127,28 @@ public class GamesFragment extends Fragment {
|
||||
Intent intent = new Intent(requireActivity(), SettingsActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
View rootView = binding.getRoot();
|
||||
binding.searchBar.inflateMenu(R.menu.game_list);
|
||||
var searchMenuItem = binding.searchBar.getMenu().findItem(R.id.action_search);
|
||||
binding.searchBar.setOnClickListener(v -> searchMenuItem.expandActionView());
|
||||
SearchView searchView = (SearchView) Objects.requireNonNull(searchMenuItem.getActionView());
|
||||
View searchPlate = searchView.findViewById(androidx.appcompat.R.id.search_plate);
|
||||
if (searchPlate != null) {
|
||||
searchPlate.setBackgroundColor(Color.TRANSPARENT);
|
||||
}
|
||||
searchView.setQueryHint(getString(R.string.search_games));
|
||||
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
gameAdapter.setFilterText(query);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
gameAdapter.setFilterText(newText);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
binding.gamesSwipeRefresh.setOnRefreshListener(() -> {
|
||||
if (refreshing) return;
|
||||
@ -137,22 +160,9 @@ public class GamesFragment extends Fragment {
|
||||
gameListViewModel.refreshGames();
|
||||
});
|
||||
recyclerView.setAdapter(gameAdapter);
|
||||
binding.searchText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
gameAdapter.setFilterText(charSequence.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
}
|
||||
});
|
||||
|
||||
return rootView;
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.guibasecomponents.ToggleRecyclerViewItem;
|
||||
import info.cemu.Cemu.guibasecomponents.GenericRecyclerViewAdapter;
|
||||
import info.cemu.Cemu.guibasecomponents.SelectionAdapter;
|
||||
@ -37,7 +37,7 @@ public class InputOverlaySettingsFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
var binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
var binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
GenericRecyclerViewAdapter genericRecyclerViewAdapter = new GenericRecyclerViewAdapter();
|
||||
|
||||
ToggleRecyclerViewItem inputOverlayToggle = new ToggleRecyclerViewItem(
|
||||
|
@ -14,7 +14,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.fragment.NavHostFragment;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.features.DocumentsProvider;
|
||||
import info.cemu.Cemu.guibasecomponents.ButtonRecyclerViewItem;
|
||||
import info.cemu.Cemu.guibasecomponents.GenericRecyclerViewAdapter;
|
||||
@ -23,7 +23,7 @@ import info.cemu.Cemu.guibasecomponents.SimpleButtonRecyclerViewItem;
|
||||
public class SettingsFragment extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
GenericRecyclerViewLayoutBinding binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
LayoutGenericRecyclerViewBinding binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
GenericRecyclerViewAdapter genericRecyclerViewAdapter = new GenericRecyclerViewAdapter();
|
||||
|
||||
genericRecyclerViewAdapter.addRecyclerViewItem(new SimpleButtonRecyclerViewItem(getString(R.string.open_cemu_folder), this::openCemuFolder));
|
||||
|
@ -13,7 +13,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.guibasecomponents.ToggleRecyclerViewItem;
|
||||
import info.cemu.Cemu.guibasecomponents.GenericRecyclerViewAdapter;
|
||||
import info.cemu.Cemu.guibasecomponents.SelectionAdapter;
|
||||
@ -33,7 +33,7 @@ public class AudioSettingsFragment extends Fragment {
|
||||
}
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
var binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
var binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
|
||||
GenericRecyclerViewAdapter genericRecyclerViewAdapter = new GenericRecyclerViewAdapter();
|
||||
|
||||
|
@ -29,7 +29,7 @@ import java.util.stream.Stream;
|
||||
|
||||
import info.cemu.Cemu.nativeinterface.NativeSettings;
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
|
||||
public class GamePathsFragment extends Fragment {
|
||||
private ActivityResultLauncher<Intent> folderSelectionLauncher;
|
||||
@ -69,14 +69,14 @@ public class GamePathsFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
GenericRecyclerViewLayoutBinding binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
LayoutGenericRecyclerViewBinding binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
binding.recyclerView.setAdapter(gamePathAdapter);
|
||||
gamesPaths = NativeSettings.getGamesPaths();
|
||||
gamePathAdapter.submitList(gamesPaths);
|
||||
requireActivity().addMenuProvider(new MenuProvider() {
|
||||
@Override
|
||||
public void onCreateMenu(@NonNull Menu menu, @NonNull MenuInflater menuInflater) {
|
||||
menuInflater.inflate(R.menu.menu_game_paths, menu);
|
||||
menuInflater.inflate(R.menu.game_paths, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,7 +17,7 @@ import java.util.Objects;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.guibasecomponents.GenericRecyclerViewAdapter;
|
||||
import info.cemu.Cemu.guibasecomponents.SingleSelectionRecyclerViewItem;
|
||||
import info.cemu.Cemu.guibasecomponents.StringSelectionAdapter;
|
||||
@ -42,7 +42,7 @@ public class GraphicPacksFragment extends Fragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
var binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
var binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
binding.recyclerView.setAdapter(genericRecyclerViewAdapter);
|
||||
|
||||
return binding.getRoot();
|
||||
|
@ -39,7 +39,7 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.guibasecomponents.FilterableRecyclerViewAdapter;
|
||||
import info.cemu.Cemu.nativeinterface.FileCallbacks;
|
||||
import info.cemu.Cemu.nativeinterface.NativeGameTitles;
|
||||
@ -173,12 +173,12 @@ public class GraphicPacksRootFragment extends Fragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
var binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
var binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
binding.recyclerView.setAdapter(this.genericRecyclerViewAdapter);
|
||||
requireActivity().addMenuProvider(new MenuProvider() {
|
||||
@Override
|
||||
public void onCreateMenu(@NonNull Menu menu, @NonNull MenuInflater menuInflater) {
|
||||
menuInflater.inflate(R.menu.menu_graphic_packs, menu);
|
||||
menuInflater.inflate(R.menu.graphic_packs, menu);
|
||||
var searchMenuItem = menu.findItem(R.id.action_graphic_packs_search);
|
||||
SearchView searchView = (SearchView) Objects.requireNonNull(searchMenuItem.getActionView());
|
||||
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
|
@ -12,7 +12,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.guibasecomponents.ToggleRecyclerViewItem;
|
||||
import info.cemu.Cemu.guibasecomponents.GenericRecyclerViewAdapter;
|
||||
import info.cemu.Cemu.guibasecomponents.SelectionAdapter;
|
||||
@ -51,7 +51,7 @@ public class GraphicsSettingsFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
var binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
var binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
|
||||
GenericRecyclerViewAdapter genericRecyclerViewAdapter = new GenericRecyclerViewAdapter();
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.guibasecomponents.GenericRecyclerViewAdapter;
|
||||
import info.cemu.Cemu.guibasecomponents.HeaderRecyclerViewItem;
|
||||
import info.cemu.Cemu.guibasecomponents.SingleSelectionRecyclerViewItem;
|
||||
@ -100,7 +100,7 @@ public class ControllerInputsFragment extends Fragment {
|
||||
|
||||
setControllerInputs(NativeInput.getControllerMappings(controllerIndex));
|
||||
|
||||
var binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
var binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
binding.recyclerView.setAdapter(genericRecyclerViewAdapter);
|
||||
|
||||
return binding.getRoot();
|
||||
|
@ -12,7 +12,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.fragment.NavHostFragment;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.guibasecomponents.ButtonRecyclerViewItem;
|
||||
import info.cemu.Cemu.guibasecomponents.GenericRecyclerViewAdapter;
|
||||
import info.cemu.Cemu.guibasecomponents.SimpleButtonRecyclerViewItem;
|
||||
@ -23,7 +23,7 @@ public class InputSettingsFragment extends Fragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
var binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
var binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
GenericRecyclerViewAdapter genericRecyclerViewAdapter = new GenericRecyclerViewAdapter();
|
||||
genericRecyclerViewAdapter.addRecyclerViewItem(new SimpleButtonRecyclerViewItem(getString(R.string.input_overlay_settings), () -> NavHostFragment.findNavController(InputSettingsFragment.this).navigate(R.id.action_inputSettingsFragment_to_inputOverlaySettingsFragment)));
|
||||
|
||||
|
@ -12,7 +12,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import info.cemu.Cemu.R;
|
||||
import info.cemu.Cemu.databinding.GenericRecyclerViewLayoutBinding;
|
||||
import info.cemu.Cemu.databinding.LayoutGenericRecyclerViewBinding;
|
||||
import info.cemu.Cemu.guibasecomponents.ToggleRecyclerViewItem;
|
||||
import info.cemu.Cemu.guibasecomponents.GenericRecyclerViewAdapter;
|
||||
import info.cemu.Cemu.guibasecomponents.HeaderRecyclerViewItem;
|
||||
@ -45,7 +45,7 @@ public class OverlaySettingsFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
var binding = GenericRecyclerViewLayoutBinding.inflate(inflater, container, false);
|
||||
var binding = LayoutGenericRecyclerViewBinding.inflate(inflater, container, false);
|
||||
|
||||
GenericRecyclerViewAdapter genericRecyclerViewAdapter = new GenericRecyclerViewAdapter();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
|
@ -7,10 +7,16 @@
|
||||
android:orientation="vertical"
|
||||
tools:context=".gameview.GameDetailsFragment">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/game_details_toolbar"
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/game_details_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -7,10 +7,15 @@
|
||||
android:orientation="vertical"
|
||||
tools:context=".gameview.GameProfileEditFragment">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/game_edit_profile_toolbar"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/game_edit_profile_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
|
@ -13,67 +13,52 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_marginEnd="328dp"
|
||||
android:layout_toStartOf="@+id/settings_button"
|
||||
app:cardCornerRadius="30dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/settings_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_search" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/search_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="@string/search_games"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text"
|
||||
android:maxWidth="300dp"
|
||||
android:maxLines="1" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/settings_button"
|
||||
style="?attr/materialIconButtonFilledStyle"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:contentDescription="@string/settings"
|
||||
android:gravity="center_vertical"
|
||||
app:icon="@drawable/ic_settings"
|
||||
app:iconSize="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_weight="1"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/search_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.8"
|
||||
app:contentInsetEnd="0dp"
|
||||
app:contentInsetEndWithActions="0dp"
|
||||
app:contentInsetStart="0dp"
|
||||
app:contentInsetStartWithNavigation="0dp"
|
||||
app:navigationIcon="@drawable/ic_search"
|
||||
app:title="@string/search_games" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/settings_button"
|
||||
style="?attr/materialIconButtonFilledStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:contentDescription="@string/settings"
|
||||
android:gravity="center_vertical"
|
||||
app:icon="@drawable/ic_settings"
|
||||
app:iconSize="24dp" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/games_recycler_view"
|
||||
@ -83,6 +68,7 @@
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
|
||||
app:spanCount="@integer/games_view_span_count" />
|
||||
app:spanCount="@integer/games_view_span_count"
|
||||
tools:listitem="@layout/layout_game" />
|
||||
</LinearLayout>
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -29,15 +29,25 @@
|
||||
android:scaleType="fitXY" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/game_favorite_icon"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:contentDescription="@string/game_favorite_description"
|
||||
android:src="@drawable/ic_favorite"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="?android:attr/colorPrimary" />
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/game_favorite_description"
|
||||
android:src="@drawable/ic_favorite"
|
||||
app:tint="?android:attr/colorPrimary" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
|
@ -3,14 +3,14 @@
|
||||
<item
|
||||
android:id="@+id/favorite"
|
||||
android:checkable="true"
|
||||
android:title="Favorite" />
|
||||
android:title="@string/game_favorite" />
|
||||
<item
|
||||
android:id="@+id/game_profile"
|
||||
android:title="Edit game profile" />
|
||||
android:title="@string/edit_game_profile" />
|
||||
<item
|
||||
android:id="@+id/remove_shader_caches"
|
||||
android:title="Remove shader caches" />
|
||||
android:title="@string/remove_shader_caches" />
|
||||
<item
|
||||
android:id="@+id/about_title"
|
||||
android:title="About title" />
|
||||
android:title="@string/about_title" />
|
||||
</menu>
|
8
src/android/app/src/main/res/menu/game_list.xml
Normal file
8
src/android/app/src/main/res/menu/game_list.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:visible="false"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
app:showAsAction="collapseActionView|ifRoom" />
|
||||
</menu>
|
@ -1,9 +0,0 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/action_settings"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
@ -8,7 +8,7 @@
|
||||
android:id="@+id/inputSettingsFragment"
|
||||
android:name="info.cemu.Cemu.settings.input.InputSettingsFragment"
|
||||
android:label="@string/input_settings"
|
||||
tools:layout="@layout/generic_recycler_view_layout">
|
||||
tools:layout="@layout/layout_generic_recycler_view">
|
||||
<action
|
||||
android:id="@+id/action_inputSettingsFragment_to_controllerInputsFragment"
|
||||
app:destination="@id/controllerInputsFragment" />
|
||||
@ -20,7 +20,7 @@
|
||||
android:id="@+id/graphicPacksRootFragment"
|
||||
android:name="info.cemu.Cemu.settings.graphicpacks.GraphicPacksRootFragment"
|
||||
android:label="@string/graphic_packs"
|
||||
tools:layout="@layout/generic_recycler_view_layout">
|
||||
tools:layout="@layout/layout_generic_recycler_view">
|
||||
<action
|
||||
android:id="@+id/action_graphicPacksRootFragment_to_graphicPacksFragment"
|
||||
app:destination="@id/graphicPacksFragment" />
|
||||
@ -29,7 +29,7 @@
|
||||
android:id="@+id/graphicPacksFragment"
|
||||
android:name="info.cemu.Cemu.settings.graphicpacks.GraphicPacksFragment"
|
||||
android:label="{title}"
|
||||
tools:layout="@layout/generic_recycler_view_layout">
|
||||
tools:layout="@layout/layout_generic_recycler_view">
|
||||
<action
|
||||
android:id="@+id/action_graphicPacksFragment_self"
|
||||
app:destination="@id/graphicPacksFragment" />
|
||||
@ -42,7 +42,7 @@
|
||||
android:id="@+id/settingsFragment"
|
||||
android:name="info.cemu.Cemu.settings.SettingsFragment"
|
||||
android:label="@string/settings"
|
||||
tools:layout="@layout/generic_recycler_view_layout">
|
||||
tools:layout="@layout/layout_generic_recycler_view">
|
||||
<action
|
||||
android:id="@+id/action_settingsFragment_to_inputSettingsFragment"
|
||||
app:destination="@id/inputSettingsFragment" />
|
||||
@ -65,30 +65,30 @@
|
||||
<fragment
|
||||
android:id="@+id/controllerInputsFragment"
|
||||
android:name="info.cemu.Cemu.settings.input.ControllerInputsFragment"
|
||||
tools:layout="@layout/generic_recycler_view_layout" />
|
||||
tools:layout="@layout/layout_generic_recycler_view" />
|
||||
<fragment
|
||||
android:id="@+id/graphicsSettingsFragment"
|
||||
android:name="info.cemu.Cemu.settings.graphics.GraphicsSettingsFragment"
|
||||
android:label="@string/graphics_settings"
|
||||
tools:layout="@layout/generic_recycler_view_layout" />
|
||||
tools:layout="@layout/layout_generic_recycler_view" />
|
||||
<fragment
|
||||
android:id="@+id/audioSettingsFragment"
|
||||
android:name="info.cemu.Cemu.settings.audio.AudioSettingsFragment"
|
||||
android:label="@string/audio_settings"
|
||||
tools:layout="@layout/generic_recycler_view_layout" />
|
||||
tools:layout="@layout/layout_generic_recycler_view" />
|
||||
<fragment
|
||||
android:id="@+id/overlaySettingsFragment"
|
||||
android:name="info.cemu.Cemu.settings.overlay.OverlaySettingsFragment"
|
||||
android:label="@string/overlay_settings"
|
||||
tools:layout="@layout/generic_recycler_view_layout" />
|
||||
tools:layout="@layout/layout_generic_recycler_view" />
|
||||
<fragment
|
||||
android:id="@+id/inputOverlaySettingsFragment"
|
||||
android:name="info.cemu.Cemu.inputoverlay.InputOverlaySettingsFragment"
|
||||
android:label="@string/input_overlay_settings"
|
||||
tools:layout="@layout/generic_recycler_view_layout" />
|
||||
tools:layout="@layout/layout_generic_recycler_view" />
|
||||
<fragment
|
||||
android:id="@+id/gamePathsFragment"
|
||||
android:name="info.cemu.Cemu.settings.gamespath.GamePathsFragment"
|
||||
android:label="@string/game_paths_settings"
|
||||
tools:layout="@layout/generic_recycler_view_layout" />
|
||||
tools:layout="@layout/layout_generic_recycler_view" />
|
||||
</navigation>
|
@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="Base.Theme.MyApplication" parent="Theme.Material3.DynamicColors.Dark">
|
||||
<style name="Base.Theme.Cemu" parent="Theme.Material3.DynamicColors.Dark">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="Theme.Cemu" parent="Base.Theme.MyApplication">
|
||||
<style name="Theme.Cemu" parent="Base.Theme.Cemu">
|
||||
<!-- Transparent system bars for edge-to-edge. -->
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
|
@ -223,4 +223,5 @@
|
||||
<string name="cpu_mode">CPU mode</string>
|
||||
<string name="thread_quantum">Thread quantum</string>
|
||||
<string name="audio_latency">Latency</string>
|
||||
<string name="game_favorite">Favorite</string>
|
||||
</resources>
|
@ -1,9 +1,9 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="Base.Theme.MyApplication" parent="Theme.Material3.DynamicColors.Light">
|
||||
<style name="Base.Theme.Cemu" parent="Theme.Material3.DynamicColors.Light">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Cemu" parent="Base.Theme.MyApplication" />
|
||||
<style name="Theme.Cemu" parent="Base.Theme.Cemu" />
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user