本文整理汇总了Java中com.ustwo.clockwise.common.WatchFaceTime类的典型用法代码示例。如果您正苦于以下问题:Java WatchFaceTime类的具体用法?Java WatchFaceTime怎么用?Java WatchFaceTime使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WatchFaceTime类属于com.ustwo.clockwise.common包,在下文中一共展示了WatchFaceTime类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTimeChanged
import com.ustwo.clockwise.common.WatchFaceTime; //导入依赖的package包/类
@Override
protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) {
if (newTime.hasHourChanged(oldTime) || newTime.hasMinuteChanged(oldTime)) {
if (layoutSet) {
wakeLock.acquire(50);
//final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BIGChart.this);
final SimpleDateFormat timeFormat = new SimpleDateFormat(sharedPrefs.getBoolean("use24HourFormat", false) ? "HH:mm" : "h:mm a");
mTime.setText(timeFormat.format(System.currentTimeMillis()));
showAgeAndStatus();
if (ageLevel() <= 0) {
mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else {
mSgv.setPaintFlags(mSgv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
}
missedReadingAlert();
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
mRelativeLayout.getMeasuredHeight());
}
else {
missedReadingAlert();//KS TEST otherwise, it can be 10+ minutes before missedReadingAlert is called; hwr, aggressive restart does not always resolve ble connection
}
}
}
示例2: onTimeChanged
import com.ustwo.clockwise.common.WatchFaceTime; //导入依赖的package包/类
@Override
protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) {
if (oldTime.hasMinuteChanged(newTime)) {
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "TimeChangedWakelock");
wakeLock.acquire(30000);
/*Preparing the layout just on every minute tick:
* - hopefully better battery life
* - drawback: might update the minutes since last reading up to one minute late*/
prepareLayout();
prepareDrawTime();
invalidate(); //redraw the time
wakeLock.release();
}
}
示例3: onTimeChanged
import com.ustwo.clockwise.common.WatchFaceTime; //导入依赖的package包/类
@Override
protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) {
if (newTime.hasHourChanged(oldTime) || newTime.hasMinuteChanged(oldTime)) {
if (layoutSet) {
wakeLock.acquire(50);
//final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BaseWatchFace.this);
final SimpleDateFormat timeFormat = new SimpleDateFormat(sharedPrefs.getBoolean("use24HourFormat", false) ? "HH:mm" : "h:mm a");
mTime.setText(timeFormat.format(System.currentTimeMillis()));
showAgoRawBattStatus();
if (ageLevel() <= 0) {
mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else {
mSgv.setPaintFlags(mSgv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
}
missedReadingAlert();
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
mRelativeLayout.getMeasuredHeight());
} else {
missedReadingAlert();//KS TEST otherwise, it can be 10+ minutes before missedReadingAlert is called; hwr, aggressive restart does not always resolve ble connection
}
}
}
示例4: onTimeChanged
import com.ustwo.clockwise.common.WatchFaceTime; //导入依赖的package包/类
@Override
protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) {
if (layoutSet && (newTime.hasHourChanged(oldTime) || newTime.hasMinuteChanged(oldTime))) {
wakeLock.acquire(50);
final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BIGChart.this);
mTime.setText(timeFormat.format(System.currentTimeMillis()));
showAgeAndStatus();
if(ageLevel()<=0) {
mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else {
mSgv.setPaintFlags(mSgv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
}
missedReadingAlert();
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
mRelativeLayout.getMeasuredHeight());
}
}
示例5: onTimeChanged
import com.ustwo.clockwise.common.WatchFaceTime; //导入依赖的package包/类
@Override
protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) {
if (oldTime.hasMinuteChanged(newTime)) {
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "TimeChangedWakelock");
wakeLock.acquire(30000);
/*Preparing the layout just on every minute tick:
* - hopefully better battery life
* - drawback: might update the minutes since last reading up endTime one minute late*/
prepareLayout();
prepareDrawTime();
invalidate(); //redraw the time
wakeLock.release();
}
}
示例6: onTimeChanged
import com.ustwo.clockwise.common.WatchFaceTime; //导入依赖的package包/类
@Override
protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) {
if (layoutSet && (newTime.hasHourChanged(oldTime) || newTime.hasMinuteChanged(oldTime))) {
wakeLock.acquire(50);
final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BaseWatchFace.this);
mTime.setText(timeFormat.format(System.currentTimeMillis()));
showAgoRawBattStatus();
if(ageLevel()<=0) {
mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else {
mSgv.setPaintFlags(mSgv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
}
missedReadingAlert();
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
mRelativeLayout.getMeasuredHeight());
}
}
示例7: onTimeChanged
import com.ustwo.clockwise.common.WatchFaceTime; //导入依赖的package包/类
@Override
protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) {
if (layoutSet && (newTime.hasHourChanged(oldTime) || newTime.hasMinuteChanged(oldTime))) {
wakeLock.acquire(50);
final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(NOChart.this);
mTime.setText(timeFormat.format(System.currentTimeMillis()));
showAgeAndStatus();
if(ageLevel()<=0) {
mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else {
mSgv.setPaintFlags(mSgv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
}
missedReadingAlert();
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
mRelativeLayout.getMeasuredHeight());
}
}