本文整理汇总了Java中jonathanfinerty.once.Once.markDone方法的典型用法代码示例。如果您正苦于以下问题:Java Once.markDone方法的具体用法?Java Once.markDone怎么用?Java Once.markDone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jonathanfinerty.once.Once
的用法示例。
在下文中一共展示了Once.markDone方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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());
}
}
示例3: 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);
}
}
示例4: 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");
}
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: 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);
}
}
}
示例8: setUserVisibleHint
import jonathanfinerty.once.Once; //导入方法依赖的package包/类
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser && !Once.beenDone("firstPrevious")) {
getPrevLaunchData();
Once.markDone("firstPrevious");
}
}
示例9: 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);
}
}