本文整理汇总了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());
}
示例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();
}
示例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();
}
示例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);
}