Commit 4cd187ed authored by luca020400's avatar luca020400

Refactor to androidx libraries

Change-Id: I56c6ee4d6478d2c3a01f2350a4110a9ab3525072
parent 1f7ae1c9
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "org.lineageos.jelly"
minSdkVersion 26
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
......@@ -34,8 +34,8 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:$androidSupportVersion"
implementation "com.android.support:design:$androidSupportVersion"
implementation "com.android.support:cardview-v7:$androidSupportVersion"
implementation "com.android.support:palette-v7:$androidSupportVersion"
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'com.google.android.material:material:1.1.0-alpha02'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.palette:palette:1.0.0'
}
......@@ -26,14 +26,13 @@ LOCAL_SRC_FILES := \
LOCAL_USE_AAPT2 := true
LOCAL_STATIC_ANDROID_LIBRARIES := \
android-support-design \
android-support-transition \
android-support-v4 \
android-support-v7-appcompat \
android-support-v7-cardview \
android-support-v7-palette \
android-support-v7-recyclerview \
android-support-annotations
androidx.annotation_annotation \
androidx.appcompat_appcompat \
androidx.cardview_cardview \
androidx.palette_palette \
androidx.recyclerview_recyclerview \
androidx.transition_transition \
com.google.android.material_material
LOCAL_PACKAGE_NAME := Jelly
......
......@@ -91,7 +91,7 @@
android:theme="@style/AppTheme.NoActionBar" />
<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="org.lineageos.jelly.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
......
......@@ -28,7 +28,6 @@ import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
......@@ -42,20 +41,20 @@ import android.os.Environment;
import android.os.Handler;
import android.os.ResultReceiver;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.BottomSheetDialog;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.FileProvider;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.menu.MenuBuilder;
import android.support.v7.view.menu.MenuPopupHelper;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.Toolbar;
import androidx.annotation.NonNull;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.material.snackbar.Snackbar;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.view.menu.MenuBuilder;
import androidx.appcompat.view.menu.MenuPopupHelper;
import androidx.appcompat.widget.PopupMenu;
import androidx.appcompat.widget.Toolbar;
import android.text.TextUtils;
import android.util.Log;
import android.view.ContextThemeWrapper;
......
......@@ -22,10 +22,10 @@ import android.preference.Preference;
import android.preference.PreferenceCategory;
import android.preference.PreferenceFragment;
import android.preference.SwitchPreference;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.webkit.CookieManager;
......
......@@ -24,12 +24,12 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
......
......@@ -17,7 +17,7 @@ package org.lineageos.jelly.favorite;
import android.content.Context;
import android.database.Cursor;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
......
......@@ -19,8 +19,8 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
......
......@@ -27,8 +27,8 @@ import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.provider.BaseColumns;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
public class FavoriteProvider extends ContentProvider {
public interface Columns extends BaseColumns {
......
......@@ -24,14 +24,14 @@ import android.database.Cursor;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.support.v7.widget.helper.ItemTouchHelper;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.ItemTouchHelper;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
......
......@@ -17,7 +17,7 @@ package org.lineageos.jelly.history;
import android.content.Context;
import android.database.Cursor;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
......
......@@ -19,8 +19,8 @@ import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import org.lineageos.jelly.R;
......
......@@ -25,9 +25,9 @@ import android.graphics.Canvas;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.ItemTouchHelper;
import android.view.View;
import org.lineageos.jelly.R;
......
......@@ -19,8 +19,8 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
......
......@@ -27,8 +27,8 @@ import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.provider.BaseColumns;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
public class HistoryProvider extends ContentProvider {
public interface Columns extends BaseColumns {
......
......@@ -16,7 +16,7 @@
package org.lineageos.jelly.suggestions;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
/**
* Search suggestions provider for the Baidu search engine.
......
......@@ -16,7 +16,7 @@
package org.lineageos.jelly.suggestions;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
/**
* Search suggestions provider for Bing search engine.
......
......@@ -16,7 +16,7 @@
package org.lineageos.jelly.suggestions;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import org.json.JSONArray;
import org.json.JSONObject;
......
......@@ -16,7 +16,7 @@
package org.lineageos.jelly.suggestions;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
/**
* Search suggestions provider for Google search engine.
......
......@@ -16,8 +16,8 @@
package org.lineageos.jelly.suggestions;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.text.TextUtils;
import android.util.Log;
......
......@@ -16,7 +16,7 @@
package org.lineageos.jelly.suggestions;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
/**
* Search suggestions provider for Yahoo search engine.
......
......@@ -21,7 +21,7 @@ import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Rect;
import android.graphics.Shader;
import android.support.v7.widget.AppCompatAutoCompleteTextView;
import androidx.appcompat.widget.AppCompatAutoCompleteTextView;
import android.util.AttributeSet;
public class AutoCompleteTextViewExt extends AppCompatAutoCompleteTextView {
......
......@@ -16,8 +16,8 @@
package org.lineageos.jelly.ui;
import android.content.Context;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
......
......@@ -16,7 +16,7 @@
package org.lineageos.jelly.utils;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import java.io.BufferedReader;
import java.io.IOException;
......
......@@ -27,11 +27,11 @@ import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.preference.PreferenceManager;
import android.support.annotation.AttrRes;
import android.support.annotation.DimenRes;
import android.support.annotation.StyleRes;
import android.support.v4.graphics.ColorUtils;
import android.support.v7.graphics.Palette;
import androidx.annotation.AttrRes;
import androidx.annotation.DimenRes;
import androidx.annotation.StyleRes;
import androidx.core.graphics.ColorUtils;
import androidx.palette.graphics.Palette;
import android.util.TypedValue;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
......
......@@ -25,8 +25,8 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.net.Uri;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AlertDialog;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
......@@ -39,7 +39,6 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import org.lineageos.jelly.IntentFilterCompat;
import org.lineageos.jelly.MainActivity;
import org.lineageos.jelly.R;
import org.lineageos.jelly.ui.UrlBarController;
import org.lineageos.jelly.utils.IntentUtils;
......
......@@ -19,7 +19,7 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.v4.util.ArrayMap;
import androidx.collection.ArrayMap;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
......
......@@ -16,7 +16,7 @@
package org.lineageos.jelly.webview;
import android.graphics.Bitmap;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.webkit.WebChromeClient;
......
......@@ -13,14 +13,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
......@@ -31,7 +31,7 @@
android:layout_height="match_parent"
android:paddingTop="?actionBarSize">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/favorite_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -54,4 +54,4 @@
android:text="@string/favorite_empty" />
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......@@ -13,14 +13,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
......@@ -31,7 +31,7 @@
android:layout_height="match_parent"
android:paddingTop="?actionBarSize">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/history_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -52,4 +52,4 @@
android:text="@string/history_empty" />
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......@@ -13,19 +13,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/AppTheme.ToolbarTheme"
android:layout_width="match_parent"
......@@ -62,8 +62,8 @@
android:layout_above="@id/load_progress" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/web_view_container"
......@@ -75,4 +75,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......@@ -18,7 +18,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
......
......@@ -28,7 +28,7 @@
android:layout_height="wrap_content"
android:paddingBottom="8dp" />
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp">
......@@ -40,9 +40,9 @@
android:hint="@string/auth_dialog_username"
android:inputType="text"
android:maxLines="1" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
......@@ -53,6 +53,6 @@
android:hint="@string/auth_dialog_password"
android:inputType="textPassword"
android:maxLines="1" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
......@@ -23,7 +23,7 @@
android:paddingStart="24dp"
android:paddingTop="16dp">
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp">
......@@ -33,9 +33,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/favorite_edit_title" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorTextAppearance="@string/favorite_edit_error">
......@@ -46,6 +46,6 @@
android:layout_height="wrap_content"
android:hint="@string/favorite_edit_url"
android:inputType="textUri" />
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
......@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/row_favorite_card"
android:layout_width="match_parent"
......@@ -35,4 +35,4 @@
android:textAlignment="center"
android:textSize="18sp" />
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
......@@ -30,7 +30,7 @@
android:focusable="true"
android:focusableInTouchMode="true" />
<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/cardview"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -97,5 +97,5 @@
android:padding="8dp"
android:src="@drawable/ic_menu" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
</RelativeLayout>
......@@ -23,7 +23,7 @@
android:paddingStart="16dp"
android:paddingTop="4dp">
<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp"
......@@ -109,5 +109,5 @@
android:src="@drawable/ic_cancel" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
</RelativeLayout>
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.androidSupportVersion = "27.1.1"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
......@@ -15,3 +15,5 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
#Wed May 02 20:40:18 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment