From 0c42ae69d3d26611d1bfeb2be4dcfafa88634ccf Mon Sep 17 00:00:00 2001 From: kishka Date: Wed, 13 May 2026 08:51:16 -0400 Subject: [PATCH] - Adds confirmation popup when resetting mana - Changes poison counter to have a -+ instead of <> to match the rest of the ui - Adds README.md --- README.md | 24 +++++++++++++++++++ .../cc/kishka/magiccounter/MainActivity.kt | 13 +++++++--- app/src/main/res/layout/activity_main.xml | 8 +++---- .../res/layout/mana_pool_dialog_content.xml | 4 +--- 4 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..33e71e8 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ + Magic Counter +--------------- + +This app functions as a counter app for Magic the Gathering. + +Features: +- One or Two counter set display(with player labels). + - Starting player can be any number + - You can choose how may people are playing in the game(While there may be 6 players, there is a max of two counters, but there will be 5 Commander Damage counters available to each of those players. +- Material UI +- Health counter +- Poison counter +- Labeled Commander Damage counters(1+ per player) +- Mana pool (There is a reset button with a confirmation popup) +- 'Dice' (You can 'roll' random numbers; D4, D6, D8, D10, D12, D20) +- Reset game option (With a confirmation popup) + +What can you do with this app? +- Fork it +- Create a pull request +- Commit stuff +- Keep it for yourself + +Have fun! diff --git a/app/src/main/java/cc/kishka/magiccounter/MainActivity.kt b/app/src/main/java/cc/kishka/magiccounter/MainActivity.kt index 90523ae..8d5a140 100644 --- a/app/src/main/java/cc/kishka/magiccounter/MainActivity.kt +++ b/app/src/main/java/cc/kishka/magiccounter/MainActivity.kt @@ -414,9 +414,16 @@ class MainActivity : AppCompatActivity() { } container.findViewById(R.id.clearManaButton).setOnClickListener { - it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS) - types.forEach { type -> pData.mana[type] = 0 } - setupManaInLayout(playerId, container) + it.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY) + MaterialAlertDialogBuilder(this) + .setTitle("Clear Mana Pool?") + .setMessage("This will reset all mana counts to zero.") + .setPositiveButton("Clear") { _, _ -> + types.forEach { type -> pData.mana[type] = 0 } + setupManaInLayout(playerId, container) + } + .setNegativeButton("Cancel", null) + .show() } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index e4d1b86..26f2f76 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -182,7 +182,7 @@ style="@style/Widget.Material3.Button.IconButton" android:layout_width="40dp" android:layout_height="40dp" - app:icon="@drawable/rounded_arrow_back_ios_24" + app:icon="@drawable/rounded_remove_24" app:iconSize="16dp" /> @@ -390,7 +390,7 @@ style="@style/Widget.Material3.Button.IconButton" android:layout_width="40dp" android:layout_height="40dp" - app:icon="@drawable/rounded_arrow_back_ios_24" + app:icon="@drawable/rounded_remove_24" app:iconSize="16dp" /> diff --git a/app/src/main/res/layout/mana_pool_dialog_content.xml b/app/src/main/res/layout/mana_pool_dialog_content.xml index 276bd5f..b98a047 100644 --- a/app/src/main/res/layout/mana_pool_dialog_content.xml +++ b/app/src/main/res/layout/mana_pool_dialog_content.xml @@ -1,6 +1,5 @@ + android:text="Clear All" />