This file contains 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
/* Ref: https://www.composables.com/tutorials/bottomsheet */ | |
val sheetState = rememberModalBottomSheetState( | |
initialValue = ModalBottomSheetValue.Hidden | |
) | |
val scope = rememberCoroutineScope() | |
ModalBottomSheetLayout(sheetState = sheetState, sheetContent = { | |
Column(Modifier.padding(16.dp)) { | |
repeat(3) { index -> |
This file contains 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
// Ref: https://medium.com/@emreuysall/manage-multiple-content-actions-and-states-modalbottomsheetlayout-jetpack-compose-ec4140b2a043 | |
// 1- Identify User Action | |
// Identify user actions | |
enum class BottomSheetAction { | |
INITIAL, // initial case before user action | |
HIDE, // user wants to hide bottom sheet | |
SHOW, // user wants to show bottom sheet | |
TIMED // user wants to see and hide bottom sheet for some time, and disables screen interaction | |
} |
This file contains 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
// # Dark and light theme | |
// 01- Color | |
val colorBlue = Color(0xFF001E63) | |
val colorBlue1 = Color(0xFF000063) | |
val colorRed = Color(0xFF5A0000) | |
val colorGreen = Color(0xFF003A00) | |
val colorWhite = Color(0xFFFFFFFF) | |
val colorBlack = Color(0xE9000000) |
This file contains 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
// https://developersbreach.com/modal-bottom-sheet-jetpack-compose-android/ | |
@Composable | |
fun BottomSheetWithAnchor() { | |
val sheetState = rememberBottomSheetState(initialValue = BottomSheetValue.Collapsed) | |
val scope = rememberCoroutineScope() | |
val sheetScaffoldState = rememberBottomSheetScaffoldState( | |
bottomSheetState = sheetState | |
) |
This file contains 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 androidx.compose.animation.core.AnimationSpec | |
import androidx.compose.animation.core.TweenSpec | |
import androidx.compose.animation.core.animateFloatAsState | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.gestures.Orientation | |
import androidx.compose.foundation.gestures.detectTapGestures | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.BoxWithConstraints | |
import androidx.compose.foundation.layout.Column |
This file contains 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
// Copyright 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
import android.content.Context | |
import android.graphics.Bitmap | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.LaunchedEffect | |
import androidx.compose.runtime.getValue | |
import androidx.compose.runtime.mutableStateOf | |
import androidx.compose.runtime.remember |
This file contains 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
// https://medium.com/atlas/android-app-widget-development-with-glance-532a5a8d602c | |
// User Interface | |
<!-- API 31 (Android 12 and up) --> | |
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" | |
android:description="@string/widget_description" | |
android:minWidth="200dp" | |
android:minHeight="200dp" | |
android:resizeMode="horizontal|vertical" | |
android:previewImage="@drawable/calendar_widget_preview_image" |
This file contains 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.Intent | |
import android.graphics.PixelFormat | |
import android.os.IBinder | |
import android.view.Gravity | |
import android.view.WindowManager | |
import androidx.compose.foundation.gestures.detectDragGestures | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.BoxScope | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.getValue |
This file contains 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.Context | |
import android.os.RemoteException | |
import com.android.installreferrer.api.InstallReferrerClient | |
import com.android.installreferrer.api.InstallReferrerStateListener | |
import com.android.installreferrer.api.ReferrerDetails | |
import kotlinx.coroutines.CompletableDeferred | |
/** | |
* https://developer.android.com/google/play/installreferrer/library | |
* |
This file contains 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
/* Copyright 2022 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
@Composable | |
fun BouncyRopes() { | |
val startCoOrdinate by remember { | |
mutableStateOf(Offset(0f, 0f)) | |
} | |
var endCoOrdinate by remember { | |
mutableStateOf(Offset(100f, 0f)) | |
} |
OlderNewer