diff --git a/.gitignore b/.gitignore
index 4c7f363..19e0266 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/jarRepositories.xml
+/.idea/
.DS_Store
/build
/captures
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index fb7f4a8..b589d56 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 2567ed1..371f4e1 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -7,7 +7,7 @@
-
+
-
+
diff --git a/app/build.gradle b/app/build.gradle
index b507a5e..3d2a02d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -44,16 +44,19 @@ android {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
+ namespace 'com.togitech.togii'
}
dependencies {
- implementation "androidx.core:core-ktx:$core_ktx_version"
- implementation "androidx.compose.ui:ui:$compose_version"
- implementation "androidx.compose.material:material:$compose_version"
- implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
+ implementation platform('androidx.compose:compose-bom:2022.10.00')
+ implementation 'androidx.compose.ui:ui'
+ implementation 'androidx.compose.material:material:1.4.3'
+ implementation 'androidx.compose.ui:ui-tooling-preview'
+
+ implementation 'androidx.core:core-ktx:1.10.0'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
- implementation "androidx.activity:activity-compose:$activity_compose_version"
+ implementation 'androidx.activity:activity-compose:1.7.1'
implementation 'com.google.accompanist:accompanist-systemuicontroller:0.29.1-alpha'
implementation project(path: ':ccp')
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c42fc78..4fbadff 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,6 +1,5 @@
-
+
-
+
\ No newline at end of file
diff --git a/ccp/src/main/java/com/togitech/ccp/component/TogiCodePicker.kt b/ccp/src/main/java/com/togitech/ccp/component/TogiCodePicker.kt
index 05f187b..1ca57b8 100644
--- a/ccp/src/main/java/com/togitech/ccp/component/TogiCodePicker.kt
+++ b/ccp/src/main/java/com/togitech/ccp/component/TogiCodePicker.kt
@@ -40,12 +40,16 @@ import com.togitech.ccp.utils.searchCountry
@Composable
fun TogiCodeDialog(
modifier: Modifier = Modifier,
- padding: Dp = 15.dp,
+ paddingStart: Dp = 12.dp,
+ paddingEnd: Dp = 0.dp,
defaultSelectedCountry: CountryData = getLibCountries.first(),
showCountryCode: Boolean = true,
pickedCountry: (CountryData) -> Unit,
showFlag: Boolean = true,
showCountryName: Boolean = false,
+ fontWeight: FontWeight = FontWeight.Bold,
+ fontSize: TextUnit = 18.sp,
+ fontColor: Color = MaterialTheme.colors.onSurface,
) {
val context = LocalContext.current
@@ -58,7 +62,7 @@ fun TogiCodeDialog(
val interactionSource = remember { MutableInteractionSource() }
Column(modifier = modifier
- .padding(padding)
+ .padding(start = paddingStart, end = paddingEnd)
.clickable(
interactionSource = interactionSource,
indication = null,
@@ -82,20 +86,20 @@ fun TogiCodeDialog(
if (showCountryCode) {
Text(
text = isPickCountry.countryPhoneCode,
- fontWeight = FontWeight.Bold,
+ fontWeight = fontWeight,
modifier = Modifier.padding(start = 6.dp),
- fontSize = 18.sp,
- color = MaterialTheme.colors.onSurface
+ fontSize = fontSize,
+ color = fontColor,
)
Icon(imageVector = Icons.Default.ArrowDropDown, contentDescription = null)
}
if (showCountryName) {
Text(
text = stringResource(id = getCountryName(isPickCountry.countryCode.lowercase())),
- fontWeight = FontWeight.Bold,
+ fontWeight = fontWeight,
modifier = Modifier.padding(start = 6.dp),
- fontSize = 18.sp,
- color = MaterialTheme.colors.onSurface
+ fontSize = fontSize,
+ color = fontColor,
)
Icon(imageVector = Icons.Default.ArrowDropDown, contentDescription = null)
}
@@ -155,6 +159,7 @@ fun CountryDialog(
)
},
modifier = Modifier
+ .padding(top = 10.dp)
.clip(RoundedCornerShape(50))
.height(40.dp),
)
@@ -211,7 +216,7 @@ private fun SearchTextField(
textColor: Color = Color.Black,
onValueChange: (String) -> Unit,
hint: String = stringResource(id = R.string.search),
- fontSize: TextUnit = MaterialTheme.typography.body2.fontSize
+ fontSize: TextUnit = MaterialTheme.typography.body2.fontSize,
) {
BasicTextField(modifier = modifier
.fillMaxWidth()
diff --git a/ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt b/ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt
index 9cfff1a..d1461fe 100644
--- a/ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt
+++ b/ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt
@@ -1,5 +1,6 @@
package com.togitech.ccp.component
+import android.util.Log
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardActions
@@ -19,9 +20,12 @@ import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalTextInputService
import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.KeyboardType
+import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
import com.togitech.ccp.R
import com.togitech.ccp.data.utils.getDefaultLangCode
import com.togitech.ccp.data.utils.getDefaultPhoneCode
@@ -48,7 +52,13 @@ fun TogiCountryCodePicker(
focusedBorderColor: Color = MaterialTheme.colors.primary,
unfocusedBorderColor: Color = MaterialTheme.colors.onSecondary,
cursorColor: Color = MaterialTheme.colors.primary,
- bottomStyle: Boolean = false
+ bottomStyle: Boolean = false,
+ codeFontWeight: FontWeight = FontWeight.Bold,
+ codeFontSize: TextUnit = 18.sp,
+ codeFontColor: Color = MaterialTheme.colors.onSurface,
+ phoneNumberFontWeight: FontWeight = FontWeight.Bold,
+ phoneNumberFontSize: TextUnit = 18.sp,
+ phoneNumberFontColor: Color = MaterialTheme.colors.onSurface,
) {
val context = LocalContext.current
var textFieldValue by rememberSaveable { mutableStateOf("") }
@@ -82,7 +92,10 @@ fun TogiCountryCodePicker(
defaultSelectedCountry = getLibCountries.single { it.countryCode == defaultLang },
showCountryCode = showCountryCode,
showFlag = showCountryFlag,
- showCountryName = true
+ showCountryName = true,
+ fontWeight = codeFontWeight,
+ fontSize = codeFontSize,
+ fontColor = codeFontColor,
)
}
Row(
@@ -92,10 +105,16 @@ fun TogiCountryCodePicker(
OutlinedTextField(modifier = modifier.fillMaxWidth(),
shape = shape,
value = textFieldValue,
+ textStyle = TextStyle(
+ fontSize = phoneNumberFontSize,
+ fontWeight = phoneNumberFontWeight,
+ color = phoneNumberFontColor,
+ ),
onValueChange = {
textFieldValue = it
if (text != it) {
onValueChange(it)
+ isPhoneNumber()
}
},
singleLine = true,
@@ -124,7 +143,10 @@ fun TogiCountryCodePicker(
},
defaultSelectedCountry = getLibCountries.single { it.countryCode == defaultLang },
showCountryCode = showCountryCode,
- showFlag = showCountryFlag
+ showFlag = showCountryFlag,
+ fontWeight = codeFontWeight,
+ fontSize = codeFontSize,
+ fontColor = codeFontColor,
)
}
}
diff --git a/ccp/src/main/res/values-fr/strings.xml b/ccp/src/main/res/values-fr/strings.xml
new file mode 100644
index 0000000..c34ccc5
--- /dev/null
+++ b/ccp/src/main/res/values-fr/strings.xml
@@ -0,0 +1,7 @@
+
+
+ Inconnue
+ Recherche…
+ Choisissez le pays
+ Numéro de téléphone invalide
+
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 9eb5a07..cd0519b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -20,5 +20,4 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
-android.nonTransitiveRClass=true
-android.disableAutomaticComponentCreation=true
\ No newline at end of file
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e2623f8..7287995 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Fri Apr 14 12:41:17 CEST 2023
distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME