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 android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.widget.GridView; | |
| public class WrapContentGridView extends GridView { | |
| public WrapContentGridView(Context context) { | |
| super(context); | |
| } | |
| public WrapContentGridView(Context context, AttributeSet attrs) { |
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 android.graphics.Rect; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.View; | |
| public class VerticalSpaceItemDecoration extends RecyclerView.ItemDecoration { | |
| private final int mVerticalSpaceHeight; | |
| /** | |
| * @param mVerticalSpaceHeight height value in dp | |
| */ |
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 android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.graphics.Canvas; | |
| import android.graphics.Rect; | |
| import android.graphics.drawable.Drawable; | |
| import android.support.v7.widget.LinearLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.View; | |
| public class LineDividerItemDecoration extends RecyclerView.ItemDecoration { |
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 org.jsoup.Jsoup; | |
| import org.jsoup.nodes.Document; | |
| public class JsoupGetMetaData { | |
| public static void main(String args[]){ | |
| Document document; | |
| String html = ""; | |
| try { | |
| document = Jsoup.connect(html).get(); |
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 rx.Observable; | |
| import rx.subjects.PublishSubject; | |
| import rx.subjects.SerializedSubject; | |
| import rx.subjects.Subject; | |
| public class RxBus { | |
| private final Subject<Object, Object> bus = new SerializedSubject<>(PublishSubject.create()); | |
| private RxBus() { |
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 class InterceptScrollView extends NestedScrollView { | |
| private int downX; | |
| private int downY; | |
| private int mTouchSlop; | |
| public InterceptScrollView(Context context) { | |
| super(context); | |
| mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); | |
| } |
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 class Singleton { | |
| private Singleton() { | |
| } | |
| public static Singleton getInstance() { | |
| return SingletonViewHolder.sInsatnce; | |
| } | |
| private static class SingletonHolder { |
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 abstract class BaseRVAdapter<T extends ViewDataBinding, M> | |
| extends RecyclerView.Adapter<DataBindingViewHolder<T>> { | |
| List<M> mDataList; | |
| public BaseRVAdapter(List<M> mDataList) { | |
| this.mDataList = mDataList; | |
| } | |
| @Override public int getItemCount() { |
OlderNewer