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


Java WatchFaceStyle.Builder方法代码示例

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


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

示例1: setNewWatchFaceStyle

import android.support.wearable.watchface.WatchFaceStyle; //导入方法依赖的package包/类
private void setNewWatchFaceStyle() {
    WatchFaceStyle.Builder watchfaceStyleBuilder = new WatchFaceStyle.Builder(ExampleWatchFace.this)
            .setAmbientPeekMode(WatchFaceStyle.AMBIENT_PEEK_MODE_VISIBLE)
            .setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
            .setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
            .setShowSystemUiTime(false);

    if(mLightTheme) { watchfaceStyleBuilder = watchfaceStyleBuilder.setViewProtectionMode(WatchFaceStyle.PROTECT_STATUS_BAR | WatchFaceStyle.PROTECT_HOTWORD_INDICATOR); }

    setWatchFaceStyle(watchfaceStyleBuilder.build());
}
 
开发者ID:patloew,项目名称:watch-face-example,代码行数:12,代码来源:ExampleWatchFace.java

示例2: buildStyle

import android.support.wearable.watchface.WatchFaceStyle; //导入方法依赖的package包/类
@Override
protected WatchFaceStyle buildStyle(final WatchFaceStyle.Builder builder) {
    return builder
            .setStatusBarGravity(Gravity.RIGHT | Gravity.TOP)
            .setHotwordIndicatorGravity(Gravity.CENTER)
            .setViewProtection(WatchFaceStyle.PROTECT_HOTWORD_INDICATOR)
            .setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
            .build();
}
 
开发者ID:rycus86,项目名称:StringTheory,代码行数:10,代码来源:StringTheoryWatchFace.java

示例3: buildStyle

import android.support.wearable.watchface.WatchFaceStyle; //导入方法依赖的package包/类
@Override
protected WatchFaceStyle buildStyle(final WatchFaceStyle.Builder builder) {
    return builder.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
            .setHotwordIndicatorGravity(Gravity.CENTER_HORIZONTAL | Gravity.TOP)
            .setStatusBarGravity(Gravity.CENTER_HORIZONTAL | Gravity.TOP)
            .build();
}
 
开发者ID:rycus86,项目名称:TriangularWatchFace,代码行数:8,代码来源:TriangularWatchFace.java

示例4: onCreate

import android.support.wearable.watchface.WatchFaceStyle; //导入方法依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
    super.onCreate(holder);
    Log.d();
    // Watch face style
    WatchFaceStyle.Builder builder = new WatchFaceStyle.Builder(mService);
    builder.setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE);
    builder.setPeekOpacityMode(WatchFaceStyle.PEEK_OPACITY_MODE_OPAQUE);
    builder.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE);
    builder.setShowSystemUiTime(false);
    builder.setAmbientPeekMode(WatchFaceStyle.AMBIENT_PEEK_MODE_VISIBLE);
    builder.setHotwordIndicatorGravity(Gravity.CENTER_HORIZONTAL | Gravity.TOP);
    builder.setShowUnreadCountIndicator(false);
    builder.setStatusBarGravity(Gravity.RIGHT | Gravity.TOP);
    builder.setViewProtection(WatchFaceStyle.PROTECT_HOTWORD_INDICATOR | WatchFaceStyle.PROTECT_STATUS_BAR);
    setWatchFaceStyle(builder.build());

    mIs24HourFormat = DateFormat.is24HourFormat(mService);

    mSettingsHelper = SettingsHelper.get(SimpleWatchFaceService.this);

    mSettingsHelper.addSettingsChangeListener(mSettingsChangeListener);
    mBackgroundPicture = mSettingsHelper.getBackgroundPicture();

    // Paints
    mBackgroundPaint = new Paint();
    mBackgroundPaint.setStyle(Paint.Style.FILL_AND_STROKE);
    mBackgroundPaint.setStrokeWidth(1);

    mHourMinutesPaint = new Paint();
    mSecondsPaint = new Paint();
    mAmPmPaint = new Paint();
    mDatePaint = new Paint();

    // Colors
    updateColors();
    updatePaints();

    // Margins
    mMarginBorders = getResources().getDimensionPixelOffset(R.dimen.wf_margin_borders);
    mMarginSeconds = getResources().getDimensionPixelOffset(R.dimen.wf_margin_seconds);
    mMarginDate = getResources().getDimensionPixelOffset(R.dimen.wf_margin_date);
}
 
开发者ID:BoD,项目名称:SimpleWatchface,代码行数:44,代码来源:SimpleWatchFaceService.java


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