Reformat code

This commit is contained in:
tarsin committed 2022-06-13 12:42:00 +08:00
1 parent 36aa37359b
commit 622d4055d9
25 files changed
+1158 -1123

No files matched your search

@@ -83,6 +83,12 @@ public class TextClock extends AppCompatTextView {
mTimeZone = TimeZone.getDefault().getID();
init();
}
private void init() {
createTime(mTimeZone);
// Wait until onAttachedToWindow() to handle the ticker
chooseFormat(false);
} private final Runnable mTicker = new Runnable() {
@Override
public void run() {
@@ -95,12 +101,6 @@ public class TextClock extends AppCompatTextView {
}
};
private void init() {
createTime(mTimeZone);
// Wait until onAttachedToWindow() to handle the ticker
chooseFormat(false);
}
private void createTime(String timeZone) {
if (timeZone != null) {
mTime = Calendar.getInstance(TimeZone.getTimeZone(timeZone));
@@ -122,6 +122,17 @@ public class TextClock extends AppCompatTextView {
public CharSequence getFormat24Hour() {
return mFormat24;
}
public void setFormat24Hour(CharSequence format) {
mFormat24 = format;
chooseFormat();
onTimeChanged();
}
public boolean is24HourModeEnabled() {
return DateFormat.is24HourFormat(getContext());
} private final ContentObserver mFormatChangeObserver = new ContentObserver(new Handler()) {
@Override
public void onChange(boolean selfChange) {
@@ -136,17 +147,6 @@ public class TextClock extends AppCompatTextView {
}
};
public void setFormat24Hour(CharSequence format) {
mFormat24 = format;
chooseFormat();
onTimeChanged();
}
public boolean is24HourModeEnabled() {
return DateFormat.is24HourFormat(getContext());
}
public String getTimeZone() {
return mTimeZone;
}