mirror of https://github.com/tuskyapp/Tusky.git
17 changed files with 185 additions and 27 deletions
@ -0,0 +1,30 @@
|
||||
/* Copyright 2017 Andrew Dawson |
||||
* |
||||
* This file is part of Tusky. |
||||
* |
||||
* Tusky is free software: you can redistribute it and/or modify it under the terms of the GNU |
||||
* General Public License as published by the Free Software Foundation, either version 3 of the |
||||
* License, or (at your option) any later version. |
||||
* |
||||
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
||||
* Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License along with Tusky. If not, see |
||||
* <http://www.gnu.org/licenses/>. */
|
||||
|
||||
package com.keylesspalace.tusky; |
||||
|
||||
import android.os.Bundle; |
||||
import android.support.annotation.Nullable; |
||||
import android.support.v7.app.AppCompatActivity; |
||||
|
||||
public class PreferencesActivity extends AppCompatActivity { |
||||
@Override |
||||
protected void onCreate(@Nullable Bundle savedInstanceState) { |
||||
super.onCreate(savedInstanceState); |
||||
getFragmentManager().beginTransaction() |
||||
.replace(android.R.id.content, new PreferencesFragment()) |
||||
.commit(); |
||||
} |
||||
} |
||||
@ -0,0 +1,27 @@
|
||||
/* Copyright 2017 Andrew Dawson |
||||
* |
||||
* This file is part of Tusky. |
||||
* |
||||
* Tusky is free software: you can redistribute it and/or modify it under the terms of the GNU |
||||
* General Public License as published by the Free Software Foundation, either version 3 of the |
||||
* License, or (at your option) any later version. |
||||
* |
||||
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
||||
* Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License along with Tusky. If not, see |
||||
* <http://www.gnu.org/licenses/>. */
|
||||
|
||||
package com.keylesspalace.tusky; |
||||
|
||||
import android.os.Bundle; |
||||
import android.preference.PreferenceFragment; |
||||
|
||||
public class PreferencesFragment extends PreferenceFragment { |
||||
@Override |
||||
public void onCreate(Bundle savedInstanceState) { |
||||
super.onCreate(savedInstanceState); |
||||
addPreferencesFromResource(R.xml.preferences); |
||||
} |
||||
} |
||||
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<resources> |
||||
|
||||
<string-array name="pull_notification_check_interval_names"> |
||||
<item>5 minutes</item> |
||||
<item>10 minutes</item> |
||||
<item>15 minutes</item> |
||||
<item>20 minutes</item> |
||||
<item>25 minutes</item> |
||||
<item>30 minutes</item> |
||||
<item>45 minutes</item> |
||||
<item>1 hour</item> |
||||
<item>2 hours</item> |
||||
</string-array> |
||||
|
||||
<string-array name="pull_notification_check_intervals" inputType="integer"> |
||||
<item>5</item> |
||||
<item>10</item> |
||||
<item>15</item> |
||||
<item>20</item> |
||||
<item>25</item> |
||||
<item>30</item> |
||||
<item>45</item> |
||||
<item>60</item> |
||||
<item>120</item> |
||||
</string-array> |
||||
|
||||
</resources> |
||||
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:key="@string/preferences_file_key"> |
||||
|
||||
<PreferenceCategory |
||||
android:title="@string/pref_title_notification_settings"> |
||||
|
||||
<CheckBoxPreference |
||||
android:key="pullNotifications" |
||||
android:title="@string/pref_title_pull_notifications" |
||||
android:summary="@string/pref_summary_pull_notifications" |
||||
android:defaultValue="true" /> |
||||
|
||||
<ListPreference |
||||
android:dependency="pullNotifications" |
||||
android:key="pullNotificationCheckInterval" |
||||
android:title="@string/pref_title_pull_notification_check_interval" |
||||
android:summary="@string/pref_summary_pull_notification_check_interval" |
||||
android:entries="@array/pull_notification_check_interval_names" |
||||
android:entryValues="@array/pull_notification_check_intervals" |
||||
android:defaultValue="15" /> |
||||
|
||||
<CheckBoxPreference |
||||
android:dependency="pullNotifications" |
||||
android:key="notificationAlertSound" |
||||
android:title="@string/pref_title_notification_alert_sound" |
||||
android:defaultValue="true" /> |
||||
|
||||
<CheckBoxPreference |
||||
android:dependency="pullNotifications" |
||||
android:key="notificationStyleVibrate" |
||||
android:title="@string/pref_title_notification_style_vibrate" |
||||
android:defaultValue="false" /> |
||||
|
||||
<CheckBoxPreference |
||||
android:dependency="pullNotifications" |
||||
android:key="notificationStyleLight" |
||||
android:title="@string/pref_title_notification_style_light" |
||||
android:defaultValue="false" /> |
||||
|
||||
</PreferenceCategory> |
||||
|
||||
</PreferenceScreen> |
||||
Loading…
Reference in new issue