Skip to content

Commit d36d81a

Browse files
authored
ADS: Re-enable ADS Preview (#6819)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1202552961248957/task/1211407136075484?focus=true ### Description Re-enable ADS demo screen ### Steps to test this PR _ADS Demo_ - [x] Install Internal flavour - [x] Navigate to Settings and verify ADS Demo is visible - [x] Open it and verify it works
1 parent 62f2c45 commit d36d81a

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

design-system/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ dependencies {
4343
anvil project(path: ':anvil-compiler')
4444
implementation project(path: ':anvil-annotations')
4545
implementation project(path: ':app-build-config-api')
46+
implementation project(':internal-features-api')
4647
implementation "androidx.datastore:datastore-preferences:_"
4748

4849
implementation AndroidX.appCompat
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2025 DuckDuckGo
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.duckduckgo.common.ui.themepreview.ui
18+
19+
import android.content.Context
20+
import com.duckduckgo.anvil.annotations.PriorityKey
21+
import com.duckduckgo.di.scopes.AppScope
22+
import com.duckduckgo.internal.features.api.InternalFeaturePlugin
23+
import com.duckduckgo.mobile.android.R as CommonR
24+
import com.squareup.anvil.annotations.ContributesMultibinding
25+
import javax.inject.Inject
26+
27+
@ContributesMultibinding(AppScope::class)
28+
@PriorityKey(InternalFeaturePlugin.ADS_SETTINGS_PRIO_KEY)
29+
class ThemesPreviewInternalFeature @Inject constructor(private val context: Context) : InternalFeaturePlugin {
30+
31+
override fun internalFeatureTitle(): String {
32+
return context.getString(CommonR.string.ads_demo_plugin_title)
33+
}
34+
35+
override fun internalFeatureSubtitle(): String {
36+
return context.getString(CommonR.string.ads_demo_plugin_message)
37+
}
38+
39+
override fun onInternalFeatureClicked(activityContext: Context) {
40+
activityContext.startActivity(AppComponentsActivity.intent(activityContext))
41+
}
42+
}

design-system/src/main/res/values/donottranslate.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<string name="ads_demo_activity_title" translatable="false">Android Design System Demo</string>
3131
<string name="ads_demo_header_title" translatable="false">Android Design System</string>
3232

33+
<!-- ADS Demo Screen -->
34+
<string name="ads_demo_plugin_title" translatable="false">Android Design System Preview</string>
35+
<string name="ads_demo_plugin_message" translatable="false">Set of components designed following our Design System</string>
3336

3437
<!--Components-->
3538
<string name="text_headline" translatable="false">Headline</string>

internal-features/internal-features-api/src/main/java/com/duckduckgo/internal/features/api/InternalFeaturePlugin.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ interface InternalFeaturePlugin {
3434

3535
// Every time you want to add a setting add the priority (order) to the list below and use it in the plugin
3636
companion object {
37-
const val EXPERIMENTAL_UI_SETTINGS = 99
3837
const val DEVELOPER_SETTINGS_PRIO_KEY = 100
3938
const val FEATURE_INVENTORY_PRIO_KEY = 110
4039
const val SYNC_SETTINGS_PRIO_KEY = 200

0 commit comments

Comments
 (0)