本文整理汇总了Java中com.r0adkll.postoffice.PostOffice类的典型用法代码示例。如果您正苦于以下问题:Java PostOffice类的具体用法?Java PostOffice怎么用?Java PostOffice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostOffice类属于com.r0adkll.postoffice包,在下文中一共展示了PostOffice类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onVideoSelected
import com.r0adkll.postoffice.PostOffice; //导入依赖的package包/类
@Override
public void onVideoSelected(Video video) {
if(mVideoLockPreference.isSet()){
mView.getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Intent service = new Intent(mView.getActivity(), KioskService.class);
service.putExtra(KioskService.EXTRA_CONTENT_PATH, video.file);
mView.getActivity().startService(service);
}else{
PostOffice.newAlertMail(mView.getActivity(),
getString(R.string.no_security_title),
getString(R.string.no_security_msg))
.show(mView.getActivity().getFragmentManager());
}
}
示例2: onCreate
import com.r0adkll.postoffice.PostOffice; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Stamp stamp = new Stamp.Builder(this)
.setDesign(Design.MATERIAL_LIGHT)
.setThemeColorResource(R.color.blue_500)
.setShowKeyboardOnLaunch(true)
.setCanceledOnTouchOutside(true)
.setCancelable(true)
.setIcon(R.drawable.ic_launcher)
.build();
PostOffice.lick(stamp);
}
示例3: onCreate
import com.r0adkll.postoffice.PostOffice; //导入依赖的package包/类
@Override
public void onCreate() {
if(BuildConfig.DEBUG){
Timber.plant(new Timber.DebugTree());
Timber.plant(new CrashlyticsTree(this));
}else{
Timber.plant(new CrashlyticsTree(this));
}
// Initialize PostOffice
PostOffice.lick(new Stamp.Builder(this)
.setCancelable(true)
.setCanceledOnTouchOutside(true)
.setDesign(Design.MATERIAL_LIGHT)
.setThemeColorResource(R.color.accent)
.build());
// Intialize Ollie
Ollie.with(this)
.setName(DB_NAME)
.setVersion(DB_VERSION)
.setLogLevel(BuildConfig.DEBUG ? Ollie.LogLevel.FULL : Ollie.LogLevel.NONE)
.init();
// Build and Inject Dagger Object Graph
buildObjectGraphAndInject();
}
示例4: onActionItemClicked
import com.r0adkll.postoffice.PostOffice; //导入依赖的package包/类
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
switch (item.getItemId()){
case R.id.action_delete:
// Get the list of selected items
SparseArray<Video> checked = getSelectedItems();
// Remove all from array of list, then delete the item
for(int i=0; i<checked.size(); i++){
mVideos.remove(checked.valueAt(i));
}
mAdapter.notifyDataSetChanged();
// Delete them
mPresenter.deleteVideos(checked);
mode.finish();
return true;
case R.id.action_info:
SparseArray<Video> items = getSelectedItems();
if(items.size() == 1){
Video vid = items.valueAt(0);
// Show dialog with information about the video
// Get Metadata on video
File videoFile = new File(vid.file);
PostOffice.newMail(HomeActivity.this)
.setDesign(Design.MATERIAL_LIGHT)
.setTitle(videoFile.getName())
.setMessage(Tools.getFormattedVideoMetadata(vid.file))
.show(getFragmentManager());
}
mode.finish();
return true;
}
return false;
}