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


Java PublishMode类代码示例

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


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

示例1: onStartCommand

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (mLiveCard == null) {
        mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_TAG);

        mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(mTimerDrawer);

        Intent menuIntent = new Intent(this, MenuActivity.class);
        menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));

        mLiveCard.publish(PublishMode.REVEAL);
        
        mTimerDrawer.getTimer().start();
    } else {
        // TODO(alainv): Jump to the LiveCard when API is available.
    }

    return START_STICKY;
}
 
开发者ID:freethejazz,项目名称:gdk-pomodoro,代码行数:21,代码来源:PomoService.java

示例2: onStartCommand

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (mLiveCard == null) {
        mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_ID);
        mRenderer = new OrientationRecorderRenderer(this, recordingOrientationManager);

        LiveCard direct = mLiveCard.setDirectRenderingEnabled(true);
        direct.getSurfaceHolder().addCallback(mRenderer);
        direct.getSurfaceHolder().setKeepScreenOn(true);

        // Display the options menu when the live card is tapped.
        Intent menuIntent = new Intent(this, OrientationRecorderMenuActivity.class);
        menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));
        
        mLiveCard.publish(PublishMode.REVEAL);
    }
    
    SharedPreferences prefs =
                    getSharedPreferences(PREFERENCES_NAME, MODE_PRIVATE);
    int uom = prefs.getInt(PREFS_UOM_KEY, OrientationRecorderView.UOM_DEFAULT);
    mRenderer.setUom(uom);

    return START_STICKY;
}
 
开发者ID:euedge,项目名称:orientation-recorder,代码行数:26,代码来源:OrientationRecorderService.java

示例3: onStartCommand

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (mLiveCard == null) {
        Log.d(TAG, "Publishing LiveCard");
        mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_TAG);

        // Keep track of the callback to remove it before unpublishing.
        mCallback = new ScouterDrawer(this);
        mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(mCallback);

        Intent menuIntent = new Intent(this, MenuActivity.class);
        menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));

        mLiveCard.publish(PublishMode.REVEAL);
        Log.d(TAG, "Done publishing LiveCard");
    } else {
        // TODO(alainv): Jump to the LiveCard when API is available.
    }

    return START_STICKY;
}
 
开发者ID:klange,项目名称:glass-scouter,代码行数:23,代码来源:ScouterService.java

示例4: onStartCommand

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (mLiveCard == null) {
        mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_ID);
        mRenderer = new LineRenderer(this, mOrientationManager, mLandmarks);

        mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(mRenderer);

        // Display the options menu when the live card is tapped.
        Intent menuIntent = new Intent(this, LineMenuActivity.class);
        menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));

        mLiveCard.publish(PublishMode.REVEAL);
    }

    return START_STICKY;
}
 
开发者ID:luisibanez,项目名称:gdk-line-sample,代码行数:19,代码来源:CompassService.java

示例5: onStartCommand

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (mLiveCard == null) {
        mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_ID);
        mRenderer = new CompassRenderer(this, mOrientationManager, mLandmarks);

        mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(mRenderer);

        // Display the options menu when the live card is tapped.
        Intent menuIntent = new Intent(this, CompassMenuActivity.class);
        menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));

        mLiveCard.publish(PublishMode.REVEAL);
    }

    return START_STICKY;
}
 
开发者ID:longzheng,项目名称:PTVGlass,代码行数:19,代码来源:CompassService.java

示例6: onStartCommand

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (mLiveCard == null) {
        Log.d(TAG, "Publishing LiveCard");
        mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_TAG);

        // Keep track of the callback to remove it before unpublishing.
        mCallback = new ChronometerDrawer(this);
        mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(mCallback);

        Intent menuIntent = new Intent(this, MenuActivity.class);
        menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));

        mLiveCard.publish(PublishMode.REVEAL);
        Log.d(TAG, "Done publishing LiveCard");
    } else {
        // TODO(alainv): Jump to the LiveCard when API is available.
    }

    return START_STICKY;
}
 
开发者ID:longzheng,项目名称:PTVGlass,代码行数:23,代码来源:StopwatchService.java

示例7: onStartCommand

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (mLiveCard == null) {
        mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_TAG);

        mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(mTimerDrawer);

        Intent menuIntent = new Intent(this, MenuActivity.class);
        menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));

        mLiveCard.publish(PublishMode.REVEAL);
    } else {
        // TODO(alainv): Jump to the LiveCard when API is available.
    }

    return START_STICKY;
}
 
开发者ID:longzheng,项目名称:PTVGlass,代码行数:19,代码来源:TimerService.java

示例8: startNewTimer

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
/** Starts a new {@link Timer}/{@link LiveCard} combination with the provided duration. */
public Timer startNewTimer(long durationMillis) {
    Timer timer = new Timer(durationMillis);
    TimerDrawer drawer = new TimerDrawer(mContext, timer);
    LiveCard liveCard = new LiveCard(mContext, timer.toString());

    liveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(drawer);
    liveCard.setVoiceActionEnabled(true);

    Intent menuIntent = new Intent(mContext, MenuActivity.class);
    menuIntent.setData(Uri.parse("glass.timer:" + timer.hashCode()));
    menuIntent.putExtra(TimerService.EXTRA_TIMER_HASH_CODE, timer.hashCode());
    liveCard.setAction(PendingIntent.getActivity(mContext, 0, menuIntent, 0));
    if (mContext instanceof Service) {
        liveCard.attach((Service) mContext);
    }
    liveCard.publish(PublishMode.REVEAL);
    timer.start();

    mTimers.put(timer, liveCard);
    return timer;
}
 
开发者ID:googleglass,项目名称:gdk-timer-sample,代码行数:23,代码来源:TimerLiveCardManager.java

示例9: onStartCommand

import com.google.android.glass.timeline.LiveCard.PublishMode; //导入依赖的package包/类
@Override
    public int onStartCommand(final Intent intent, final int flags,
            final int startId) {
        if (this.mLiveCard == null) {
            Log.d(LocationService.TAG, "Publishing LiveCard");
//            this.mLiveCard = this.mTimelineManager
//                    .createLiveCard(LocationService.LIVE_CARD_TAG);

            // Keep track of the callback to remove it before unpublishing.
            this.mCallback = new ChronometerDrawer(this);
            this.mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder()
                    .addCallback(this.mCallback);

            final Intent menuIntent = new Intent(this, MenuActivity.class);
            menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                    | Intent.FLAG_ACTIVITY_CLEAR_TASK);
            this.mLiveCard.setAction(PendingIntent.getActivity(this, 0,
                    menuIntent, 0));

            this.mLiveCard.publish(PublishMode.REVEAL);
            Log.d(LocationService.TAG, "Done publishing LiveCard");
        } else {
            // TODO(alainv): Jump to the LiveCard when API is available.
        }

        return Service.START_STICKY;
    }
 
开发者ID:jaredsburrows,项目名称:open-quartz,代码行数:28,代码来源:LocationService.java


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