This file contains 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
(* based on https://gist.github.com/davedelong/850409c512ab2d2a21aa6fa690096d56 *) | |
on setDarkModeSmothly(shouldBeDark) | |
tell application "System Events" | |
if dark mode of appearance preferences is shouldBeDark then | |
return "no changes" | |
end if | |
end tell | |
if shouldBeDark then | |
set mode to "dark" |
This file contains 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 NumberView extends View { | |
private final Interpolator mInterpolator; | |
private final Paint mPaint; | |
private final Path mPath; | |
// Numbers currently shown. | |
private int mCurrent = 0; | |
private int mNext = 1; | |
This file contains 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
/** | |
* @param str String with special caracters | |
* @return double value of string | |
*/ | |
public static double toDouble(String str) { | |
str = str.replaceAll("[^\\d]", ""); | |
if (str != null && str.length() > 0) { | |
return Double.parseDouble(str) / 100; | |
} else { | |
return 0; |
This file contains 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 MoneyTextWatcher extends METValidator implements TextWatcher, View.OnFocusChangeListener { | |
public static final String T = "MoneyTextWatcher"; | |
protected int max_length = Integer.MAX_VALUE; | |
private EditText editText; | |
private View linkedText; | |
private String formatType; | |
private String current = ""; | |
private boolean insertingSelected = false; | |
private boolean isDeleting; | |
private MoneyTextDelegate delegate; |