Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted to Androidx and made this library live again #656

Open
wants to merge 5 commits into
base: v3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
/.idea/copyright/profiles_settings.xml
/.idea/encodings.xml
/.idea/
/Fetch.zip
875 changes: 674 additions & 201 deletions LICENSE

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions fetch2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
versionCode library_version_code
versionName library_version

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}

Expand Down Expand Up @@ -63,13 +63,13 @@ android {
dependencies {

api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
kapt "android.arch.persistence.room:compiler:$room_version"
api "android.arch.persistence.room:runtime:$room_version"
kapt 'androidx.room:room-compiler:2.0.0'
api 'androidx.room:room-runtime:2.0.0'
api project(':fetch2core')

testImplementation "junit:junit:$junit_version"
androidTestImplementation "com.android.support.test:runner:$test_runner_version"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better to stay with constants instead of hardcoded versions

androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

//publish {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tonyodev.fetch2;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.tonyodev.fetch2.database.FetchDatabaseManager;
import com.tonyodev.fetch2.database.FetchDatabaseManagerImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.tonyodev.fetch2.database.FetchDatabaseManager;
import com.tonyodev.fetch2.database.FetchDatabaseManagerImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.tonyodev.fetch2.database.FetchDatabaseManager;
import com.tonyodev.fetch2.database.FetchDatabaseManagerImpl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tonyodev.fetch2;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.tonyodev.fetch2.database.FetchDatabaseManager;
import com.tonyodev.fetch2.database.FetchDatabaseManagerImpl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tonyodev.fetch2;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.tonyodev.fetch2core.FetchLogger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.tonyodev.fetch2.database.FetchDatabaseManager;
import com.tonyodev.fetch2.database.FetchDatabaseManagerImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import android.content.Intent
import android.content.IntentFilter
import android.net.Uri
import android.os.Build
import android.support.v4.app.NotificationCompat
import androidx.core.app.NotificationCompat

import com.tonyodev.fetch2.DownloadNotification.ActionType.*
import com.tonyodev.fetch2.util.DEFAULT_NOTIFICATION_TIMEOUT_AFTER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context
import android.support.v4.app.NotificationCompat
import androidx.core.app.NotificationCompat

/**
* Implement this interface to create, maintain and show notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database

import android.arch.persistence.room.TypeConverter
import androidx.room.TypeConverter
import com.tonyodev.fetch2.*
import com.tonyodev.fetch2.util.EMPTY_JSON_OBJECT_STRING
import com.tonyodev.fetch2.NetworkType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database

import android.arch.persistence.room.*
import androidx.room.*
import com.tonyodev.fetch2.Status
import com.tonyodev.fetch2.database.DownloadDatabase.Companion.COLUMN_CREATED
import com.tonyodev.fetch2.database.DownloadDatabase.Companion.COLUMN_FILE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tonyodev.fetch2.database

import android.arch.persistence.room.Database
import android.arch.persistence.room.RoomDatabase
import android.arch.persistence.room.TypeConverters
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.tonyodev.fetch2.database.DownloadDatabase.Companion.DATABASE_VERSION
import com.tonyodev.fetch2.database.migration.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database

import android.arch.persistence.room.*
import androidx.room.*
import android.net.Uri
import android.os.Parcel
import android.os.Parcelable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.tonyodev.fetch2.database

import android.arch.persistence.db.SupportSQLiteDatabase
import android.arch.persistence.room.Room
import androidx.sqlite.db.SupportSQLiteDatabase
import androidx.room.Room
import android.content.Context
import android.database.Cursor
import android.database.sqlite.SQLiteException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database.migration

import android.arch.persistence.room.migration.Migration
import androidx.room.migration.Migration


abstract class Migration constructor(startVersion: Int, endVersion: Int)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database.migration

import android.arch.persistence.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteDatabase
import com.tonyodev.fetch2.database.DownloadDatabase
import com.tonyodev.fetch2.util.EMPTY_JSON_OBJECT_STRING

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database.migration

import android.arch.persistence.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteDatabase
import com.tonyodev.fetch2.database.DownloadDatabase

class MigrationFourToFive : Migration(4, 5) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database.migration

import android.arch.persistence.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteDatabase
import com.tonyodev.fetch2.database.DownloadDatabase


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database.migration

import android.arch.persistence.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteDatabase
import com.tonyodev.fetch2.database.DownloadDatabase
import com.tonyodev.fetch2.util.DEFAULT_AUTO_RETRY_ATTEMPTS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database.migration

import android.arch.persistence.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteDatabase
import com.tonyodev.fetch2.database.DownloadDatabase
import com.tonyodev.fetch2.util.DEFAULT_UNIQUE_IDENTIFIER

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2.database.migration

import android.arch.persistence.db.SupportSQLiteDatabase
import androidx.sqlite.db.SupportSQLiteDatabase
import com.tonyodev.fetch2.EnqueueAction
import com.tonyodev.fetch2.database.DownloadDatabase

Expand Down
Empty file modified fetch2/src/main/res/drawable-hdpi/fetch_notification_cancel.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-hdpi/fetch_notification_pause.png
100755 → 100644
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the diff here?

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-hdpi/fetch_notification_resume.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-hdpi/fetch_notification_retry.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-mdpi/fetch_notification_cancel.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-mdpi/fetch_notification_pause.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-mdpi/fetch_notification_resume.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-mdpi/fetch_notification_retry.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-xhdpi/fetch_notification_pause.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified fetch2/src/main/res/drawable-xhdpi/fetch_notification_retry.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions fetch2core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
versionCode library_version_code
versionName library_version

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}

Expand Down Expand Up @@ -59,8 +59,8 @@ dependencies {

api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation "junit:junit:$junit_version"
androidTestImplementation "com.android.support.test:runner:$test_runner_version"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

//publish {
Expand Down
12 changes: 6 additions & 6 deletions fetch2fileserver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
versionCode library_version_code
versionName library_version

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}

Expand Down Expand Up @@ -56,16 +56,16 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:$android_support_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
kapt "android.arch.persistence.room:compiler:$room_version"
api "android.arch.persistence.room:runtime:$room_version"
kapt 'androidx.room:room-compiler:2.0.0'
api 'androidx.room:room-runtime:2.0.0'

api project(':fetch2core')

testImplementation "junit:junit:$junit_version"
androidTestImplementation "com.android.support.test:runner:$test_runner_version"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

//publish {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tonyodev.fetch2fileserver;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2fileserver.database

import android.arch.persistence.room.*
import androidx.room.*
import android.content.Context
import java.io.Closeable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.tonyodev.fetch2fileserver.database

import android.arch.persistence.room.ColumnInfo
import android.arch.persistence.room.Entity
import android.arch.persistence.room.Index
import android.arch.persistence.room.PrimaryKey
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey

@Entity(tableName = FileResourceInfoDatabase.TABLE_NAME,
indices = [(Index(value = [FileResourceInfoDatabase.COLUMN_NAME], unique = true)),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tonyodev.fetch2fileserver.database

import android.arch.persistence.room.*
import androidx.room.*
import com.tonyodev.fetch2fileserver.database.FileResourceInfoDatabase.Companion.COLUMN_ID
import com.tonyodev.fetch2fileserver.database.FileResourceInfoDatabase.Companion.COLUMN_NAME
import com.tonyodev.fetch2fileserver.database.FileResourceInfoDatabase.Companion.TABLE_NAME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.tonyodev.fetch2fileserver.database

import android.arch.persistence.room.Database
import android.arch.persistence.room.RoomDatabase
import androidx.room.Database
import androidx.room.RoomDatabase
import com.tonyodev.fetch2fileserver.database.FileResourceInfoDatabase.Companion.DATABASE_VERSION

@Database(entities = [FileResourceInfo::class], version = DATABASE_VERSION, exportSchema = false)
Expand Down
6 changes: 3 additions & 3 deletions fetch2okhttp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
versionCode library_version_code
versionName library_version

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}

Expand Down Expand Up @@ -67,8 +67,8 @@ dependencies {
api project(':fetch2core')

testImplementation "junit:junit:$junit_version"
androidTestImplementation "com.android.support.test:runner:$test_runner_version"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

//publish {
Expand Down
6 changes: 3 additions & 3 deletions fetch2rx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {
versionCode library_version_code
versionName library_version

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}

Expand Down Expand Up @@ -61,8 +61,8 @@ dependencies {
api project(':fetch2')

testImplementation "junit:junit:$junit_version"
androidTestImplementation "com.android.support.test:runner:$test_runner_version"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

//publish {
Expand Down
6 changes: 3 additions & 3 deletions fetchmigrator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {
versionCode library_version_code
versionName library_version

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}

Expand Down Expand Up @@ -60,8 +60,8 @@ dependencies {

testImplementation "junit:junit:$junit_version"

androidTestImplementation "com.android.support.test:runner:$test_runner_version"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

//publish {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.tonyodev.fetchmigrator

import android.content.Context
import android.database.sqlite.SQLiteConstraintException
import android.support.annotation.WorkerThread
import androidx.annotation.WorkerThread
import com.tonyodev.fetch2.database.FetchDatabaseManagerImpl
import com.tonyodev.fetch2.database.DownloadDatabase
import com.tonyodev.fetch2.database.DownloadInfo
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
Expand Down
Loading