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