本文整理汇总了Java中android.support.wearable.view.DelayedConfirmationView类的典型用法代码示例。如果您正苦于以下问题:Java DelayedConfirmationView类的具体用法?Java DelayedConfirmationView怎么用?Java DelayedConfirmationView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DelayedConfirmationView类属于android.support.wearable.view包,在下文中一共展示了DelayedConfirmationView类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getIntent() != null) {
String action = getIntent().getAction();
if (ACTION_CLOSE_SUNROOF.equals(action)) {
mActionMode = ACTION_MODE_CLOSE_SUNROOF;
} else if (ACTION_LOCK_DOOR.equals(action)) {
mActionMode = ACTION_MODE_LOCK_DOOR;
} else if (ACTION_START_CHARGING.equals(action)) {
mActionMode = ACTION_MODE_START_CHARGING;
}
}
setContentView(R.layout.activity_notification_confirmation);
mDelayedConfirmation = (DelayedConfirmationView) findViewById(R.id.delayed_confirm);
mConfirmationText = (TextView) findViewById(R.id.confirmation_text);
initView();
}
示例2: onCreate
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_delete);
mDelayedConfirmationView = (DelayedConfirmationView) findViewById(R.id.delayed_confirmation);
mDelayedConfirmationView.setListener(this);
mDelayedConfirmationView.setTotalTimeMs(3000);
mDelayedConfirmationView.start();
}
示例3: onCreate
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_confirmation);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
mGoogleApiClient.connect();
mDelayedView = (DelayedConfirmationView) findViewById(R.id.delayed_confirm);
mDelayedView.setListener(this);
routeGradeLabelToSave = getIntent().getStringExtra(ClimbTrackerWear.EXTRA_ROUTE_GRADE_LABEL);
// change the recap text
TextView climbRecapText = (TextView) findViewById(R.id.climb_recap);
String recapString = getString(R.string.climb_recap, routeGradeLabelToSave);
climbRecapText.setText(recapString);
// Four seconds to cancel the action
mDelayedView.setTotalTimeMs(4000);
// Start the timer
mDelayedView.start();
}
示例4: onCreateView
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
// Inflate and customize the UI from its XML layout definition
final View view = inflater.inflate(R.layout.fragment_view, container, false);
mConfirmationView = (DelayedConfirmationView)
view.findViewById(R.id.delayed_confirm);
mConfirmationView.setImageDrawable(getResources().
getDrawable(R.drawable.ic_close_door));
mTextView = (TextView) view.findViewById(R.id.label);
mTextView.setText("Fechar Porta");
return view;
}
示例5: onCreateView
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
// Inflate and customize the UI from its XML layout definition
final View view = inflater.inflate(R.layout.fragment_view, container, false);
mConfirmationView = (DelayedConfirmationView)
view.findViewById(R.id.delayed_confirm);
mConfirmationView.setImageDrawable(getResources().
getDrawable(R.drawable.ic_open_door));
mTextView = (TextView) view.findViewById(R.id.label);
mTextView.setText("Abrir Porta");
return view;
}
示例6: onCreate
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_annotate_smoking);
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
final Annotate me = this;
final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub watchViewStub) {
delayedConfirmationView = (DelayedConfirmationView) findViewById(R.id.delayed_confirmation);
delayedConfirmationView.setListener(me);
delayedConfirmationView.setTotalTimeMs(NUM_SECONDS * 1000);
delayedConfirmationView.start();
}
});
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addOnConnectionFailedListener(this)
.build();
}
示例7: onCreate
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
public void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.main_activity);
delayedConfirmationView = (DelayedConfirmationView) findViewById(R.id.delayed_confirmation);
delayedConfirmationView.setTotalTimeMs(NUM_SECONDS * 1000);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addOnConnectionFailedListener(this)
.build();
}
示例8: onTimerSelected
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
public void onTimerSelected(View v) {
v.setPressed(true);
Notification notification = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(getString(R.string.notification_title))
.setContentText(getString(R.string.notification_timer_selected))
.build();
NotificationManagerCompat.from(this).notify(0, notification);
sendMessageToCompanion(TIMER_SELECTED_PATH);
// Prevent onTimerFinished from being heard.
((DelayedConfirmationView) v).setListener(null);
finish();
}
示例9: onStartTimer
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
/**
* Handles the button to start a DelayedConfirmationView timer.
*/
public void onStartTimer(View view) {
DelayedConfirmationView delayedConfirmationView = (DelayedConfirmationView)
findViewById(R.id.timer);
delayedConfirmationView.setTotalTimeMs(NUM_SECONDS * 1000);
delayedConfirmationView.setListener(this);
delayedConfirmationView.start();
scroll(View.FOCUS_DOWN);
}
示例10: onCreateView
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_add_note, container, false);
mConfirmationView = (DelayedConfirmationView) view.findViewById(R.id.confirm_notes);
mAddNotesTextView = (TextView) view.findViewById(R.id.add_notes_label);
return view;
}
示例11: onCreateView
import android.support.wearable.view.DelayedConfirmationView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_buy_book, container, false);
mConfirmationView = (DelayedConfirmationView) view.findViewById(R.id.confirm_buy);
return view;
}