You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to test bug: add next code in onCreate, run app, choose some transformation and wait for 6 seconds, it will change something but slider won't appear or animation would be frozen (paused at its start)
// test bug
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
mPager.setCurrentItem(4, false);
}
}, 6000);
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int selectedPage = 0;
if (savedInstanceState != null) {
mSelectedItem = savedInstanceState.getInt(KEY_SELECTED_CLASS);
selectedPage = savedInstanceState.getInt(KEY_SELECTED_PAGE);
}
final ArrayAdapter<TransformerItem> actionBarAdapter = new ArrayAdapter<>(
getApplicationContext(), android.R.layout.simple_list_item_1, android.R.id.text1, TRANSFORM_CLASSES);
setContentView(R.layout.activity_main);
mAdapter = new PageAdapter(getFragmentManager());
mPager = (ViewPager) findViewById(R.id.container);
mPager.setAdapter(mAdapter);
mPager.setCurrentItem(selectedPage);
// test bug
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
mPager.setCurrentItem(4, false);
}
}, 6000);
final ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setListNavigationCallbacks(actionBarAdapter, this);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
//noinspection ResourceType
actionBar.setDisplayOptions(actionBar.getDisplayOptions() ^ ActionBar.DISPLAY_SHOW_TITLE);
actionBar.setSelectedNavigationItem(mSelectedItem);
}
}
for example with ZoomOutSliderTransformer slider won't be fully 100% taking all space of layout (you can see white paddings or margin at right and bottom)
The text was updated successfully, but these errors were encountered:
it only works with smooth parameter set to true, but it could result in bad user exepirence if someone changes position form 3 to 125, so in this case I need to change current fragment without any smooth and transformation, fastly, it should be done only if we change from 2 to 3 or from 3 to 2 (next, previous fragments), in this case transformation is ok
solved this by setting temporarily page transformer to null before setCurrentItem for big distances between position and then again set needed page transformer:
try {
mPager.setPageTransformer(true, new TransformerItem(ZoomOutSlideTransformer.class).clazz.newInstance());
} catch (Exception e) {
throw new RuntimeException(e);
}
// test bug
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
mPager.setPageTransformer(true, null);
mPager.setCurrentItem(4, false);
try {
mPager.setPageTransformer(true, new TransformerItem(ZoomOutSlideTransformer.class).clazz.newInstance());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}, 3000);
How to test bug: add next code in onCreate, run app, choose some transformation and wait for 6 seconds, it will change something but slider won't appear or animation would be frozen (paused at its start)
for example with ZoomOutSliderTransformer slider won't be fully 100% taking all space of layout (you can see white paddings or margin at right and bottom)
The text was updated successfully, but these errors were encountered: