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 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 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 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 class UnderlineTextView extends TextView { | |
private Context context; | |
private int textColor; | |
public UnderlineTextView(Context context) { | |
this(context, null); | |
} | |
public UnderlineTextView(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
# Built application files | |
*.apk | |
*.ap_ | |
# Files for the Dalvik VM | |
*.dex | |
# Java class files | |
*.class |
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 hideSoftKeyboard(Activity context) { | |
View view = context.getCurrentFocus(); | |
if (view == null) { | |
return; | |
} | |
InputMethodManager inputMethodManager = | |
(InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); | |
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), | |
InputMethodManager.HIDE_NOT_ALWAYS); |
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 BasePreferenceActivity extends PreferenceActivity { | |
private AppCompatDelegate appCompatDelegate; | |
private Toolbar toolbar; | |
protected abstract int getPreferencesResource(); | |
protected abstract int getLayoutResource(); | |
protected abstract int getTitleResource(); |
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
@IntDef({ | |
FIND_STREAK_LESS_THAN_ZERO, FIND_STREAK_LESS_EQUAL_TO_ZERO, FIND_STREAK_LESS_GREATER_ZERO | |
}) @Retention(RetentionPolicy.SOURCE) public @interface FIND_STREAK_OPERATOR { | |
} | |
public static final int FIND_STREAK_LESS_THAN_ZERO = 0; | |
public static final int FIND_STREAK_LESS_EQUAL_TO_ZERO = 1; | |
public static final int FIND_STREAK_LESS_GREATER_ZERO = 2; | |
public int findLongestStreak(float[] values, @FIND_STREAK_OPERATOR int operator) { |
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 PreferencesObjectHelper<T> { | |
private static final String TAG = "PreferencesObjectHelper"; | |
private final SharedPreferences preferences; | |
private final SharedPreferences.Editor editor; | |
@SuppressLint("CommitPrefEdits") | |
public PreferencesObjectHelper(Context context, String fileName) { | |
preferences = context.getSharedPreferences(fileName, Context.MODE_PRIVATE); | |
editor = preferences.edit(); |