• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Once类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    @SuppressWarnings("unused")
    boolean enterGuide = !Once.beenDone(Once.THIS_APP_INSTALL, VCommends.TAG_NEW_VERSION);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    VUiKit.defer().when(() -> {
        if (!Once.beenDone("collect_flurry")) {
            FlurryROMCollector.startCollect();
            Once.markDone("collect_flurry");
        }
        long time = System.currentTimeMillis();
        VirtualCore.get().waitForEngine();
        time = System.currentTimeMillis() - time;
        long delta = 1000L - time;
        if (delta > 0) {
            VUiKit.sleep(delta);
        }
    }).done((res) -> {
        HomeActivity.goHome(this);
        finish();
    });
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:26,代码来源:SplashActivity.java


示例2: onPreferenceClick

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public boolean onPreferenceClick(Preference preference) {
    String key = preference.getKey();
    //用if判断 效率不会很好 待改善
    if (key.equals(getString(R.string.preference_key_wechat_helper))) {
        final String showWhatsNew = "showWhatsWeChatHelper";
        if (!Once.beenDone(Once.THIS_APP_VERSION, showWhatsNew)) {
            DialogUtil.showSinglePointDialog(getActivity(), mContext.getString(R.string.about_wechat_helper), mContext.getString(R.string.dialog_know), new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    Once.markDone(showWhatsNew);
                    mHelper.checkDownloadListDialog(false);
                }
            });
        }else{
            mHelper.checkDownloadListDialog(false);
        }


    }
    if (key.equals(getString(R.string.preference_key_open_wechat_download))) {

    }
    return false;
}
 
开发者ID:maoruibin,项目名称:AppPlus,代码行数:26,代码来源:WechatHelperFragment.java


示例3: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);

    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction()
                .replace(R.id.container, new FragmentSettings(), FragmentSettings.TAG)
                .commit();
    }

    final boolean hasPermissions = PermissionCheck.hasPermissions(this, REQUIRED_PERMISSIONS);

    if (!Once.beenDone(KEY_SHOW_TUTORIAL)
            || Is.greaterThanOrEqual(MARSHMALLOW) && !hasPermissions) {

        Once.markDone(KEY_SHOW_TUTORIAL);

        Intent intent = new Intent(this, ActivityTutorial.class);
        startActivity(intent);
    }
}
 
开发者ID:ToxicBakery,项目名称:Screenshot-Redaction,代码行数:23,代码来源:ActivitySettings.java


示例4: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    // Install Timber
    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
    }

    Once.initialise(this);
    screenShotNotifications = new ScreenShotNotifications(this);

    Observable.just(true)
            .subscribeOn(AndroidSchedulers.mainThread())
            .subscribe(new Action1<Boolean>() {
                @Override
                public void call(Boolean aBoolean) {
                    initializeResources();
                }
            });
}
 
开发者ID:ToxicBakery,项目名称:Screenshot-Redaction,代码行数:22,代码来源:ScreenshotApplication.java


示例5: initializeResources

import jonathanfinerty.once.Once; //导入依赖的package包/类
void initializeResources() {
    if (!Once.beenDone(REMOVE_OLD_DIR)) {
        Once.markDone(REMOVE_OLD_DIR);

        File externalFilesDir = getApplicationContext().getExternalFilesDir(null);
        if (externalFilesDir != null
                && externalFilesDir.exists()
                && !externalFilesDir.delete()) {

            Log.e(TAG, "Failed to delete external storage directory");
        }
    }

    if (Is.lessThan(MARSHMALLOW) || PermissionCheck.hasPermissions(getApplicationContext(), PERMISSIONS)) {
        new CopyToSdCard()
                .copy(new TessDataRawResourceCopyConfiguration(getApplicationContext(), R.raw.eng));

        DictionaryEnglish.getInstance(getApplicationContext());
        DictionaryEnglishNames.getInstance(getApplicationContext());
        ScreenshotService.startScreenshotService(getApplicationContext());
    }
}
 
开发者ID:ToxicBakery,项目名称:Screenshot-Redaction,代码行数:23,代码来源:ScreenshotApplication.java


示例6: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    if (BuildConfig.DEBUG) {
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .penaltyDeath()
                .build());

        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .penaltyDeath()
                .build());
    }

    Once.initialise(this);
}
 
开发者ID:jonfinerty,项目名称:Once,代码行数:21,代码来源:ExampleApplication.java


示例7: start

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public void start() {
    dataChanged();
    if (!Once.beenDone(VCommends.TAG_SHOW_ADD_APP_GUIDE)) {
        mView.showGuide();
        Once.markDone(VCommends.TAG_SHOW_ADD_APP_GUIDE);
    }
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:9,代码来源:HomePresenterImpl.java


示例8: onStop

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
protected void onStop() {
    super.onStop();
    if (!Once.beenDone(Once.THIS_APP_VERSION, "update")) {
        final GcmNetworkManager manager = GcmNetworkManager.getInstance(this);
        if (mPrefsModel.isBackgroundUpdateServiceEnabled())
            manager.schedule(TimelineUpdateService.create(mPrefsModel.backgroundUpdateInterval() / 1000));
        manager.schedule(AccountUpdateService.create());
        Once.markDone("update");
    }
}
 
开发者ID:mecid,项目名称:robird-reborn,代码行数:12,代码来源:HomeActivity.java


示例9: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    Analytics.setup(this);
    Once.initialise(this);
    Inject.using(new DefaultDependencyFactory(this));

    if (BuildConfig.DEBUG)
        Timber.plant(new Timber.DebugTree());
    else
        Timber.plant(new Analytics.YandexMeticaTree());
}
 
开发者ID:mecid,项目名称:robird-reborn,代码行数:14,代码来源:RobirdApplication.java


示例10: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    sDb = LiteOrm.newSingleInstance(this, DB_NAME);
    sContext = this;
    Once.initialise(this);
    Logger.init("AppPlusLog").setLogLevel(BuildConfig.IS_DEBUG?LogLevel.FULL:LogLevel.NONE);
    sDb.setDebugged(BuildConfig.IS_DEBUG);
}
 
开发者ID:maoruibin,项目名称:AppPlus,代码行数:10,代码来源:App.java


示例11: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/GothamRnd-Book.otf")
                    .setFontAttrId(R.attr.fontPath)
                    .build());
    mCheckoutInternal = new CheckoutInternal(this, Products.create().add(ProductTypes.IN_APP,
            IabProducts.PRODUCT_LIST));
    Once.initialise(this);
}
 
开发者ID:shaobin0604,项目名称:HeartbeatFixerForGCM,代码行数:12,代码来源:HeartbeatFixerForGcmApp.java


示例12: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    requestCheckout();
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar_actionbar));

    if (!Once.beenDone(Once.THIS_APP_INSTALL, ONCE_TAG_CLICK_AD)) {
        final View adView = findViewById(R.id.ll_ad);
        adView.setVisibility(View.VISIBLE);
        adView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                v.setVisibility(View.GONE);
                Once.markDone(ONCE_TAG_CLICK_AD);
                PlayStoreUtils.launchAppDetailPage(MainActivity.this, "com.insgot.ins", false);
            }
        });
    }

    if (savedInstanceState == null) {
        SettingsFragment fragment = new SettingsFragment();
        fragment.setRetainInstance(false);
        getFragmentManager().beginTransaction()
                .add(R.id.container, fragment)
                .commit();
    }
}
 
开发者ID:shaobin0604,项目名称:HeartbeatFixerForGCM,代码行数:29,代码来源:MainActivity.java


示例13: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
public void onCreate() {
        super.onCreate();
        sContext = this;
        Once.initialise(this);
        initRongIM();
        ImageHelper.initImageLoader(getApplicationContext());
        SmsSdkHelper.initSmsSDK(getApplicationContext());
        if ("com.cuitrip.service".equals(getCurProcessName(getApplicationContext())) ||
                "io.rong.push".equals(getCurProcessName(getApplicationContext()))) {

            initRongIM();
            /**
             * 融云SDK事件监听处理
             *
             * 注册相关代码,只需要在主进程里做。
             */
            if ("com.cuitrip.service".equals(getCurProcessName(getApplicationContext()))) {
                initRongImCallback();
//                RongCloudEvent.init(this);
//                DemoContext.init(this);
//                Thread.setDefaultUncaughtExceptionHandler(new RongExceptionHandler(this));
//                try {
//                    RongIM.registerMessageType(DeAgreedFriendRequestMessage.class);
//                    RongIM.registerMessageTemplate(new DeContactNotificationMessageProvider());
////                RongIM.registerMessageTemplate(new DeAgreedFriendRequestMessageProvider());
//
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
            }
        }
        init();
        initStictMode();
    }
 
开发者ID:MoonRune,项目名称:CuiTrip,代码行数:35,代码来源:MainApplication.java


示例14: call

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public void call(CopyToSdCard.ICopyConfiguration copyConfig) {
    long startTime = System.currentTimeMillis();
    OutputStream outputStream = null;
    InputStream inputStream = null;

    try {
        // Dumb evaluate source/target on size
        File target = copyConfig.getTarget();
        long originSize = copyConfig.getSize();
        long targetSize = target.exists() ? target.length() : -1;

        if (originSize == targetSize
                && Once.beenDone(THIS_APP_VERSION, target.getPath())) {

            Log.d(TAG, "Skipping copy of " + target.getName());
        } else {
            Log.d(TAG, "Copying " + target.getName());

            Once.markDone(target.getPath());

            inputStream = copyConfig.getCopyStream();
            outputStream = new FileOutputStream(target);
            IOUtils.copyLarge(inputStream, outputStream);
            outputStream.flush();
        }

        Log.d(TAG, "Completed copying " + target.getName() + " in ~" + (System.currentTimeMillis() - startTime));
    } catch (Exception e) {
        Log.e(TAG, "Failed to copy file.", e);
    } finally {
        IOUtils.closeQuietly(inputStream);
        IOUtils.closeQuietly(outputStream);

        copyBus.post(copyConfig);
    }
}
 
开发者ID:ToxicBakery,项目名称:Screenshot-Redaction,代码行数:38,代码来源:CopyAction.java


示例15: onResume

import jonathanfinerty.once.Once; //导入依赖的package包/类
public void onResume() {
    super.onResume();
    if (rate != null) {
        rate.count();
    }
    if (BuildConfig.DEBUG) {
        showRemainingCount();
    }

    if (!Once.beenDone(Once.THIS_APP_VERSION, "showChangelog")) {
        if (!rate.isShown()) {
            Once.markDone("showChangelog");
            final Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    showChangelogSnackbar();
                }
            }, 1000);
        }
    }
    if (getSharedPreferences("theme_changed", 0).getBoolean("recreate", false)) {
        SharedPreferences.Editor editor = getSharedPreferences("theme_changed", 0).edit();
        editor.putBoolean("recreate", false);
        editor.apply();
        recreate();
    }

    if (listPreferences.isNightModeActive(this)) {
        switchPreferences.setNightModeStatus(true);
        statusColor = ContextCompat.getColor(context, R.color.darkPrimary_dark);
    } else {
        switchPreferences.setNightModeStatus(false);
        statusColor = ContextCompat.getColor(context, R.color.colorPrimaryDark);
    }
}
 
开发者ID:ItsCalebJones,项目名称:SpaceLaunchNow-Android,代码行数:37,代码来源:MainActivity.java


示例16: onActivityResult

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // Check which request we're responding to
    if (requestCode == SHOW_INTRO) {
        // Make sure the request was successful
        if (resultCode == RESULT_OK) {
            Once.markDone("showTutorial");
            navigate(mNavItemId);
        }
    }
}
 
开发者ID:ItsCalebJones,项目名称:SpaceLaunchNow-Android,代码行数:12,代码来源:MainActivity.java


示例17: setUserVisibleHint

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
    super.setUserVisibleHint(isVisibleToUser);
    if (isVisibleToUser && !Once.beenDone("firstPrevious")) {
        getPrevLaunchData();
        Once.markDone("firstPrevious");
    }
}
 
开发者ID:ItsCalebJones,项目名称:SpaceLaunchNow-Android,代码行数:9,代码来源:PreviousLaunchesFragment.java


示例18: onCreate

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Once.initialise(getApplicationContext());

    if (!Once.beenDone(KEY)) {
        Once.toDo(KEY);
    }
    if (!Once.beenDone(KEY2)) {
        Once.toDo(KEY2);
    }
}
 
开发者ID:Piasy,项目名称:AndroidPlayground,代码行数:15,代码来源:MainActivity.java


示例19: onResume

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();

    if (Once.needToDo(KEY)) {
        Log.d(KEY, "needToDo");
        Once.markDone(KEY);
    }
    if (Once.needToDo(KEY2)) {
        Log.d(KEY, "needToDo2");
        Once.markDone(KEY2);
    }
}
 
开发者ID:Piasy,项目名称:AndroidPlayground,代码行数:14,代码来源:MainActivity.java


示例20: onLogoutEvent

import jonathanfinerty.once.Once; //导入依赖的package包/类
@Subscribe
public void onLogoutEvent(LogoutEvent event) {
    List<CloudAppItem> cloudAppItems = SugarRecord.listAll(CloudAppItem.class);
    SugarRecord.deleteInTx(cloudAppItems);
    Once.clearAll();
    CloudAppItem.executeQuery("DELETE FROM sqlite_sequence WHERE NAME = 'CLOUD_APP_ITEM'");
    CloudAppItem.executeQuery("VACUUM");
}
 
开发者ID:tevjef,项目名称:Vapor,代码行数:9,代码来源:DataManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MultipleOutputs类代码示例发布时间:2022-05-22
下一篇:
Java ScriptPlugin类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap