本文整理匯總了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);
}