View signe_apk.sh
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
#!/usr/bin/env bash | |
if [ $# -lt 2 ] ;then | |
echo "Please specify a key store" | |
exit 0 | |
fi | |
if [ $# -lt 3 ] ;then | |
echo "Please specify a source unsigned apk file" | |
exit 0 | |
fi |
View batch_replace_text.sh
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
#!/usr/bin/env bash | |
old="onFailure(MetaCode" | |
new="onFailure(int" | |
# sed -i "s/$old/$new/g" `grep $old -rl $1` | |
# sed -i -e "s/$old/$new/g" `ls` | |
#The sed command is a bit different in Mac OS X, the ‘-i’ option | |
# required a parameter to tell what extension to add for the backup file. |
View NativeCalled.java
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.lang.annotation.ElementType; | |
import java.lang.annotation.Inherited; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
/** | |
* A annotation which to indicate the method is called by native code. | |
* | |
*/ |
View FileUtils.java
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.Context; | |
import android.os.Environment; | |
import android.text.TextUtils; | |
import java.io.BufferedOutputStream; | |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.FileOutputStream; |
View OnLastItemVisibleListener.java
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.widget.AbsListView; | |
import android.widget.AbsListView.OnScrollListener; | |
public abstract class OnLastItemVisibleListener implements AbsListView.OnScrollListener { | |
private boolean mLastItemVisible = false; | |
@Override | |
public void onScrollStateChanged(AbsListView view, int scrollState) { | |
/** | |
* Check that the scrolling has stopped, and that the last item is |
View SimpleBitmapAsyncTask.java
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.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.os.AsyncTask; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
public class SimpleBitmapAsyncTask extends AsyncTask<String, Void, Bitmap> { |
View Keyboard.java
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.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import com.theonepiano.smartpiano.R; |
View NonSwipeableViewPager.java
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.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import com.folyd.app.R; | |
public class NonSwipeableViewPager extends ViewPager { |
View ToggleVisibilityHelper.java
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.Handler; | |
/** | |
* A helper class can toggle target object visibility automatically. | |
* It is very useful for MediaController (or ActionBar) when play video in Activity. | |
*/ | |
public abstract class ToggleVisibilityHelper { | |
/** | |
* Record the time while user lasted click. |
OlderNewer