本文整理匯總了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;
}