/** * Animate to specified Activity * * @param to The class of the activity * @param finishFromActivity true: Finish the current activity * @param requestCode Request code for stating the activity, not waiting for result if null */ public void animateToActivity(Class to, Boolean finishFromActivity, Integer requestCode) { animateToActivity(new Intent(_activity, to), finishFromActivity, requestCode); }
public void showDialogWithHtmlTextView(@StringRes int resTitleId, String html) { showDialogWithHtmlTextView(resTitleId, html, true, null); }
@Override @SuppressWarnings({"ConstantConditions", "ConstantIfStatement", "StatementWithEmptyBody"}) public Boolean onPreferenceClicked(Preference preference) { ActivityUtils au = new ActivityUtils(getActivity()); if (isAdded() && preference.hasKey()) { switch (keyToStringResId(preference)) { au.animateToActivity(SettingsActivity.class, false, 124); return true; au.showDialogWithHtmlTextView(R.string.licenses, new SimpleMarkdownParser().parse( getResources().openRawResource(R.raw.license), "", SimpleMarkdownParser.FILTER_ANDROID_TEXTVIEW).getHtml()); au.showDialogWithHtmlTextView(R.string.licenses, new SimpleMarkdownParser().parse( getResources().openRawResource(R.raw.licenses_3rd_party), "", SimpleMarkdownParser.FILTER_ANDROID_TEXTVIEW).getHtml()); au.openWebpageInExternalBrowser(getString(R.string.app_contributors_url)); return true; au.openWebpageInExternalBrowser(getString(R.string.app_changelog_url)); return true;
/** * Animate to Activity specified in intent * Requires animation resources * * @param intent Intent to open start an activity * @param finishFromActivity true: Finish the current activity * @param requestCode Request code for stating the activity, not waiting for result if null */ public void animateToActivity(Intent intent, Boolean finishFromActivity, Integer requestCode) { intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); if (requestCode != null) { _activity.startActivityForResult(intent, requestCode); } else { _activity.startActivity(intent); } _activity.overridePendingTransition(getResId(ResType.DIMEN, "fadein"), getResId(ResType.DIMEN, "fadeout")); if (finishFromActivity != null && finishFromActivity) { _activity.finish(); } }