This file contains hidden or 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
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * 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 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This file contains hidden or 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
| /* | |
| * Copyright 2014 Google Inc. | |
| * | |
| * 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 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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.io.IOException; | |
| import java.io.OutputStream; | |
| import android.graphics.Bitmap; | |
| import android.graphics.Bitmap.Config; | |
| import android.graphics.Canvas; | |
| import android.graphics.Paint; | |
| public class AnimatedGifEncoder { | |
| protected int width; // image size |
This file contains hidden or 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
| package com.example.scalpeldrawer; | |
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.support.v4.widget.DrawerLayout; | |
| import android.util.AttributeSet; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.CheckBox; |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="hzqtc.flowlayout" | |
| android:versionCode="1" | |
| android:versionName="1.0"> | |
| <uses-sdk | |
| android:minSdkVersion="14" | |
| android:targetSdkVersion="19"/> |
This file contains hidden or 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 static char[] parseMethodArguments(String desc) { | |
| String[] splitDesc = splitMethodDesc(desc); | |
| char[] returnChars = new char[splitDesc.length]; | |
| int count = 0; | |
| for(String type : splitDesc) { | |
| if(type.startsWith("L") || type.startsWith("[")) { | |
| returnChars[count] = 'L'; | |
| } | |
| else { | |
| if(type.length() > 1) { throw new RuntimeException(); } |
This file contains hidden or 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.android.volley.toolbox.HurlStack; | |
| import com.squareup.okhttp.OkHttpClient; | |
| import java.io.IOException; | |
| import java.net.HttpURLConnection; | |
| import java.net.URL; | |
| /** | |
| * An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which | |
| * uses OkHttp as its transport. | |
| */ |
This file contains hidden or 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
| package your.awesome.app; | |
| import android.graphics.Bitmap; | |
| import android.support.v4.util.LruCache; | |
| import com.android.volley.toolbox.ImageLoader.ImageCache; | |
| public class LruBitmapCache extends LruCache<String, Bitmap> implements ImageCache { | |
| public LruBitmapCache(int maxSize) { | |
| super(maxSize); |
This file contains hidden or 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.Gson; | |
| import com.google.gson.JsonSyntaxException; | |
| import com.android.volley.AuthFailureError; | |
| import com.android.volley.NetworkResponse; | |
| import com.android.volley.ParseError; | |
| import com.android.volley.Request; | |
| import com.android.volley.Response; | |
| import com.android.volley.Response.ErrorListener; | |
| import com.android.volley.Response.Listener; |