当前位置: 首页>>代码示例>>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;未经允许,请勿转载。