kopia lustrzana https://github.com/ryukoposting/Signal-Android
Remove notification profile megaphone.
rodzic
9599d3a0b6
commit
e710e231ad
|
@ -22,8 +22,6 @@ import org.thoughtcrime.securesms.components.settings.DSLSettingsAdapter
|
||||||
import org.thoughtcrime.securesms.components.settings.DSLSettingsFragment
|
import org.thoughtcrime.securesms.components.settings.DSLSettingsFragment
|
||||||
import org.thoughtcrime.securesms.components.settings.app.notifications.profiles.EditNotificationProfileViewModel.SaveNotificationProfileResult
|
import org.thoughtcrime.securesms.components.settings.app.notifications.profiles.EditNotificationProfileViewModel.SaveNotificationProfileResult
|
||||||
import org.thoughtcrime.securesms.components.settings.app.notifications.profiles.models.NotificationProfileNamePreset
|
import org.thoughtcrime.securesms.components.settings.app.notifications.profiles.models.NotificationProfileNamePreset
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
|
||||||
import org.thoughtcrime.securesms.megaphone.Megaphones
|
|
||||||
import org.thoughtcrime.securesms.reactions.any.ReactWithAnyEmojiBottomSheetDialogFragment
|
import org.thoughtcrime.securesms.reactions.any.ReactWithAnyEmojiBottomSheetDialogFragment
|
||||||
import org.thoughtcrime.securesms.util.BottomSheetUtil
|
import org.thoughtcrime.securesms.util.BottomSheetUtil
|
||||||
import org.thoughtcrime.securesms.util.CircularProgressButtonUtil
|
import org.thoughtcrime.securesms.util.CircularProgressButtonUtil
|
||||||
|
@ -49,11 +47,6 @@ class EditNotificationProfileFragment : DSLSettingsFragment(layoutId = R.layout.
|
||||||
return EditNotificationProfileViewModel.Factory(profileId)
|
return EditNotificationProfileViewModel.Factory(profileId)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
ApplicationDependencies.getMegaphoneRepository().markFinished(Megaphones.Event.NOTIFICATION_PROFILES)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,6 @@ import org.thoughtcrime.securesms.components.settings.app.notifications.profiles
|
||||||
import org.thoughtcrime.securesms.components.settings.app.notifications.profiles.models.NotificationProfilePreference
|
import org.thoughtcrime.securesms.components.settings.app.notifications.profiles.models.NotificationProfilePreference
|
||||||
import org.thoughtcrime.securesms.components.settings.configure
|
import org.thoughtcrime.securesms.components.settings.configure
|
||||||
import org.thoughtcrime.securesms.components.settings.conversation.preferences.LargeIconClickPreference
|
import org.thoughtcrime.securesms.components.settings.conversation.preferences.LargeIconClickPreference
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
|
||||||
import org.thoughtcrime.securesms.megaphone.Megaphones
|
|
||||||
import org.thoughtcrime.securesms.notifications.profiles.NotificationProfile
|
import org.thoughtcrime.securesms.notifications.profiles.NotificationProfile
|
||||||
import org.thoughtcrime.securesms.notifications.profiles.NotificationProfiles
|
import org.thoughtcrime.securesms.notifications.profiles.NotificationProfiles
|
||||||
import org.thoughtcrime.securesms.util.LifecycleDisposable
|
import org.thoughtcrime.securesms.util.LifecycleDisposable
|
||||||
|
@ -37,11 +35,6 @@ class NotificationProfilesFragment : DSLSettingsFragment() {
|
||||||
private val lifecycleDisposable = LifecycleDisposable()
|
private val lifecycleDisposable = LifecycleDisposable()
|
||||||
private var toolbar: Toolbar? = null
|
private var toolbar: Toolbar? = null
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
ApplicationDependencies.getMegaphoneRepository().markFinished(Megaphones.Event.NOTIFICATION_PROFILES)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ public class MegaphoneRepository {
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
database.markFinished(Event.CHAT_COLORS);
|
database.markFinished(Event.CHAT_COLORS);
|
||||||
database.markFinished(Event.ADD_A_PROFILE_PHOTO);
|
database.markFinished(Event.ADD_A_PROFILE_PHOTO);
|
||||||
database.markFinished(Event.NOTIFICATION_PROFILES);
|
|
||||||
resetDatabaseCache();
|
resetDatabaseCache();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,6 @@ public final class Megaphones {
|
||||||
// Feature-introduction megaphones should *probably* be added below this divider
|
// Feature-introduction megaphones should *probably* be added below this divider
|
||||||
put(Event.CHAT_COLORS, ALWAYS);
|
put(Event.CHAT_COLORS, ALWAYS);
|
||||||
put(Event.ADD_A_PROFILE_PHOTO, shouldShowAddAProfilePhotoMegaphone(context) ? ALWAYS : NEVER);
|
put(Event.ADD_A_PROFILE_PHOTO, shouldShowAddAProfilePhotoMegaphone(context) ? ALWAYS : NEVER);
|
||||||
put(Event.NOTIFICATION_PROFILES, ShowForDurationSchedule.showForDays(7));
|
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,8 +132,6 @@ public final class Megaphones {
|
||||||
return buildAddAProfilePhotoMegaphone(context);
|
return buildAddAProfilePhotoMegaphone(context);
|
||||||
case BECOME_A_SUSTAINER:
|
case BECOME_A_SUSTAINER:
|
||||||
return buildBecomeASustainerMegaphone(context);
|
return buildBecomeASustainerMegaphone(context);
|
||||||
case NOTIFICATION_PROFILES:
|
|
||||||
return buildNotificationProfilesMegaphone(context);
|
|
||||||
case TURN_OFF_CENSORSHIP_CIRCUMVENTION:
|
case TURN_OFF_CENSORSHIP_CIRCUMVENTION:
|
||||||
return buildTurnOffCircumventionMegaphone(context);
|
return buildTurnOffCircumventionMegaphone(context);
|
||||||
default:
|
default:
|
||||||
|
@ -281,21 +278,6 @@ public final class Megaphones {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static @NonNull Megaphone buildNotificationProfilesMegaphone(@NonNull Context context) {
|
|
||||||
return new Megaphone.Builder(Event.NOTIFICATION_PROFILES, Megaphone.Style.BASIC)
|
|
||||||
.setTitle(R.string.NotificationProfilesMegaphone__notification_profiles)
|
|
||||||
.setImage(R.drawable.ic_notification_profiles_megaphone)
|
|
||||||
.setBody(R.string.NotificationProfilesMegaphone__only_get_notifications_from_the_people_and_groups_you_choose)
|
|
||||||
.setActionButton(R.string.NotificationProfilesMegaphone__create_a_profile, (megaphone, listener) -> {
|
|
||||||
listener.onMegaphoneNavigationRequested(AppSettingsActivity.notificationProfiles(context));
|
|
||||||
listener.onMegaphoneCompleted(Event.NOTIFICATION_PROFILES);
|
|
||||||
})
|
|
||||||
.setSecondaryButton(R.string.NotificationProfilesMegaphone__not_now, (megaphone, listener) -> {
|
|
||||||
listener.onMegaphoneCompleted(Event.NOTIFICATION_PROFILES);
|
|
||||||
})
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static @NonNull Megaphone buildTurnOffCircumventionMegaphone(@NonNull Context context) {
|
private static @NonNull Megaphone buildTurnOffCircumventionMegaphone(@NonNull Context context) {
|
||||||
return new Megaphone.Builder(Event.TURN_OFF_CENSORSHIP_CIRCUMVENTION, Megaphone.Style.BASIC)
|
return new Megaphone.Builder(Event.TURN_OFF_CENSORSHIP_CIRCUMVENTION, Megaphone.Style.BASIC)
|
||||||
.setTitle(R.string.CensorshipCircumventionMegaphone_turn_off_censorship_circumvention)
|
.setTitle(R.string.CensorshipCircumventionMegaphone_turn_off_censorship_circumvention)
|
||||||
|
@ -395,7 +377,6 @@ public final class Megaphones {
|
||||||
ADD_A_PROFILE_PHOTO("add_a_profile_photo"),
|
ADD_A_PROFILE_PHOTO("add_a_profile_photo"),
|
||||||
BECOME_A_SUSTAINER("become_a_sustainer"),
|
BECOME_A_SUSTAINER("become_a_sustainer"),
|
||||||
VALENTINES_DONATIONS_2022("valentines_donations_2022"),
|
VALENTINES_DONATIONS_2022("valentines_donations_2022"),
|
||||||
NOTIFICATION_PROFILES("notification_profiles"),
|
|
||||||
TURN_OFF_CENSORSHIP_CIRCUMVENTION("turn_off_censorship_circumvention");
|
TURN_OFF_CENSORSHIP_CIRCUMVENTION("turn_off_censorship_circumvention");
|
||||||
|
|
||||||
private final String key;
|
private final String key;
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item>
|
|
||||||
<shape android:shape="oval">
|
|
||||||
<solid android:color="#E3E3FE"/>
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
<item android:drawable="@drawable/ic_sleeping_face" android:top="12dp" android:bottom="12dp" android:left="12dp" android:right="12dp" />
|
|
||||||
</layer-list>
|
|
|
@ -4377,15 +4377,6 @@
|
||||||
<!-- Descriptor text indicating how long a profile will be on when there is a time component associated with it -->
|
<!-- Descriptor text indicating how long a profile will be on when there is a time component associated with it -->
|
||||||
<string name="NotificationProfileSelection__on_until_s">On until %1$s</string>
|
<string name="NotificationProfileSelection__on_until_s">On until %1$s</string>
|
||||||
|
|
||||||
<!-- Title for notification profile megaphone -->
|
|
||||||
<string name="NotificationProfilesMegaphone__notification_profiles">Notification profiles</string>
|
|
||||||
<!-- Description for notification profile megaphone -->
|
|
||||||
<string name="NotificationProfilesMegaphone__only_get_notifications_from_the_people_and_groups_you_choose">Only get notifications from the people and groups you choose.</string>
|
|
||||||
<!-- Call to action button to create a profile from megaphone -->
|
|
||||||
<string name="NotificationProfilesMegaphone__create_a_profile">Create a profile</string>
|
|
||||||
<!-- Button to dismiss notification profile megaphone -->
|
|
||||||
<string name="NotificationProfilesMegaphone__not_now">Not now</string>
|
|
||||||
|
|
||||||
<!-- Displayed in a toast when we fail to open the ringtone picker -->
|
<!-- Displayed in a toast when we fail to open the ringtone picker -->
|
||||||
<string name="NotificationSettingsFragment__failed_to_open_picker">Failed to open picker.</string>
|
<string name="NotificationSettingsFragment__failed_to_open_picker">Failed to open picker.</string>
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue