testDispatcher.scheduler.advanceUntilIdle()
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 de.grumpyshoe.pdfviewer | |
import android.graphics.Bitmap | |
import android.graphics.pdf.PdfRenderer | |
import android.os.Bundle | |
import android.os.ParcelFileDescriptor | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.annotation.RawRes | |
import androidx.compose.foundation.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
String getGitHash() { | |
// git hash | |
def command = Runtime.getRuntime().exec("git rev-parse --short HEAD") | |
def result = command.waitFor() | |
if (result != 0) { | |
throw new IOException("Command 'getGitHash()' exited with " + result) | |
} | |
String gitCommitHash = command.inputStream.text.trim() |
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
fun Modifier.swiper( | |
enabled: Boolean, | |
state: Swipe, | |
onDragReset: () -> Unit = {}, | |
onTap: () -> Unit, | |
onLongPress: () -> Unit, | |
onDrag: (SwipeDirection?, Float) -> Unit = { _, _ -> }, | |
onDragRight: () -> Unit, | |
onDragLeft: () -> Unit, | |
): Modifier = composed { |
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
fun Modifier.pinchToZoom( | |
minZoom: Float? = null, | |
maxZoom: Float? = null, | |
): Modifier = composed { | |
var zoom by remember { mutableStateOf(1f) } | |
val state = rememberTransformableState { scaleChange, _, _ -> | |
val newZoom = (zoom * scaleChange).coerceIn(minZoom ?: MIN_VALUE, maxZoom ?: MAX_VALUE) | |
zoom = newZoom | |
} |
Source: StackOferflow
To see total no of commits you can do as Peter suggested above
git rev-list --count HEAD
And if you want to see number of commits made by each person try this line
git shortlog -s -n
adb shell cmd -w wifi set-wifi-enabled enable
adb shell cmd -w wifi set-wifi-enabled disable
Quelle: https://stackoverflow.com/a/68794783/5804482
adb shell svc data enable
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://stackoverflow.com/questions/13565082/how-can-i-force-gradle-to-redownload-dependencies | |
# https://discuss.gradle.org/t/how-to-get-gradle-to-download-newer-snapshots-to-gradle-cache-when-using-an-ivy-repository/7344 | |
# You can tell Gradle to re-download some dependencies in the build script by flagging | |
# the dependency as 'changing'. Gradle will then check for updates every 24 hours, but | |
# this can be configured using the resolutionStrategy DSL. I find it useful to use this | |
# for for SNAPSHOT or NIGHTLY builds. | |
configurations.all { | |
// Check for updates every build | |
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' |
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
class MainViewModelTest { | |
private lateinit var apiService: ApiService | |
@Rule | |
@JvmField | |
var rule: TestRule = InstantTaskExecutorRule() | |
@Before | |
fun setUp() { |
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
class TestAppApplication : Application() { | |
// initialize mock ApiService | |
var mockApiService = MockApiService | |
/** | |
* onCreate | |
* | |
*/ | |
override fun onCreate() { |
NewerOlder