Skip to content

Instantly share code, notes, and snippets.

View andhie's full-sized avatar

Andhie Wong andhie

View GitHub Profile
@andhie
andhie / FirebaseJobDispatcherService.java
Created February 1, 2018 08:16
Android Priority Job Queue for Firebase JobDispatcher
package com.birbit.android.jobqueue.scheduling;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.birbit.android.jobqueue.JobManager;
import com.birbit.android.jobqueue.log.JqLog;
import com.firebase.jobdispatcher.JobParameters;
import com.firebase.jobdispatcher.JobService;
@andhie
andhie / PermissionUtil.java
Last active October 23, 2017 17:04
Marshmallow Permission Level
public static void printPermissions(Context context) {
PackageInfo android;
try {
android = context.getPackageManager().getPackageInfo("android", PackageManager.GET_PERMISSIONS);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return;
}
PermissionInfo[] permissions = android.permissions;
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--
The FAB widget inflates a default style which is available in
/sdk/extras/android/support/design/res/values. As per Material Design
guidelines, the FAB elevation is 6dp instead of the preset 8dp value.
Other default FAB values are correct with respect to the specs.