本文整理汇总了Java中net.gsantner.opoc.util.ActivityUtils类的典型用法代码示例。如果您正苦于以下问题:Java ActivityUtils类的具体用法?Java ActivityUtils怎么用?Java ActivityUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActivityUtils类属于net.gsantner.opoc.util包,在下文中一共展示了ActivityUtils类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
//applyTextFormat(TextFormat.FORMAT_PLAIN);
setupAppearancePreferences();
if (savedInstanceState != null && savedInstanceState.containsKey(SAVESTATE_DOCUMENT)) {
_document = (Document) savedInstanceState.getSerializable(SAVESTATE_DOCUMENT);
}
_document = loadDocument();
loadDocumentIntoUi();
if (savedInstanceState != null && savedInstanceState.containsKey(SAVESTATE_CURSOR_POS)) {
int cursor = savedInstanceState.getInt(SAVESTATE_CURSOR_POS);
if (cursor >= 0 && cursor < _hlEditor.length()) {
_hlEditor.setSelection(cursor);
}
}
new ActivityUtils(getActivity()).hideSoftKeyboard();
AppSettings appSettings = new AppSettings(_context);
_hlEditor.clearFocus();
_hlEditor.setLineSpacing(0, appSettings.getEditorLineSpacing());
}
示例2: onClick
import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
@OnClick({R.id.more__fragment__action_about, R.id.more__fragment__action_contribute, R.id.more__fragment__action_donate, R.id.more__fragment__action_settings})
public void onClick(View view) {
ActivityUtils au = new ActivityUtils(getActivity());
switch (view.getId()) {
case R.id.more__fragment__action_settings: {
au.animateToActivity(SettingsActivity.class, false, 124);
break;
}
case R.id.more__fragment__action_about: {
au.animateToActivity(AboutActivity.class, false, 123);
break;
}
case R.id.more__fragment__action_donate: {
au.openWebpageInExternalBrowser(getString(R.string.url_donate));
break;
}
case R.id.more__fragment__action_contribute: {
au.openWebpageInExternalBrowser(getString(R.string.url_contribute));
break;
}
}
}
示例3: checkPermissionResult
import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
public static boolean checkPermissionResult(final Activity activity, int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == 314) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
return true;
}
}
new ActivityUtils(activity).showSnackBar(R.string.error_storage_permission, true);
return false;
}
示例4: mkSaveDir
import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
public static boolean mkSaveDir(Activity activity) {
File saveDir = AppSettings.get().getNotebookDirectory();
if (!saveDir.exists() && !saveDir.mkdirs()) {
new ActivityUtils(activity).showSnackBar(R.string.error_cannot_create_notebook_dir, false);
return false;
}
return true;
}
示例5: handleBarClick
import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
public boolean handleBarClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_settings: {
new ActivityUtils(this).animateToActivity(SettingsActivity.class, false, null);
return true;
}
case R.id.action_login: {
loadWebapp(true);
return true;
}
case R.id.action_info: {
startActivity(new Intent(this, AboutActivity.class));
return true;
}
case R.id.action_exit: {
webView.clearCache(true);
webView.clearFormData();
webView.clearHistory();
webView.clearMatches();
webView.clearSslPreferences();
finish();
if (getResources().getBoolean(R.bool.should_exit_with_system_too)) {
System.exit(0);
}
return true;
}
case R.id.action_reload: {
WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags ^= WindowManager.LayoutParams.FLAG_FULLSCREEN;
getWindow().setAttributes(attrs);
webView.reload();
return true;
}
case R.id.action_donate: {
ContextUtils.get().openWebpageInExternalBrowser(getString(R.string.donate__url));
return true;
}
case R.id.action_homepage_additional: {
ContextUtils.get().openWebpageInExternalBrowser(getString(R.string.page_additional_homepage));
return true;
}
case R.id.action_homepage_author: {
ContextUtils.get().openWebpageInExternalBrowser(getString(R.string.page_author));
return true;
}
}
return false;
}