@@ -99,6 +99,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
99
99
private View avatarBorder ;
100
100
private TextView name , username , bio , followersCount , followersLabel , followingCount , followingLabel , postsCount , postsLabel ;
101
101
private ProgressBarButton actionButton ;
102
+ private Button notifyButton ;
102
103
private ViewPager2 pager ;
103
104
private NestedRecyclerScrollView scrollView ;
104
105
private AccountTimelineFragment postsFragment , postsWithRepliesFragment , mediaFragment ;
@@ -181,6 +182,7 @@ public View onCreateContentView(LayoutInflater inflater, ViewGroup container, Bu
181
182
postsLabel =content .findViewById (R .id .posts_label );
182
183
postsBtn =content .findViewById (R .id .posts_btn );
183
184
actionButton =content .findViewById (R .id .profile_action_btn );
185
+ notifyButton =content .findViewById (R .id .notify_btn );
184
186
pager =content .findViewById (R .id .pager );
185
187
scrollView =content .findViewById (R .id .scroller );
186
188
tabbar =content .findViewById (R .id .tabbar );
@@ -256,6 +258,7 @@ public void getOutline(View view, Outline outline){
256
258
});
257
259
258
260
actionButton .setOnClickListener (this ::onActionButtonClick );
261
+ notifyButton .setOnClickListener (this ::onNotifyButtonClick );
259
262
avatar .setOnClickListener (this ::onAvatarClick );
260
263
cover .setOnClickListener (this ::onCoverClick );
261
264
refreshLayout .setOnRefreshListener (this );
@@ -454,6 +457,7 @@ private void bindHeaderView(){
454
457
455
458
if (AccountSessionManager .getInstance ().isSelf (accountID , account )){
456
459
actionButton .setText (R .string .edit_profile );
460
+ notifyButton .setVisibility (View .GONE );
457
461
}else {
458
462
actionButton .setVisibility (View .GONE );
459
463
}
@@ -566,7 +570,7 @@ public boolean onOptionsItemSelected(MenuItem item){
566
570
updateRelationship ();
567
571
});
568
572
}else if (id ==R .id .hide_boosts ){
569
- new SetAccountFollowed (account .id , true , !relationship .showingReblogs )
573
+ new SetAccountFollowed (account .id , true , !relationship .showingReblogs , relationship . notifying )
570
574
.setCallback (new Callback <>(){
571
575
@ Override
572
576
public void onSuccess (Relationship result ){
@@ -614,6 +618,8 @@ private void updateRelationship(){
614
618
UiUtils .setRelationshipToActionButton (relationship , actionButton );
615
619
actionProgress .setIndeterminateTintList (actionButton .getTextColors ());
616
620
followsYouView .setVisibility (relationship .followedBy ? View .VISIBLE : View .GONE );
621
+ notifyButton .setVisibility (relationship .following ? View .VISIBLE : View .GONE );
622
+ notifyButton .setSelected (relationship .notifying );
617
623
}
618
624
619
625
private void onScrollChanged (View v , int scrollX , int scrollY , int oldScrollX , int oldScrollY ){
@@ -847,6 +853,10 @@ private List<Attachment> createFakeAttachments(String url, Drawable drawable){
847
853
return Collections .singletonList (att );
848
854
}
849
855
856
+ private void onNotifyButtonClick (View v ) {
857
+ UiUtils .performToggleAccountNotifications (getActivity (), account , accountID , relationship , actionButton , this ::updateRelationship );
858
+ }
859
+
850
860
private void onAvatarClick (View v ){
851
861
if (isInEditMode ){
852
862
startImagePicker (AVATAR_RESULT );
0 commit comments