From 9d606a6ad0671dd8a262870cdf48deef1bcefa27 Mon Sep 17 00:00:00 2001 From: Simonx22 <26326692+Simonx22@users.noreply.github.com> Date: Fri, 15 Nov 2019 01:51:54 -0500 Subject: [PATCH] migrate to AndroidX --- Source/Android/app/build.gradle | 14 +- .../Android/app/src/main/AndroidManifest.xml | 2 +- .../activities/AppLinkActivity.java | 6 +- .../activities/CustomFilePickerActivity.java | 3 +- .../activities/EmulationActivity.java | 14 +- .../dolphinemu/adapters/GameAdapter.java | 13 +- .../dolphinemu/adapters/GameRowPresenter.java | 18 +- .../adapters/PlatformPagerAdapter.java | 8 +- .../adapters/SettingsRowPresenter.java | 6 +- .../dialogs/GameSettingsDialog.java | 4 +- .../settings/ui/SettingsActivity.java | 8 +- .../features/settings/ui/SettingsAdapter.java | 6 +- .../settings/ui/SettingsFragment.java | 10 +- .../settings/ui/SettingsFragmentView.java | 2 +- .../ui/viewholder/SettingViewHolder.java | 3 +- .../features/settings/utils/SettingsFile.java | 3 +- .../fragments/CustomFilePickerFragment.java | 6 +- .../fragments/EmulationFragment.java | 7 +- .../dolphinemu/fragments/MenuFragment.java | 6 +- .../fragments/SaveLoadStateFragment.java | 6 +- .../services/GameFileCacheService.java | 359 +++++++++--------- .../services/SyncChannelJobService.java | 8 +- .../services/SyncProgramsJobService.java | 8 +- .../dolphinemu/ui/DividerItemDecoration.java | 6 +- .../dolphinemu/ui/main/CustomTitleView.java | 6 +- .../dolphinemu/ui/main/MainActivity.java | 16 +- .../dolphinemu/ui/main/MainPresenter.java | 3 +- .../dolphinemu/ui/main/TvMainActivity.java | 20 +- .../ui/platform/PlatformGamesFragment.java | 10 +- .../AfterDirectoryInitializationRunner.java | 3 +- .../dolphinemu/utils/Analytics.java | 2 - .../dolphinemu/utils/AppLinkHelper.java | 3 +- .../utils/DirectoryInitialization.java | 3 +- .../dolphinemu/utils/FileBrowserHelper.java | 5 +- .../dolphinemu/utils/PermissionsHandler.java | 6 +- .../dolphinemu/utils/StartupHandler.java | 5 +- .../dolphinemu/dolphinemu/utils/TvUtil.java | 12 +- .../viewholders/FileViewHolder.java | 3 +- .../viewholders/GameViewHolder.java | 3 +- .../viewholders/TvGameViewHolder.java | 5 +- .../viewholders/TvSettingsViewHolder.java | 5 +- .../res/layout/activity_add_directory.xml | 6 +- .../app/src/main/res/layout/activity_main.xml | 16 +- .../app/src/main/res/layout/card_game.xml | 4 +- .../app/src/main/res/layout/fragment_grid.xml | 4 +- .../src/main/res/layout/fragment_settings.xml | 2 +- .../app/src/main/res/layout/tv_title.xml | 4 +- Source/Android/gradle.properties | 2 + 48 files changed, 359 insertions(+), 315 deletions(-) diff --git a/Source/Android/app/build.gradle b/Source/Android/app/build.gradle index c3b1e8450e..90c3fbe464 100644 --- a/Source/Android/app/build.gradle +++ b/Source/Android/app/build.gradle @@ -80,15 +80,15 @@ ext { } dependencies { - implementation "com.android.support:support-v13:$androidSupportVersion" - implementation "com.android.support:exifinterface:$androidSupportVersion" - implementation "com.android.support:cardview-v7:$androidSupportVersion" - implementation "com.android.support:recyclerview-v7:$androidSupportVersion" - implementation "com.android.support:design:$androidSupportVersion" + implementation 'androidx.legacy:legacy-support-v13:1.0.0' + implementation 'androidx.exifinterface:exifinterface:1.0.0' + implementation 'androidx.cardview:cardview:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.0.0' + implementation 'com.google.android.material:material:1.0.0' // Android TV UI libraries. - implementation "com.android.support:leanback-v17:$androidSupportVersion" - implementation "com.android.support:support-tv-provider:$androidSupportVersion" + implementation 'androidx.leanback:leanback:1.0.0' + implementation 'androidx.tvprovider:tvprovider:1.0.0' // For REST calls implementation 'com.android.volley:volley:1.1.0' diff --git a/Source/Android/app/src/main/AndroidManifest.xml b/Source/Android/app/src/main/AndroidManifest.xml index 623343a352..0ba4bc2b51 100644 --- a/Source/Android/app/src/main/AndroidManifest.xml +++ b/Source/Android/app/src/main/AndroidManifest.xml @@ -100,7 +100,7 @@ android:permission="android.permission.BIND_JOB_SERVICE"/> diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AppLinkActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AppLinkActivity.java index 5b5c310f75..09c8441a7a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AppLinkActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AppLinkActivity.java @@ -6,8 +6,10 @@ import android.content.Intent; import android.content.IntentFilter; import android.net.Uri; import android.os.Bundle; -import android.support.v4.app.FragmentActivity; -import android.support.v4.content.LocalBroadcastManager; + +import androidx.fragment.app.FragmentActivity; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + import android.util.Log; import android.widget.Toast; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/CustomFilePickerActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/CustomFilePickerActivity.java index 34ff216fc6..f715766bff 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/CustomFilePickerActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/CustomFilePickerActivity.java @@ -1,7 +1,8 @@ package org.dolphinemu.dolphinemu.activities; import android.os.Environment; -import android.support.annotation.Nullable; + +import androidx.annotation.Nullable; import com.nononsenseapps.filepicker.AbstractFilePickerFragment; import com.nononsenseapps.filepicker.FilePickerActivity; 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 ad97625af0..5c81a11727 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 @@ -6,16 +6,17 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ActivityInfo; -import android.content.res.Configuration; import android.hardware.usb.UsbManager; import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; -import android.support.annotation.IntDef; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentManager; -import android.support.v7.app.AppCompatActivity; + +import androidx.annotation.IntDef; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; +import androidx.appcompat.app.AppCompatActivity; + import android.text.TextUtils; import android.util.SparseIntArray; import android.view.InputDevice; @@ -42,7 +43,6 @@ import org.dolphinemu.dolphinemu.services.GameFileCacheService; import org.dolphinemu.dolphinemu.overlay.InputOverlay; import org.dolphinemu.dolphinemu.overlay.InputOverlayPointer; import org.dolphinemu.dolphinemu.ui.main.MainActivity; -import org.dolphinemu.dolphinemu.ui.main.MainPresenter; import org.dolphinemu.dolphinemu.ui.platform.Platform; import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper; import org.dolphinemu.dolphinemu.utils.FileBrowserHelper; 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 52312b29f9..1e208e16df 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,27 +1,22 @@ package org.dolphinemu.dolphinemu.adapters; import android.app.AlertDialog; -import android.content.DialogInterface; import android.graphics.Rect; -import android.support.v4.app.FragmentActivity; -import android.support.v7.widget.RecyclerView; + +import androidx.fragment.app.FragmentActivity; +import androidx.recyclerview.widget.RecyclerView; + import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Toast; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.activities.EmulationActivity; import org.dolphinemu.dolphinemu.dialogs.GameSettingsDialog; -import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag; -import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivity; import org.dolphinemu.dolphinemu.model.GameFile; -import org.dolphinemu.dolphinemu.utils.DirectoryInitialization; -import org.dolphinemu.dolphinemu.ui.platform.Platform; import org.dolphinemu.dolphinemu.utils.PicassoUtils; import org.dolphinemu.dolphinemu.viewholders.GameViewHolder; -import java.io.File; import java.util.ArrayList; import java.util.List; 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 8047a438e8..ab5c200100 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 @@ -2,29 +2,23 @@ package org.dolphinemu.dolphinemu.adapters; import android.app.AlertDialog; import android.content.Context; -import android.content.DialogInterface; import android.graphics.drawable.Drawable; -import android.support.v17.leanback.widget.ImageCardView; -import android.support.v17.leanback.widget.Presenter; -import android.support.v4.app.FragmentActivity; -import android.support.v4.content.ContextCompat; -import android.view.View; + +import androidx.leanback.widget.ImageCardView; +import androidx.leanback.widget.Presenter; +import androidx.fragment.app.FragmentActivity; +import androidx.core.content.ContextCompat; + import android.view.ViewGroup; import android.widget.ImageView; -import android.widget.Toast; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.dialogs.GameSettingsDialog; -import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag; -import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivity; import org.dolphinemu.dolphinemu.model.GameFile; -import org.dolphinemu.dolphinemu.utils.DirectoryInitialization; import org.dolphinemu.dolphinemu.ui.platform.Platform; import org.dolphinemu.dolphinemu.utils.PicassoUtils; import org.dolphinemu.dolphinemu.viewholders.TvGameViewHolder; -import java.io.File; - /** * The Leanback library / docs call this a Presenter, but it works very * similarly to a RecyclerView.Adapter. diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/PlatformPagerAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/PlatformPagerAdapter.java index 05c7dd3124..dd13742d61 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/PlatformPagerAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/PlatformPagerAdapter.java @@ -2,9 +2,11 @@ package org.dolphinemu.dolphinemu.adapters; import android.content.Context; import android.graphics.drawable.Drawable; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; + +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; + import android.text.Spannable; import android.text.SpannableString; import android.text.style.ImageSpan; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/SettingsRowPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/SettingsRowPresenter.java index a69508cc52..65751468ac 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/SettingsRowPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/SettingsRowPresenter.java @@ -1,8 +1,10 @@ package org.dolphinemu.dolphinemu.adapters; import android.content.res.Resources; -import android.support.v17.leanback.widget.ImageCardView; -import android.support.v17.leanback.widget.Presenter; + +import androidx.leanback.widget.ImageCardView; +import androidx.leanback.widget.Presenter; + import android.view.ViewGroup; import org.dolphinemu.dolphinemu.model.TvSettingsItem; 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 53e314d57b..10d66f255a 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 @@ -3,7 +3,9 @@ package org.dolphinemu.dolphinemu.dialogs; import android.app.AlertDialog; import android.app.Dialog; import android.os.Bundle; -import android.support.v4.app.DialogFragment; + +import androidx.fragment.app.DialogFragment; + import android.widget.Toast; import org.dolphinemu.dolphinemu.R; 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 314e8daf51..f0d0b65711 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 @@ -7,9 +7,11 @@ import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.provider.Settings; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.content.LocalBroadcastManager; -import android.support.v7.app.AppCompatActivity; + +import androidx.fragment.app.FragmentTransaction; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.appcompat.app.AppCompatActivity; + import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java index a4ce9ce7a8..cc7f586105 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java @@ -4,8 +4,10 @@ import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.RecyclerView; + +import androidx.appcompat.app.AlertDialog; +import androidx.recyclerview.widget.RecyclerView; + import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragment.java index a9e2720cd7..c27e481465 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragment.java @@ -3,10 +3,12 @@ package org.dolphinemu.dolphinemu.features.settings.ui; import android.app.Activity; import android.content.Context; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java index bc818dbf14..eeff02d7db 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java @@ -1,6 +1,6 @@ package org.dolphinemu.dolphinemu.features.settings.ui; -import android.support.v4.app.FragmentActivity; +import androidx.fragment.app.FragmentActivity; import org.dolphinemu.dolphinemu.features.settings.model.Setting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java index d6848d7bab..9523939e3e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.ui.viewholder; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; + import android.view.View; import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java index aac139266f..7c24bac42d 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.utils; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; + import android.text.TextUtils; import org.dolphinemu.dolphinemu.NativeLibrary; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/CustomFilePickerFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/CustomFilePickerFragment.java index 58cfcb9121..5f20e10325 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/CustomFilePickerFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/CustomFilePickerFragment.java @@ -2,8 +2,10 @@ package org.dolphinemu.dolphinemu.fragments; import android.net.Uri; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.content.FileProvider; + +import androidx.annotation.NonNull; +import androidx.core.content.FileProvider; + import android.view.View; import android.widget.TextView; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java index 64959601bb..881fd3c554 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java @@ -5,8 +5,10 @@ import android.content.IntentFilter; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v4.app.Fragment; -import android.support.v4.content.LocalBroadcastManager; + +import androidx.fragment.app.Fragment; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + import android.view.LayoutInflater; import android.view.Surface; import android.view.SurfaceHolder; @@ -24,7 +26,6 @@ import org.dolphinemu.dolphinemu.utils.DirectoryInitialization; import org.dolphinemu.dolphinemu.utils.DirectoryInitialization.DirectoryInitializationState; import org.dolphinemu.dolphinemu.utils.DirectoryStateReceiver; import org.dolphinemu.dolphinemu.utils.Log; -import org.dolphinemu.dolphinemu.utils.StartupHandler; import java.io.File; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java index 7296946346..f81853661b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java @@ -1,8 +1,10 @@ package org.dolphinemu.dolphinemu.fragments; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + import android.util.SparseIntArray; import android.view.LayoutInflater; import android.view.View; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveLoadStateFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveLoadStateFragment.java index 9bd30d68fe..026b95d1e1 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveLoadStateFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveLoadStateFragment.java @@ -1,8 +1,10 @@ package org.dolphinemu.dolphinemu.fragments; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + import android.util.SparseIntArray; import android.view.LayoutInflater; import android.view.View; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java index 440f70a5bb..fa6f039d84 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java @@ -1,179 +1,180 @@ -package org.dolphinemu.dolphinemu.services; - -import android.app.IntentService; -import android.content.Context; -import android.content.Intent; -import android.support.v4.content.LocalBroadcastManager; - -import org.dolphinemu.dolphinemu.model.GameFile; -import org.dolphinemu.dolphinemu.model.GameFileCache; -import org.dolphinemu.dolphinemu.ui.platform.Platform; -import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; - -/** - * A service that loads game list data on a separate thread. - */ -public final class GameFileCacheService extends IntentService -{ - public static final String BROADCAST_ACTION = "org.dolphinemu.dolphinemu.GAME_FILE_CACHE_UPDATED"; - - private static final String ACTION_LOAD = "org.dolphinemu.dolphinemu.LOAD_GAME_FILE_CACHE"; - private static final String ACTION_RESCAN = "org.dolphinemu.dolphinemu.RESCAN_GAME_FILE_CACHE"; - - private static GameFileCache gameFileCache = null; - private static AtomicReference gameFiles = new AtomicReference<>(new GameFile[]{}); - private static AtomicBoolean hasLoadedCache = new AtomicBoolean(false); - private static AtomicBoolean hasScannedLibrary = new AtomicBoolean(false); - - public GameFileCacheService() - { - // Superclass constructor is called to name the thread on which this service executes. - super("GameFileCacheService"); - } - - public static List getGameFilesForPlatform(Platform platform) - { - GameFile[] allGames = gameFiles.get(); - ArrayList platformGames = new ArrayList<>(); - for (GameFile game : allGames) - { - if (Platform.fromNativeInt(game.getPlatform()) == platform) - { - platformGames.add(game); - } - } - return platformGames; - } - - public static GameFile getGameFileByGameId(String gameId) - { - GameFile[] allGames = gameFiles.get(); - for (GameFile game : allGames) - { - if (game.getGameId().equals(gameId)) - { - return game; - } - } - return null; - } - - public static GameFile findSecondDisc(GameFile game) - { - GameFile matchWithoutRevision = null; - - GameFile[] allGames = gameFiles.get(); - for (GameFile otherGame : allGames) - { - if (game.getGameId().equals(otherGame.getGameId()) && - game.getDiscNumber() != otherGame.getDiscNumber()) - { - if (game.getRevision() == otherGame.getRevision()) - return otherGame; - else - matchWithoutRevision = otherGame; - } - } - - return matchWithoutRevision; - } - - public static boolean hasLoadedCache() - { - return hasLoadedCache.get(); - } - - public static boolean hasScannedLibrary() - { - return hasScannedLibrary.get(); - } - - private static void startService(Context context, String action) - { - Intent intent = new Intent(context, GameFileCacheService.class); - intent.setAction(action); - context.startService(intent); - } - - /** - * Asynchronously loads the game file cache from disk without checking - * which games are present on the file system. - */ - public static void startLoad(Context context) - { - new AfterDirectoryInitializationRunner().run(context, - () -> startService(context, ACTION_LOAD)); - } - - /** - * Asynchronously scans for games in the user's configured folders, - * updating the game file cache with the results. - * If startLoad hasn't been called before this, this has no effect. - */ - public static void startRescan(Context context) - { - new AfterDirectoryInitializationRunner().run(context, - () -> startService(context, ACTION_RESCAN)); - } - - public static GameFile addOrGet(String gamePath) - { - // The existence of this one function, which is called from one - // single place, forces us to use synchronization in onHandleIntent... - // A bit annoying, but should be good enough for now - synchronized (gameFileCache) - { - return gameFileCache.addOrGet(gamePath); - } - } - - @Override - protected void onHandleIntent(Intent intent) - { - // Load the game list cache if it isn't already loaded, otherwise do nothing - if (ACTION_LOAD.equals(intent.getAction()) && gameFileCache == null) - { - GameFileCache temp = new GameFileCache(getCacheDir() + File.separator + "gamelist.cache"); - synchronized (temp) - { - gameFileCache = temp; - gameFileCache.load(); - updateGameFileArray(); - hasLoadedCache.set(true); - sendBroadcast(); - } - } - - // Rescan the file system and update the game list cache with the results - if (ACTION_RESCAN.equals(intent.getAction()) && gameFileCache != null) - { - synchronized (gameFileCache) - { - boolean changed = gameFileCache.scanLibrary(this); - if (changed) - updateGameFileArray(); - hasScannedLibrary.set(true); - sendBroadcast(); - } - } - } - - private void updateGameFileArray() - { - GameFile[] gameFilesTemp = gameFileCache.getAllGames(); - Arrays.sort(gameFilesTemp, (lhs, rhs) -> lhs.getTitle().compareToIgnoreCase(rhs.getTitle())); - gameFiles.set(gameFilesTemp); - } - - private void sendBroadcast() - { - LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(BROADCAST_ACTION)); - } -} +package org.dolphinemu.dolphinemu.services; + +import android.app.IntentService; +import android.content.Context; +import android.content.Intent; + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + +import org.dolphinemu.dolphinemu.model.GameFile; +import org.dolphinemu.dolphinemu.model.GameFileCache; +import org.dolphinemu.dolphinemu.ui.platform.Platform; +import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; + +/** + * A service that loads game list data on a separate thread. + */ +public final class GameFileCacheService extends IntentService +{ + public static final String BROADCAST_ACTION = "org.dolphinemu.dolphinemu.GAME_FILE_CACHE_UPDATED"; + + private static final String ACTION_LOAD = "org.dolphinemu.dolphinemu.LOAD_GAME_FILE_CACHE"; + private static final String ACTION_RESCAN = "org.dolphinemu.dolphinemu.RESCAN_GAME_FILE_CACHE"; + + private static GameFileCache gameFileCache = null; + private static AtomicReference gameFiles = new AtomicReference<>(new GameFile[]{}); + private static AtomicBoolean hasLoadedCache = new AtomicBoolean(false); + private static AtomicBoolean hasScannedLibrary = new AtomicBoolean(false); + + public GameFileCacheService() + { + // Superclass constructor is called to name the thread on which this service executes. + super("GameFileCacheService"); + } + + public static List getGameFilesForPlatform(Platform platform) + { + GameFile[] allGames = gameFiles.get(); + ArrayList platformGames = new ArrayList<>(); + for (GameFile game : allGames) + { + if (Platform.fromNativeInt(game.getPlatform()) == platform) + { + platformGames.add(game); + } + } + return platformGames; + } + + public static GameFile getGameFileByGameId(String gameId) + { + GameFile[] allGames = gameFiles.get(); + for (GameFile game : allGames) + { + if (game.getGameId().equals(gameId)) + { + return game; + } + } + return null; + } + + public static GameFile findSecondDisc(GameFile game) + { + GameFile matchWithoutRevision = null; + + GameFile[] allGames = gameFiles.get(); + for (GameFile otherGame : allGames) + { + if (game.getGameId().equals(otherGame.getGameId()) && + game.getDiscNumber() != otherGame.getDiscNumber()) + { + if (game.getRevision() == otherGame.getRevision()) + return otherGame; + else + matchWithoutRevision = otherGame; + } + } + + return matchWithoutRevision; + } + + public static boolean hasLoadedCache() + { + return hasLoadedCache.get(); + } + + public static boolean hasScannedLibrary() + { + return hasScannedLibrary.get(); + } + + private static void startService(Context context, String action) + { + Intent intent = new Intent(context, GameFileCacheService.class); + intent.setAction(action); + context.startService(intent); + } + + /** + * Asynchronously loads the game file cache from disk without checking + * which games are present on the file system. + */ + public static void startLoad(Context context) + { + new AfterDirectoryInitializationRunner().run(context, + () -> startService(context, ACTION_LOAD)); + } + + /** + * Asynchronously scans for games in the user's configured folders, + * updating the game file cache with the results. + * If startLoad hasn't been called before this, this has no effect. + */ + public static void startRescan(Context context) + { + new AfterDirectoryInitializationRunner().run(context, + () -> startService(context, ACTION_RESCAN)); + } + + public static GameFile addOrGet(String gamePath) + { + // The existence of this one function, which is called from one + // single place, forces us to use synchronization in onHandleIntent... + // A bit annoying, but should be good enough for now + synchronized (gameFileCache) + { + return gameFileCache.addOrGet(gamePath); + } + } + + @Override + protected void onHandleIntent(Intent intent) + { + // Load the game list cache if it isn't already loaded, otherwise do nothing + if (ACTION_LOAD.equals(intent.getAction()) && gameFileCache == null) + { + GameFileCache temp = new GameFileCache(getCacheDir() + File.separator + "gamelist.cache"); + synchronized (temp) + { + gameFileCache = temp; + gameFileCache.load(); + updateGameFileArray(); + hasLoadedCache.set(true); + sendBroadcast(); + } + } + + // Rescan the file system and update the game list cache with the results + if (ACTION_RESCAN.equals(intent.getAction()) && gameFileCache != null) + { + synchronized (gameFileCache) + { + boolean changed = gameFileCache.scanLibrary(this); + if (changed) + updateGameFileArray(); + hasScannedLibrary.set(true); + sendBroadcast(); + } + } + } + + private void updateGameFileArray() + { + GameFile[] gameFilesTemp = gameFileCache.getAllGames(); + Arrays.sort(gameFilesTemp, (lhs, rhs) -> lhs.getTitle().compareToIgnoreCase(rhs.getTitle())); + gameFiles.set(gameFilesTemp); + } + + private void sendBroadcast() + { + LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(BROADCAST_ACTION)); + } +} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java index 5735c7e06d..43dabe7444 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java @@ -11,9 +11,11 @@ import android.media.tv.TvContract; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; -import android.support.media.tv.Channel; -import android.support.media.tv.ChannelLogoUtils; -import android.support.media.tv.TvContractCompat; + +import androidx.tvprovider.media.tv.Channel; +import androidx.tvprovider.media.tv.ChannelLogoUtils; +import androidx.tvprovider.media.tv.TvContractCompat; + import android.util.Log; import org.dolphinemu.dolphinemu.R; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncProgramsJobService.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncProgramsJobService.java index e083c32edf..8819746aba 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncProgramsJobService.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncProgramsJobService.java @@ -6,9 +6,11 @@ import android.content.Context; import android.net.Uri; import android.os.AsyncTask; import android.os.PersistableBundle; -import android.support.media.tv.Channel; -import android.support.media.tv.PreviewProgram; -import android.support.media.tv.TvContractCompat; + +import androidx.tvprovider.media.tv.Channel; +import androidx.tvprovider.media.tv.PreviewProgram; +import androidx.tvprovider.media.tv.TvContractCompat; + import android.util.Log; import org.dolphinemu.dolphinemu.R; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/DividerItemDecoration.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/DividerItemDecoration.java index 5cde35dd4a..0a923e4eaf 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/DividerItemDecoration.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/DividerItemDecoration.java @@ -5,8 +5,10 @@ import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import android.util.AttributeSet; import android.view.View; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/CustomTitleView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/CustomTitleView.java index 5ad3b39b5a..aefc4c3ad3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/CustomTitleView.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/CustomTitleView.java @@ -2,7 +2,9 @@ package org.dolphinemu.dolphinemu.ui.main; import android.content.Context; import android.graphics.drawable.Drawable; -import android.support.v17.leanback.widget.TitleViewAdapter; + +import androidx.leanback.widget.TitleViewAdapter; + import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; @@ -79,4 +81,4 @@ public class CustomTitleView extends LinearLayout implements TitleViewAdapter.Pr { return mTitleViewAdapter; } -} \ No newline at end of file +} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java index 84506567fd..826c42ec72 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java @@ -3,12 +3,16 @@ package org.dolphinemu.dolphinemu.ui.main; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.TabLayout; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; + +import androidx.annotation.Nullable; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.tabs.TabLayout; + +import androidx.viewpager.widget.ViewPager; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java index 54ef3cf377..047e710b7b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java @@ -4,7 +4,8 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.support.v4.content.LocalBroadcastManager; + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java index c3acef8add..2ae421fbb2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java @@ -3,15 +3,17 @@ package org.dolphinemu.dolphinemu.ui.main; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; -import android.support.v17.leanback.app.BrowseFragment; -import android.support.v17.leanback.app.BrowseSupportFragment; -import android.support.v17.leanback.widget.ArrayObjectAdapter; -import android.support.v17.leanback.widget.HeaderItem; -import android.support.v17.leanback.widget.ListRow; -import android.support.v17.leanback.widget.ListRowPresenter; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentManager; -import android.support.v4.content.ContextCompat; + +import androidx.leanback.app.BrowseFragment; +import androidx.leanback.app.BrowseSupportFragment; +import androidx.leanback.widget.ArrayObjectAdapter; +import androidx.leanback.widget.HeaderItem; +import androidx.leanback.widget.ListRow; +import androidx.leanback.widget.ListRowPresenter; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; +import androidx.core.content.ContextCompat; + import android.widget.Toast; import org.dolphinemu.dolphinemu.R; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java index 6502241705..d735e17119 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java @@ -1,10 +1,12 @@ package org.dolphinemu.dolphinemu.ui.platform; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.GridLayoutManager; -import android.support.v7.widget.RecyclerView; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AfterDirectoryInitializationRunner.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AfterDirectoryInitializationRunner.java index 0ce87b2b8a..1ff86d8656 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AfterDirectoryInitializationRunner.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AfterDirectoryInitializationRunner.java @@ -2,7 +2,8 @@ package org.dolphinemu.dolphinemu.utils; import android.content.Context; import android.content.IntentFilter; -import android.support.v4.content.LocalBroadcastManager; + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; public class AfterDirectoryInitializationRunner { 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 cb7aec2056..783536f1cd 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 @@ -2,11 +2,9 @@ package org.dolphinemu.dolphinemu.utils; import android.app.AlertDialog; import android.content.Context; -import android.content.IntentFilter; import android.content.SharedPreferences; import android.os.Build; import android.preference.PreferenceManager; -import android.support.v4.content.LocalBroadcastManager; import com.android.volley.Request; import com.android.volley.toolbox.StringRequest; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AppLinkHelper.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AppLinkHelper.java index c94db9915f..0958eb2e33 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AppLinkHelper.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AppLinkHelper.java @@ -1,7 +1,8 @@ package org.dolphinemu.dolphinemu.utils; import android.net.Uri; -import android.support.annotation.StringDef; + +import androidx.annotation.StringDef; import java.util.List; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java index 727240b478..10adda88fa 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java @@ -11,7 +11,8 @@ import android.content.Intent; import android.content.SharedPreferences; import android.os.Environment; import android.preference.PreferenceManager; -import android.support.v4.content.LocalBroadcastManager; + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; import org.dolphinemu.dolphinemu.NativeLibrary; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java index 8e94bf3153..20245deb12 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java @@ -3,8 +3,9 @@ package org.dolphinemu.dolphinemu.utils; import android.content.Intent; import android.net.Uri; import android.os.Environment; -import android.support.annotation.Nullable; -import android.support.v4.app.FragmentActivity; + +import androidx.annotation.Nullable; +import androidx.fragment.app.FragmentActivity; import com.nononsenseapps.filepicker.FilePickerActivity; import com.nononsenseapps.filepicker.Utils; 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 7cc08ec1e3..20cfa6c130 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 @@ -6,8 +6,10 @@ import android.content.Context; import android.content.DialogInterface; import android.content.pm.PackageManager; import android.os.Build; -import android.support.v4.app.FragmentActivity; -import android.support.v4.content.ContextCompat; + +import androidx.fragment.app.FragmentActivity; +import androidx.core.content.ContextCompat; + import android.widget.Toast; import org.dolphinemu.dolphinemu.R; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java index cdddd4cd37..a7f479cde8 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java @@ -1,11 +1,12 @@ package org.dolphinemu.dolphinemu.utils; import android.content.Context; -import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v4.app.FragmentActivity; + +import androidx.fragment.app.FragmentActivity; + import android.text.TextUtils; import org.dolphinemu.dolphinemu.NativeLibrary; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java index e56d2cd8c0..d81150d300 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java @@ -18,10 +18,12 @@ import android.media.tv.TvContract; import android.net.Uri; import android.os.Build; import android.os.PersistableBundle; -import android.support.annotation.AnyRes; -import android.support.annotation.NonNull; -import android.support.media.tv.Channel; -import android.support.media.tv.TvContractCompat; + +import androidx.annotation.AnyRes; +import androidx.annotation.NonNull; +import androidx.tvprovider.media.tv.Channel; +import androidx.tvprovider.media.tv.TvContractCompat; + import android.util.Log; import org.dolphinemu.dolphinemu.model.GameFile; @@ -35,7 +37,7 @@ import java.util.ArrayList; import java.util.List; import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION; -import static android.support.v4.content.FileProvider.getUriForFile; +import static androidx.core.content.FileProvider.getUriForFile; /** * Assists in TV related services, e.g., home screen channels diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/FileViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/FileViewHolder.java index d5f2f84fe7..af854fa763 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/FileViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/FileViewHolder.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.viewholders; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; + import android.view.View; import android.widget.ImageView; import android.widget.TextView; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/GameViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/GameViewHolder.java index 2bd510438e..7c6fb270da 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/GameViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/GameViewHolder.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.viewholders; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; + import android.view.View; import android.widget.ImageView; import android.widget.TextView; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvGameViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvGameViewHolder.java index ba1c04c512..f239b20854 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvGameViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvGameViewHolder.java @@ -1,7 +1,8 @@ package org.dolphinemu.dolphinemu.viewholders; -import android.support.v17.leanback.widget.ImageCardView; -import android.support.v17.leanback.widget.Presenter; +import androidx.leanback.widget.ImageCardView; +import androidx.leanback.widget.Presenter; + import android.view.View; import android.widget.ImageView; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvSettingsViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvSettingsViewHolder.java index ec35aae061..7a2cf07556 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvSettingsViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvSettingsViewHolder.java @@ -1,7 +1,8 @@ package org.dolphinemu.dolphinemu.viewholders; -import android.support.v17.leanback.widget.ImageCardView; -import android.support.v17.leanback.widget.Presenter; +import androidx.leanback.widget.ImageCardView; +import androidx.leanback.widget.Presenter; + import android.view.View; public final class TvSettingsViewHolder extends Presenter.ViewHolder diff --git a/Source/Android/app/src/main/res/layout/activity_add_directory.xml b/Source/Android/app/src/main/res/layout/activity_add_directory.xml index b52a9b5187..151d307c51 100644 --- a/Source/Android/app/src/main/res/layout/activity_add_directory.xml +++ b/Source/Android/app/src/main/res/layout/activity_add_directory.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" android:orientation="vertical"> - - - \ No newline at end of file + 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 eccfb1a910..ecbdca3536 100644 --- a/Source/Android/app/src/main/res/layout/activity_main.xml +++ b/Source/Android/app/src/main/res/layout/activity_main.xml @@ -1,24 +1,24 @@ - - - - - + - - - + diff --git a/Source/Android/app/src/main/res/layout/card_game.xml b/Source/Android/app/src/main/res/layout/card_game.xml index e3db4abf76..8a0a577e21 100644 --- a/Source/Android/app/src/main/res/layout/card_game.xml +++ b/Source/Android/app/src/main/res/layout/card_game.xml @@ -1,5 +1,5 @@ - - + diff --git a/Source/Android/app/src/main/res/layout/fragment_grid.xml b/Source/Android/app/src/main/res/layout/fragment_grid.xml index f7fbcc6427..97faa0ac8d 100644 --- a/Source/Android/app/src/main/res/layout/fragment_grid.xml +++ b/Source/Android/app/src/main/res/layout/fragment_grid.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - \ No newline at end of file + diff --git a/Source/Android/app/src/main/res/layout/fragment_settings.xml b/Source/Android/app/src/main/res/layout/fragment_settings.xml index 2525ad507c..ce381beb57 100644 --- a/Source/Android/app/src/main/res/layout/fragment_settings.xml +++ b/Source/Android/app/src/main/res/layout/fragment_settings.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - @@ -28,4 +28,4 @@ android:src="@drawable/ic_launcher"/> - \ No newline at end of file + diff --git a/Source/Android/gradle.properties b/Source/Android/gradle.properties index f85a73bae2..6775491294 100644 --- a/Source/Android/gradle.properties +++ b/Source/Android/gradle.properties @@ -7,6 +7,8 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit