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 DisplayLeakConnectorView extends View { | |
private static final float DEFAULT_STROKEWIDTH = 4f; | |
private static final int DEFAULT_COLOR_BRANCH = 0xFFbababa; | |
private static final int DEFAULT_COLOR_ROOT = 0xFF84a6c5; | |
private static final int DEFAULT_COLOR_LEAK = 0xFFb1554e; | |
public static final int TYPE_START = -1; | |
public static final int TYPE_NODE = 0; | |
public static final int TYPE_END = 1; | |
public static final int TYPE_DEFAULT = TYPE_NODE; |
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 DebugLog { | |
private static final int LOG_TAG_MAX_LENGTH = 23; | |
private static final String TEXT_NULL_VALUE = "null value"; | |
private static final String TEXT_SEPARATOR = " "; | |
private DebugLog() { | |
} | |
private static boolean isDebuggable() { | |
return BuildConfig.DEBUG; |
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 UniversalFragmentPagerAdapter extends FragmentPagerAdapter { | |
private final String[] tabTitles; | |
private final Fragment[] tabFragments; | |
public UniversalFragmentPagerAdapter(@NonNull FragmentManager fm, String[] tabTitles, | |
@NonNull Fragment[] tabFragments) { | |
super(fm); | |
if (tabTitles != null && tabTitles.length != tabFragments.length) { | |
throw new IllegalArgumentException(); | |
} |
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 TextViewFont extends TextView { | |
public TextViewFont(Context context) { | |
this(context, null); | |
} | |
public TextViewFont(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
public TextViewFont(Context context, AttributeSet attrs, int defStyleAttr) { |
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 FontCache { | |
private static final Map<String, Typeface> mapFont = new HashMap<>(); | |
public static Typeface getFont(Context context, String fontName) { | |
Typeface typeface = mapFont.get(fontName); | |
if (typeface == null) { | |
try { | |
typeface = Typeface.createFromAsset(context.getAssets(), fontName); | |
} catch (Exception e) { |
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 TextViewWriter extends TextView { | |
private static final int DEFAULT_DELAY_MS = 150; | |
private static final boolean DEFAULT_AUTOSTART = false; | |
public static final int MODE_CHARACTER = 0; | |
public static final int MODE_WORD = 1; | |
private static final int DEFAULT_MODE = MODE_CHARACTER; | |
@Retention(RetentionPolicy.SOURCE) @IntDef({ MODE_CHARACTER, MODE_WORD }) public @interface Mode { | |
} |
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 UniversalFragmentStatePagerAdapter extends FragmentStatePagerAdapter { | |
private final String[] titles; | |
private final Fragment[] fragments; | |
public UniversalFragmentStatePagerAdapter(@NonNull FragmentManager fragmentManager, | |
String[] titles, @NonNull Fragment[] fragments) { | |
super(fragmentManager); | |
if (titles != null && titles.length != fragments.length) { | |
throw new IllegalArgumentException(); | |
} |
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 void addListener(Listener listener) { | |
if (listeners == null) { | |
listeners = new ArrayList<>(); | |
} | |
listeners.add(listener); | |
} | |
public void removeListener(Listener listener) { | |
if (listeners != null) { | |
int position = listeners.indexOf(listener); |
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 LockableViewPager extends ViewPager { | |
private static final boolean DEFAULT_LOCK_STATE = false; | |
private boolean locked; | |
public LockableViewPager(Context context) { | |
this(context, null); | |
} | |
public LockableViewPager(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 AdvancedRadioGroup extends LinearLayout { | |
private int radioButtonCheckedId; | |
private boolean working; | |
private RadioGroup.OnCheckedChangeListener listener; | |
public AdvancedRadioGroup(Context context) { | |
this(context, null); | |
} |