Review and fix ishan things

This commit is contained in:
gabriel 2024-02-11 12:26:21 -04:00
parent 8cb7a230cc
commit 45bdfd67b1
16 changed files with 79 additions and 109 deletions

View file

@ -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;

View file

@ -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;

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="16dp"/>
<solid android:color="#FFF"/>
</shape>

View file

@ -1,9 +1,9 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?colorControlHighlight">
android:color="?colorOnSurface">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<corners android:radius="9dp" />
<solid android:color="@android:color/black" />
<solid android:color="#FFFF" />
</shape>
</item>
</ripple>

View file

@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:radius="8dp"/>
<solid android:color="#FFF"/>
</shape>
</item>
</selector>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<solid android:color="#FFF"/>
</shape>

View file

@ -8,14 +8,6 @@
tools:context=".app.MainActivity"
android:background="?colorSurface">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorSurfaceVariant"
android:minHeight="?attr/actionBarSize"
app:title="@string/app_name" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_container"
android:layout_width="0dp"

View file

@ -29,7 +29,8 @@
android:layout_height="90dp"
app:cardCornerRadius="10dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp">
android:layout_marginBottom="20dp"
app:strokeWidth="0px">
<com.panda3ds.pandroid.view.gamesgrid.GameIconView
android:id="@+id/game_icon"
@ -55,10 +56,6 @@
android:paddingBottom="4dp"
android:gravity="center"
android:textStyle="bold"
android:ellipsize="marquee"
style="?attr/textAppearanceTitleSmall"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textSize="19sp"/>
<androidx.appcompat.widget.AppCompatTextView
@ -84,10 +81,10 @@
android:layout_marginTop="195dp">
<com.google.android.material.navigation.NavigationView
android:id="@+id/action_navigation"
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/game_drawer_settings"
app:menu="@menu/game_drawer"
android:background="?colorSurface"
android:theme="@style/Widget.App.NavigationView"
app:subheaderTextAppearance="@style/TextAppearanceGameDrawerSubTitle"/>

View file

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
android:layout_width="match_parent"
android:layout_marginTop="60dp"
android:layout_height="match_parent">
<com.panda3ds.pandroid.view.gamesgrid.GamesGridView
@ -13,16 +11,17 @@
android:paddingStart="15dp"
android:paddingEnd="15dp"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/add_rom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_width="58dp"
android:layout_height="58dp"
android:layout_margin="22dp"
android:background="@drawable/medium_card_background"
android:layout_gravity="end|bottom"
android:src="@drawable/ic_add"
android:gravity="center"
app:rippleColor="?colorOnSurfaceVariant"
app:backgroundTint="?colorPrimary"
tools:ignore="PrivateResource"/>
android:tint="?colorOnPrimary"
android:elevation="5dp"
app:backgroundTint="?colorPrimary"/>
</FrameLayout>

View file

@ -9,8 +9,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="64dp"
android:paddingHorizontal="20dp"
android:background="?colorSurfaceVariant">
android:paddingHorizontal="20dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/search_bar"

View file

@ -10,11 +10,10 @@
android:padding="15dp">
<com.google.android.material.card.MaterialCardView
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
app:shapeAppearance="?attr/shapeAppearanceCornerLarge">
app:cardCornerRadius="10dp"
app:strokeWidth="0dp">
<com.panda3ds.pandroid.view.gamesgrid.GameIconView
android:id="@+id/icon"
@ -29,27 +28,19 @@
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="?attr/textAppearanceTitleSmall"
android:textColor="?colorOnSurface"
android:text="@string/app_name"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:textStyle="bold"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:gravity="center"/>
android:gravity="center"
android:layout_marginTop="10dp"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textSize="10sp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textSize="11sp"
android:alpha="0.75"
android:gravity="center"/>
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -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">
<LinearLayout
android:layout_width="match_parent"
@ -22,15 +23,15 @@
android:gravity="center"
android:padding="10dp">
<ImageView
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginHorizontal="5dp"
android:scaleType="fitCenter"
android:tint="?attr/colorOnSurfaceVariant"
android:alpha="0.5"
android:padding="14dp"
android:src="@drawable/ic_code"
android:tint="?attr/colorOnSurfaceVariant"
android:layout_marginBottom="14dp"/>
<TextView
@ -44,7 +45,7 @@
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.button.MaterialButton
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/edit"
android:layout_width="40dp"
android:layout_height="40dp"

View file

@ -0,0 +1,34 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
android:divider="@null"
android:dividerHeight="0dp">
<item
android:id="@+id/header_actions"
android:title="@string/actions">
<menu>
<item
android:id="@+id/resume"
android:icon="@drawable/ic_shortcut"
android:title="@string/resume" />
<item
android:id="@+id/exit"
android:icon="@drawable/ic_exit"
android:title="@string/exit"/>
</menu>
</item>
<item
android:id="@+id/header_others"
android:title="@string/others">
<menu>
<item
android:id="@+id/change_orientation"
android:icon="@drawable/ic_rotate_screen"
android:title="@string/rotate" />
<item
android:id="@+id/lua_script"
android:icon="@drawable/ic_code"
android:title="@string/lua_script" />
</menu>
</item>
</menu>

View file

@ -1,35 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
android:divider="@null"
android:dividerHeight="0dp">
<item
android:id="@+id/header_actions"
android:title="Actions">
<menu>
<item
android:id="@+id/resume"
android:icon="@drawable/ic_shortcut"
android:title="@string/resume" />
<item
android:id="@+id/exit"
android:icon="@drawable/ic_exit"
android:title="@string/exit"/>
</menu>
</item>
<item
android:id="@+id/header_others"
android:title="Others">
<menu>
<item
android:id="@+id/change_orientation"
android:icon="@drawable/ic_rotate_screen"
android:title="Rotate" />
<item
android:id="@+id/lua_script"
android:icon="@drawable/ic_code"
android:title="@string/lua_script" />
</menu>
</item>
</menu>

View file

@ -54,4 +54,5 @@
<string name="pref_shader_jit_title">Shader Jit</string>
<string name="pref_shader_jit_summary">Usar recompilador de shaders.</string>
<string name="graphics">Gráficos</string>
<string name="rotate">Rotacionar</string>
</resources>

View file

@ -55,4 +55,5 @@
<string name="pref_shader_jit_title">Shader JIT</string>
<string name="pref_shader_jit_summary">Use shader recompiler.</string>
<string name="graphics">Graphics</string>
<string name="rotate">Rotate</string>
</resources>

View file

@ -42,9 +42,9 @@
<style name="Theme.Pandroid" parent="Base.Theme.Pandroid"/>
<style name="Widget.App.NavigationView" parent="Widget.Material3.NavigationView">
<item name="android:listDivider">@android:color/transparent</item>
</style>
<style name="Widget.App.NavigationView" parent="Widget.Material3.NavigationView">
<item name="android:listDivider">@android:color/transparent</item>
</style>
<style name="Theme.Pandroid.Custom" parent="Theme.Pandroid">
<item name="android:textColor">?colorOnSurface</item>