Fixes #4300 Limited connection mode banner occupies too much space (#4375)

* done

* fixed

* minor changes made

changed tv, Tv to text_view, TextView, improved comment for toggleDescriptionListener
This commit is contained in:
Vinayak Aggarwal 2021-05-08 15:19:50 +05:30 committed by GitHub
parent 845a901604
commit 117a7805ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 6 deletions

View file

@ -89,6 +89,7 @@ public class ContributionsFragment
@BindView(R.id.card_view_nearby) public NearbyNotificationCardView nearbyNotificationCardView;
@BindView(R.id.campaigns_view) CampaignView campaignView;
@BindView(R.id.limited_connection_enabled_layout) LinearLayout limitedConnectionEnabledLayout;
@BindView(R.id.limited_connection_description_text_view) TextView limitedConnectionDescriptionTextView;
@Inject ContributionsPresenter contributionsPresenter;
@ -158,6 +159,7 @@ public class ContributionsFragment
&& sessionManager.getCurrentAccount() != null) {
setUploadCount();
}
limitedConnectionEnabledLayout.setOnClickListener(toggleDescriptionListener);
setHasOptionsMenu(true);
return view;
}
@ -617,5 +619,21 @@ public class ContributionsFragment
public MediaDetailPagerFragment getMediaDetailPagerFragment() {
return mediaDetailPagerFragment;
}
// click listener to toggle description that means uses can press the limited connection
// banner and description will hide. Tap again to show description.
private View.OnClickListener toggleDescriptionListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
View view2 = limitedConnectionDescriptionTextView;
if (view2.getVisibility() == View.GONE) {
view2.setVisibility(View.VISIBLE);
} else {
view2.setVisibility(View.GONE);
}
}
};
}