Search in sources :

Example 1 with QKPreference

use of com.moez.QKSMS.ui.view.QKPreference in project qksms by moezbhatti.

the class ConversationSettingsDialog method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    setTitle(getArguments().getString(ARG_NAME));
    mThreadId = getArguments().getLong(ARG_THREAD_ID);
    mRes = getActivity().getResources();
    mConversationPrefs = new ConversationPrefsHelper(getActivity(), mThreadId);
    mLedColors = new int[] { mRes.getColor(R.color.blue_light), mRes.getColor(R.color.purple_light), mRes.getColor(R.color.green_light), mRes.getColor(R.color.yellow_light), mRes.getColor(R.color.red_light), mRes.getColor(R.color.white_pure) };
    int padding = Units.dpToPx(getActivity(), 16);
    QKTextView premiumWarning = new QKTextView(getActivity());
    premiumWarning.setLayoutParams(mLayoutParams);
    premiumWarning.setPadding(padding, padding, padding, padding);
    LinearLayout list = new LinearLayout(getActivity());
    list.setOrientation(LinearLayout.VERTICAL);
    list.addView(new QKPreference(getActivity(), this, SettingsFragment.THEME, R.string.pref_theme, R.string.pref_theme_summary_alt).getView());
    list.addView(new QKSwitchPreference(getActivity(), this, SettingsFragment.NOTIFICATION_LED, mConversationPrefs.getConversationPrefs(), mConversationPrefs.getNotificationLedEnabled(), R.string.pref_led, 0).getView());
    list.addView(new QKPreference(getActivity(), this, SettingsFragment.NOTIFICATION_LED_COLOR, R.string.pref_theme_led, 0).getView());
    list.addView(new QKSwitchPreference(getActivity(), this, SettingsFragment.WAKE, mConversationPrefs.getConversationPrefs(), mConversationPrefs.getWakePhoneEnabled(), R.string.pref_wake, R.string.pref_wake_summary).getView());
    list.addView(new QKSwitchPreference(getActivity(), this, SettingsFragment.NOTIFICATION_TICKER, mConversationPrefs.getConversationPrefs(), mConversationPrefs.getTickerEnabled(), R.string.pref_ticker, R.string.pref_ticker_summary).getView());
    list.addView(new QKSwitchPreference(getActivity(), this, SettingsFragment.NOTIFICATION_VIBRATE, mConversationPrefs.getConversationPrefs(), mConversationPrefs.getVibrateEnabled(), R.string.pref_vibration, R.string.pref_vibration_summary).getView());
    list.addView(new QKRingtonePreference(getActivity(), this, SettingsFragment.NOTIFICATION_TONE, R.string.pref_ringtone, R.string.pref_ringtone_summary).getView());
    list.addView(new QKSwitchPreference(getActivity(), this, SettingsFragment.NOTIFICATION_CALL_BUTTON, mConversationPrefs.getConversationPrefs(), mConversationPrefs.getCallButtonEnabled(), R.string.pref_notification_call, R.string.pref_notification_call_summary).getView());
    setCustomView(list);
    return super.onCreateDialog(savedInstanceState);
}
Also used : QKPreference(com.moez.QKSMS.ui.view.QKPreference) QKTextView(com.moez.QKSMS.ui.view.QKTextView) LinearLayout(android.widget.LinearLayout) ConversationPrefsHelper(com.moez.QKSMS.common.ConversationPrefsHelper) QKSwitchPreference(com.moez.QKSMS.ui.view.QKSwitchPreference) QKRingtonePreference(com.moez.QKSMS.ui.view.QKRingtonePreference)

Aggregations

LinearLayout (android.widget.LinearLayout)1 ConversationPrefsHelper (com.moez.QKSMS.common.ConversationPrefsHelper)1 QKPreference (com.moez.QKSMS.ui.view.QKPreference)1 QKRingtonePreference (com.moez.QKSMS.ui.view.QKRingtonePreference)1 QKSwitchPreference (com.moez.QKSMS.ui.view.QKSwitchPreference)1 QKTextView (com.moez.QKSMS.ui.view.QKTextView)1