mirror of
				https://codeberg.org/tom79/Fedilab.git
				synced 2025-10-20 11:20:16 +03:00 
			
		
		
		
	Fix issue #368 - Allow to enable/disable media in notifications for boost/fav
This commit is contained in:
		
							parent
							
								
									8b336f1012
								
							
						
					
					
						commit
						15921978d3
					
				
					 4 changed files with 28 additions and 9 deletions
				
			
		| 
						 | 
					@ -277,7 +277,13 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                holderStatus.bindingNotification.containerTransparent.setVisibility(View.VISIBLE);
 | 
					                holderStatus.bindingNotification.containerTransparent.setVisibility(View.VISIBLE);
 | 
				
			||||||
                holderStatus.bindingNotification.status.mediaContainer.setVisibility(View.GONE);
 | 
					                SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
 | 
				
			||||||
 | 
					                boolean displayMedia = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_MEDIA_NOTIFICATION), true);
 | 
				
			||||||
 | 
					                if (displayMedia) {
 | 
				
			||||||
 | 
					                    holderStatus.bindingNotification.status.mediaContainer.setVisibility(View.VISIBLE);
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                    holderStatus.bindingNotification.status.mediaContainer.setVisibility(View.GONE);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                String title = "";
 | 
					                String title = "";
 | 
				
			||||||
                MastodonHelper.loadPPMastodon(holderStatus.binding.avatar, notification.account);
 | 
					                MastodonHelper.loadPPMastodon(holderStatus.binding.avatar, notification.account);
 | 
				
			||||||
                if (getItemViewType(position) == TYPE_FAVOURITE) {
 | 
					                if (getItemViewType(position) == TYPE_FAVOURITE) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -809,6 +809,8 @@
 | 
				
			||||||
    <string name="SET_CLEAR_CACHE_EXIT" translatable="false">SET_CLEAR_CACHE_EXIT</string>
 | 
					    <string name="SET_CLEAR_CACHE_EXIT" translatable="false">SET_CLEAR_CACHE_EXIT</string>
 | 
				
			||||||
    <string name="SET_DISPLAY_EMOJI" translatable="false">SET_DISPLAY_EMOJI</string>
 | 
					    <string name="SET_DISPLAY_EMOJI" translatable="false">SET_DISPLAY_EMOJI</string>
 | 
				
			||||||
    <string name="SET_AGGREGATE_NOTIFICATION" translatable="false">SET_AGGREGATE_NOTIFICATION</string>
 | 
					    <string name="SET_AGGREGATE_NOTIFICATION" translatable="false">SET_AGGREGATE_NOTIFICATION</string>
 | 
				
			||||||
 | 
					    <string name="SET_DISPLAY_MEDIA_NOTIFICATION" translatable="false">SET_DISPLAY_MEDIA_NOTIFICATION</string>
 | 
				
			||||||
 | 
					    x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <string name="SET_DISPLAY_CARD" translatable="false">SET_DISPLAY_CARD</string>
 | 
					    <string name="SET_DISPLAY_CARD" translatable="false">SET_DISPLAY_CARD</string>
 | 
				
			||||||
    <string name="SET_DISPLAY_VIDEO_PREVIEWS" translatable="false">SET_DISPLAY_VIDEO_PREVIEWS</string>
 | 
					    <string name="SET_DISPLAY_VIDEO_PREVIEWS" translatable="false">SET_DISPLAY_VIDEO_PREVIEWS</string>
 | 
				
			||||||
| 
						 | 
					@ -1488,4 +1490,6 @@
 | 
				
			||||||
    <string name="remember_position">Remember position in timelines</string>
 | 
					    <string name="remember_position">Remember position in timelines</string>
 | 
				
			||||||
    <string name="aggregate_notifications">Aggregate notifications</string>
 | 
					    <string name="aggregate_notifications">Aggregate notifications</string>
 | 
				
			||||||
    <string name="aggregate_notifications_summary">When turning on, the app will collapse related notifications</string>
 | 
					    <string name="aggregate_notifications_summary">When turning on, the app will collapse related notifications</string>
 | 
				
			||||||
 | 
					    <string name="display_media_notification">Display media in notifications</string>
 | 
				
			||||||
 | 
					    <string name="display_media_notification_summary">Media in notifications for reblogs and favourites will be displayed</string>
 | 
				
			||||||
</resources>
 | 
					</resources>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,14 +20,6 @@
 | 
				
			||||||
        app:summary="@string/set_timelines_in_a_list"
 | 
					        app:summary="@string/set_timelines_in_a_list"
 | 
				
			||||||
        app:title="@string/set_timelines_in_a_list_title" />
 | 
					        app:title="@string/set_timelines_in_a_list_title" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    <SwitchPreferenceCompat
 | 
					 | 
				
			||||||
        app:defaultValue="true"
 | 
					 | 
				
			||||||
        app:iconSpaceReserved="false"
 | 
					 | 
				
			||||||
        app:key="@string/SET_AGGREGATE_NOTIFICATION"
 | 
					 | 
				
			||||||
        app:singleLineTitle="false"
 | 
					 | 
				
			||||||
        app:summary="@string/aggregate_notifications_summary"
 | 
					 | 
				
			||||||
        app:title="@string/aggregate_notifications" />
 | 
					 | 
				
			||||||
    <SwitchPreferenceCompat
 | 
					    <SwitchPreferenceCompat
 | 
				
			||||||
        app:defaultValue="true"
 | 
					        app:defaultValue="true"
 | 
				
			||||||
        app:iconSpaceReserved="false"
 | 
					        app:iconSpaceReserved="false"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,6 +31,23 @@
 | 
				
			||||||
        app:key="@string/SET_DISPLAY_BOOKMARK"
 | 
					        app:key="@string/SET_DISPLAY_BOOKMARK"
 | 
				
			||||||
        app:singleLineTitle="false"
 | 
					        app:singleLineTitle="false"
 | 
				
			||||||
        app:title="@string/set_display_bookmark_indication" />
 | 
					        app:title="@string/set_display_bookmark_indication" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <SwitchPreferenceCompat
 | 
				
			||||||
 | 
					        app:defaultValue="true"
 | 
				
			||||||
 | 
					        app:iconSpaceReserved="false"
 | 
				
			||||||
 | 
					        app:key="@string/SET_AGGREGATE_NOTIFICATION"
 | 
				
			||||||
 | 
					        app:singleLineTitle="false"
 | 
				
			||||||
 | 
					        app:summary="@string/aggregate_notifications_summary"
 | 
				
			||||||
 | 
					        app:title="@string/aggregate_notifications" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <SwitchPreferenceCompat
 | 
				
			||||||
 | 
					        app:defaultValue="true"
 | 
				
			||||||
 | 
					        app:iconSpaceReserved="false"
 | 
				
			||||||
 | 
					        app:key="@string/SET_DISPLAY_MEDIA_NOTIFICATION"
 | 
				
			||||||
 | 
					        app:singleLineTitle="false"
 | 
				
			||||||
 | 
					        app:summary="@string/display_media_notification_summary"
 | 
				
			||||||
 | 
					        app:title="@string/display_media_notification" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <ListPreference
 | 
					    <ListPreference
 | 
				
			||||||
        app:defaultValue="ALWAYS"
 | 
					        app:defaultValue="ALWAYS"
 | 
				
			||||||
        app:dialogTitle="@string/load_media_type_title"
 | 
					        app:dialogTitle="@string/load_media_type_title"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue