Fix onButtonClick bug on Android 6.0

This commit is contained in:
Davide Depau 2018-11-19 03:03:13 +01:00
parent 7db42212ea
commit 691bddcc00
Signed by: depau
GPG key ID: C7D999B6A55EFE86
4 changed files with 7 additions and 5 deletions

View file

@ -56,6 +56,8 @@ class ConfirmationActivity : ActivityBase() {
setContentView(R.layout.activity_confirmation)
actionBar?.setDisplayHomeAsUpEnabled(true)
confirm_fab.setOnClickListener(this::onButtonClicked)
// displayImageLayout must be called before displayDetails
// to ensure uncompressed image size is available
displayImageLayout()

View file

@ -12,6 +12,7 @@ import eu.depau.etchdroid.R
import eu.depau.etchdroid.StateKeeper
import eu.depau.etchdroid.enums.FlashMethod
import eu.depau.etchdroid.utils.DoNotShowAgainDialogFragment
import kotlinx.android.synthetic.main.activity_start.*
import java.io.File
@ -34,6 +35,8 @@ class StartActivity : ActivityBase() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_start)
btn_image_raw.setOnClickListener(this::onButtonClicked)
btn_image_dmg.setOnClickListener(this::onButtonClicked)
}
fun onButtonClicked(view: View) = onButtonClicked(view, true)

View file

@ -215,7 +215,6 @@
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:onClick="onButtonClicked"
app:srcCompat="@drawable/ic_twotone_save_alt_24px"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -38,8 +38,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/CardContentStyle"
android:foreground="?attr/selectableItemBackground"
android:onClick="onButtonClicked">
android:foreground="?attr/selectableItemBackground">
<ImageView
android:id="@+id/imageView"
@ -102,8 +101,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/CardContentStyle"
android:foreground="?attr/selectableItemBackground"
android:onClick="onButtonClicked">
android:foreground="?attr/selectableItemBackground">
<ImageView
android:id="@+id/imageView2"