mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
parent
d3238c2598
commit
d6def8f128
1 changed files with 13 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
@ -100,7 +102,18 @@ public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment imple
|
||||||
pager.addOnPageChangeListener(this);
|
pager.addOnPageChangeListener(this);
|
||||||
|
|
||||||
adapter = new MediaDetailAdapter(getChildFragmentManager());
|
adapter = new MediaDetailAdapter(getChildFragmentManager());
|
||||||
|
|
||||||
|
|
||||||
|
if (getActivity() != null) {
|
||||||
|
final ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pager.setAdapter(adapter);
|
pager.setAdapter(adapter);
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
final int pageNumber = savedInstanceState.getInt("current-page");
|
final int pageNumber = savedInstanceState.getInt("current-page");
|
||||||
pager.setCurrentItem(pageNumber, false);
|
pager.setCurrentItem(pageNumber, false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue