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
// You can use maven-publish-helper.gradle script without changes and even share it between multiple | |
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project, | |
// then apply it at the bottom of your module's build.gradle file like this: | |
// ...content of module's build.gradle file... | |
apply from: '../maven-publish-helper.gradle' | |
publishing { | |
publications { |
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
/** | |
* An [Observer] for [Event]s, simplifying the pattern of checking if the [Event]'s content has | |
* already been handled. | |
* | |
* [onEventUnhandledContent] is *only* called if the [Event]'s contents has not been handled. | |
*/ | |
class EventObserver<T>(private val onEventUnhandledContent: (T) -> Unit) : Observer<Event<T>> { | |
override fun onChanged(event: Event<T>?) { | |
event?.getContentIfNotHandled()?.let { value -> | |
onEventUnhandledContent(value) |
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.content.Intent | |
import android.content.IntentFilter | |
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY | |
import androidx.lifecycle.Lifecycle.Event.ON_START | |
import androidx.lifecycle.LifecycleObserver | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.OnLifecycleEvent | |
import android.content.BroadcastReceiver as StockReceiver |
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.mercury.app.updater | |
import android.app.Activity | |
import androidx.activity.compose.rememberLauncherForActivityResult | |
import androidx.activity.result.ActivityResult | |
import androidx.activity.result.ActivityResultLauncher | |
import androidx.activity.result.IntentSenderRequest | |
import androidx.activity.result.contract.ActivityResultContracts | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.Stable |
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
typealias LogElement = Triple<String, Int, String?> | |
object LogController { | |
private var flush = BehaviorSubject.create<Long>() | |
private var flushCompleted = BehaviorSubject.create<Long>() | |
private var LOG_LEVELS = arrayOf("", "", "VERBOSE", | |
"DEBUG", | |
"INFO", |
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
#!/bin/bash | |
remote=origin ; for brname in `git branch -r | grep $remote | grep -v /master | grep -v /HEAD | awk '{gsub(/^[^\/]+\//,"",$1); print $1}'`; do git branch --track $brname $remote/$brname || true; done 2>/dev/null |
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
def getGitCommand = { -> | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'log','--date=local','--name-status','--after="2018.07.19"' | |
standardOutput = stdout | |
} | |
return stdout.toString().trim() | |
} | |
task prinGitLog{ |
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 java.math.BigInteger | |
import java.security.MessageDigest | |
fun String.md5(): String { | |
val md = MessageDigest.getInstance("MD5") | |
return BigInteger(1, md.digest(toByteArray())).toString(16).padStart(32, '0') | |
} |
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
def robolectricVersion = '3.3' | |
def androidSdkVersions = [ | |
'4.1.2_r1-robolectric-0', | |
'4.2.2_r1.2-robolectric-0', | |
'4.3_r2-robolectric-0', | |
'4.4_r1-robolectric-1', | |
'5.0.0_r2-robolectric-1', | |
'5.1.1_r9-robolectric-1', | |
'6.0.0_r1-robolectric-0', |
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 be.digitalia.common.widgets; | |
import android.content.Context; | |
import android.os.SystemClock; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.ProgressBar; | |
/** | |
* ContentLoadingProgressBar implements a ProgressBar that waits a minimum time to be |
NewerOlder