This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.res.AssetManager | |
import okhttp3.Interceptor | |
import okhttp3.MediaType.Companion.toMediaTypeOrNull | |
import okhttp3.Protocol | |
import okhttp3.Response | |
import okhttp3.ResponseBody.Companion.toResponseBody | |
import java.io.BufferedReader | |
import java.io.InputStreamReader | |
class AssetFileInterceptor(private val assetManager: AssetManager) : Interceptor { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
PlayingWithComposeTheme { | |
FavoriteAppScreen() | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.veroanggra.migratingsample | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.animation.core.Spring | |
import androidx.compose.animation.core.animateDpAsState | |
import androidx.compose.animation.core.spring | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.background |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun FavoriteButton(modifier: Modifier = Modifier) { | |
val (favorite, setFavorite) = remember { | |
mutableStateOf(false) | |
} | |
val (color, setColor) = remember { | |
mutableStateOf(Color.Gray) | |
} | |
setColor( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun FavoriteButton(modifier: Modifier = Modifier) { | |
var favorite by remember { mutableStateOf(false) } | |
var color by remember { mutableStateOf(Color.Gray) } | |
color = if (favorite) { | |
Color.Red | |
} else { | |
Color.Gray | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
PlayingWithComposeTheme { | |
Surface { | |
HomeScreen(Modifier) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
PlayingWithComposeTheme { | |
Surface { | |
ConstraintScreen() | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.veroanggra.migratingsample | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.material.Surface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.veroanggra.migratingsample | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.material.Surface | |
import androidx.compose.material.Text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.veroanggra.migratingsample | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.material.Surface | |
import androidx.compose.material3.Text | |
import androidx.compose.runtime.Composable | |
import com.veroanggra.composesubmission.ui.theme.PlayingWithComposeTheme |
NewerOlder