-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ceefa88
Update markup and signature exit model with new styling
grzesiek2010 1d9e95c
Fixed imports
grzesiek2010 ac65e71
Removed unused strings
grzesiek2010 6e6911b
Removed unused classes
grzesiek2010 ab42303
Added comments to strings
grzesiek2010 dc28baf
Use margin_standard instead of margin
grzesiek2010 7fb24f8
Add tests
grzesiek2010 399dbc4
Remove unused strings
grzesiek2010 d5d877f
Fix test
grzesiek2010 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| <application> | ||
| <activity | ||
| android:name=".DrawActivity" | ||
| android:theme="@style/Theme.Material3.DayNight"/> | ||
| </application> | ||
| </manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
draw/src/main/java/org/odk/collect/draw/IconMenuListAdapter.java
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
draw/src/main/java/org/odk/collect/draw/QuitDrawingDialog.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { | ||
grzesiek2010 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| onDiscardChanges?.run() | ||
| } | ||
|
|
||
| binding.keepEditing.setOnClickListener { | ||
| dialog.dismiss() | ||
| } | ||
|
|
||
| binding.saveChanges.setOnClickListener { | ||
| onSaveChanges?.run() | ||
| } | ||
|
|
||
| return dialog | ||
| } | ||
| } | ||
16 changes: 16 additions & 0 deletions
16
draw/src/main/java/org/odk/collect/draw/RobolectricApplication.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package org.odk.collect.draw | ||
|
|
||
| import android.app.Application | ||
| /** | ||
| * Used as the Application in tests in in the `test/src` root. This is setup in `robolectric.properties` | ||
| */ | ||
| internal class RobolectricApplication : Application(), DrawDependencyComponentProvider { | ||
|
|
||
| override lateinit var drawDependencyComponent: DrawDependencyComponent | ||
|
|
||
| fun setupDependencies(dependencyModule: DrawDependencyModule) { | ||
| drawDependencyComponent = DaggerDrawDependencyComponent.builder() | ||
| .drawDependencyModule(dependencyModule) | ||
| .build() | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.