Add ApplicationConfig object to help tweaking the application / brand name used across the application.
This commit is contained in:
parent
ffede8b13b
commit
447a10cb06
2 changed files with 47 additions and 4 deletions
|
|
@ -23,6 +23,7 @@ import androidx.preference.PreferenceManager
|
||||||
import com.squareup.anvil.annotations.ContributesTo
|
import com.squareup.anvil.annotations.ContributesTo
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
import dagger.Provides
|
import dagger.Provides
|
||||||
|
import io.element.android.appconfig.ApplicationConfig
|
||||||
import io.element.android.features.messages.impl.timeline.components.customreaction.DefaultEmojibaseProvider
|
import io.element.android.features.messages.impl.timeline.components.customreaction.DefaultEmojibaseProvider
|
||||||
import io.element.android.features.messages.impl.timeline.components.customreaction.EmojibaseProvider
|
import io.element.android.features.messages.impl.timeline.components.customreaction.EmojibaseProvider
|
||||||
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
||||||
|
|
@ -79,10 +80,9 @@ object AppModule {
|
||||||
fun providesBuildMeta(@ApplicationContext context: Context, buildType: BuildType) = BuildMeta(
|
fun providesBuildMeta(@ApplicationContext context: Context, buildType: BuildType) = BuildMeta(
|
||||||
isDebuggable = BuildConfig.DEBUG,
|
isDebuggable = BuildConfig.DEBUG,
|
||||||
buildType = buildType,
|
buildType = buildType,
|
||||||
applicationName = context.getString(R.string.app_name),
|
applicationName = ApplicationConfig.APPLICATION_NAME.takeIf { it.isNotEmpty() } ?: context.getString(R.string.app_name),
|
||||||
productionApplicationName = "Element",
|
productionApplicationName = ApplicationConfig.PRODUCTION_APPLICATION_NAME,
|
||||||
// Use the same name for desktop and mobile for now
|
desktopApplicationName = ApplicationConfig.DESKTOP_APPLICATION_NAME,
|
||||||
desktopApplicationName = context.getString(R.string.app_name),
|
|
||||||
applicationId = BuildConfig.APPLICATION_ID,
|
applicationId = BuildConfig.APPLICATION_ID,
|
||||||
// TODO EAx Config.LOW_PRIVACY_LOG_ENABLE,
|
// TODO EAx Config.LOW_PRIVACY_LOG_ENABLE,
|
||||||
lowPrivacyLoggingEnabled = false,
|
lowPrivacyLoggingEnabled = false,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.element.android.appconfig
|
||||||
|
|
||||||
|
object ApplicationConfig {
|
||||||
|
/**
|
||||||
|
* Application name used in the UI for string. If empty, the value is taken from the resources `R.string.app_name`.
|
||||||
|
* Note that this value is not used for the launcher icon.
|
||||||
|
* For Element, the value is empty, and so read from `R.string.app_name`, which depends on the build variant:
|
||||||
|
* - "Element X" for release builds;
|
||||||
|
* - "Element X dbg" for debug builds;
|
||||||
|
* - "Element X nightly" for nightly builds.
|
||||||
|
*/
|
||||||
|
const val APPLICATION_NAME: String = ""
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used in the strings to reference the Element client.
|
||||||
|
* Cannot be empty.
|
||||||
|
* For Element, the value is "Element".
|
||||||
|
*/
|
||||||
|
const val PRODUCTION_APPLICATION_NAME: String = "Element"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used in the strings to reference the Element Desktop client, for instance Element Web.
|
||||||
|
* Cannot be empty.
|
||||||
|
* For Element, the value is "Element". We use the same name for desktop and mobile for now.
|
||||||
|
*/
|
||||||
|
const val DESKTOP_APPLICATION_NAME: String = "Element"
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue