(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
SQLiteDatabase database = dbHelper.getWritableDatabase(); | |
Cursor c = database.rawQuery( | |
"SELECT name FROM sqlite_master WHERE type='table'", null); | |
Assert.assertNotNull(c); | |
String actual = ""; | |
if (c.moveToFirst()) { | |
while (!c.isAfterLast()) { | |
actual += c.getString(0) + ","; | |
c.moveToNext(); |
package com.edinstudio.app.samples.multiplerowradiobuttons; | |
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import android.view.View; | |
import android.widget.RadioGroup; | |
import android.widget.Toast; | |
public class MainActivity extends ActionBarActivity { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Hi All! | |
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future. | |
Feel free to request any features you'd like to see, and I'll prioritize them accordingly. | |
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it. | |
Here's the link to the repository: https://github.com/Pulimet/ADBugger | |
App Description: | |
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups. |
/** | |
* Authenticator that attempts to refresh the client's access token. | |
* In the event that a refresh fails and a new token can't be issued an error | |
* is delivered to the caller. This authenticator blocks all requests while a token | |
* refresh is being performed. In-flight requests that fail with a 401 are | |
* automatically retried. | |
*/ | |
class AccessTokenAuthenticator( | |
private val tokenProvider: AccessTokenProvider | |
) : Authenticator { |
fun <T> Flow<T>.throttle(waitMillis: Int) = flow { | |
coroutineScope { | |
val context = coroutineContext | |
var nextMillis = 0L | |
var delayPost: Deferred<Unit>? = null | |
collect { | |
val current = SystemClock.uptimeMillis() | |
if (nextMillis < current) { | |
nextMillis = current + waitMillis |
fun <T> debounce( | |
waitMs: Long = 300L, | |
scope: CoroutineScope, | |
destinationFunction: (T) -> Unit | |
): (T) -> Unit { | |
var debounceJob: Job? = null | |
return { param: T -> | |
debounceJob?.cancel() | |
debounceJob = scope.launch { | |
delay(waitMs) |
import androidx.animation.IntToVectorConverter | |
import androidx.animation.tween | |
import androidx.compose.Composable | |
import androidx.compose.mutableStateOf | |
import androidx.compose.remember | |
import androidx.ui.animation.animatedFloat | |
import androidx.ui.animation.animatedValue | |
import androidx.ui.core.* | |
import androidx.ui.core.gesture.scrollorientationlocking.Orientation | |
import androidx.ui.foundation.animation.FlingConfig |
class SnackbarState { | |
var show by mutableStateOf(false) | |
} | |
@Composable | |
fun TransientSnackbar( | |
modifier: Modifier = Modifier, | |
snackbarState: SnackbarState, | |
text: String, | |
actionLabel: String, |
inline fun <reified T : Fragment> launchFragmentInHiltContainer( | |
fragmentArgs: Bundle? = null, | |
@StyleRes themeResId: Int = R.style.SomeTheme, | |
fragmentFactory: FragmentFactory? = null, | |
crossinline action: Fragment.() -> Unit = {} | |
) { | |
val startActivityIntent = Intent.makeMainActivity( | |
ComponentName( | |
ApplicationProvider.getApplicationContext(), | |
HiltTestActivity::class.java |