Commit 7b83e4fc authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix google sdk 29 nullability issues

parent 19597003
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
</profile-state> </profile-state>
</entry> </entry>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
......
...@@ -65,7 +65,7 @@ class DownloadTourDialogController : Controller { ...@@ -65,7 +65,7 @@ class DownloadTourDialogController : Controller {
.inject(this) .inject(this)
} }
private val tour:TourModel by lazy { private val tour:TourModel? by lazy {
args.getParcelable<TourModel>(DOWNLOAD_TOUR_ID_KEY) args.getParcelable<TourModel>(DOWNLOAD_TOUR_ID_KEY)
} }
...@@ -105,17 +105,17 @@ class DownloadTourDialogController : Controller { ...@@ -105,17 +105,17 @@ class DownloadTourDialogController : Controller {
downloadToken = DownloadUseCase.CancellationToken(false) downloadToken = DownloadUseCase.CancellationToken(false)
downloadTourTitleText.text = tour.title tour?.let{ tourModel ->
downloadTourTitleText.text = tourModel.title
Glide.with(view) Glide.with(view)
.load(tour.previewUrl) .load(tourModel.previewUrl)
.transform(BlurTransformation(13, 8) .transform(BlurTransformation(13, 8)
,ColorFilterTransformation(0x99000000.toInt())) ,ColorFilterTransformation(0x99000000.toInt()))
.into(downloaderBg) .into(downloaderBg)
disposables.add( disposables.add(
downloader.downloadTour(tour.tour_id, downloadToken) downloader.downloadTour(tourModel.tour_id, downloadToken)
.onErrorReturn { Timber.e(it);TourPreviewEntity() } .onErrorReturn { Timber.e(it);TourPreviewEntity() }
// .onErrorReturn { parseError(it);TourPreviewEntity() }
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe ( .subscribe (
...@@ -133,13 +133,17 @@ class DownloadTourDialogController : Controller { ...@@ -133,13 +133,17 @@ class DownloadTourDialogController : Controller {
} }
)) ))
cancelDownloadText.setOnClickListener {handleBack() } cancelDownloadText.setOnClickListener {handleBack() }
// downloadTour(it.tour.tour_id, downloadToken) }?: ::tourError
// view.findViewById<View>(R.id.close_current_button).setOnClickListener { handleBack() }
return view return view
} }
private fun tourError(){
Timber.e("Tour not been initialized by key: $DOWNLOAD_TOUR_ID_KEY")
snackbar.showSnackBar("Ошибка! Данные тура не найдены.")
handleBack()
}
private fun updateProgressBar(curr:Int, max:Int){ private fun updateProgressBar(curr:Int, max:Int){
......
...@@ -120,8 +120,8 @@ data class UpdateAppModel( ...@@ -120,8 +120,8 @@ data class UpdateAppModel(
val downloadUrl : String? val downloadUrl : String?
) : Parcelable { ) : Parcelable {
constructor(parcel: Parcel) : this( constructor(parcel: Parcel) : this(
parcel.readString(), parcel.readString()?:error("current version not read"),
parcel.readString(), parcel.readString()?:error("new version not read"),
parcel.readByte() != 0.toByte(), parcel.readByte() != 0.toByte(),
parcel.readString(), parcel.readString(),
parcel.readString()) { parcel.readString()) {
......
...@@ -32,17 +32,17 @@ data class TourModel ( ...@@ -32,17 +32,17 @@ data class TourModel (
) : Parcelable { ) : Parcelable {
constructor(parcel: Parcel) : this( constructor(parcel: Parcel) : this(
parcel.readString(), parcel.readString()?:error("tour id not read"),
parcel.readSerializable() as Date, parcel.readSerializable() as Date,
parcel.readSerializable() as Date, parcel.readSerializable() as Date,
TourType.valueOf(parcel.readString()), TourType.valueOf(parcel.readString()?: error("tour type not read")),
parcel.readString(), parcel.readString()?: error("tour title not read"),
parcel.readString(), parcel.readString(),
parcel.readString(), parcel.readString(),
parcel.readByte() != 0.toByte(), parcel.readByte() != 0.toByte(),
parcel.readString(), parcel.readString(),
parcel.readInt(), parcel.readInt(),
DownloadState.valueOf(parcel.readString()), DownloadState.valueOf(parcel.readString()?:error("tour state not read")),
parcel.readLong(), parcel.readLong(),
parcel.readLong(), parcel.readLong(),
parcel.readInt(), parcel.readInt(),
......
...@@ -64,8 +64,8 @@ data class PhotoResolutionModel( ...@@ -64,8 +64,8 @@ data class PhotoResolutionModel(
val resHeight:Int val resHeight:Int
) : Parcelable { ) : Parcelable {
constructor(parcel: Parcel) : this( constructor(parcel: Parcel) : this(
parcel.readString(), parcel.readString()?:error("resName not read"),
parcel.readString(), parcel.readString()?:error("photo url not read"),
parcel.readInt(), parcel.readInt(),
parcel.readInt() parcel.readInt()
) )
......
...@@ -18,8 +18,8 @@ data class LoadTourConfig( ...@@ -18,8 +18,8 @@ data class LoadTourConfig(
constructor(parcel: Parcel) : this( constructor(parcel: Parcel) : this(
parcel.readInt(), parcel.readInt(),
parcel.readInt(), parcel.readInt(),
parcel.readString(), parcel.readString()?:error("cache uri not read"),
parcel.readString(), parcel.readString()?:error("meta uri not read"),
parcel.readString(), parcel.readString(),
parcel.readInt()!= 0, parcel.readInt()!= 0,
parcel.readInt() == 1 parcel.readInt() == 1
......
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