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 TextViewDrawableSize extends TextView { | |
private static final int DEFAULT_COMPOUND_DRAWABLE_SIZE = -1; | |
private int compoundDrawableWidth; | |
private int compoundDrawableHeight; | |
public TextViewDrawableSize(Context context) { | |
this(context, null); | |
} | |
public TextViewDrawableSize(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
public class RightAlignedHorizontalScrollView extends HorizontalScrollView { | |
private static final boolean DEFAULT_GRAVITY_RIGHT = true; | |
private static final boolean DEFAULT_AUTOSCROLL = true; | |
private boolean autoScroll; | |
private boolean gravityRight; | |
public RightAlignedHorizontalScrollView(Context context) { | |
this(context, null); | |
} |
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 final class ColorDividerItemDecoration extends RecyclerView.ItemDecoration { | |
private static final int DEFAULT_DIVIDER_COLOR = Color.GRAY; | |
private static final int DEFAULT_DIVIDER_SIZE_PX = 1; | |
private static final boolean DEFAULT_DIVIDER_SHOW_FIRST = false; | |
private static final boolean DEFAULT_DIVIDER_SHOW_LAST = false; | |
private final boolean showFirstDivider; | |
private final boolean showLastDivider; | |
private final Paint paint; |
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 BaseActivity extends AppCompatActivity { | |
private Toolbar toolbar; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(getLayoutResource()); | |
toolbar = (Toolbar) findViewById(R.id.toolbar); | |
if (toolbar != null) { |
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
int totalItems=10; | |
horizontalScrollView = (HorizontalScrollViewSelector) findViewById(R.id.horizontalScrollView); | |
horizontalScrollView.setListener(new HorizontalScrollViewSelector.OnScrollChangedListener() { | |
@Override | |
public void onScrollChanged(int totalX, int x) { | |
items = x * totalItems / maxX); | |
} | |
}); |
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 SafeStringUtils { | |
public static boolean safeEquals(Object o1, Object o2) { | |
return o1 != null && o1.equals(o2); | |
} | |
public static boolean safeEqualsIgnoreCase(String s1, String s2) { | |
return s1 != null && s1.equalsIgnoreCase(s2); | |
} | |
public static boolean safeIsEmpty(String s) { |
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 ObservableScrollView extends ScrollView { | |
private static final int DEFAULT_THRESHOLD_DP = 4; | |
private ScrollDirectionListener scrollDirectionListener; | |
private int scrollThreshold; | |
public ObservableScrollView(Context context) { | |
this(context, null); | |
} | |
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 SquareRelativeLayout extends RelativeLayout { | |
public SquareRelativeLayout(Context context) { | |
this(context, null); | |
} | |
public SquareRelativeLayout(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
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 SpaceItemDecoration extends RecyclerView.ItemDecoration { | |
private static final boolean DEFAULT_ADD_SPACE_ABOVE_FIRST_ITEM = false; | |
private static final boolean DEFAULT_ADD_SPACE_BELOW_LAST_ITEM = false; | |
private final int space; | |
private final boolean addSpaceAboveFirstItem; | |
private final boolean addSpaceBelowLastItem; | |
public SpaceItemDecoration(int space) { | |
this(space, DEFAULT_ADD_SPACE_ABOVE_FIRST_ITEM, DEFAULT_ADD_SPACE_BELOW_LAST_ITEM); |
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 OutlineTextView extends TextView { | |
private static final int DEFAULT_OUTLINE_COLOR = 0xFF000000; | |
private static final int DEFAULT_OUTLINE_SIZE = 7; | |
private static final boolean DEFAULT_OUTLINE_STATE = true; | |
private int outlineColor; | |
private int outlineSize; | |
private boolean outlineState; | |
public OutlineTextView(Context context) { |