Skip to content
Permalink
Browse files

Merge pull request #8471 from Simonx22/AndroidX

Android: migrate to AndroidX
  • Loading branch information
JosJuice committed Nov 20, 2019
2 parents 6d193d3 + 9d606a6 commit 9ef526c70888d91b27123e49218d7743aa5c3a0a
Showing with 359 additions and 315 deletions.
  1. +7 −7 Source/Android/app/build.gradle
  2. +1 −1 Source/Android/app/src/main/AndroidManifest.xml
  3. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AppLinkActivity.java
  4. +2 −1 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/CustomFilePickerActivity.java
  5. +7 −7 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
  6. +4 −9 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java
  7. +6 −12 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java
  8. +5 −3 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/PlatformPagerAdapter.java
  9. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/SettingsRowPresenter.java
  10. +3 −1 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameSettingsDialog.java
  11. +5 −3 ...ce/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java
  12. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java
  13. +6 −4 ...ce/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragment.java
  14. +1 −1 ...ndroid/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java
  15. +2 −1 ...pp/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java
  16. +2 −1 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java
  17. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/CustomFilePickerFragment.java
  18. +4 −3 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java
  19. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java
  20. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveLoadStateFragment.java
  21. +180 −179 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java
  22. +5 −3 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncChannelJobService.java
  23. +5 −3 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/SyncProgramsJobService.java
  24. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/DividerItemDecoration.java
  25. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/CustomTitleView.java
  26. +10 −6 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java
  27. +2 −1 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java
  28. +11 −9 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java
  29. +6 −4 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java
  30. +2 −1 ...Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AfterDirectoryInitializationRunner.java
  31. +0 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java
  32. +2 −1 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AppLinkHelper.java
  33. +2 −1 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java
  34. +3 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java
  35. +4 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PermissionsHandler.java
  36. +3 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java
  37. +7 −5 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/TvUtil.java
  38. +2 −1 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/FileViewHolder.java
  39. +2 −1 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/GameViewHolder.java
  40. +3 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvGameViewHolder.java
  41. +3 −2 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvSettingsViewHolder.java
  42. +3 −3 Source/Android/app/src/main/res/layout/activity_add_directory.xml
  43. +8 −8 Source/Android/app/src/main/res/layout/activity_main.xml
  44. +2 −2 Source/Android/app/src/main/res/layout/card_game.xml
  45. +2 −2 Source/Android/app/src/main/res/layout/fragment_grid.xml
  46. +1 −1 Source/Android/app/src/main/res/layout/fragment_settings.xml
  47. +2 −2 Source/Android/app/src/main/res/layout/tv_title.xml
  48. +2 −0 Source/Android/gradle.properties
@@ -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'
@@ -100,7 +100,7 @@
android:permission="android.permission.BIND_JOB_SERVICE"/>

<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.filesprovider"
android:exported="false"
android:grantUriPermissions="true">
@@ -6,8 +6,10 @@
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;

@@ -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;
@@ -6,16 +6,17 @@
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.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;
@@ -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;

@@ -2,29 +2,23 @@

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.
@@ -2,9 +2,11 @@

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;
@@ -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;
@@ -3,7 +3,9 @@
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;
@@ -7,9 +7,11 @@
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;
@@ -4,8 +4,10 @@
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;
@@ -3,10 +3,12 @@
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;
@@ -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;
@@ -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;
@@ -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;
@@ -2,8 +2,10 @@

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;

@@ -5,8 +5,10 @@
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.DirectoryInitializationState;
import org.dolphinemu.dolphinemu.utils.DirectoryStateReceiver;
import org.dolphinemu.dolphinemu.utils.Log;
import org.dolphinemu.dolphinemu.utils.StartupHandler;

import java.io.File;

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

0 comments on commit 9ef526c

Please sign in to comment.
You can’t perform that action at this time.