1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-24 17:10:33 +00:00

Move player notification settings into appearance section

This commit is contained in:
Koitharu 2021-05-24 19:32:56 +03:00
parent da9bd1d420
commit e0c674bc9e
No known key found for this signature in database
GPG Key ID: 8E861F8CE6E7CE27
7 changed files with 23 additions and 19 deletions

View File

@ -34,12 +34,6 @@
android:title="@string/content"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.NotificationSettingsFragment"
android:icon="@drawable/ic_play_arrow"
android:title="@string/settings_category_notification_title"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.NotificationsSettingsFragment"
android:icon="@drawable/ic_notifications"

View File

@ -71,12 +71,12 @@ class SubscriptionManager(context: Context) {
fun updateNotificationMode(serviceId: Int, url: String?, @NotificationMode mode: Int): Completable {
return subscriptionTable().getSubscription(serviceId, url!!)
.flatMapCompletable { entity: SubscriptionEntity ->
Completable.fromAction {
entity.notificationMode = mode
subscriptionTable().update(entity)
}.andThen(rememberLastStream(entity))
}
.flatMapCompletable { entity: SubscriptionEntity ->
Completable.fromAction {
entity.notificationMode = mode
subscriptionTable().update(entity)
}.andThen(rememberLastStream(entity))
}
}
fun updateFromInfo(subscriptionId: Long, info: ListInfo<StreamInfoItem>) {
@ -110,11 +110,11 @@ class SubscriptionManager(context: Context) {
private fun rememberLastStream(subscription: SubscriptionEntity): Completable {
return ExtractorHelper.getChannelInfo(subscription.serviceId, subscription.url, false)
.map { channel -> channel.relatedItems.map { stream -> StreamEntity(stream) } }
.flatMapCompletable { entities ->
Completable.fromAction {
database.streamDAO().upsertAll(entities)
}
}.onErrorComplete()
.map { channel -> channel.relatedItems.map { stream -> StreamEntity(stream) } }
.flatMapCompletable { entities ->
Completable.fromAction {
database.streamDAO().upsertAll(entities)
}
}.onErrorComplete()
}
}

View File

@ -60,7 +60,7 @@ public class AppearanceSettingsFragment extends BasePreferenceFragment {
@Override
public boolean onPreferenceTreeClick(final Preference preference) {
if (preference.getKey().equals(captionSettingsKey) && CAPTIONING_SETTINGS_ACCESSIBLE) {
if (captionSettingsKey.equals(preference.getKey()) && CAPTIONING_SETTINGS_ACCESSIBLE) {
try {
startActivity(new Intent(Settings.ACTION_CAPTIONING_SETTINGS));
} catch (final ActivityNotFoundException e) {

View File

@ -569,6 +569,7 @@
<string name="clear_queue_confirmation_title">Подтверждать очистку очереди</string>
<string name="clear_queue_confirmation_summary">Переход от одного плеера к другому может заменить вашу очередь</string>
<string name="settings_category_notification_title">Уведомление</string>
<string name="settings_category_notification_summary">Настроить уведомление о воспроизводимом сейчас потоке</string>
<string name="notification_action_nothing">Ничего</string>
<string name="notification_action_buffering">Буферизация</string>
<string name="notification_action_shuffle">Перемешать</string>

View File

@ -582,6 +582,7 @@
<string name="related_items_tab_description">Повʼязані елементи</string>
<string name="comments_tab_description">Коментарі</string>
<string name="settings_category_notification_title">Сповіщення</string>
<string name="settings_category_notification_summary">Налаштувати повідомлення про відтворюваний наразі потік</string>
<string name="unsupported_url_dialog_message">Не розпізнано URL. Відкрити через іншу програму\?</string>
<string name="auto_queue_toggle">Самододавання в чергу</string>
<string name="show_meta_info_title">Показувати метадані</string>

View File

@ -147,6 +147,7 @@
<string name="settings_category_debug_title">Debug</string>
<string name="settings_category_updates_title">Updates</string>
<string name="settings_category_notification_title">Notification</string>
<string name="settings_category_notification_summary">Configure current playing stream notification</string>
<string name="background_player_playing_toast">Playing in background</string>
<string name="popup_playing_toast">Playing in popup mode</string>
<string name="content">Content</string>

View File

@ -57,4 +57,11 @@
android:title="@string/tablet_mode_title"
app:singleLineTitle="false"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.NotificationSettingsFragment"
android:summary="@string/settings_category_notification_summary"
android:title="@string/settings_category_notification_title"
app:iconSpaceReserved="false" />
</PreferenceScreen>