mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Add contribution number next to tab text for contribution, as discussed in thread
This commit is contained in:
parent
01461d2508
commit
0497737922
3 changed files with 9 additions and 2 deletions
|
|
@ -83,6 +83,12 @@ public class ContributionsActivity extends AuthenticatedActivity implements Frag
|
|||
setTabAndViewPagerSynchronisation();
|
||||
}
|
||||
|
||||
public void setNumOfUploads(int uploadCount) {
|
||||
tabLayout.getTabAt(0).setText(getResources().getString(R.string.contributions_fragment) +" "+ getResources()
|
||||
.getQuantityString(R.plurals.contributions_subtitle,
|
||||
uploadCount, uploadCount));
|
||||
}
|
||||
|
||||
/**
|
||||
* Normally tab layout and view pager has no relation, which means when you swipe view pager
|
||||
* tab won't change and vice versa. So we have to notify each of them.
|
||||
|
|
|
|||
|
|
@ -397,6 +397,7 @@ public class ContributionsFragment
|
|||
return;
|
||||
}
|
||||
|
||||
((ContributionsActivity)getActivity()).setNumOfUploads(uploadCount);
|
||||
numberOfUploads.setText(getResources()
|
||||
.getQuantityString(R.plurals.contributions_subtitle,
|
||||
uploadCount, uploadCount));
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@
|
|||
<plurals name="contributions_subtitle">
|
||||
<!--zero is not used in english. Category mentioned here for easy reference in future-->
|
||||
<item quantity="zero">@string/contributions_subtitle_zero</item>
|
||||
<item quantity="one">%1$d upload</item>
|
||||
<item quantity="other">%1$d uploads</item>
|
||||
<item quantity="one">(%1$d)</item>
|
||||
<item quantity="other">(%1$d)</item>
|
||||
</plurals>
|
||||
<plurals name="starting_multiple_uploads">
|
||||
<item quantity="one">Starting %1$d upload</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue