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
android { | |
compileSdk = 31 | |
} | |
dependencies { | |
val splahScreenVersion = "1.0.0-alpha01" | |
// Use: def instead of val if you are not using Kotlin Gradle(.kts) | |
implementation("androidx.core:core-splashscreen:$splashScreenVersion") | |
} |
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
/** | |
* Collapsing Toolbar that can be used in a topBar slot of Scaffold. | |
* It has a back button, default bottom rounded corners | |
* & a box scope which holds content centered by default. | |
* You need to implement nestedScrollConnection to set the offset values | |
* See Usage of this in DashboardScreen or TasksScreen or GoalsScreen | |
* | |
* To use this Toolbar without a heading text just make toolbarHeading `null` | |
* To Disable the back button at the top set showBackButton to false | |
* |
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
/** | |
* The base properties and methods that each item will need. | |
* Just to make it easier to add more bars item that can need hiding. | |
* Eg. scroll bars, navigation rails, etc. | |
*/ | |
@Stable | |
interface BarVisibilityState { | |
val isVisible: Boolean | |
fun hide() | |
fun show() |
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.* | |
class AndroidHapticFeedback(private val context: Context) { | |
fun tick() { | |
val durationMillis = 20L | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { | |
val vibrationEffect = VibrationEffect.createPredefined(VibrationEffect.EFFECT_TICK) | |
vibrate(durationMillis, vibrationEffect) | |
} else vibrate(durationMillis) |
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
package com.louiscad.splitties.eap.bottomsheet | |
import android.app.Activity | |
import android.view.ViewGroup | |
import androidx.activity.compose.BackHandler | |
import androidx.compose.material.ExperimentalMaterialApi | |
import androidx.compose.material.ModalBottomSheetLayout | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.DisposableEffect | |
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
#include "am2320.h" | |
static uint16_t readRegister16(uint8_t reg); | |
static uint16_t crc16(uint8_t *buffer, uint8_t nbytes); | |
static void sensor_read() { | |
sleep_ms(3000); | |
am2320_data values; | |
while (true) { |