Skip to content

Instantly share code, notes, and snippets.

View yongjhih's full-sized avatar
Working from home

Andrew Chen yongjhih

Working from home
View GitHub Profile
yongjhih / DashedBorder.kt
Created September 27, 2023 12:17 — forked from DavidIbrahim/DashedBorder.kt
dashedBorder modifier for android compose
* Copyright 2020 The Android Open Source Project
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
yongjhih / FirebaseMessagingProxyService.kt
Last active February 18, 2021 11:25 — forked from volodia-chornenkyy/
Handling of multiple FirebaseMessagingService
class FirebaseMessagingProxyService : FirebaseMessagingService() {
private val messagingServices: List<FirebaseMessagingService> by lazy {
.onEach { it.injectContext(this) }
override fun onNewToken(token: String) {
Log.d(TAG, "onNewToken: token")
public void login(final String mac, final String devicesOs, final String appVersion, String userAcct, String userPwd, String memType) {
getSubscription().add(ApiClient.getInstance().personLogin(mac, devicesOs, appVersion, userAcct, userPwd, memType)
.subscribeOn(Schedulers.newThread()) // (1)
.observeOn(AndroidSchedulers.mainThread()) // (2)
.flatMap(new Func1<PersonLogin, Observable<PersonData>>() {
public Observable<PersonData> call(PersonLogin personLogin) {
// main thread
return ApiClient.getInstance().queryPersonData(mac, devicesOs, appVersion, personLogin.getUId(), personLogin.getSessionId()).subscribeOn(Schedulers.newThread());
yongjhih /
Last active September 14, 2015 16:34 — forked from donnfelker/
RxJava Bound Service AIDL Abstraction
package com.donnfelker.rxexample;
import android.os.Bundle;
import rx.Subscriber;
import rx.Subscription;
import rx.schedulers.Schedulers;
yongjhih /
Last active April 19, 2016 00:03 — forked from FireZenk/
With this class you can clone the {Snackbar} animation to move the {ViewGroup} above of the Snackbar when it is visible and avoid view overlapping (clone of fab animation)
package com.your.package;
import android.view.View;
import android.view.ViewGroup;
import com.daimajia.easing.BaseEasingMethod;
import com.daimajia.easing.Glider;
import com.daimajia.easing.Skill;
import com.nineoldandroids.animation.AnimatorSet;
package com.github.pgloaguen;
import android.animation.ValueAnimator;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.ImageView;
import java.lang.ref.SoftReference;
# Startup / shutdown script for the couchbase sync_gateway
if [ "$(id -u)" != "0" ]; then
echo "Must run as root"
exit 1