use of com.moez.QKSMS.ui.dialog.mms.MMSSetupFragment in project qksms by moezbhatti.
the class MainActivity method beginMmsSetup.
private void beginMmsSetup() {
if (!mPrefs.getBoolean(MMS_SETUP_DONT_ASK_AGAIN, false) && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMSC_URL, "")) && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMS_PROXY, "")) && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMS_PORT, ""))) {
// Launch the MMS setup fragment here. This is a series of dialogs that will guide the
// user through the MMS setup process.
FragmentManager manager = getFragmentManager();
if (manager.findFragmentByTag(MMSSetupFragment.TAG) == null) {
MMSSetupFragment f = new MMSSetupFragment();
Bundle args = new Bundle();
args.putBoolean(MMSSetupFragment.ARG_ASK_FIRST, true);
args.putString(MMSSetupFragment.ARG_DONT_ASK_AGAIN_PREF, MMS_SETUP_DONT_ASK_AGAIN);
f.setArguments(args);
getFragmentManager().beginTransaction().add(f, MMSSetupFragment.TAG).commit();
}
}
}
use of com.moez.QKSMS.ui.dialog.mms.MMSSetupFragment in project qksms by moezbhatti.
the class SettingsFragment method onPreferenceClick.
@Override
public boolean onPreferenceClick(Preference preference) {
String key = preference.getKey() != null ? preference.getKey() : "";
AnalyticsManager.getInstance().sendEvent(AnalyticsManager.CATEGORY_PREFERENCE_CLICK, key, null);
// Categories
int resId = 0;
switch(key) {
case CATEGORY_APPEARANCE:
resId = R.xml.settings_appearance;
break;
case CATEGORY_GENERAL:
resId = R.xml.settings_general;
break;
case CATEGORY_NOTIFICATIONS:
resId = R.xml.settings_notifications;
break;
case CATEGORY_MMS:
resId = R.xml.settings_mms;
break;
case CATEGORY_QUICKREPLY:
resId = R.xml.settings_quickreply;
break;
case CATEGORY_QUICKCOMPOSE:
resId = R.xml.settings_quickcompose;
break;
case CATEGORY_ABOUT:
resId = R.xml.settings_about;
break;
}
if (resId != 0) {
Fragment fragment = SettingsFragment.newInstance(resId);
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.content_frame, fragment, CATEGORY_TAG).commit();
}
switch(key) {
case THEME:
ThemeManager.showColorPickerDialog(mContext);
break;
case ICON:
ThemeManager.setIcon(mContext);
break;
case BUBBLES:
new BubblePreferenceDialog().setContext(mContext).show();
break;
case BLOCKED_FUTURE:
BlockedNumberDialog.showDialog(mContext);
break;
case SHOULD_I_ANSWER:
final String packageName = "org.mistergroup.muzutozvednout";
if (!PackageUtils.isAppInstalled(mContext, packageName)) {
String referrer = "referrer=utm_source%3Dqksms%26utm_medium%3Dapp%26utm_campaign%3Dqksmssettings";
new QKDialog().setContext(mContext).setTitle(R.string.dialog_should_i_answer_title).setMessage(R.string.dialog_should_i_answer_message).setNegativeButton(R.string.cancel, null).setPositiveButton(R.string.okay, v -> {
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName + "&" + referrer)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName + "&" + referrer)));
}
}).show();
new Handler().postDelayed(() -> {
mPrefs.edit().putBoolean(SHOULD_I_ANSWER, false).commit();
((CheckBoxPreference) preference).setChecked(false);
}, 500);
}
break;
case NOTIFICATION_LED_COLOR:
mLedColorPickerDialog.show(getActivity().getFragmentManager(), "colorpicker");
break;
case DAY_START:
case NIGHT_START:
TimePickerFragment fragment = new TimePickerFragment();
fragment.setPreference(preference);
fragment.setOnPreferenceChangeListener(this);
fragment.show(getFragmentManager(), "timepicker");
break;
case QK_RESPONSES:
showQkResponseEditor();
break;
case AUTOMATICALLY_CONFIGURE_MMS:
// Show the MMS setup dialogs. See the MMSSetupDialog class for info about what the
// arguments mean.
MMSSetupFragment f = new MMSSetupFragment();
Bundle args = new Bundle();
args.putBoolean(MMSSetupFragment.ARG_ASK_FIRST, false);
args.putString(MMSSetupFragment.ARG_DONT_ASK_AGAIN_PREF, null);
f.setArguments(args);
getFragmentManager().beginTransaction().add(f, MMSSetupFragment.TAG).commit();
break;
case MMS_CONTACT_SUPPORT:
// Opens an email compose intent with MMS debugging information
MMSSetupFragment.contactSupport(getActivity());
break;
case CHANGELOG:
DialogHelper.showChangelog(mContext);
break;
case THANKS:
new QKDialog().setContext(mContext).setTitle(R.string.pref_about_thanks_title).setTripleLineItems(R.array.contributor_names, R.array.contributor_githubs, R.array.contributor_projects, new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String baseUrl = ((QKTextView) view.findViewById(R.id.list_item_subtitle)).getText().toString();
startBrowserIntent("https://" + baseUrl);
}
}).show();
break;
case DONATE:
DonationManager.getInstance(mContext).showDonateDialog();
break;
case GOOGLE_PLUS:
startBrowserIntent(GOOGLE_PLUS_URL);
break;
case GITHUB:
startBrowserIntent(GITHUB_URL);
break;
case CROWDIN:
startBrowserIntent(CROWDIN_URL);
break;
}
return false;
}
use of com.moez.QKSMS.ui.dialog.mms.MMSSetupFragment in project qksms by moezbhatti.
the class ComposeView method hasSetupMms.
private boolean hasSetupMms() {
if (TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMSC_URL, "")) && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMS_PROXY, "")) && TextUtils.isEmpty(mPrefs.getString(SettingsFragment.MMS_PORT, ""))) {
// Not so fast! You need to set up MMS first.
MMSSetupFragment f = new MMSSetupFragment();
Bundle args = new Bundle();
args.putBoolean(MMSSetupFragment.ARG_ASK_FIRST, true);
f.setArguments(args);
((Activity) mContext).getFragmentManager().beginTransaction().add(f, MMSSetupFragment.TAG).commit();
return false;
}
return true;
}
Aggregations