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 AddTweetButton() { | |
val icon = vectorResource(id = R.drawable.ic_add) | |
val context = ContextAmbient.current | |
val color = MaterialTheme.colors.primary | |
FloatingActionButton( | |
backgroundColor = color, | |
contentColor = MaterialTheme.colors.contentColorFor(color), | |
onClick = { | |
Toast.makeText(context, "Clicked on FAB", Toast.LENGTH_SHORT).show() |
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
@Immutable | |
data class Typography internal constructor( | |
val h1: TextStyle, | |
val h2: TextStyle, | |
val h3: TextStyle, | |
val h4: TextStyle, | |
val h5: TextStyle, | |
val h6: TextStyle, | |
val subtitle1: TextStyle, | |
val subtitle2: TextStyle, |
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
<resources> | |
<color name="colorPrimary">#FF5C6BC0</color> | |
<color name="colorPrimaryDark">#FF5C6BC0</color> | |
<color name="colorAccent">#FFF06292</color> | |
</resources> |
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 TweetTheme(content: @Composable() () -> Unit) { | |
val colors = lightColorPalette( | |
primary = Color(0xFF5C6BC0), | |
onPrimary = Color(0xFFFFFFFF), | |
primaryVariant = Color(0xFF8e99f3), | |
secondary = Color(0xFFF06292), | |
onSecondary = Color(0xFF000000), | |
secondaryVariant = Color(0xFFFF94C2), | |
surface = Color(0xFFFFFFFF), |
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
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val tweetList = generateFakeTweetList() | |
val state = mutableStateOf(tweetList, StructurallyEqual) | |
setContent { | |
TweetTheme { | |
ListScreen(state = state) | |
} | |
} | |
} |
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 TweetTheme(content: @Composable() () -> Unit) { | |
MaterialTheme(content = content) | |
} |
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 TweetTheme(content: @Composable() () -> Unit) { | |
} |
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
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val tweetList = generateFakeTweetList() | |
val state = mutableStateOf(tweetList, StructurallyEqual) | |
setContent { | |
MaterialTheme { | |
ListScreen(state = state) | |
} | |
} | |
} |
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 TweetBottomBar( | |
fabConfiguration: BottomAppBar.FabConfiguration?, | |
homeListener: () -> Unit, | |
searchListener: () -> Unit, | |
notificationListener: () -> Unit, | |
messageListener: () -> Unit | |
) { | |
BottomAppBar( | |
fabConfiguration = fabConfiguration, |
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 ListScreen(state: MutableState<MutableList<Tweet>>) { | |
val (scaffoldState, onScaffoldStateChange) = state { | |
// state contents collapsed | |
} | |
Scaffold( | |
scaffoldState = scaffoldState, | |
topAppBar = { | |
// top app bar contents collapsed |
NewerOlder