This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.JsonElement; | |
import com.google.gson.JsonObject; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.util.Iterator; | |
import java.util.Map; | |
public class JsonUtils { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log; | |
import com.google.gson.JsonArray; | |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonObject; | |
import com.google.gson.JsonPrimitive; | |
import java.util.Map; | |
public class PrintFormattedJson { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.ContentResolver; | |
import android.content.ContentUris; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.database.Cursor; | |
import android.database.DatabaseUtils; | |
import android.graphics.Bitmap; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Environment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LocalStorageProvider extends DocumentsProvider { | |
public static final String AUTHORITY = "com.app.android.localstorage.documents"; | |
/** | |
* Default root projection: everything but Root.COLUMN_MIME_TYPES | |
*/ | |
private final static String[] DEFAULT_ROOT_PROJECTION = new String[]{ | |
DocumentsContract.Root.COLUMN_ROOT_ID, | |
DocumentsContract.Root.COLUMN_FLAGS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomeActivity extends BaseAppCompatActivity { | |
// Used to load the 'native-lib' library on application startup. | |
static { | |
System.loadLibrary("native-lib"); | |
} | |
public native Object[] getMediaFiles(String root); | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.library' | |
apply plugin: 'checkstyle' | |
apply plugin: 'maven-publish' | |
android { | |
publishNonDefault true | |
compileSdkVersion 25 | |
buildToolsVersion "25.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Rect; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
public class GridSpacingItemDecoration extends RecyclerView.ItemDecoration { | |
private int spanCount; | |
private int spacing; | |
private boolean includeEdge; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Observer; | |
public final class NotificationCenter { | |
private static NotificationCenter instance; | |
private final HashMap<String, NotificationObservable> observables; | |
private NotificationCenter() { | |
observables = new HashMap<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Parcel; | |
import android.os.Parcelable; | |
public class ParcelableUtil { | |
public static byte[] marshall(Parcelable parceable) { | |
Parcel parcel = Parcel.obtain(); | |
parceable.writeToParcel(parcel, 0); | |
byte[] bytes = parcel.marshall(); | |
parcel.recycle(); | |
return bytes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v4.view.GravityCompat; | |
import android.support.v4.widget.DrawerLayout; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.Toolbar; | |
import android.view.View; | |
import android.widget.TextView; | |
public class ToolbarUtils { |
OlderNewer