Commit f3eb8195 authored by Grigory Fedorov's avatar Grigory Fedorov

New NotificationsSettings activity and NotificationsSettingsFragment.

parent c3f0e901
......@@ -279,11 +279,11 @@
<activity
android:name="com.xabber.android.ui.preferences.PhraseList"
android:label="@string/events_phrases_title"
android:parentActivityName="com.xabber.android.ui.preferences.PreferenceEditor">
android:parentActivityName="com.xabber.android.ui.preferences.NotificationsSettings">
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.preferences.PreferenceEditor" />
android:value="com.xabber.android.ui.preferences.NotificationsSettings" />
</activity>
<activity
android:name="com.xabber.android.ui.preferences.PhraseEditor"
......@@ -334,6 +334,15 @@
android:value="com.xabber.android.ui.preferences.PreferenceEditor" />
</activity>
<activity
android:name="com.xabber.android.ui.preferences.NotificationsSettings"
android:parentActivityName="com.xabber.android.ui.preferences.PreferenceEditor">
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.preferences.PreferenceEditor" />
</activity>
<service android:name="com.xabber.android.service.XabberService" />
<service
android:name="com.xabber.android.service.SyncAdapterService"
......
......@@ -5,7 +5,7 @@ import android.os.Bundle;
import com.xabber.android.ui.helper.PreferenceSummaryHelper;
import com.xabber.androiddev.R;
public class ChatSettingsFragment extends android.preference.PreferenceFragment {
public class ChatSettingsFragment extends android.preference.PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......
package com.xabber.android.ui.preferences;
import android.os.Bundle;
import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.androiddev.R;
public class NotificationsSettings extends ManagedActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFinishing())
return;
setContentView(R.layout.activity_preferences);
getActionBar().setDisplayHomeAsUpEnabled(true);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.preferences_activity_container, new NotificationsSettingsFragment()).commit();
}
}
}
package com.xabber.android.ui.preferences;
import android.os.Bundle;
import com.xabber.android.ui.helper.PreferenceSummaryHelper;
import com.xabber.androiddev.R;
public class NotificationsSettingsFragment extends android.preference.PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference_notifications);
PreferenceSummaryHelper.updateSummary(getPreferenceScreen());
}
}
......@@ -46,70 +46,14 @@
android:targetPackage="@string/application_package"
android:targetClass="com.xabber.android.ui.preferences.ChatSettings"/>
</Preference>
<PreferenceScreen
<Preference
android:title="@string/preference_events"
android:key="@string/preference_events"
>
<RingtonePreference
android:title="@string/events_sound"
android:key="@string/events_sound_key"
android:defaultValue="@string/events_sound_default"
android:ringtoneType="notification"
android:showSilent="true"
android:showDefault="true"
/>
<CheckBoxPreference
android:title="@string/events_vibro"
android:key="@string/events_vibro_key"
android:defaultValue="@bool/events_vibro_default"
/>
<CheckBoxPreference
android:title="@string/events_ignore_system_vibro"
android:key="@string/events_ignore_system_vibro_key"
android:defaultValue="@bool/events_ignore_system_vibro_default"
android:dependency="@string/events_vibro_key"
/>
<CheckBoxPreference
android:title="@string/events_lightning"
android:key="@string/events_lightning_key"
android:defaultValue="@bool/events_lightning_default"
/>
<CheckBoxPreference
android:title="@string/events_persistent"
android:key="@string/events_persistent_key"
android:defaultValue="@bool/events_persistent_default"
/>
<CheckBoxPreference
android:title="@string/events_show_text"
android:key="@string/events_show_text_key"
android:defaultValue="@bool/events_show_text_default"
/>
<ListPreference
android:title="@string/events_message"
android:key="@string/events_message_key"
android:entries="@array/events_message_entries"
android:entryValues="@array/events_message_entryvalues"
android:defaultValue="@string/events_message_default"
/>
<CheckBoxPreference
android:title="@string/events_visible_chat"
android:key="@string/events_visible_chat_key"
android:defaultValue="@bool/events_visible_chat_default"
/>
<CheckBoxPreference
android:title="@string/events_first_only"
android:key="@string/events_first_only_key"
android:defaultValue="@bool/events_first_only_default"
/>
<Preference
android:title="@string/events_phrases"
android:key="@string/events_phrases">
<intent
android:targetPackage="@string/application_package"
android:targetClass="com.xabber.android.ui.preferences.PhraseList"/>
</Preference>
</PreferenceScreen>
<intent
android:targetPackage="@string/application_package"
android:targetClass="com.xabber.android.ui.preferences.NotificationsSettings"/>
</Preference>
<PreferenceScreen
android:title="@string/preference_connection"
android:key="@string/preference_connection"
......
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<RingtonePreference
android:title="@string/events_sound"
android:key="@string/events_sound_key"
android:defaultValue="@string/events_sound_default"
android:ringtoneType="notification"
android:showSilent="true"
android:showDefault="true"
/>
<CheckBoxPreference
android:title="@string/events_vibro"
android:key="@string/events_vibro_key"
android:defaultValue="@bool/events_vibro_default"
/>
<CheckBoxPreference
android:title="@string/events_ignore_system_vibro"
android:key="@string/events_ignore_system_vibro_key"
android:defaultValue="@bool/events_ignore_system_vibro_default"
android:dependency="@string/events_vibro_key"
/>
<CheckBoxPreference
android:title="@string/events_lightning"
android:key="@string/events_lightning_key"
android:defaultValue="@bool/events_lightning_default"
/>
<CheckBoxPreference
android:title="@string/events_persistent"
android:key="@string/events_persistent_key"
android:defaultValue="@bool/events_persistent_default"
/>
<CheckBoxPreference
android:title="@string/events_show_text"
android:key="@string/events_show_text_key"
android:defaultValue="@bool/events_show_text_default"
/>
<ListPreference
android:title="@string/events_message"
android:key="@string/events_message_key"
android:entries="@array/events_message_entries"
android:entryValues="@array/events_message_entryvalues"
android:defaultValue="@string/events_message_default"
/>
<CheckBoxPreference
android:title="@string/events_visible_chat"
android:key="@string/events_visible_chat_key"
android:defaultValue="@bool/events_visible_chat_default"
/>
<CheckBoxPreference
android:title="@string/events_first_only"
android:key="@string/events_first_only_key"
android:defaultValue="@bool/events_first_only_default"
/>
<Preference
android:title="@string/events_phrases"
android:key="@string/events_phrases">
<intent
android:targetPackage="@string/application_package"
android:targetClass="com.xabber.android.ui.preferences.PhraseList"/>
</Preference>
</PreferenceScreen>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment