mirror of
https://github.com/izzy2lost/WeeU.git
synced 2026-07-06 00:19:59 -07:00
Refactored UI code
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -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));
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
+3
-3
@@ -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() {
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
+2
-2
@@ -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)));
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user