Skip to content

Commit

Permalink
Migrate to AndroidX
Browse files Browse the repository at this point in the history
  • Loading branch information
whackawaldo committed Apr 22, 2020
1 parent de30ced commit 474a1ba
Show file tree
Hide file tree
Showing 147 changed files with 658 additions and 656 deletions.
55 changes: 29 additions & 26 deletions base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ apply plugin: 'com.github.ben-manes.versions'// to check for dependency updates

android {
compileSdkVersion rootProject.ext.compileSdk
buildToolsVersion rootProject.ext.buildToolsVersion

def buildNumber = (System.getenv('BUILD_NUMBER') == null ? 0 : System.getenv('BUILD_NUMBER')) as int
def gitBranch = (System.getenv('GIT_BRANCH') == null ? 'local' : System.getenv('GIT_BRANCH').replace('origin/', ''))
Expand Down Expand Up @@ -45,47 +44,51 @@ android {
abortOnError false
lintConfig file('lint.xml')
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.1'
api fileTree(dir: 'libs', include: ['*.jar'])

api project(':vlc')
api project(':connectsdk')

compile "com.android.support:support-v4:${rootProject.ext.appCompatVersion}"
compile "com.android.support:palette-v7:${rootProject.ext.appCompatVersion}"
compile "com.android.support:appcompat-v7:${rootProject.ext.appCompatVersion}"
compile "com.android.support:design:${rootProject.ext.appCompatVersion}"
api 'androidx.multidex:multidex:2.0.1'

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
api 'androidx.legacy:legacy-support-v4:1.0.0'
api 'androidx.palette:palette:1.0.0'
api 'com.google.android.material:material:1.1.0'

compile 'com.jakewharton.timber:timber:4.1.2'
compile "com.squareup.okhttp3:okhttp:${rootProject.ext.okHttpVersion}"
compile "com.squareup.picasso:picasso:${rootProject.ext.picassoVersion}"
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
compile "com.jakewharton:butterknife:${rootProject.ext.butterknifeVersion}"
debugApi 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseApi 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'

compile "com.github.TorrentStream:TorrentStreamServer-Android:${rootProject.ext.torrentstreamServerVersion}"
api 'com.jakewharton.timber:timber:4.1.2'
api "com.squareup.okhttp3:okhttp:${rootProject.ext.okHttpVersion}"
api "com.squareup.picasso:picasso:${rootProject.ext.picassoVersion}"
api "com.jakewharton:butterknife:${rootProject.ext.butterknifeVersion}"

compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
api "com.github.TorrentStream:TorrentStreamServer-Android:${rootProject.ext.torrentstreamServerVersion}"

compile 'com.koushikdutta.async:androidasync:2.1.9'
api 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'

compile 'de.timroes:aXMLRPC:1.8.1'
api 'com.koushikdutta.async:androidasync:2.1.9'

compile "com.google.dagger:dagger:${rootProject.ext.daggerVersion}"
api 'de.timroes:aXMLRPC:1.8.1'

compile 'com.fasterxml.jackson.core:jackson-core:2.7.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.2'
api "com.google.dagger:dagger:${rootProject.ext.daggerVersion}"

api 'com.fasterxml.jackson.core:jackson-core:2.7.2'
api 'com.fasterxml.jackson.core:jackson-annotations:2.7.2'
api 'com.fasterxml.jackson.core:jackson-databind:2.7.2'

annotationProcessor "com.google.dagger:dagger-compiler:${rootProject.ext.daggerVersion}"
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.butterknifeVersion}"

provided "javax.annotation:javax.annotation-api:${rootProject.ext.javaxAnnotationVersion}"

compile project(':vlc')
compile project(':connectsdk')
compileOnly "javax.annotation:javax.annotation-api:${rootProject.ext.javaxAnnotationVersion}"


}
9 changes: 7 additions & 2 deletions base/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="butter.droid.base">

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<application
android:usesCleartextTraffic="true"
tools:targetApi="M">

<service android:name="butter.droid.base.torrent.TorrentService" />

<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
Expand Down
6 changes: 3 additions & 3 deletions base/src/main/java/butter/droid/base/ButterApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.support.multidex.MultiDex;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.FileProvider;
import androidx.multidex.MultiDex;
import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider;

import com.sjl.foreground.Foreground;
import com.squareup.leakcanary.LeakCanary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package butter.droid.base.adapters;

import android.content.Context;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package butter.droid.base.adapters.models;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import butter.droid.base.utils.LocaleUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.IBinder;
import android.support.v7.app.NotificationCompat;

import androidx.core.app.NotificationCompat;
import androidx.media.app.NotificationCompat.MediaStyle;

import com.connectsdk.device.ConnectableDevice;
import com.connectsdk.service.capability.MediaControl;
Expand Down Expand Up @@ -118,7 +120,7 @@ private void buildNotification( NotificationCompat.Action action ) {
if(mManager.getStreamInfo() == null)
return;

NotificationCompat.MediaStyle style = new NotificationCompat.MediaStyle();
MediaStyle style = new MediaStyle();

Intent intent = new Intent(this, BeamPlayerNotificationService.class);
intent.setAction( ACTION_STOP );
Expand Down Expand Up @@ -177,7 +179,7 @@ private void initMediaSessions() {
mMediaControl.getPlayState(mPlayStateListener);

if(mManager.getStreamInfo().getImageUrl() != null)
Picasso.with(this).load(mManager.getStreamInfo().getImageUrl()).resize(400, 400).centerInside().into(new Target() {
Picasso.get().load(mManager.getStreamInfo().getImageUrl()).resize(400, 400).centerInside().into(new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
mImage = bitmap;
Expand All @@ -190,7 +192,7 @@ public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
}

@Override
public void onBitmapFailed(Drawable errorDrawable) {
public void onBitmapFailed(Exception exc, Drawable errorDrawable) {
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
package butter.droid.base.content;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package butter.droid.base.content.preferences;

import android.content.Context;
import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;

import butter.droid.base.utils.PrefUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.net.Uri;
import android.support.v4.app.FragmentActivity;
import androidx.fragment.app.FragmentActivity;
import android.text.format.DateFormat;

import java.text.SimpleDateFormat;
Expand Down
11 changes: 2 additions & 9 deletions base/src/main/java/butter/droid/base/data/DataModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.content.Context;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.jakewharton.picasso.OkHttp3Downloader;
import com.squareup.picasso.Picasso;

import java.io.File;
Expand Down Expand Up @@ -65,14 +64,8 @@ public OkHttpClient provideOkHttpClient(Cache cache) {

@Provides
@Singleton
public OkHttp3Downloader provideOkHttpDownloader(OkHttpClient client) {
return new OkHttp3Downloader(client);
}

@Provides
@Singleton
public Picasso providePicasso(Context context, OkHttp3Downloader okHttpDownloader) {
return new Picasso.Builder(context).downloader(okHttpDownloader).build();
public Picasso providePicasso(Context context) {
return new Picasso.Builder(context).build();
}

@Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import android.content.Context;
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 com.github.se_bastiaan.torrentstream.StreamStatus;
import com.github.se_bastiaan.torrentstream.Torrent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
Expand All @@ -42,8 +41,8 @@
import com.connectsdk.device.ConnectableDevice;
import com.github.se_bastiaan.torrentstream.StreamStatus;
import com.github.se_bastiaan.torrentstream.Torrent;
import com.github.se_bastiaan.torrentstream.listeners.TorrentListener;
import com.github.se_bastiaan.torrentstreamserver.TorrentServerListener;
import com.google.android.material.snackbar.Snackbar;

import org.videolan.libvlc.IVLCVout;
import org.videolan.libvlc.LibVLC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import android.view.View;

import butter.droid.base.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import android.view.ViewGroup;
import android.widget.NumberPicker;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

package butter.droid.base.manager.provider;

import android.support.annotation.IntDef;
import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.IntDef;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package butter.droid.base.providers;

import android.support.annotation.CallSuper;
import androidx.annotation.CallSuper;

import com.fasterxml.jackson.databind.ObjectMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package butter.droid.base.providers.media;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import com.fasterxml.jackson.databind.ObjectMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package butter.droid.base.providers.media;

import android.accounts.NetworkErrorException;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;

import com.fasterxml.jackson.databind.ObjectMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package butter.droid.base.providers.media;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import com.fasterxml.jackson.databind.ObjectMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package butter.droid.base.providers.media;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import com.fasterxml.jackson.databind.ObjectMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Context;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import java.io.File;
import java.io.FileInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;

import butter.droid.base.R;
import butter.droid.base.utils.VersionUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import android.os.Binder;
import android.os.IBinder;
import android.os.PowerManager;
import android.support.annotation.NonNull;
import android.support.v4.app.NotificationCompat;
import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat;

import com.github.se_bastiaan.torrentstream.StreamStatus;
import com.github.se_bastiaan.torrentstream.Torrent;
Expand Down
Loading

0 comments on commit 474a1ba

Please sign in to comment.