Skip to content

Instantly share code, notes, and snippets.

@James-Aidoo
James-Aidoo / ConcurrencyHelpers.kt
Created September 22, 2021 07:10 — forked from objcode/ConcurrencyHelpers.kt
Helpers to control concurrency for one shot requests using Kotlin coroutines.
import kotlinx.coroutines.CoroutineStart.LAZY
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.async
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.yield
import java.util.concurrent.atomic.AtomicReference
import kotlin.DeprecationLevel.ERROR
@James-Aidoo
James-Aidoo / app-center-distribute-template.yml
Last active September 1, 2021 16:11
App Center Distribute template to be used for distributing multiple generated APKs with Azure Pipelines.
# Variable 'AppCenter.ConnectionName' was defined in the Variables tab
# Variable 'AppCenter.AppSlug' was defined in the Variables tab
# Variable 'AppCenter.DestinationGroupId' was defined in the Variables tab
parameters:
- name: listOfApks # name of the parameter; required
type: object # data type of the parameter; required
default: apk
steps:
@James-Aidoo
James-Aidoo / azure-pipeline.yml
Last active September 1, 2021 16:16
Sample Azure pipeline for building and distributing multiple generated APKs to Visual Center AppCenter for release. App center distribute template here: https://gist.github.com/James-Aidoo/0f7eb562ec69da6e1fe3a01152db7acd
# Variable 'Key.StorePassword' was defined in the Variables tab
# Variable 'Key.Alias' was defined in the Variables tab
# Variable 'Key.Password' was defined in the Variables tab
# Variable 'Key.StoreFileName' was defined in the Variables tab
variables:
- name: BuildParameters.wrapperScript
value: gradlew
- name: BuildParameters.tasks
value: assembleRelease
@James-Aidoo
James-Aidoo / AA Transition App theme between light and dark themes
Created January 28, 2021 13:59 — forked from alphamu/AA Transition App theme between light and dark themes
Example of how to change themes at runtime with a smooth animation. In this example, we just switch between a light and a dark theme. The activity animation is defined in the theme and as such will be default on all activities with the set theme. [Demo Video here](http://youtu.be/Ps0phswbHls).
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
public class TransitionThemeActivity extends AppCompatActivity implements View.OnClickListener {