fix image pager enter transition
This commit is contained in:
parent
c3a80f1be4
commit
4d016aee20
@ -9,6 +9,7 @@ import android.net.Uri;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.view.PagerAdapter;
|
import android.support.v4.view.PagerAdapter;
|
||||||
import android.support.v4.view.ViewCompat;
|
import android.support.v4.view.ViewCompat;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
@ -127,8 +128,9 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (position == 0)
|
if (position == 0) {
|
||||||
ViewCompat.setTransitionName(imgView, "TRANSITION:ARTICLE_IMAGES_PAGER");
|
ViewCompat.setTransitionName(imgView, "TRANSITION:ARTICLE_IMAGES_PAGER");
|
||||||
|
}
|
||||||
|
|
||||||
registerForContextMenu(imgView);
|
registerForContextMenu(imgView);
|
||||||
|
|
||||||
@ -171,6 +173,10 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur
|
|||||||
|
|
||||||
((ViewPager) container).addView(view, 0);
|
((ViewPager) container).addView(view, 0);
|
||||||
|
|
||||||
|
if (position == 0) {
|
||||||
|
ActivityCompat.startPostponedEnterTransition(ArticleImagesPagerActivity.this);
|
||||||
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,6 +240,8 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
ActivityCompat.postponeEnterTransition(this);
|
||||||
|
|
||||||
// we use that before parent onCreate so let's init locally
|
// we use that before parent onCreate so let's init locally
|
||||||
m_prefs = PreferenceManager
|
m_prefs = PreferenceManager
|
||||||
.getDefaultSharedPreferences(getApplicationContext());
|
.getDefaultSharedPreferences(getApplicationContext());
|
||||||
@ -363,7 +371,7 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur
|
|||||||
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
finish();
|
onBackPressed();
|
||||||
return true;
|
return true;
|
||||||
case R.id.article_img_open:
|
case R.id.article_img_open:
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user