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 TintedProgressBar extends ProgressBar { | |
public TintedProgressBar(Context context) { | |
this(context, null); | |
} | |
public TintedProgressBar(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
public TintedProgressBar(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
android.libraryVariants.all { variant -> | |
String taskName = "makeJar${variant.name.capitalize()}" | |
task(taskName, type: Copy) { | |
String baseFileName = "${project.name}-${variant.name}" | |
String outputDir = "${buildDir.getPath()}/outputs" | |
dependsOn "assemble${variant.name.capitalize()}" | |
from(zipTree("${outputDir}/aar/${baseFileName}.aar")) | |
into("${outputDir}/jar/") |
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 ProgressView extends View { | |
private static final int DEFAULT_PROGRESS = 0; | |
private static final int DEFAULT_PROGRESS_MAX = 100; | |
private static final int DEFAULT_COLOR_BACKGROUND = Color.GRAY; | |
private static final int DEFAULT_COLOR_PROGRESS = Color.BLUE; | |
private Paint paintProgress; | |
private Paint paintProgressBackground; | |
private int height; |
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
@SuppressWarnings({ "WeakerAccess", "unused" }) public class SQLQueryBuilder { | |
private static final String STATEMENT_SELECT = "SELECT"; | |
private static final String STATEMENT_DISTINCT_SELECT = "SELECT DISTINCT"; | |
private static final String STATEMENT_UPDATE = "UPDATE"; | |
private static final String STATEMENT_INSERT_INTO = "INSERT INTO"; | |
private static final String STATEMENT_DELETE = "DELETE FROM"; | |
private static final String WHERE = "WHERE"; | |
private static final String FROM = "FROM"; |
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); | |
} |
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 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 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 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 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) { |