Skip to content

Commit 1aa1823

Browse files
authored
Merge pull request #6 from FeernandoOFF/main
Updated :: Provide no-op implementations for release source sets
2 parents 2d036f1 + 4552c1c commit 1aa1823

35 files changed

Lines changed: 283 additions & 130 deletions

app/build.gradle.kts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,20 @@ android {
1818
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1919
}
2020

21-
buildTypes {
22-
release {
23-
isMinifyEnabled = false
24-
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
21+
signingConfigs {
22+
create("release") {
23+
storeFile = file("../signing/app-release.jks")
24+
keyAlias="app-release"
25+
keyPassword="password0"
26+
storePassword="password0"
27+
}
28+
}
29+
30+
buildTypes {
31+
release {
32+
isMinifyEnabled = false
33+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
34+
signingConfig = signingConfigs.getByName("release")
2535
}
2636
}
2737
compileOptions {

debugMenu/src/main/java/com/tapadoo/debugmenu/DebugMenu.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/DebugMenu.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fun DebugMenuOverlay(
8181
}
8282
}
8383
}
84-
84+
8585
MaterialTheme(
8686
colorScheme = colorScheme,
8787
) {
@@ -158,4 +158,4 @@ internal fun getTheme(
158158
else -> lightColorScheme()
159159
}
160160

161-
}
161+
}

debugMenu/src/main/java/com/tapadoo/debugmenu/DebugMenuAttacher.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/DebugMenuAttacher.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ object DebugMenuAttacher {
5353
enableShake: Boolean = false,
5454
) = runCatching {
5555
val decor = activity.window?.decorView as? ViewGroup ?: return@runCatching
56-
5756
// Avoid duplicates
5857
val existing = decor.findViewWithTag<FrameLayout>(TAG)
5958
if (existing != null) return@runCatching
@@ -106,4 +105,4 @@ object DebugMenuAttacher {
106105
}
107106

108107
private const val TAG = "debugMenu_overlay_container"
109-
}
108+
}

debugMenu/src/main/java/com/tapadoo/debugmenu/ShakeDetector.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/ShakeDetector.kt

File renamed without changes.

debugMenu/src/main/java/com/tapadoo/debugmenu/analytics/AnalyticsModule.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/analytics/AnalyticsModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ class AnalyticsModule : DebugMenuModule {
1313
AnalyticsScreen()
1414
}
1515

16-
}
16+
}

debugMenu/src/main/java/com/tapadoo/debugmenu/analytics/AnalyticsModels.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/analytics/DebugAnalytics.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
package com.tapadoo.debugmenu.analytics
22

3-
import android.R.attr.value
43
import android.os.Bundle
54
import androidx.compose.runtime.mutableStateListOf
65
import androidx.compose.runtime.snapshots.SnapshotStateList
76

8-
/** Public display model for analytics items shown in the debug menu */
9-
data class AnalyticsItem(
10-
val name: String,
11-
val params: Map<String, String> = emptyMap(),
12-
val timestampMs: Long = System.currentTimeMillis(),
13-
)
14-
157
/** Internal state holder and public API for analytics */
168
object DebugAnalytics {
179
private var mapper: ((Any) -> AnalyticsItem)? = null
@@ -23,7 +15,7 @@ object DebugAnalytics {
2315
val params = bundle.keySet().associateWith { key ->
2416
bundle.get(key).toString()
2517
}
26-
18+
2719
runCatching {
2820
events.add(AnalyticsItem(
2921
name = eventName,

debugMenu/src/main/java/com/tapadoo/debugmenu/datastore/BasePrefs.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/datastore/BasePrefs.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ class BasePrefs(private val dataStore: DataStore<Preferences>) {
5353
suspend fun setString(key: String, value: String?) = stringPreferencesKey(key).set(value)
5454

5555
suspend fun clear() { dataStore.edit { it.clear() } }
56-
}
56+
}

debugMenu/src/main/java/com/tapadoo/debugmenu/datastore/DataStoreModule.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/datastore/DataStoreModule.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import androidx.datastore.preferences.core.Preferences
99
/**
1010
* A module for the debug menu providing an interface to interact with DataStore objects.
1111
*
12-
* This class implements the DebugMenuModule interface, displaying a UI component that allows
13-
* the user to view and modify entries in multiple instances of DataStore<Preferences>. The entries
14-
* are rendered via the DataStoreScreen composable.
15-
*
1612
* @property dataStores A list of DataStore<Preferences> instances that are managed and displayed
1713
* in the module's interface.
1814
*/
@@ -26,4 +22,4 @@ class DataStoreModule(
2622
DataStoreScreen(dataStores)
2723
}
2824

29-
}
25+
}

debugMenu/src/main/java/com/tapadoo/debugmenu/dynamic/DynamicModule.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/dynamic/DynamicModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ private fun DynamicListItem(
108108
Text("Perform")
109109
}
110110
}
111-
}
111+
}

debugMenu/src/main/java/com/tapadoo/debugmenu/dynamic/DynamicModels.kt renamed to debugMenu/src/debug/java/com/tapadoo/debugmenu/dynamic/DynamicModuleState.kt

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,8 @@ import androidx.lifecycle.LifecycleEventObserver
99
import androidx.lifecycle.LifecycleOwner
1010

1111

12-
/**
13-
* Represents a dynamic action with a title, an optional description, and an action to be executed when clicked.
14-
*
15-
* This can be used to define actions that are dynamically added or removed within a module
16-
* or executed upon certain user interactions in a composable UI.
17-
*
18-
* @property title The title of the action.
19-
* @property description An optional description providing additional details about the action.
20-
* @property onClick A lambda function to be executed when the action is triggered.
21-
*/
22-
data class DynamicAction(
23-
val title: String,
24-
val description: String? = null,
25-
val onClick: () -> Unit
26-
)
27-
28-
2912
/**
3013
* A singleton object that manages the state of dynamic actions in a module.
31-
*
32-
* This object provides a centralized mechanism to dynamically add, remove, or clear actions
33-
* represented by `DynamicAction`. These actions can be used for scenarios where the list of
34-
* options or operations needs to be updated dynamically. Actions added to this state
35-
* are observable and can be reflected in a UI, such as within a Composable interface.
36-
*
37-
* Properties:
38-
* - `action`: A mutable state-backed list of `DynamicAction`, holding the currently active dynamic actions.
3914
*/
4015
object DynamicModuleState {
4116

@@ -81,21 +56,6 @@ fun DynamicModuleActions(lifecycleOwner: LifecycleOwner, vararg options: Dynamic
8156

8257
/**
8358
* Extension function for LifecycleOwner to register dynamic module actions.
84-
* This function automatically handles the lifecycle of the actions, adding them when
85-
* the owner is resumed and removing them when paused or destroyed.
86-
*
87-
* Usage example:
88-
* ```
89-
* class MyFragment : Fragment() {
90-
* override fun onCreate(savedInstanceState: Bundle?) {
91-
* super.onCreate(savedInstanceState)
92-
* registerDynamicModuleActions(
93-
* DynamicAction("Action 1") { /* action 1 */ },
94-
* DynamicAction("Action 2") { /* action 2 */ }
95-
* )
96-
* }
97-
* }
98-
* ```
9959
*
10060
* @param options A variable number of DynamicAction objects to be managed.
10161
*/
@@ -120,5 +80,3 @@ fun LifecycleOwner.registerDynamicModuleActions(vararg options: DynamicAction) {
12080
}
12181
lifecycle.addObserver(observer)
12282
}
123-
124-

0 commit comments

Comments
 (0)