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 HomeList(taskViewModel: ListViewModel = viewModel()) { | |
val coroutineScope = rememberCoroutineScope() | |
val scaffoldState = rememberScaffoldState() | |
val onShowSnackbar: (Task) -> Unit = { task -> | |
coroutineScope.launch { | |
val snackbarResult = scaffoldState.snackbarHostState.showSnackbar( | |
message = "${task.title} completed", | |
actionLabel = "Undo" |
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
internal class DynamicActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
MyTheme { | |
DynamicScreen() | |
} | |
} |
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
... | |
<application> | |
<activity | |
android:name=".presentation.DynamicActivity" | |
android:exported="true" | |
android:theme="@style/Theme.MyTheme"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> |
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
android { | |
testOptions { | |
devices { | |
pixel2api29(com.android.build.api.dsl.ManagedVirtualDevice) { | |
device = "Pixel 2" | |
apiLevel = 29 | |
systemImageSource = "google" | |
abi = "x86" | |
} | |
} |
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
testOptions { | |
devices { | |
pixel2api29 (com.android.build.api.dsl.ManagedVirtualDevice) { ... } | |
nexus9api30 (com.android.build.api.dsl.ManagedVirtualDevice) { ... } | |
deviceGroups { | |
phoneAndTablet { | |
targetDevices.addAll(devices.pixel2api29, devices.nexus9api30) | |
} | |
} | |
} |
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
<style name="Theme.MySplash" parent="Theme.SplashScreen"> | |
<item name="windowSplashScreenBackground">@color/purple_500</item> | |
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item> | |
<item name="postSplashScreenTheme">@style/Theme.MyApp</item> | |
</style> | |
<style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | |
<!-- Your theme attributes goes here --> | |
</style> | |
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 : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
installSplashScreen() | |
setContentView(R.layout.activity_main) | |
} | |
} |
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
<application | |
... | |
android:theme="@style/Theme.MySplash"> | |
... | |
</application> |