New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable support toolbar for ProfileActivity and added a couple of unit… #5188
Enable support toolbar for ProfileActivity and added a couple of unit… #5188
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind applying relevant styling conventions? Thanks!
And would you mind posting before/after screenshots? Thanks! |
@nicolas-raoul Added the screenshots and made a very minor change in the MediaDetailPagerFragment.java. |
@@ -196,6 +196,10 @@ private void initWLMCampaign() { | |||
|
|||
@Override | |||
public void onCreateOptionsMenu(@NonNull final Menu menu, @NonNull final MenuInflater inflater) { | |||
|
|||
// Removing contributions menu items for ProfileActivity | |||
if(getActivity() instanceof ProfileActivity){ return;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after if
@@ -641,7 +645,7 @@ public void viewPagerNotifyDataSetChanged() { | |||
@Override | |||
public void showDetail(int position, boolean isWikipediaButtonDisplayed) { | |||
if (mediaDetailPagerFragment == null || !mediaDetailPagerFragment.isVisible()) { | |||
mediaDetailPagerFragment = new MediaDetailPagerFragment(); | |||
mediaDetailPagerFragment = new MediaDetailPagerFragment(false,true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after ,
@@ -67,7 +67,7 @@ class MediaDetailPagerFragmentUnitTests { | |||
|
|||
val activity = Robolectric.buildActivity(SearchActivity::class.java).create().get() | |||
|
|||
fragment = MediaDetailPagerFragment() | |||
fragment = MediaDetailPagerFragment(false,true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
@nicolas-raoul Thanks for pointing out the errors. I have made the changes as requested. |
@@ -196,6 +196,10 @@ private void initWLMCampaign() { | |||
|
|||
@Override | |||
public void onCreateOptionsMenu(@NonNull final Menu menu, @NonNull final MenuInflater inflater) { | |||
|
|||
// Removing contributions menu items for ProfileActivity | |||
if (getActivity() instanceof ProfileActivity) { return;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before }
@@ -140,14 +149,13 @@ private void setTabs() { | |||
fragmentList.add(leaderboardFragment); | |||
titleList.add(getResources().getString(R.string.leaderboard_tab_title).toUpperCase()); | |||
|
|||
if (shouldShowContributions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past, why was this if (shouldShowContributions) {
added? You can use git blame
to find out.
@nicolas-raoul Made the requested changes and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working well, thank you!
Hey @nicolas-raoul I was having a look at the issues trying to decide what to pick next. I am a bit confused right now. If you have any issues in mind, that might be suitable for me please let me know |
Description (required)
Fixes #5026
What changes did you make and why?
Added a couple of unit tests to #5068