當前位置: 首頁>>代碼示例>>Java>>正文


Java PostOffice類代碼示例

本文整理匯總了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());
    }
}
 
開發者ID:52inc,項目名稱:android-Showcase,代碼行數:17,代碼來源:HomePresenterImpl.java

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

}
 
開發者ID:r0adkll,項目名稱:PostOffice,代碼行數:17,代碼來源:MainApplication.java

示例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();

}
 
開發者ID:52inc,項目名稱:android-Showcase,代碼行數:30,代碼來源:ShowcaseApp.java

示例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;
}
 
開發者ID:52inc,項目名稱:android-Showcase,代碼行數:40,代碼來源:HomeActivity.java


注:本文中的com.r0adkll.postoffice.PostOffice類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。