Browse Source

Create module :appicon:enterprise

pull/3134/head
Benoit Marty 2 months ago committed by Benoit Marty
parent
commit
9440d08c20
  1. 2
      app/build.gradle.kts
  2. 26
      appicon/enterprise/build.gradle.kts
  3. 10
      appicon/enterprise/src/debug/res/drawable/ic_launcher_background.xml
  4. 53
      appicon/enterprise/src/main/kotlin/io/element/android/appicon/enterprise/IconPreview.kt
  5. 21
      appicon/enterprise/src/main/res/mipmap-anydpi/ic_launcher.xml
  6. 21
      appicon/enterprise/src/main/res/mipmap-anydpi/ic_launcher_round.xml
  7. BIN
      appicon/enterprise/src/main/res/mipmap-hdpi/ic_launcher_background.webp
  8. BIN
      appicon/enterprise/src/main/res/mipmap-mdpi/ic_launcher_background.webp
  9. BIN
      appicon/enterprise/src/main/res/mipmap-xhdpi/ic_launcher_background.webp
  10. BIN
      appicon/enterprise/src/main/res/mipmap-xxhdpi/ic_launcher_background.webp
  11. BIN
      appicon/enterprise/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp
  12. BIN
      appicon/enterprise/src/main/res/mipmap-xxxhdpi/ic_launcher_background.webp
  13. 10
      appicon/enterprise/src/nightly/res/drawable/ic_launcher_background.xml
  14. 2
      appicon/enterprise/src/release/res/drawable/ic_launcher_background.xml
  15. 2
      settings.gradle.kts

2
app/build.gradle.kts

@ -241,7 +241,7 @@ dependencies { @@ -241,7 +241,7 @@ dependencies {
allServicesImpl()
if (isEnterpriseBuild) {
allEnterpriseImpl(rootDir, logger)
// TODO implementation(projects.appicon.enterprise)
implementation(projects.appicon.enterprise)
} else {
implementation(projects.appicon.element)
}

26
appicon/enterprise/build.gradle.kts

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
/*
* 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
*
* 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.
*/
plugins {
id("io.element.android-compose-library")
}
android {
namespace = "io.element.android.appicon.enterprise"
buildTypes {
register("nightly")
}
}

10
appicon/enterprise/src/debug/res/drawable/ic_launcher_background.xml

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#F7F07E"
android:fillType="evenOdd"
android:pathData="m0,0h108v108h-108z" />
</vector>

53
appicon/enterprise/src/main/kotlin/io/element/android/appicon/enterprise/IconPreview.kt

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
/*
* 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.appicon.enterprise
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
@Preview
@Composable
internal fun IconPreview() {
Box {
Image(painter = painterResource(id = R.mipmap.ic_launcher_background), contentDescription = null)
Image(
modifier = Modifier.align(Alignment.Center),
painter = painterResource(id = R.mipmap.ic_launcher_foreground),
contentDescription = null,
)
}
}
@Preview
@Composable
internal fun RoundIconPreview() {
Box(modifier = Modifier.clip(shape = CircleShape)) {
Image(painter = painterResource(id = R.mipmap.ic_launcher_background), contentDescription = null)
Image(
modifier = Modifier.align(Alignment.Center),
painter = painterResource(id = R.mipmap.ic_launcher_foreground),
contentDescription = null,
)
}
}

21
appicon/enterprise/src/main/res/mipmap-anydpi/ic_launcher.xml

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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
~
~ 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.
-->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

21
appicon/enterprise/src/main/res/mipmap-anydpi/ic_launcher_round.xml

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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
~
~ 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.
-->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon>

BIN
appicon/enterprise/src/main/res/mipmap-hdpi/ic_launcher_background.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
appicon/enterprise/src/main/res/mipmap-mdpi/ic_launcher_background.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
appicon/enterprise/src/main/res/mipmap-xhdpi/ic_launcher_background.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
appicon/enterprise/src/main/res/mipmap-xxhdpi/ic_launcher_background.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
appicon/enterprise/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
appicon/enterprise/src/main/res/mipmap-xxxhdpi/ic_launcher_background.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

10
appicon/enterprise/src/nightly/res/drawable/ic_launcher_background.xml

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#07007E"
android:fillType="evenOdd"
android:pathData="m0,0h108v108h-108z" />
</vector>

2
appicon/enterprise/src/release/res/drawable/ic_launcher_background.xml

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@mipmap/ic_launcher_background" />

2
settings.gradle.kts

@ -72,7 +72,7 @@ include(":app") @@ -72,7 +72,7 @@ include(":app")
include(":appnav")
include(":appconfig")
include(":appicon:element")
// TODO include(":appicon:enterprise")
include(":appicon:enterprise")
include(":tests:konsist")
include(":tests:uitests")
include(":tests:testutils")

Loading…
Cancel
Save