diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java index 0595100e09..1c748a5cea 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -6,9 +6,10 @@ package org.dolphinemu.dolphinemu; -import android.app.AlertDialog; import android.view.Surface; +import androidx.appcompat.app.AlertDialog; + import org.dolphinemu.dolphinemu.activities.EmulationActivity; import org.dolphinemu.dolphinemu.utils.Log; import org.dolphinemu.dolphinemu.utils.Rumble; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index 5c81a11727..1b5661b9a0 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -1,6 +1,5 @@ package org.dolphinemu.dolphinemu.activities; -import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -12,6 +11,8 @@ import android.os.Handler; import android.preference.PreferenceManager; import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; @@ -326,7 +327,7 @@ public final class EmulationActivity extends AppCompatActivity } @Override - protected void onSaveInstanceState(Bundle outState) + protected void onSaveInstanceState(@NonNull Bundle outState) { if (!isChangingConfigurations()) { @@ -384,6 +385,7 @@ public final class EmulationActivity extends AppCompatActivity @Override protected void onActivityResult(int requestCode, int resultCode, Intent result) { + super.onActivityResult(requestCode, resultCode, result); switch (requestCode) { case REQUEST_CHANGE_DISC: @@ -795,9 +797,9 @@ public final class EmulationActivity extends AppCompatActivity LayoutInflater inflater = LayoutInflater.from(this); View view = inflater.inflate(R.layout.dialog_seekbar, null); - final SeekBar seekbar = (SeekBar) view.findViewById(R.id.seekbar); - final TextView value = (TextView) view.findViewById(R.id.text_value); - final TextView units = (TextView) view.findViewById(R.id.text_units); + final SeekBar seekbar = view.findViewById(R.id.seekbar); + final TextView value = view.findViewById(R.id.text_value); + final TextView units = view.findViewById(R.id.text_units); seekbar.setMax(150); seekbar.setProgress(mPreferences.getInt("controlScale", 50)); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java index c16ff93494..5cdb4d984d 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java @@ -1,9 +1,9 @@ package org.dolphinemu.dolphinemu.adapters; -import android.app.AlertDialog; import android.graphics.Rect; import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.FragmentActivity; import androidx.recyclerview.widget.RecyclerView; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java index ab5c200100..439c4a94d0 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java @@ -1,9 +1,9 @@ package org.dolphinemu.dolphinemu.adapters; -import android.app.AlertDialog; import android.content.Context; import android.graphics.drawable.Drawable; +import androidx.appcompat.app.AlertDialog; import androidx.leanback.widget.ImageCardView; import androidx.leanback.widget.Presenter; import androidx.fragment.app.FragmentActivity; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameSettingsDialog.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameSettingsDialog.java index 10d66f255a..9d2bf1cf76 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameSettingsDialog.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameSettingsDialog.java @@ -1,9 +1,10 @@ package org.dolphinemu.dolphinemu.dialogs; -import android.app.AlertDialog; import android.app.Dialog; import android.os.Bundle; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import android.widget.Toast; @@ -34,15 +35,16 @@ public class GameSettingsDialog extends DialogFragment return fragment; } + @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); + AlertDialog.Builder builder = new AlertDialog.Builder(requireContext()); - String gameId = getArguments().getString(ARG_GAMEID); - int platform = getArguments().getInt(ARG_PLATFORM); + String gameId = requireArguments().getString(ARG_GAMEID); + int platform = requireArguments().getInt(ARG_PLATFORM); - builder.setTitle(getActivity().getString(R.string.preferences_game_settings) + ": " + gameId) + builder.setTitle(requireContext().getString(R.string.preferences_game_settings) + ": " + gameId) .setItems(platform == Platform.GAMECUBE.toInt() ? R.array.gameSettingsMenusGC : R.array.gameSettingsMenusWii, (dialog, which) -> diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/MotionAlertDialog.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/MotionAlertDialog.java index f3b72dbcfc..880a28e08d 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/MotionAlertDialog.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/MotionAlertDialog.java @@ -1,11 +1,13 @@ package org.dolphinemu.dolphinemu.dialogs; -import android.app.AlertDialog; import android.content.Context; import android.view.InputDevice; import android.view.KeyEvent; import android.view.MotionEvent; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; + import org.dolphinemu.dolphinemu.features.settings.model.view.InputBindingSetting; import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper; import org.dolphinemu.dolphinemu.utils.Log; @@ -59,7 +61,7 @@ public final class MotionAlertDialog extends AlertDialog } @Override - public boolean onKeyLongPress(int keyCode, KeyEvent event) + public boolean onKeyLongPress(int keyCode, @NonNull KeyEvent event) { // Option to clear by long back is only needed on the TV interface if (TvUtil.isLeanback(getContext()) && keyCode == KeyEvent.KEYCODE_BACK) @@ -79,7 +81,7 @@ public final class MotionAlertDialog extends AlertDialog } @Override - public boolean dispatchGenericMotionEvent(MotionEvent event) + public boolean dispatchGenericMotionEvent(@NonNull MotionEvent event) { // Handle this event if we care about it, otherwise pass it down the framework return onMotionEvent(event) || super.dispatchGenericMotionEvent(event); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java index f0d0b65711..85ab6d328b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java @@ -1,6 +1,5 @@ package org.dolphinemu.dolphinemu.features.settings.ui; -import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; @@ -8,6 +7,8 @@ import android.content.IntentFilter; import android.os.Bundle; import android.provider.Settings; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.FragmentTransaction; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.appcompat.app.AppCompatActivity; @@ -67,7 +68,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting } @Override - protected void onSaveInstanceState(Bundle outState) + protected void onSaveInstanceState(@NonNull Bundle outState) { // Critical: If super method is not called, rotations will be busted. super.onSaveInstanceState(outState); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java index e391f582ea..0cc9dc7f72 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java @@ -1,6 +1,5 @@ package org.dolphinemu.dolphinemu.utils; -import android.app.AlertDialog; import android.content.Context; import android.content.SharedPreferences; import android.os.Build; @@ -14,7 +13,7 @@ import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.features.settings.model.Settings; import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile; -import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.appcompat.app.AlertDialog; public class Analytics { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PermissionsHandler.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PermissionsHandler.java index 20cfa6c130..64c59c17a2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PermissionsHandler.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PermissionsHandler.java @@ -1,12 +1,12 @@ package org.dolphinemu.dolphinemu.utils; import android.annotation.TargetApi; -import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.pm.PackageManager; import android.os.Build; +import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.FragmentActivity; import androidx.core.content.ContextCompat; diff --git a/Source/Android/app/src/main/res/layout/activity_main.xml b/Source/Android/app/src/main/res/layout/activity_main.xml index ecbdca3536..3ff9ddae0f 100644 --- a/Source/Android/app/src/main/res/layout/activity_main.xml +++ b/Source/Android/app/src/main/res/layout/activity_main.xml @@ -1,9 +1,9 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/coordinator_main" + android:layout_width="match_parent" + android:layout_height="match_parent"> + app:layout_scrollFlags="scroll|enterAlways" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> + app:tabTextAppearance="@style/MyCustomTextAppearance" /> @@ -32,17 +34,17 @@ android:id="@+id/pager_platforms" android:layout_width="match_parent" android:layout_height="match_parent" - app:layout_behavior="@string/appbar_scrolling_view_behavior"/> + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> + app:layout_anchorGravity="bottom|right|end" + app:rippleColor="?android:colorPrimaryDark" />