本文整理汇总了Java中android.support.wearable.watchface.WatchFaceStyle类的典型用法代码示例。如果您正苦于以下问题:Java WatchFaceStyle类的具体用法?Java WatchFaceStyle怎么用?Java WatchFaceStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WatchFaceStyle类属于android.support.wearable.watchface包,在下文中一共展示了WatchFaceStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(PacktWatchFace.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.build());
// Let us initialize them all here
// bob = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
backGround = new Paint() {{ setARGB(255, 120, 190, 0); }};
textPaint = createPaint(false, 40);
boldTextPaint = createPaint(true, 40);
whiteBackground = createPaint(false, 0);
darkText = new Paint() {{ setARGB(255, 50, 50, 50); setTextSize(18); }};
setWatchFaceStyle(new WatchFaceStyle.Builder(PacktWatchFace.this)
.setAcceptsTapEvents(true)
.setHideHotwordIndicator(true)
.build());
calendar = Calendar.getInstance();
}
示例2: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
engine = this;
setWatchFaceStyle(new WatchFaceStyle.Builder(WatchFaceService.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.build());
Resources resources = WatchFaceService.this.getResources();
timeOffsetY = resources.getDimension(R.dimen.clock_offset_y);
dateOffsetY = resources.getDimension(R.dimen.offset_date_y);
lineOffsetY = resources.getDimension(R.dimen.offset_line_y);
currentWeatherOffsetY = resources.getDimension(R.dimen.offset_current_weather_y);
initPaint();
currentTime = Calendar.getInstance();
notifyHandheld();
}
示例3: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(
new WatchFaceStyle.Builder(ComplicationWatchFaceService.this)
.setAcceptsTapEvents(true)
.build());
mCalendar = Calendar.getInstance();
initializeBackground();
// TODO: Step 2, intro 3
initializeComplications();
initializeHands();
}
示例4: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(wearDripWatchFaceService.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setAmbientPeekMode(WatchFaceStyle.AMBIENT_PEEK_MODE_HIDDEN)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.setAcceptsTapEvents(true)
.build());
timeTick = new Handler(Looper.myLooper());
startTimerIfNecessary();
//watchFace = wearDripWatchFace.newInstance(wearDripWatchFaceService.this);
}
示例5: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
IntentFilter messageFilter = new IntentFilter(Intent.ACTION_SEND);
MessageReceiver messageReceiver = new MessageReceiver();
LocalBroadcastManager.getInstance(WatchFaceService.this).registerReceiver(messageReceiver, messageFilter);
setUpGoogleApiClient();
setWatchFaceStyle(new WatchFaceStyle.Builder(WatchFaceService.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setAmbientPeekMode(WatchFaceStyle.AMBIENT_PEEK_MODE_HIDDEN)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.build());
timeTick = new Handler(Looper.myLooper());
startTimerIfNecessary();
watchFace = WatchFace.newInstance(WatchFaceService.this);
}
示例6: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(MyWatchFaceService.this).build());
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(Color.BLACK);
final int backgroundResId = R.drawable.custom_background;
mBackgroundBitmap = BitmapFactory.decodeResource(getResources(), backgroundResId);
mHandPaint = new Paint();
mHandPaint.setColor(Color.WHITE);
mHandPaint.setStrokeWidth(STROKE_WIDTH);
mHandPaint.setAntiAlias(true);
mHandPaint.setStrokeCap(Paint.Cap.ROUND);
mHandPaint.setShadowLayer(SHADOW_RADIUS, 0, 0, Color.BLACK);
mHandPaint.setStyle(Paint.Style.STROKE);
mCalendar = Calendar.getInstance();
}
示例7: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(MyWatchFaceService.this).build());
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(Color.BLACK);
mHandPaint = new Paint();
mHandPaint.setColor(Color.WHITE);
mHandPaint.setStrokeWidth(STROKE_WIDTH);
mHandPaint.setAntiAlias(true);
mHandPaint.setStrokeCap(Paint.Cap.ROUND);
mCalendar = Calendar.getInstance();
}
示例8: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(MyWatchFaceService.this).build());
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(Color.BLACK);
final int backgroundResId = R.drawable.custom_background;
mBackgroundBitmap = BitmapFactory.decodeResource(getResources(), backgroundResId);
mHandPaint = new Paint();
mHandPaint.setColor(Color.WHITE);
mHandPaint.setStrokeWidth(STROKE_WIDTH);
mHandPaint.setAntiAlias(true);
mHandPaint.setStrokeCap(Paint.Cap.ROUND);
mCalendar = Calendar.getInstance();
}
示例9: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(AndelaWatchFace.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.build());
mCalendar = Calendar.getInstance();
initializeBackground();
initializeText();
initializeDate();
}
示例10: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder){
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(IOWatchFace.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setHotwordIndicatorGravity(Gravity.TOP | Gravity.RIGHT)
.setShowSystemUiTime(false)
.setAcceptsTapEvents(true)
.build());
Resources resources=IOWatchFace.this.getResources();
mBackgroundPaint=new Paint();
//mBackgroundPaint.setColor(0xFFFFFFFF);
mBackgroundPaint.setColor(0xFF000000);
paint=new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(1f*getResources().getDisplayMetrics().density);
paint.setColor(0xFFFFFFFF);
//paint.setStrokeCap(Paint.Cap.ROUND);
time=new Time();
}
示例11: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(MyWatchFace.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.setAcceptsTapEvents(true)
.build());
resources = MyWatchFace.this.getResources();
mYOffset = resources.getDimension(R.dimen.digital_y_offset);
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(resources.getColor(R.color.background));
mTextPaint = new Paint();
mTextPaint = createTextPaint(resources.getColor(R.color.digital_text));
battery = BitmapFactory.decodeResource(resources, R.drawable.battery);
mTime = new Time();
}
示例12: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(WatchFace.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setStatusBarGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL)
.setPeekOpacityMode(WatchFaceStyle.PEEK_OPACITY_MODE_TRANSLUCENT)
.setShowSystemUiTime(false)
.build());
resetColors();
mCalendar = Calendar.getInstance();
}
示例13: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(BitcoinWatchFaceService.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.build());
Resources resources = BitcoinWatchFaceService.this.getResources();
googleApiClient = new GoogleApiClient.Builder(getBaseContext())
.addApi(Wearable.API)
.build();
googleApiClient.connect();
Storage storage = new Storage(getBaseContext());
viewModelFactory = new WatchFaceViewModelFactory(storage, getBaseContext());
watchFaceTimer = new WatchFaceTimer(this, storage, googleApiClient);
drawer = new WatchFaceDrawer(resources);
}
示例14: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
setWatchFaceStyle(new WatchFaceStyle.Builder(HexWatchFaceService.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.build());
Resources resources = HexWatchFaceService.this.getResources();
mYOffset = resources.getDimension(R.dimen.y_offset);
mHexPaint = createTextPaint();
mHexPaint.setTextSize(resources.getDimension(R.dimen.text_size_time));
mDayPaint = createTextPaint();
mDayPaint.setFakeBoldText(true);
mDayPaint.setTextSize(resources.getDimension(R.dimen.text_size_date));
mDatePaint = createTextPaint();
mDatePaint.setTextSize(resources.getDimension(R.dimen.text_size_date));
mTime = new Time();
}
示例15: onCreate
import android.support.wearable.watchface.WatchFaceStyle; //导入依赖的package包/类
@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
mBackgroundBitMap = BitmapFactory.decodeResource(getResources(), R.drawable.custom_background);
setWatchFaceStyle(new WatchFaceStyle.Builder(MyWatchFaceService.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.build());
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(Color.BLACK);
mHandPaint = new Paint();
mHandPaint.setColor(Color.WHITE);
mHandPaint.setStrokeWidth(STROKE_WIDTH);
mHandPaint.setAntiAlias(true);
mHandPaint.setStrokeCap(Paint.Cap.ROUND);
mTime = new Time();
}