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
yongjhih / DashedBorder.kt
Created September 27, 2023 12:17 — forked from DavidIbrahim/DashedBorder.kt
dashedBorder modifier for android compose
import androidx.compose.foundation.BorderStroke
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
@yongjhih
yongjhih / FirebaseMessagingProxyService.kt
Last active February 18, 2021 11:25 — forked from volodia-chornenkyy/OwnPushService.java
Handling of multiple FirebaseMessagingService
class FirebaseMessagingProxyService : FirebaseMessagingService() {
private val messagingServices: List<FirebaseMessagingService> by lazy {
listOf(FlutterFirebaseMessagingService())
.onEach { it.injectContext(this) }
}
override fun onNewToken(token: String) {
super.onNewToken(token)
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>>() {
@Override
public Observable<PersonData> call(PersonLogin personLogin) {
// main thread
return ApiClient.getInstance().queryPersonData(mac, devicesOs, appVersion, personLogin.getUId(), personLogin.getSessionId()).subscribeOn(Schedulers.newThread());
}
@yongjhih
yongjhih / OrderActivity.java
Last active September 14, 2015 16:34 — forked from donnfelker/OrderActivity.java
RxJava Bound Service AIDL Abstraction
package com.donnfelker.rxexample;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
@yongjhih
yongjhih / SnackbarAnimation.java
Last active April 19, 2016 00:03 — forked from FireZenk/SnackbarAnimation.java
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.support.design.widget.Snackbar;
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.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.ImageView;
import java.lang.ref.SoftReference;
#!/bin/sh
#
# Startup / shutdown script for the couchbase sync_gateway
#
if [ "$(id -u)" != "0" ]; then
echo "Must run as root"
exit 1
fi