Skip to content

Commit

Permalink
chore: fix string resources, remove unused fonts and update Gradle co…
Browse files Browse the repository at this point in the history
…nfiguration to further reduce the app size (#343)
  • Loading branch information
cbeyls authored Mar 2, 2025
1 parent 8f485c3 commit 2480579
Show file tree
Hide file tree
Showing 25 changed files with 13 additions and 111 deletions.
5 changes: 4 additions & 1 deletion androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ android {
namespace = "fr.paug.androidmakers"
versionCode = libs.versions.version.code.get().toInt()
versionName = libs.versions.version.code.get()
androidResources.localeFilters += listOf("en", "fr")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -31,7 +32,9 @@ android {
"LICENSE-junit.txt",
"/*.proto",
"google/**",
"META-INF/*.version"
"META-INF/*.version",
"META-INF/versions/**",
"META-INF/androidx/**"
)
}
jniLibs {
Expand Down
2 changes: 1 addition & 1 deletion shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kotlin {
}

configurations.configureEach {
// Remove unnecessary dependency of Moko
// Remove unnecessary transitive dependency
exclude(group = "androidx.appcompat", module = "appcompat")
}

Expand Down
5 changes: 0 additions & 5 deletions shared/di/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ kotlin {
}
}

configurations.configureEach {
// Remove unnecessary dependency of Precompose and Koin Android
exclude(group = "androidx.appcompat", module = "appcompat")
}

android {
namespace = "fr.paug.androidmakers.di"
buildFeatures.buildConfig = true
Expand Down
3 changes: 1 addition & 2 deletions shared/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ kotlin {
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.materialIconsExtended)
implementation(compose.components.uiToolingPreview)
implementation(libs.coil.compose)
Expand All @@ -53,7 +52,7 @@ kotlin {
}

configurations.configureEach {
// Remove unnecessary dependency of Moko
// Remove unnecessary transitive dependency
exclude(group = "androidx.appcompat", module = "appcompat")
// Disable Android Drawable support in Coil
exclude(group = "com.google.accompanist", module = "accompanist-drawablepainter")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import coil3.ImageLoader
import coil3.annotation.ExperimentalCoilApi
import coil3.compose.setSingletonImageLoaderFactory
import coil3.request.crossfade
import com.androidmakers.ui.agenda.SessionDetailScreen
Expand All @@ -26,7 +25,6 @@ import org.koin.core.parameter.parametersOf
/**
* The main layout: entry point of the application
*/
@OptIn(ExperimentalCoilApi::class)
@Composable
fun MainLayout(
versionCode: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,6 @@ import androidx.compose.ui.text.font.FontWeight
import dev.icerock.moko.resources.compose.asFont
import fr.paug.androidmakers.ui.MR


@Composable
fun montserratExtraLight() = MR.fonts.montserrat_extralight.asFont(
FontWeight.ExtraLight
)!!

@Composable
fun montserratExtraLightItalic() = MR.fonts.montserrat_extralightitalic.asFont(
FontWeight.ExtraLight, FontStyle.Italic
)!!

@Composable
fun montserratLight() = MR.fonts.montserrat_light.asFont(
FontWeight.Light
)!!

@Composable
fun montserratLightItalic() = MR.fonts.montserrat_lightitalic.asFont(
FontWeight.Light, FontStyle.Italic
)!!

@Composable
fun montserratThin() = MR.fonts.montserrat_thin.asFont(
FontWeight.Thin
)!!

@Composable
fun montserratThinItalic() = MR.fonts.montserrat_thinitalic.asFont(
FontWeight.Thin, FontStyle.Italic
)!!

@Composable
fun montserratRegular() = MR.fonts.montserrat_regular.asFont()!!

Expand All @@ -47,16 +16,6 @@ fun montserratItalic() = MR.fonts.montserrat_italic.asFont(
FontStyle.Italic
)!!

@Composable
fun montserratMedium() = MR.fonts.montserrat_medium.asFont(
FontWeight.Medium
)!!

@Composable
fun montserratMediumItalic() = MR.fonts.montserrat_mediumitalic.asFont(
FontWeight.Medium, FontStyle.Italic
)!!

@Composable
fun montserratSemiBold() = MR.fonts.montserrat_semibold.asFont(
FontWeight.SemiBold
Expand All @@ -79,46 +38,12 @@ fun montserratBoldItalic() = MR.fonts.montserrat_bolditalic.asFont(
FontStyle.Italic
)!!

@Composable
fun montserratExtraBold() = MR.fonts.montserrat_extrabold.asFont(
FontWeight.ExtraBold
)!!

@Composable
fun montserratExtraBoldItalic() = MR.fonts.montserrat_extrabolditalic.asFont(
FontWeight.ExtraBold,
FontStyle.Italic
)!!

@Composable
fun montserratBlack() = MR.fonts.montserrat_black.asFont(
FontWeight.Black
)!!

@Composable
fun montserratBlackItalic() = MR.fonts.montserrat_blackitalic.asFont(
FontWeight.Black,
FontStyle.Italic
)!!

@Composable
fun montserratFamily() = FontFamily(
montserratBlack(),
montserratBlackItalic(),
montserratBold(),
montserratBoldItalic(),
montserratExtraBold(),
montserratExtraBoldItalic(),
montserratExtraLight(),
montserratExtraLightItalic(),
montserratItalic(),
montserratLight(),
montserratLightItalic(),
montserratMedium(),
montserratMediumItalic(),
montserratRegular(),
montserratSemiBold(),
montserratSemiBoldItalic(),
montserratThin(),
montserratThinItalic()
montserratSemiBoldItalic()
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.androidmakers.ui.venue

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.pager.HorizontalPager
Expand All @@ -26,7 +25,6 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import org.koin.compose.viewmodel.koinViewModel

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun VenuePager() {
val viewModel = koinViewModel<VenueViewModel>()
Expand Down
7 changes: 0 additions & 7 deletions shared/ui/src/commonMain/moko-resources/base/plurals.xml

This file was deleted.

5 changes: 2 additions & 3 deletions shared/ui/src/commonMain/moko-resources/base/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<string name="app_name">Android Makers by droidcon</string>

<string name="version">Version %s (%s)</string>
<string name="version">Version %1$s (%2$s)</string>

<string name="agenda">Agenda</string>
<string name="venue">Venue</string>
Expand All @@ -17,7 +17,6 @@

<string name="filter">Filter</string>
<string name="bookmarked">Favorite</string>
<string name="language">Language</string>
<string name="room">Room</string>
<string name="rooms">Rooms</string>
<string name="empty_events">Sorry, there is no session available for the currently selected filters.</string>
Expand Down Expand Up @@ -65,7 +64,7 @@
<string name="ask_speaker">Ask a question to the speaker on Slido</string>

<!-- Info about the session. It is `date` at `start time` - `end time`-->
<string name="session_detail">%s at %s - %s</string>
<string name="session_detail">%1$s at %2$s - %3$s</string>

<string name="x_hashtag" translatable="false">#AMxDC24</string>
<string name="x_hashtag_for_query" translatable="false">AMxDC24</string>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 0 additions & 7 deletions shared/ui/src/commonMain/moko-resources/fr/plurals.xml

This file was deleted.

5 changes: 2 additions & 3 deletions shared/ui/src/commonMain/moko-resources/fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<resources>
<string name="app_name">Android Makers by droidcon</string>

<string name="version">Version %s (%s)</string>
<string name="version">Version %1$s (%2$s)</string>

<string name="agenda">Agenda</string>
<string name="venue">Lieu</string>
Expand All @@ -15,7 +15,6 @@

<string name="filter">Filtres</string>
<string name="bookmarked">Favoris</string>
<string name="language">Langues</string>
<string name="room">Salle</string>
<string name="rooms">Salles</string>
<string name="empty_events">Désolé, aucune conférence n‘est disponible pour les filtres actuellement sélectionnés.</string>
Expand Down Expand Up @@ -62,7 +61,7 @@
<string name="ask_speaker">Posez une question au speaker sur Slido</string>

<!-- Info about the session. It is `date` at `start time` - `end time`-->
<string name="session_detail">%s à %s - %s</string>
<string name="session_detail">%1$s à %2$s - %3$s</string>

<string name="speaker_search_placeholder">Recherche</string>

Expand Down
2 changes: 2 additions & 0 deletions wearApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ android {
minSdk = 30
targetSdk = 33
versionCode = libs.versions.version.code.get().toInt()
androidResources.localeFilters += listOf("en", "fr")
versionName = "1.0"
}

Expand All @@ -42,6 +43,7 @@ android {
"google/**",
"src/google/**",
"META-INF/*.version",
"META-INF/androidx/**",
"core/**",
"java/**"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package fr.paug.androidmakers.wear.ui.main
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.rememberPagerState
Expand Down Expand Up @@ -123,7 +122,6 @@ fun WearApp(
}
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun MainScreen(
viewModel: MainViewModel,
Expand Down

0 comments on commit 2480579

Please sign in to comment.