diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3f5618b208..7778a3246e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -36,6 +36,7 @@ plugins { id(libs.plugins.firebaseAppDistribution.get().pluginId) alias(libs.plugins.knit) id("kotlin-parcelize") + id("com.google.android.gms.oss-licenses-plugin") // To be able to update the firebase.xml files, uncomment and build the project // id("com.google.gms.google-services") } @@ -250,6 +251,7 @@ dependencies { implementation(projects.anvilannotations) implementation(projects.appnav) implementation(projects.appconfig) + implementation(projects.libraries.uiStrings) anvil(projects.anvilcodegen) // Comment to not include firebase in the project @@ -257,6 +259,8 @@ dependencies { // Comment to not include unified push in the project implementation(projects.libraries.pushproviders.unifiedpush) + "gplayImplementation"(libs.play.services.oss.licenses) + implementation(libs.appyx.core) implementation(libs.androidx.splash) implementation(libs.androidx.core) diff --git a/app/src/fdroid/kotlin/io/element/android/x/licenses/FdroidOpenSourceLicensesProvider.kt b/app/src/fdroid/kotlin/io/element/android/x/licenses/FdroidOpenSourceLicensesProvider.kt new file mode 100644 index 0000000000..2e926f487e --- /dev/null +++ b/app/src/fdroid/kotlin/io/element/android/x/licenses/FdroidOpenSourceLicensesProvider.kt @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 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 + * + * https://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.x.licenses + +import android.app.Activity +import com.squareup.anvil.annotations.ContributesBinding +import io.element.android.features.preferences.api.OpenSourceLicensesProvider +import io.element.android.libraries.di.AppScope +import javax.inject.Inject + +@ContributesBinding(AppScope::class) +class FdroidOpenSourceLicensesProvider @Inject constructor() : OpenSourceLicensesProvider { + override val hasOpenSourceLicenses: Boolean = false + + override fun navigateToOpenSourceLicenses(activity: Activity) { + error("Not supported, please ensure that hasOpenSourcesLicenses is true before calling this method") + } +} diff --git a/app/src/gplay/AndroidManifest.xml b/app/src/gplay/AndroidManifest.xml new file mode 100644 index 0000000000..234003d953 --- /dev/null +++ b/app/src/gplay/AndroidManifest.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/app/src/gplay/kotlin/io/element/android/x/licenses/OssOpenSourcesLicensesProvider.kt b/app/src/gplay/kotlin/io/element/android/x/licenses/OssOpenSourcesLicensesProvider.kt new file mode 100644 index 0000000000..93848c438d --- /dev/null +++ b/app/src/gplay/kotlin/io/element/android/x/licenses/OssOpenSourcesLicensesProvider.kt @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 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 + * + * https://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.x.licenses + +import android.app.Activity +import android.content.Intent +import com.google.android.gms.oss.licenses.OssLicensesMenuActivity +import com.squareup.anvil.annotations.ContributesBinding +import io.element.android.features.preferences.api.OpenSourceLicensesProvider +import io.element.android.libraries.di.AppScope +import io.element.android.libraries.ui.strings.CommonStrings +import javax.inject.Inject + +@ContributesBinding(AppScope::class) +class OssOpenSourcesLicensesProvider @Inject constructor() : OpenSourceLicensesProvider { + override val hasOpenSourceLicenses: Boolean = true + + override fun navigateToOpenSourceLicenses(activity: Activity) { + val title = activity.getString(CommonStrings.common_open_source_licenses) + OssLicensesMenuActivity.setActivityTitle(title) + activity.startActivity(Intent(activity, OssLicensesMenuActivity::class.java)) + } +} diff --git a/app/src/gplay/res/values-night-v27/themes.xml b/app/src/gplay/res/values-night-v27/themes.xml new file mode 100644 index 0000000000..b1b00d7205 --- /dev/null +++ b/app/src/gplay/res/values-night-v27/themes.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + diff --git a/app/src/gplay/res/values/themes.xml b/app/src/gplay/res/values/themes.xml new file mode 100644 index 0000000000..ab93c3743d --- /dev/null +++ b/app/src/gplay/res/values/themes.xml @@ -0,0 +1,47 @@ + + + + + + + #FFFFFFFF + + #FF1B1D22 + + #FF656D77 + + + +