-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update markup and signature exit model with new styling #6300
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
base: master
Are you sure you want to change the base?
Changes from all commits
2310af9
acd2ac9
72c9fe2
593f604
63e498b
67eeb8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package org.odk.collect.draw | ||
|
||
import android.app.Activity | ||
import androidx.appcompat.app.AlertDialog | ||
import com.google.android.material.dialog.MaterialAlertDialogBuilder | ||
import org.odk.collect.draw.databinding.QuitDrawingDialogLayoutBinding | ||
|
||
object QuitDrawingDialog { | ||
|
||
@JvmStatic | ||
fun show( | ||
activity: Activity, | ||
onDiscardChanges: Runnable?, | ||
onSaveChanges: Runnable? | ||
): AlertDialog { | ||
return create( | ||
activity, | ||
onDiscardChanges, | ||
onSaveChanges | ||
).also { | ||
it.show() | ||
} | ||
} | ||
|
||
private fun create( | ||
activity: Activity, | ||
onDiscardChanges: Runnable?, | ||
onSaveChanges: Runnable? | ||
): AlertDialog { | ||
val binding = QuitDrawingDialogLayoutBinding.inflate(activity.layoutInflater) | ||
val dialog = MaterialAlertDialogBuilder(activity) | ||
.setTitle(org.odk.collect.strings.R.string.save_drawing_title) | ||
.setView(binding.root) | ||
.create() | ||
|
||
binding.discardChanges.setOnClickListener { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see any test coverage for these 3 buttons - I'm guessing that's an existing problem though. This is probably a good opportunity to add it (maybe as part of a |
||
onDiscardChanges?.run() | ||
} | ||
|
||
binding.keepEditing.setOnClickListener { | ||
dialog.dismiss() | ||
} | ||
|
||
binding.saveChanges.setOnClickListener { | ||
onSaveChanges?.run() | ||
} | ||
|
||
return dialog | ||
} | ||
} |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.