From ed18f003bb3bd80149e9fce7288382fb85dafdd7 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 26 Dec 2019 15:32:31 -0800 Subject: Convert to view binding --- .../pitchedapps/frost/activities/ImageActivity.kt | 4 +- app/src/main/res/layout/activity_image.xml | 84 +++++++++++----------- 2 files changed, 42 insertions(+), 46 deletions(-) (limited to 'app/src') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt index d7876888..71152190 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt @@ -24,7 +24,6 @@ import android.os.Bundle import android.os.Environment import android.view.View import androidx.customview.widget.ViewDragHelper -import androidx.databinding.DataBindingUtil import ca.allanwang.kau.internal.KauBaseActivity import ca.allanwang.kau.logging.KauLoggerExtension import ca.allanwang.kau.mediapicker.scanMedia @@ -177,7 +176,8 @@ class ImageActivity : KauBaseActivity() { L.v { "Launching with true url $result" } result } - binding = DataBindingUtil.setContentView(this, R.layout.activity_image) + binding = ActivityImageBinding.inflate(layoutInflater) + setContentView(binding.root) binding.onCreate() tempFile = File(cacheDir(this), imageHash) launch(CoroutineExceptionHandler { _, throwable -> loadError(throwable) }) { diff --git a/app/src/main/res/layout/activity_image.xml b/app/src/main/res/layout/activity_image.xml index 2bf68056..7d79cb74 100644 --- a/app/src/main/res/layout/activity_image.xml +++ b/app/src/main/res/layout/activity_image.xml @@ -1,51 +1,47 @@ - - - + + + + - - - - - - - - - + android:layout_height="match_parent" + android:alpha="0" + android:scaleX="0.9" + android:scaleY="0.9" /> - + - - - + + + + + -- cgit v1.2.3