Skip to content
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

Feature/debug menu separate task #45

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/debug-menu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {

ext {
PUBLISH_GROUP_ID = 'com.trendyol.android.devtools'
PUBLISH_VERSION = '0.4.1'
PUBLISH_VERSION = '0.5.0'
PUBLISH_ARTIFACT_ID = 'debug-menu'
PUBLISH_DESCRIPTION = "Android QA Debug Menu"
PUBLISH_URL = "https://github.com/Trendyol/android-dev-tools"
Expand Down
2 changes: 2 additions & 0 deletions libraries/debug-menu/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<activity
android:name=".internal.ui.DebugMenuActivity"
android:launchMode="singleInstance"
android:label="@string/label"
android:taskAffinity="com.trendyol.android.devtools.debugmenu.task"
android:theme="@style/Theme.Devtools" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.trendyol.android.devtools.debugmenu

import android.content.Context
import android.content.Intent
import com.trendyol.android.devtools.debugmenu.internal.di.ContextContainer
import com.trendyol.android.devtools.debugmenu.internal.domain.DebugMenuUseCase
import com.trendyol.android.devtools.debugmenu.internal.ui.DebugMenuActivity
Expand All @@ -25,10 +26,19 @@ object DebugMenu {
* @param title to show above menu. Default is "Debug Menu".
*/
fun show(title: String = "Debug Menu") {
val context = ContextContainer.getContext()
context.startActivity(DebugMenuActivity.newIntent(context, title))
ContextContainer.getContext().startActivity(newIntent(title))
}

/**
* Creates an Intent to launch Debug menu.
*
* @param title to show above menu. Default is "Debug Menu".
*
* @return intent for Debug Menu's activity.
*/
fun newIntent(title: String = "Debug Menu"): Intent =
DebugMenuActivity.newIntent(ContextContainer.getContext(), title)

fun addDebugAction(debugAction: DebugActionItem) {
addDebugActionItems(listOf(debugAction))
}
Expand Down
1 change: 1 addition & 0 deletions libraries/debug-menu/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<resources>
<string name="label">Debug Menu</string>
<string name="dev_tools_notification_title">Dev Tools</string>
<string name="dev_tools_notification_description">Tap to open Dev Tools</string>
<string name="dev_tools_notification_name">Android Dev Tools</string>
Expand Down
Loading