• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java WatchFaceStyle类的典型用法和代码示例

java 11次浏览

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

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

示例1: onCreate

点赞 3

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();
        }
 

开发者ID:PacktPublishing,
项目名称:Android-Wear-Projects,
代码行数:26,
代码来源:PacktWatchFace.java

示例2: onCreate

点赞 3

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();
}
 

开发者ID:hieple7985,
项目名称:nano-go-ubiquitous,
代码行数:25,
代码来源:WatchFaceService.java

示例3: onCreate

点赞 3

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();
}
 

开发者ID:googlecodelabs,
项目名称:complications,
代码行数:19,
代码来源:ComplicationWatchFaceService.java

示例4: onCreate

点赞 3

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);

}
 

开发者ID:LadyViktoria,
项目名称:wearDrip,
代码行数:19,
代码来源:wearDripWatchFaceService.java

示例5: onCreate

点赞 3

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);
}
 

开发者ID:sahilandroid19,
项目名称:WearApp,
代码行数:22,
代码来源:WatchFaceService.java

示例6: onCreate

点赞 3

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();
}
 

开发者ID:googlecodelabs,
项目名称:watchface,
代码行数:23,
代码来源:MyWatchFaceService.java

示例7: onCreate

点赞 3

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();
}
 

开发者ID:googlecodelabs,
项目名称:watchface,
%


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)