Skip to content

Commit

Permalink
new minSdkVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
DKarapetyan authored and DKarapetyan committed Oct 29, 2018
1 parent d41fba0 commit d622042
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
compileSdkVersion 28
defaultConfig {
applicationId "ru.ctcmedia.downloadservice"
minSdkVersion 21
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
Expand Down
35 changes: 3 additions & 32 deletions app/src/main/java/ru/ctcmedia/DownloadableFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,14 @@ import android.os.Parcel
import android.os.Parcelable.Creator
import ru.ctcmedia.downloadservicelibrary.downloadservice.interfaces.Downloadable

class DownloadableFile : Downloadable {
class DownloadableFile(remoteUrl: String, localUrl: String) : Downloadable {

override val downloadableName: String?
get() = remoteUrl.lastPathSegment

constructor(remoteUrl: String, localUrl: String) {
this.remoteUrl = Uri.parse(remoteUrl)
this.localUrl = Uri.parse(localUrl)
}

constructor(parcel: Parcel) {
remoteUrl = Uri.parse(parcel.readString())
localUrl = Uri.parse(parcel.readString())
}

override val downloadableUniqueId: String
get() = "$remoteUrl||$localUrl".hashCode().toString()

override val remoteUrl: Uri
override val localUrl: Uri

override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(remoteUrl.path)
parcel.writeString(localUrl.path)
}

override fun describeContents(): Int {
return 0
}

companion object CREATOR : Creator<DownloadableFile> {
override fun createFromParcel(parcel: Parcel): DownloadableFile {
return DownloadableFile(parcel)
}

override fun newArray(size: Int): Array<DownloadableFile?> {
return arrayOfNulls(size)
}
}
override val remoteUrl: Uri = Uri.parse(remoteUrl)
override val localUrl: Uri = Uri.parse(localUrl)
}
2 changes: 1 addition & 1 deletion downloadservicelibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 21
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
Expand Down

0 comments on commit d622042

Please sign in to comment.