From 45bdfd67b1e364ede1ca68ebcbe676a60d26c4c0 Mon Sep 17 00:00:00 2001 From: gabriel Date: Sun, 11 Feb 2024 12:26:21 -0400 Subject: [PATCH] Review and fix ishan things --- .../pandroid/app/game/DrawerFragment.java | 16 ++------- .../pandroid/app/game/LuaDialogFragment.java | 1 - .../res/drawable/medium_card_background.xml | 5 +++ .../rounded_selectable_item_background.xml | 4 +-- .../res/drawable/simple_card_background.xml | 12 +++---- .../app/src/main/res/layout/activity_main.xml | 8 ----- .../main/res/layout/fragment_game_drawer.xml | 11 +++--- .../src/main/res/layout/fragment_games.xml | 17 +++++---- .../src/main/res/layout/fragment_search.xml | 3 +- .../app/src/main/res/layout/holder_game.xml | 23 ++++-------- .../src/main/res/layout/holder_lua_script.xml | 11 +++--- .../app/src/main/res/menu/game_drawer.xml | 34 ++++++++++++++++++ .../main/res/menu/game_drawer_settings.xml | 35 ------------------- .../src/main/res/values-pt-rBR/strings.xml | 1 + .../app/src/main/res/values/strings.xml | 1 + .../app/src/main/res/values/themes.xml | 6 ++-- 16 files changed, 79 insertions(+), 109 deletions(-) create mode 100644 src/pandroid/app/src/main/res/drawable/medium_card_background.xml create mode 100644 src/pandroid/app/src/main/res/menu/game_drawer.xml delete mode 100644 src/pandroid/app/src/main/res/menu/game_drawer_settings.xml diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/game/DrawerFragment.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/game/DrawerFragment.java index 3506e054..e15a27f5 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/game/DrawerFragment.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/game/DrawerFragment.java @@ -48,7 +48,7 @@ public class DrawerFragment extends Fragment implements DrawerLayout.DrawerListe ((AppCompatTextView)view.findViewById(R.id.game_title)).setText(game.getTitle()); ((AppCompatTextView)view.findViewById(R.id.game_publisher)).setText(game.getPublisher()); - ((NavigationView)view.findViewById(R.id.action_navigation)).setNavigationItemSelectedListener(this); + ((NavigationView)view.findViewById(R.id.menu)).setNavigationItemSelectedListener(this); } @Override @@ -81,17 +81,6 @@ public class DrawerFragment extends Fragment implements DrawerLayout.DrawerListe } } - private void changeScreenOrientation() { - int currentOrientation = getResources().getConfiguration().orientation; - - // Change the orientation - if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) { - requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } else { - requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } -} - @Override public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {} @@ -119,7 +108,8 @@ public class DrawerFragment extends Fragment implements DrawerLayout.DrawerListe } else if (id == R.id.lua_script){ new LuaDialogFragment().show(getParentFragmentManager(), null); } else if (id == R.id.change_orientation) { - changeScreenOrientation(); + boolean isLandscape = getResources().getDisplayMetrics().widthPixels > getResources().getDisplayMetrics().heightPixels; + requireActivity().setRequestedOrientation(isLandscape ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT : ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } return false; diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/game/LuaDialogFragment.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/game/LuaDialogFragment.java index e7da87bf..da059399 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/game/LuaDialogFragment.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/game/LuaDialogFragment.java @@ -12,7 +12,6 @@ import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; -import com.google.android.material.button.MaterialButton; import com.panda3ds.pandroid.AlberDriver; import com.panda3ds.pandroid.R; diff --git a/src/pandroid/app/src/main/res/drawable/medium_card_background.xml b/src/pandroid/app/src/main/res/drawable/medium_card_background.xml new file mode 100644 index 00000000..805248ea --- /dev/null +++ b/src/pandroid/app/src/main/res/drawable/medium_card_background.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/pandroid/app/src/main/res/drawable/rounded_selectable_item_background.xml b/src/pandroid/app/src/main/res/drawable/rounded_selectable_item_background.xml index fad2fe96..16b39ced 100644 --- a/src/pandroid/app/src/main/res/drawable/rounded_selectable_item_background.xml +++ b/src/pandroid/app/src/main/res/drawable/rounded_selectable_item_background.xml @@ -1,9 +1,9 @@ + android:color="?colorOnSurface"> - + diff --git a/src/pandroid/app/src/main/res/drawable/simple_card_background.xml b/src/pandroid/app/src/main/res/drawable/simple_card_background.xml index 88845ce4..f07f345c 100644 --- a/src/pandroid/app/src/main/res/drawable/simple_card_background.xml +++ b/src/pandroid/app/src/main/res/drawable/simple_card_background.xml @@ -1,9 +1,5 @@ - - - - - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/src/pandroid/app/src/main/res/layout/activity_main.xml b/src/pandroid/app/src/main/res/layout/activity_main.xml index c0d0efd7..68b87bfb 100644 --- a/src/pandroid/app/src/main/res/layout/activity_main.xml +++ b/src/pandroid/app/src/main/res/layout/activity_main.xml @@ -8,14 +8,6 @@ tools:context=".app.MainActivity" android:background="?colorSurface"> - - + android:layout_marginBottom="20dp" + app:strokeWidth="0px"> diff --git a/src/pandroid/app/src/main/res/layout/fragment_games.xml b/src/pandroid/app/src/main/res/layout/fragment_games.xml index 0538aeb6..33033834 100644 --- a/src/pandroid/app/src/main/res/layout/fragment_games.xml +++ b/src/pandroid/app/src/main/res/layout/fragment_games.xml @@ -1,9 +1,7 @@ - + android:tint="?colorOnPrimary" + android:elevation="5dp" + app:backgroundTint="?colorPrimary"/> diff --git a/src/pandroid/app/src/main/res/layout/fragment_search.xml b/src/pandroid/app/src/main/res/layout/fragment_search.xml index 3d987ff9..e165ff32 100644 --- a/src/pandroid/app/src/main/res/layout/fragment_search.xml +++ b/src/pandroid/app/src/main/res/layout/fragment_search.xml @@ -9,8 +9,7 @@ + android:paddingHorizontal="20dp"> + app:cardCornerRadius="10dp" + app:strokeWidth="0dp"> + android:gravity="center" + android:layout_marginTop="10dp"/> diff --git a/src/pandroid/app/src/main/res/layout/holder_lua_script.xml b/src/pandroid/app/src/main/res/layout/holder_lua_script.xml index 071d3c8c..c4410011 100644 --- a/src/pandroid/app/src/main/res/layout/holder_lua_script.xml +++ b/src/pandroid/app/src/main/res/layout/holder_lua_script.xml @@ -11,9 +11,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" app:cardBackgroundColor="?attr/colorSurfaceVariant" - app:cardCornerRadius="8dp" android:layout_gravity="center" - android:layout_margin="10dp"> + android:layout_margin="10dp" + app:strokeWidth="0px" + app:cardCornerRadius="8dp"> - - + + + + + + + + + + + + + + + diff --git a/src/pandroid/app/src/main/res/menu/game_drawer_settings.xml b/src/pandroid/app/src/main/res/menu/game_drawer_settings.xml deleted file mode 100644 index 12fa6d47..00000000 --- a/src/pandroid/app/src/main/res/menu/game_drawer_settings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/pandroid/app/src/main/res/values-pt-rBR/strings.xml b/src/pandroid/app/src/main/res/values-pt-rBR/strings.xml index eeeb842b..26f36faf 100644 --- a/src/pandroid/app/src/main/res/values-pt-rBR/strings.xml +++ b/src/pandroid/app/src/main/res/values-pt-rBR/strings.xml @@ -54,4 +54,5 @@ Shader Jit Usar recompilador de shaders. Gráficos + Rotacionar diff --git a/src/pandroid/app/src/main/res/values/strings.xml b/src/pandroid/app/src/main/res/values/strings.xml index 47cda8f0..d546620f 100644 --- a/src/pandroid/app/src/main/res/values/strings.xml +++ b/src/pandroid/app/src/main/res/values/strings.xml @@ -55,4 +55,5 @@ Shader JIT Use shader recompiler. Graphics + Rotate diff --git a/src/pandroid/app/src/main/res/values/themes.xml b/src/pandroid/app/src/main/res/values/themes.xml index 79ecdd60..e292b5e3 100644 --- a/src/pandroid/app/src/main/res/values/themes.xml +++ b/src/pandroid/app/src/main/res/values/themes.xml @@ -42,9 +42,9 @@ +