Reformat Code

This commit is contained in:
tarsin committed 2022-05-30 09:23:41 +08:00
1 parent 01daf4a63e
commit 12f857a936
73 files changed
+2712 -2844

No files matched your search

@@ -73,6 +73,16 @@ public class TextClock extends AppCompatTextView {
public TextClock(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public TextClock(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mFormat12 = DEFAULT_FORMAT_12_HOUR;
mFormat24 = DEFAULT_FORMAT_24_HOUR;
mTimeZone = TimeZone.getDefault().getID();
init();
} private final Runnable mTicker = new Runnable() {
@Override
public void run() {
@@ -85,16 +95,6 @@ public class TextClock extends AppCompatTextView {
}
};
public TextClock(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mFormat12 = DEFAULT_FORMAT_12_HOUR;
mFormat24 = DEFAULT_FORMAT_24_HOUR;
mTimeZone = TimeZone.getDefault().getID();
init();
}
private void init() {
createTime(mTimeZone);
// Wait until onAttachedToWindow() to handle the ticker
@@ -111,6 +111,17 @@ public class TextClock extends AppCompatTextView {
public CharSequence getFormat12Hour() {
return mFormat12;
}
public void setFormat12Hour(CharSequence format) {
mFormat12 = format;
chooseFormat();
onTimeChanged();
}
public CharSequence getFormat24Hour() {
return mFormat24;
} private final ContentObserver mFormatChangeObserver = new ContentObserver(new Handler()) {
@Override
public void onChange(boolean selfChange) {
@@ -125,17 +136,6 @@ public class TextClock extends AppCompatTextView {
}
};
public void setFormat12Hour(CharSequence format) {
mFormat12 = format;
chooseFormat();
onTimeChanged();
}
public CharSequence getFormat24Hour() {
return mFormat24;
}
public void setFormat24Hour(CharSequence format) {
mFormat24 = format;