Skip to content

Commit 68716b5

Browse files
Merge pull request #45 from Trendyol/feature/debug-menu-separate-task
Feature/debug menu separate task
2 parents 0d0e539 + d130c1d commit 68716b5

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

libraries/debug-menu/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ android {
3838

3939
ext {
4040
PUBLISH_GROUP_ID = 'com.trendyol.android.devtools'
41-
PUBLISH_VERSION = '0.4.1'
41+
PUBLISH_VERSION = '0.5.0'
4242
PUBLISH_ARTIFACT_ID = 'debug-menu'
4343
PUBLISH_DESCRIPTION = "Android QA Debug Menu"
4444
PUBLISH_URL = "https://github.com/Trendyol/android-dev-tools"

libraries/debug-menu/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<activity
99
android:name=".internal.ui.DebugMenuActivity"
1010
android:launchMode="singleInstance"
11+
android:label="@string/label"
12+
android:taskAffinity="com.trendyol.android.devtools.debugmenu.task"
1113
android:theme="@style/Theme.Devtools" />
1214
</application>
1315
</manifest>

libraries/debug-menu/src/main/java/com/trendyol/android/devtools/debugmenu/DebugMenu.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.trendyol.android.devtools.debugmenu
22

33
import android.content.Context
4+
import android.content.Intent
45
import com.trendyol.android.devtools.debugmenu.internal.di.ContextContainer
56
import com.trendyol.android.devtools.debugmenu.internal.domain.DebugMenuUseCase
67
import com.trendyol.android.devtools.debugmenu.internal.ui.DebugMenuActivity
@@ -25,10 +26,19 @@ object DebugMenu {
2526
* @param title to show above menu. Default is "Debug Menu".
2627
*/
2728
fun show(title: String = "Debug Menu") {
28-
val context = ContextContainer.getContext()
29-
context.startActivity(DebugMenuActivity.newIntent(context, title))
29+
ContextContainer.getContext().startActivity(newIntent(title))
3030
}
3131

32+
/**
33+
* Creates an Intent to launch Debug menu.
34+
*
35+
* @param title to show above menu. Default is "Debug Menu".
36+
*
37+
* @return intent for Debug Menu's activity.
38+
*/
39+
fun newIntent(title: String = "Debug Menu"): Intent =
40+
DebugMenuActivity.newIntent(ContextContainer.getContext(), title)
41+
3242
fun addDebugAction(debugAction: DebugActionItem) {
3343
addDebugActionItems(listOf(debugAction))
3444
}

libraries/debug-menu/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<resources>
2+
<string name="label">Debug Menu</string>
23
<string name="dev_tools_notification_title">Dev Tools</string>
34
<string name="dev_tools_notification_description">Tap to open Dev Tools</string>
45
<string name="dev_tools_notification_name">Android Dev Tools</string>

0 commit comments

Comments
 (0)