From d6ee7c82611d6c7dcd39449b49b632d9fa24071c Mon Sep 17 00:00:00 2001 From: Laxmi kant Date: Wed, 21 Dec 2022 12:59:35 +0530 Subject: [PATCH] Country code change log--> --> list --> compose design --> compose themes --> MCodeUtils.kt --> Color.kt --> Shape.kt --> Type.kt --> CCApp.kt --> Activity --- README.md | 4 ++-- app/src/main/AndroidManifest.xml | 7 ++++--- app/src/main/java/com/mcode/countrycode/CCApp.kt | 9 +++++++++ .../com/mcode/{togii => countrycode}/MainActivity.kt | 6 +++--- .../com/mcode/{togii => countrycode}/ui/theme/Color.kt | 2 +- .../com/mcode/{togii => countrycode}/ui/theme/Shape.kt | 2 +- .../com/mcode/{togii => countrycode}/ui/theme/Theme.kt | 2 +- .../com/mcode/{togii => countrycode}/ui/theme/Type.kt | 2 +- app/src/main/res/values/themes.xml | 2 +- ...ogiCountryCodePicker.kt => MCodeCountryCodePicker.kt} | 6 +++--- .../ccp/component/{TogiCodePicker.kt => MCodePicker.kt} | 2 +- .../mcode/ccp/data/utils/{TogiUtils.kt => MCodeUtils.kt} | 0 12 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 app/src/main/java/com/mcode/countrycode/CCApp.kt rename app/src/main/java/com/mcode/{togii => countrycode}/MainActivity.kt (96%) rename app/src/main/java/com/mcode/{togii => countrycode}/ui/theme/Color.kt (87%) rename app/src/main/java/com/mcode/{togii => countrycode}/ui/theme/Shape.kt (87%) rename app/src/main/java/com/mcode/{togii => countrycode}/ui/theme/Theme.kt (96%) rename app/src/main/java/com/mcode/{togii => countrycode}/ui/theme/Type.kt (95%) rename ccp/src/main/java/com/mcode/ccp/component/{TogiCountryCodePicker.kt => MCodeCountryCodePicker.kt} (98%) rename ccp/src/main/java/com/mcode/ccp/component/{TogiCodePicker.kt => MCodePicker.kt} (99%) rename ccp/src/main/java/com/mcode/ccp/data/utils/{TogiUtils.kt => MCodeUtils.kt} (100%) diff --git a/README.md b/README.md index 1e9563e..7e41be7 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Languages: ```kotlin @Composable -fun TogiCountryCodePicker( +fun MCodeCountryCodePicker( modifier: Modifier = Modifier, text: String, onValueChange: (String) -> Unit, @@ -68,7 +68,7 @@ fun CountryCodePick() { val fullPhoneNumber = rememberSaveable { mutableStateOf("") } val onlyPhoneNumber = rememberSaveable { mutableStateOf("") } - TogiCountryCodePicker( + MCodeCountryCodePicker( text = phoneNumber.value, onValueChange = { phoneNumber.value = it }, unfocusedBorderColor = MaterialTheme.colors.primary, diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 61cf0d3..de0aabc 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -7,13 +7,14 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" + android:name="com.mcode.countrycode.CCApp" android:supportsRtl="true" - android:theme="@style/Theme.Togii"> + android:theme="@style/Theme.MCode"> + android:theme="@style/Theme.MCode"> diff --git a/app/src/main/java/com/mcode/countrycode/CCApp.kt b/app/src/main/java/com/mcode/countrycode/CCApp.kt new file mode 100644 index 0000000..748c3ff --- /dev/null +++ b/app/src/main/java/com/mcode/countrycode/CCApp.kt @@ -0,0 +1,9 @@ +package com.mcode.countrycode + +import android.app.Application + +class CCApp : Application() { + override fun onCreate() { + super.onCreate() + } +} \ No newline at end of file diff --git a/app/src/main/java/com/mcode/togii/MainActivity.kt b/app/src/main/java/com/mcode/countrycode/MainActivity.kt similarity index 96% rename from app/src/main/java/com/mcode/togii/MainActivity.kt rename to app/src/main/java/com/mcode/countrycode/MainActivity.kt index 1942484..dd8397d 100644 --- a/app/src/main/java/com/mcode/togii/MainActivity.kt +++ b/app/src/main/java/com/mcode/countrycode/MainActivity.kt @@ -1,4 +1,4 @@ -package com.mcode.togii +package com.mcode.countrycode import android.os.Bundle import androidx.activity.ComponentActivity @@ -17,7 +17,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import com.google.accompanist.systemuicontroller.rememberSystemUiController import com.mcode.ccp.component.* -import com.mcode.togii.ui.theme.MCodeTheme +import com.mcode.countrycode.ui.theme.MCodeTheme class MainActivity : ComponentActivity() { @@ -61,7 +61,7 @@ fun CountryCodePick() { val fullPhoneNumber = rememberSaveable { mutableStateOf("") } val onlyPhoneNumber = rememberSaveable { mutableStateOf("") } - TogiCountryCodePicker( + MCodeCountryCodePicker( text = phoneNumber.value, onValueChange = { phoneNumber.value = it }, unfocusedBorderColor = MaterialTheme.colors.primary, diff --git a/app/src/main/java/com/mcode/togii/ui/theme/Color.kt b/app/src/main/java/com/mcode/countrycode/ui/theme/Color.kt similarity index 87% rename from app/src/main/java/com/mcode/togii/ui/theme/Color.kt rename to app/src/main/java/com/mcode/countrycode/ui/theme/Color.kt index 83039f1..18752d9 100644 --- a/app/src/main/java/com/mcode/togii/ui/theme/Color.kt +++ b/app/src/main/java/com/mcode/countrycode/ui/theme/Color.kt @@ -1,4 +1,4 @@ -package com.mcode.togii.ui.theme +package com.mcode.countrycode.ui.theme import androidx.compose.ui.graphics.Color diff --git a/app/src/main/java/com/mcode/togii/ui/theme/Shape.kt b/app/src/main/java/com/mcode/countrycode/ui/theme/Shape.kt similarity index 87% rename from app/src/main/java/com/mcode/togii/ui/theme/Shape.kt rename to app/src/main/java/com/mcode/countrycode/ui/theme/Shape.kt index bbbf39c..7d27c0f 100644 --- a/app/src/main/java/com/mcode/togii/ui/theme/Shape.kt +++ b/app/src/main/java/com/mcode/countrycode/ui/theme/Shape.kt @@ -1,4 +1,4 @@ -package com.mcode.togii.ui.theme +package com.mcode.countrycode.ui.theme import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Shapes diff --git a/app/src/main/java/com/mcode/togii/ui/theme/Theme.kt b/app/src/main/java/com/mcode/countrycode/ui/theme/Theme.kt similarity index 96% rename from app/src/main/java/com/mcode/togii/ui/theme/Theme.kt rename to app/src/main/java/com/mcode/countrycode/ui/theme/Theme.kt index 7390b9b..c876420 100644 --- a/app/src/main/java/com/mcode/togii/ui/theme/Theme.kt +++ b/app/src/main/java/com/mcode/countrycode/ui/theme/Theme.kt @@ -1,4 +1,4 @@ -package com.mcode.togii.ui.theme +package com.mcode.countrycode.ui.theme import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material.MaterialTheme diff --git a/app/src/main/java/com/mcode/togii/ui/theme/Type.kt b/app/src/main/java/com/mcode/countrycode/ui/theme/Type.kt similarity index 95% rename from app/src/main/java/com/mcode/togii/ui/theme/Type.kt rename to app/src/main/java/com/mcode/countrycode/ui/theme/Type.kt index 502efc0..17283fe 100644 --- a/app/src/main/java/com/mcode/togii/ui/theme/Type.kt +++ b/app/src/main/java/com/mcode/countrycode/ui/theme/Type.kt @@ -1,4 +1,4 @@ -package com.mcode.togii.ui.theme +package com.mcode.countrycode.ui.theme import androidx.compose.material.Typography import androidx.compose.ui.text.TextStyle diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 0cc3a02..1ed1c7c 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,7 +1,7 @@ - \ No newline at end of file diff --git a/ccp/src/main/java/com/mcode/ccp/component/TogiCountryCodePicker.kt b/ccp/src/main/java/com/mcode/ccp/component/MCodeCountryCodePicker.kt similarity index 98% rename from ccp/src/main/java/com/mcode/ccp/component/TogiCountryCodePicker.kt rename to ccp/src/main/java/com/mcode/ccp/component/MCodeCountryCodePicker.kt index 147331b..702f079 100644 --- a/ccp/src/main/java/com/mcode/ccp/component/TogiCountryCodePicker.kt +++ b/ccp/src/main/java/com/mcode/ccp/component/MCodeCountryCodePicker.kt @@ -37,7 +37,7 @@ private var countryCodeState: String by mutableStateOf("") @Composable -fun TogiCountryCodePicker( +fun MCodeCountryCodePicker( modifier: Modifier = Modifier, text: String, onValueChange: (String) -> Unit, @@ -74,7 +74,7 @@ fun TogiCountryCodePicker( Surface(color = color) { Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 16.dp)) { if (bottomStyle) { - TogiCodeDialog( + MCodeDialog( pickedCountry = { phoneCode = it.countryPhoneCode defaultLang = it.countryCode @@ -117,7 +117,7 @@ fun TogiCountryCodePicker( if (!bottomStyle) Row { Column { - TogiCodeDialog( + MCodeDialog( pickedCountry = { phoneCode = it.countryPhoneCode defaultLang = it.countryCode diff --git a/ccp/src/main/java/com/mcode/ccp/component/TogiCodePicker.kt b/ccp/src/main/java/com/mcode/ccp/component/MCodePicker.kt similarity index 99% rename from ccp/src/main/java/com/mcode/ccp/component/TogiCodePicker.kt rename to ccp/src/main/java/com/mcode/ccp/component/MCodePicker.kt index cc5a775..66b6bd8 100644 --- a/ccp/src/main/java/com/mcode/ccp/component/TogiCodePicker.kt +++ b/ccp/src/main/java/com/mcode/ccp/component/MCodePicker.kt @@ -38,7 +38,7 @@ import com.mcode.ccp.utils.searchCountry @Composable -fun TogiCodeDialog( +fun MCodeDialog( modifier: Modifier = Modifier, padding: Dp = 15.dp, defaultSelectedCountry: CountryData = getLibCountries.first(), diff --git a/ccp/src/main/java/com/mcode/ccp/data/utils/TogiUtils.kt b/ccp/src/main/java/com/mcode/ccp/data/utils/MCodeUtils.kt similarity index 100% rename from ccp/src/main/java/com/mcode/ccp/data/utils/TogiUtils.kt rename to ccp/src/main/java/com/mcode/ccp/data/utils/MCodeUtils.kt