Migrate to AndroidX

This commit is contained in:
Andrew Rabert 2019-08-24 14:24:07 -04:00
parent 39a7c39b94
commit d62e010894
41 changed files with 81 additions and 84 deletions

View File

@ -31,7 +31,7 @@ android {
dependencies {
implementation 'com.esotericsoftware:kryo:4.0.2'
implementation "com.android.support:design:$android_support_version"
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.github.hannesa2:AndroidSlidingUpPanel:3.5.0'
implementation 'com.squareup.okhttp3:okhttp:4.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
@ -39,7 +39,6 @@ dependencies {
buildscript {
ext.kotlin_version = '1.3.50'
ext.android_support_version = '28.0.0'
repositories {
mavenCentral()
}

View File

@ -18,8 +18,8 @@ package net.nullsum.audinaut.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AlertDialog;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AlertDialog;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

View File

@ -19,7 +19,7 @@
package net.nullsum.audinaut.activity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import androidx.appcompat.widget.Toolbar;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.fragments.PreferenceCompatFragment;

View File

@ -27,16 +27,16 @@ import android.media.AudioManager;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.support.design.widget.NavigationView;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import com.google.android.material.navigation.NavigationView;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.core.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;

View File

@ -27,9 +27,9 @@ import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.Toolbar;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;

View File

@ -16,7 +16,7 @@
package net.nullsum.audinaut.adapter;
import android.content.Context;
import android.support.v7.widget.PopupMenu;
import androidx.appcompat.widget.PopupMenu;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View File

@ -19,8 +19,8 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Build;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.RecyclerView;
import androidx.appcompat.view.ActionMode;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.util.TypedValue;
import android.view.Menu;

View File

@ -17,7 +17,7 @@ package net.nullsum.audinaut.fragments;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.widget.helper.ItemTouchHelper;
import androidx.recyclerview.widget.ItemTouchHelper;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;

View File

@ -18,9 +18,9 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.ItemTouchHelper;
import android.util.DisplayMetrics;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;

View File

@ -1,8 +1,8 @@
package net.nullsum.audinaut.fragments;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;

View File

@ -1,9 +1,9 @@
package net.nullsum.audinaut.fragments;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;

View File

@ -1,7 +1,7 @@
package net.nullsum.audinaut.fragments;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import androidx.appcompat.app.AlertDialog;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

View File

@ -16,8 +16,8 @@
package net.nullsum.audinaut.fragments;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;

View File

@ -26,13 +26,13 @@ import android.content.SharedPreferences;
import android.media.MediaMetadataRetriever;
import android.os.Bundle;
import android.os.StatFs;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.SearchView;
import android.util.Log;
import android.view.GestureDetector;
import android.view.Menu;

View File

@ -32,7 +32,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.PowerManager;
import android.support.v4.util.LruCache;
import androidx.collection.LruCache;
import android.util.Log;
import net.nullsum.audinaut.R;
@ -60,7 +60,6 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import static net.nullsum.audinaut.domain.PlayerState.COMPLETED;
import static net.nullsum.audinaut.domain.PlayerState.DOWNLOADING;
import static net.nullsum.audinaut.domain.PlayerState.IDLE;
import static net.nullsum.audinaut.domain.PlayerState.PAUSED;

View File

@ -21,7 +21,7 @@ package net.nullsum.audinaut.service;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.Log;
import net.nullsum.audinaut.domain.Genre;
@ -60,11 +60,8 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import okhttp3.FormBody;
import okhttp3.FormBody.Builder;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**

View File

@ -1,7 +1,7 @@
package net.nullsum.audinaut.util;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.ItemTouchHelper;
import net.nullsum.audinaut.adapter.SectionAdapter;
import net.nullsum.audinaut.fragments.SubsonicFragment;

View File

@ -20,8 +20,8 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.support.annotation.AttrRes;
import android.support.annotation.DrawableRes;
import androidx.annotation.AttrRes;
import androidx.annotation.DrawableRes;
import android.util.SparseArray;
import android.util.TypedValue;

View File

@ -23,7 +23,7 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Environment;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;
import android.util.Log;
import com.esotericsoftware.kryo.Kryo;

View File

@ -30,7 +30,7 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.util.LruCache;
import androidx.collection.LruCache;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;

View File

@ -25,7 +25,7 @@ import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Handler;
import android.support.v4.app.NotificationCompat;
import androidx.core.app.NotificationCompat;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;

View File

@ -17,7 +17,7 @@ package net.nullsum.audinaut.util;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import net.nullsum.audinaut.domain.User;

View File

@ -36,9 +36,9 @@ import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v7.app.AlertDialog;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;

View File

@ -17,7 +17,7 @@
package net.nullsum.audinaut.util.tags;
import android.support.v4.util.LruCache;
import androidx.collection.LruCache;
import java.util.HashMap;
import java.util.Vector;

View File

@ -1,7 +1,7 @@
package net.nullsum.audinaut.view;
import android.content.Context;
import android.support.v7.widget.AppCompatImageButton;
import androidx.appcompat.widget.AppCompatImageButton;
import android.util.AttributeSet;
import android.view.MotionEvent;

View File

@ -18,7 +18,7 @@ import android.content.Context;
import android.os.Build;
import android.os.Environment;
import android.preference.EditTextPreference;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;

View File

@ -20,7 +20,7 @@ package net.nullsum.audinaut.view;
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import androidx.appcompat.app.AlertDialog;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.activity.SubsonicFragmentActivity;

View File

@ -19,10 +19,10 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.AdapterDataObserver;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
@ -34,7 +34,7 @@ import android.widget.TextView;
import net.nullsum.audinaut.R;
import static android.support.v7.widget.RecyclerView.OnScrollListener;
import static androidx.recyclerview.widget.RecyclerView.OnScrollListener;
public class FastScroller extends LinearLayout {
private static final String TAG = FastScroller.class.getSimpleName();

View File

@ -16,8 +16,8 @@
package net.nullsum.audinaut.view;
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;

View File

@ -20,7 +20,7 @@ import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.support.v7.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatImageView;
import android.util.AttributeSet;
public class RecyclingImageView extends AppCompatImageView {

View File

@ -22,7 +22,7 @@ import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -12,9 +12,9 @@
android:layout_height="match_parent" />
<!-- The navigation drawer -->
<android.support.design.widget.NavigationView
<com.google.android.material.navigation.NavigationView
android:id="@+id/left_drawer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start" />
</android.support.v4.widget.DrawerLayout>
</androidx.drawerlayout.widget.DrawerLayout>

View File

@ -13,7 +13,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
@ -36,7 +36,7 @@
android:layout_height="wrap_content"
android:background="?attr/actionbarBackgroundColor">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/now_playing_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@ -14,7 +14,7 @@
android:layout_height="0dip"
android:layout_weight="1.0">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/fragment_recycler"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@ -32,4 +32,4 @@
<include layout="@layout/tab_progress" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@ -22,7 +22,7 @@
android:layout_height="0dip"
android:layout_weight="1.0">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/download_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"

View File

@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"

View File

@ -5,7 +5,7 @@
android:id="@+id/menu_global_search"
android:icon="?attr/search"
android:title="@string/menu.search"
compat:actionViewClass="android.support.v7.widget.SearchView"
compat:actionViewClass="androidx.appcompat.widget.SearchView"
compat:showAsAction="always|collapseActionView" />
<group android:id="@+id/not_touchscreen">

View File

@ -5,7 +5,7 @@
android:id="@+id/menu_global_search"
android:icon="?attr/search"
android:title="@string/menu.search"
compat:actionViewClass="android.support.v7.widget.SearchView"
compat:actionViewClass="androidx.appcompat.widget.SearchView"
compat:showAsAction="ifRoom|collapseActionView" />
<item

View File

@ -5,6 +5,6 @@
android:id="@+id/menu_global_search"
android:icon="?attr/search"
android:title="@string/menu.search"
compat:actionViewClass="android.support.v7.widget.SearchView"
compat:actionViewClass="androidx.appcompat.widget.SearchView"
compat:showAsAction="always|collapseActionView" />
</menu>

View File

@ -5,7 +5,7 @@
android:id="@+id/menu_global_search"
android:icon="?attr/search"
android:title="@string/menu.search"
compat:actionViewClass="android.support.v7.widget.SearchView"
compat:actionViewClass="androidx.appcompat.widget.SearchView"
compat:showAsAction="ifRoom|collapseActionView" />
<item

View File

@ -11,6 +11,8 @@
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs = -Xmx3072m
# When configured, Gradle will run in incubating parallel mode.