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