當前位置: 首頁>>代碼示例>>Java>>正文


Java WatchFaceTime類代碼示例

本文整理匯總了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
        }
    }
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:27,代碼來源:BIGChart.java

示例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();

    }
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:17,代碼來源:CircleWatchface.java

示例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
        }
    }
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:26,代碼來源:BaseWatchFace.java

示例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());
    }
}
 
開發者ID:MilosKozak,項目名稱:AndroidAPS,代碼行數:21,代碼來源:BIGChart.java

示例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();

    }
}
 
開發者ID:MilosKozak,項目名稱:AndroidAPS,代碼行數:17,代碼來源:CircleWatchface.java

示例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());
    }
}
 
開發者ID:MilosKozak,項目名稱:AndroidAPS,代碼行數:21,代碼來源:BaseWatchFace.java

示例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());
    }
}
 
開發者ID:MilosKozak,項目名稱:AndroidAPS,代碼行數:21,代碼來源:NOChart.java


注:本文中的com.ustwo.clockwise.common.WatchFaceTime類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。