当前位置: 首页>>代码示例>>Java>>正文


Java WatchFaceService.INTERRUPTION_FILTER_NONE属性代码示例

本文整理汇总了Java中android.support.wearable.watchface.WatchFaceService.INTERRUPTION_FILTER_NONE属性的典型用法代码示例。如果您正苦于以下问题:Java WatchFaceService.INTERRUPTION_FILTER_NONE属性的具体用法?Java WatchFaceService.INTERRUPTION_FILTER_NONE怎么用?Java WatchFaceService.INTERRUPTION_FILTER_NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.support.wearable.watchface.WatchFaceService的用法示例。


在下文中一共展示了WatchFaceService.INTERRUPTION_FILTER_NONE属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG, "onInterruptionFilterChanged: " + interruptionFilter);
    }
    super.onInterruptionFilterChanged(interruptionFilter);

    boolean inMuteMode = interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE;
    // We only need to update once a minute in mute mode.
    setInteractiveUpdateRateMs(inMuteMode ? MUTE_UPDATE_RATE_MS : NORMAL_UPDATE_RATE_MS);

    if (mMute != inMuteMode) {
        mMute = inMuteMode;
        int alpha = inMuteMode ? MUTE_ALPHA : NORMAL_ALPHA;
        mDatePaint.setAlpha(alpha);
        mHourPaint.setAlpha(alpha);
        mMinutePaint.setAlpha(alpha);
        mColonPaint.setAlpha(alpha);
        mAmPmPaint.setAlpha(alpha);
        invalidate();
    }
}
 
开发者ID:mjhassanpur,项目名称:sunshine-wear,代码行数:22,代码来源:DigitalWatchFaceService.java

示例2: onCreate

@Override
public void onCreate(SurfaceHolder holder) {
    LOGD(TAG, "onCreate");
    super.onCreate(holder);

    updateDateStr();

    mMute = getInterruptionFilter() == WatchFaceService.INTERRUPTION_FILTER_NONE;
    handleConfigUpdated();

    mDateTypeface = Typeface.createFromAsset(getAssets(), "VT323-Regular.ttf");
    initClockRenderers();

    registerSystemSettingsListener();
    registerSharedPrefsListener();
    registerTimeZoneReceiver();

    initMuzei();
}
 
开发者ID:romannurik,项目名称:FORMWatchFace,代码行数:19,代码来源:FormWatchFace.java

示例3: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG, "onInterruptionFilterChanged: " + interruptionFilter);
    }
    super.onInterruptionFilterChanged(interruptionFilter);

    boolean inMuteMode = interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE;
    // We only need to update once a minute in mute mode.
    setInteractiveUpdateRateMs(inMuteMode ? MUTE_UPDATE_RATE_MS : NORMAL_UPDATE_RATE_MS);

    if (mMute != inMuteMode) {
        mMute = inMuteMode;
        int alpha = inMuteMode ? MUTE_ALPHA : NORMAL_ALPHA;
        mHourPaint.setAlpha(alpha);
        mMinutePaint.setAlpha(alpha);
        mColonPaint.setAlpha(alpha);
        mAmPmPaint.setAlpha(alpha);
        invalidate();
    }
}
 
开发者ID:AndroidAvanzato,项目名称:Capitolo6,代码行数:21,代码来源:DigitalWatchFaceService.java

示例4: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG, "onInterruptionFilterChanged: " + interruptionFilter);
    }
    super.onInterruptionFilterChanged(interruptionFilter);

    boolean inMuteMode = interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE;
    // We only need to update once a minute in mute mode.
    setInteractiveUpdateRateMs(inMuteMode ? MUTE_UPDATE_RATE_MS : NORMAL_UPDATE_RATE_MS);

    if (mMute != inMuteMode) {
        mMute = inMuteMode;
        updateWatchFaceStyle();
        invalidate();
    }
}
 
开发者ID:romannurik,项目名称:muzei,代码行数:17,代码来源:MuzeiWatchFace.java

示例5: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
    super.onInterruptionFilterChanged(interruptionFilter);
    boolean inMuteMode = (interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE);
    if (mMute != inMuteMode) {
        mMute = inMuteMode;
        mHourPaint.setAlpha(inMuteMode ? 100 : 255);
        mMinutePaint.setAlpha(inMuteMode ? 100 : 255);
        mSecondPaint.setAlpha(inMuteMode ? 80 : 255);
        invalidate();
    }
}
 
开发者ID:stevengatto,项目名称:PavlovWatchface,代码行数:12,代码来源:AnalogWatchFaceServiceUpdated.java

示例6: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
    super.onInterruptionFilterChanged(interruptionFilter);
    boolean inMuteMode = (interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE);
    if (mMute != inMuteMode) {
        mMute = inMuteMode;

        invalidate();
    }
}
 
开发者ID:alessandrocucci,项目名称:WatchFaceTutorial,代码行数:10,代码来源:CanvasHand.java

示例7: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
    LOGD(TAG, "onInterruptionFilterChanged: " + interruptionFilter);
    super.onInterruptionFilterChanged(interruptionFilter);

    boolean inMuteMode = interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE;

    if (mMute != inMuteMode) {
        mMute = inMuteMode;
        updateWatchFaceStyle();
        postInvalidate();
    }
}
 
开发者ID:romannurik,项目名称:FORMWatchFace,代码行数:13,代码来源:FormWatchFace.java

示例8: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged( int interruptionFilter ) {
    super.onInterruptionFilterChanged( interruptionFilter );
    boolean inMuteMode = ( interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE );
    if ( mMute != inMuteMode ) {
        mMute = inMuteMode;
        mHourPaint.setAlpha(inMuteMode ? 100 : 255);
        mMinutePaint.setAlpha(inMuteMode ? 100 : 255);
        mSecondPaint.setAlpha(inMuteMode ? 80 : 255);
        invalidate();
    }
}
 
开发者ID:Lakkichand,项目名称:AndroidDemoProjects,代码行数:12,代码来源:WatchFace.java

示例9: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
  super.onInterruptionFilterChanged(interruptionFilter);
  boolean inMuteMode = (interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE);
  if (mute != inMuteMode) {
    mute = inMuteMode;
    allFill.setAlpha(inMuteMode ? 100 : 255);
    secondFill.setAlpha(inMuteMode ? 80 : 255);
    invalidate();
  }
}
 
开发者ID:jimblackler,项目名称:YourPhotosWatch,代码行数:11,代码来源:BaseWatchService.java

示例10: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
  super.onInterruptionFilterChanged(interruptionFilter);
  boolean inMuteMode = (interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE);
  if (mute == inMuteMode)
    return;
  mute = inMuteMode;
  invalidate();
}
 
开发者ID:jimblackler,项目名称:BigBen,代码行数:9,代码来源:BigBenWatchFaceService.java

示例11: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
  super.onInterruptionFilterChanged(interruptionFilter);
  boolean inMuteMode = (interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE);
  if (mMute != inMuteMode) {
    mMute = inMuteMode;
    mHourPaint.setAlpha(inMuteMode ? 100 : 255);
    mMinutePaint.setAlpha(inMuteMode ? 100 : 255);
    mSecondPaint.setAlpha(inMuteMode ? 80 : 255);
    invalidate();
  }
}
 
开发者ID:INsReady,项目名称:ReleaseWatch,代码行数:12,代码来源:D8ReleaseWatchFaceService.java

示例12: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
    super.onInterruptionFilterChanged(interruptionFilter);
    boolean inMuteMode = (interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE);
    if (mMute != inMuteMode) {
        mMute = inMuteMode;
        mHourPaint.setAlpha(inMuteMode ? 100 : 255);
        mHandPaint.setAlpha(inMuteMode ? 100 : 255);
        mCurrentHourPaint.setAlpha(inMuteMode ? 80 : 255);
        mUTCLabelPaint.setAlpha(inMuteMode ? 80 : 180);
        invalidate();
    }
}
 
开发者ID:cartland,项目名称:watchface-utc,代码行数:13,代码来源:UTCWatchFaceService.java

示例13: onInterruptionFilterChanged

@Override
public void onInterruptionFilterChanged(int interruptionFilter) {
    super.onInterruptionFilterChanged(interruptionFilter);
    boolean inMuteMode = (interruptionFilter == WatchFaceService.INTERRUPTION_FILTER_NONE);

    /* Dim display in mute mode. */
    if (mMuteMode != inMuteMode) {
        mMuteMode = inMuteMode;
        mHourPaint.setAlpha(inMuteMode ? 100 : 255);
        mMinutePaint.setAlpha(inMuteMode ? 100 : 255);
        mSecondAndHighlightPaint.setAlpha(inMuteMode ? 80 : 255);
        invalidate();
    }
}
 
开发者ID:googlesamples,项目名称:android-WatchFace,代码行数:14,代码来源:AnalogComplicationWatchFaceService.java

示例14: onCreate

@Override
public void onCreate(SurfaceHolder holder) {
    super.onCreate(holder);
    FirebaseAnalytics.getInstance(MuzeiWatchFace.this).logEvent("watchface_created", null);

    mMute = getInterruptionFilter() == WatchFaceService.INTERRUPTION_FILTER_NONE;
    SharedPreferences preferences =
            PreferenceManager.getDefaultSharedPreferences(MuzeiWatchFace.this);
    mBlurred = preferences.getBoolean(BLURRED_PREF_KEY, false);
    updateWatchFaceStyle();

    mCalendar = Calendar.getInstance();
    mClockMargin = getResources().getDimension(R.dimen.clock_margin);
    mDateMinAvailableMargin = getResources().getDimension(R.dimen.date_min_available_margin);
    mBackgroundPaint = new Paint();
    mBackgroundPaint.setColor(Color.BLACK);
    mHeavyTypeface = ResourcesCompat.getFont(MuzeiWatchFace.this, R.font.nunito_clock_bold);
    mLightTypeface = ResourcesCompat.getFont(MuzeiWatchFace.this, R.font.nunito_clock_regular);

    float densityMultiplier = getResources().getDisplayMetrics().density;

    mClockPaint = new Paint();
    mClockPaint.setColor(Color.WHITE);
    mClockPaint.setShadowLayer(
            1f * densityMultiplier, 0, 0.5f * densityMultiplier, 0xcc000000);
    mClockPaint.setAntiAlias(true);
    mClockPaint.setTypeface(mHeavyTypeface);
    // Square watch face as defaults, will be changed in onApplyWindowInsets() if needed
    mClockPaint.setTextAlign(Paint.Align.RIGHT);
    mClockPaint.setTextSize(getResources().getDimension(R.dimen.clock_text_size));
    recomputeClockTextHeight();

    mClockAmbientShadowPaint = new Paint(mClockPaint);
    mClockAmbientShadowPaint.setColor(Color.TRANSPARENT);
    mClockAmbientShadowPaint.setShadowLayer(
            6f * densityMultiplier, 0, 2f * densityMultiplier,
            0x66000000);

    mDatePaint = new Paint();
    mDatePaint.setColor(Color.WHITE);
    mDatePaint.setShadowLayer(
            1f * densityMultiplier, 0, 0.5f * densityMultiplier, 0xcc000000);
    mDatePaint.setAntiAlias(true);
    mDatePaint.setTypeface(mLightTypeface);
    // Square watch face as defaults, will be changed in onApplyWindowInsets() if needed
    mDatePaint.setTextAlign(Paint.Align.RIGHT);
    mDatePaint.setTextSize(getResources().getDimension(R.dimen.date_text_size));
    recomputeDateTextHeight();

    mDateAmbientShadowPaint = new Paint(mDatePaint);
    mDateAmbientShadowPaint.setColor(Color.TRANSPARENT);
    mDateAmbientShadowPaint.setShadowLayer(
            4f * densityMultiplier, 0, 2f * densityMultiplier,
            0x66000000);
    recomputeDateFormat();
}
 
开发者ID:romannurik,项目名称:muzei,代码行数:56,代码来源:MuzeiWatchFace.java


注:本文中的android.support.wearable.watchface.WatchFaceService.INTERRUPTION_FILTER_NONE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。