Skip to content

Commit

Permalink
Merge pull request #2 from codewith-fun/fix/m_themes_utils
Browse files Browse the repository at this point in the history
Country code change log-->
  • Loading branch information
lkant8 committed Dec 21, 2022
2 parents 7afe78a + d6ee7c8 commit fa72efc
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Languages:

```kotlin
@Composable
fun TogiCountryCodePicker(
fun MCodeCountryCodePicker(
modifier: Modifier = Modifier,
text: String,
onValueChange: (String) -> Unit,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<activity
android:name="com.mcode.togii.MainActivity"
android:name="com.mcode.countrycode.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Togii">
android:theme="@style/Theme.MCode">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/com/mcode/countrycode/CCApp.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.mcode.countrycode

import android.app.Application

class CCApp : Application() {
override fun onCreate() {
super.onCreate()
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mcode.togii
package com.mcode.countrycode

import android.os.Bundle
import androidx.activity.ComponentActivity
Expand All @@ -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() {

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mcode.togii.ui.theme
package com.mcode.countrycode.ui.theme

import androidx.compose.ui.graphics.Color

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.Togii" parent="android:Theme.Material.Light.NoActionBar">
<style name="Theme.MCode" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@color/purple_700</item>
</style>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private var countryCodeState: String by mutableStateOf("")


@Composable
fun TogiCountryCodePicker(
fun MCodeCountryCodePicker(
modifier: Modifier = Modifier,
text: String,
onValueChange: (String) -> Unit,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -117,7 +117,7 @@ fun TogiCountryCodePicker(
if (!bottomStyle)
Row {
Column {
TogiCodeDialog(
MCodeDialog(
pickedCountry = {
phoneCode = it.countryPhoneCode
defaultLang = it.countryCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit fa72efc

Please sign in to comment.