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 { |
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.util.AttributeSet; | |
import android.widget.GridView; | |
/** | |
* A custom GridView which can wrap content. | |
*/ | |
public class WrapGridView extends GridView { | |
public WrapGridView(Context context) { |
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. |
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.support.annotation.NonNull; | |
import android.util.AttributeSet; | |
import android.view.View; |
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.AsyncTask; | |
import android.text.TextUtils; | |
import android.util.Log; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; |
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 Utils { | |
/** | |
* To record the user click time. | |
*/ | |
private static long sLastClickTime = 0L; | |
/** | |
* Get device unique identify. | |
* | |
* @param context |
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 LoadMoreView extends LinearLayout { | |
private TextView mTipText; | |
private ProgressBar mProgressBar; | |
private boolean mIsLoading; | |
private boolean mIsDone; | |
private int mLimit = 20; | |
private String mCursor = null; | |
private int mPage = 1; |
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 | |
#Notice: if unable to connect to [ip]:5555, | |
#try adb kill-server then try again. | |
adb shell ip route > addrs.txt | |
#Case 1:Nexus 7 | |
#192.168.88.0/23 dev wlan0 proto kernel scope link src 192.168.89.48 | |
#Case 2: Smartsian T1,Huawei C8813 | |
#default via 192.168.88.1 dev eth0 metric 30 |
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 VideoPickerActivity extends Activity{ | |
private final int REQUEST_PICK_VIDEO = 1; | |
public void onVideoPickClick(View view) { | |
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI); | |
startActivityForResult(intent, REQUEST_PICK_VIDEO); | |
} | |
@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
/* | |
* Copyright 2014 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 | |
* | |
* Unless required by applicable law or agreed to in writing, software |