Skip to content

Commit

Permalink
addon Page locale support
Browse files Browse the repository at this point in the history
hide ime when submit text
fix forkDebug build
  • Loading branch information
akliuxingyuan committed Apr 18, 2023
1 parent d41f7ef commit 83348b6
Show file tree
Hide file tree
Showing 10 changed files with 282 additions and 101 deletions.
11 changes: 10 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,16 @@ android {
debuggable true
def deepLinkSchemeValue = "iceraven-debug"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
"sharedUserId": "io.github.forkmaintainers.iceraven.sharedID",
"deepLinkScheme": deepLinkSchemeValue,
"targetActivity": targetActivity
]
// Use custom default allowed addon list
buildConfigField "String", "AMO_COLLECTION_USER", "\"16201230\""
buildConfigField "String", "AMO_COLLECTION_NAME", "\"What-I-want-on-Fenix\""
resValue "bool", "IS_DEBUG", "true"
matchingFallbacks = ['debug']
}
forkRelease releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
Expand All @@ -182,7 +188,8 @@ android {
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
"sharedUserId": "io.github.forkmaintainers.iceraven.sharedID",
"deepLinkScheme": deepLinkSchemeValue
"deepLinkScheme": deepLinkSchemeValue,
"targetActivity": targetActivity
]
// Use custom default allowed addon list
buildConfigField "String", "AMO_COLLECTION_USER", "\"16201230\""
Expand Down Expand Up @@ -488,6 +495,7 @@ nimbus {
fenixNightly: "nightly",
fenixBeta: "beta",
fenixRelease: "release",
fenixForkDebug: "forkDebug",
fenixForkRelease: "forkRelease"
]
// This is generated by the FML and should be checked into git.
Expand Down Expand Up @@ -625,6 +633,7 @@ dependencies {
implementation project(':lib-dataprotect')

debugImplementation FenixDependencies.leakcanary
forkDebugImplementation FenixDependencies.leakcanary

implementation FenixDependencies.androidx_annotation
implementation FenixDependencies.androidx_compose_ui
Expand Down
1 change: 1 addition & 0 deletions app/nimbus.fml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ channels:
- beta
- nightly
- developer
- forkDebug
- forkRelease
includes:
- messaging.fml.yaml
Expand Down
1 change: 0 additions & 1 deletion app/src/forkDebug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest
package="org.mozilla.fenix"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

Expand Down
15 changes: 13 additions & 2 deletions app/src/forkDebug/java/org/mozilla/fenix/DebugFenixApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,31 @@ import android.os.StrictMode
import androidx.preference.PreferenceManager
import leakcanary.AppWatcher
import leakcanary.LeakCanary
import org.mozilla.fenix.ext.application
import org.mozilla.fenix.ext.getPreferenceKey

class DebugFenixApplication : FenixApplication() {

override fun setupLeakCanary() {
if (!AppWatcher.isInstalled) {
AppWatcher.manualInstall(
application = application,
watchersToInstall = AppWatcher.appDefaultWatchers(application),
)
}

val isEnabled = components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean(getPreferenceKey(R.string.pref_key_leakcanary), true)
}

updateLeakCanaryState(isEnabled)
}

override fun updateLeakCanaryState(isEnabled: Boolean) {
AppWatcher.config = AppWatcher.config.copy(enabled = isEnabled)
LeakCanary.config = LeakCanary.config.copy(dumpHeap = isEnabled)
LeakCanary.showLeakDisplayActivityLauncherIcon(isEnabled)
components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
LeakCanary.config = LeakCanary.config.copy(dumpHeap = isEnabled)
}
}
}
2 changes: 1 addition & 1 deletion app/src/forkDebug/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<color name="ic_launcher_background">@color/debug_launcher_background</color>
<color name="ic_launcher_background">@color/photonInk20</color>
</resources>
Loading

0 comments on commit 83348b6

Please sign in to comment.