2

customers want to have page with horizontal ViewPager which has two page on screen as same time ( i.e if we have 5 item in collection, then user can see 1 + 2, 2 + 3, 3 + 4, 4 + 5 screens)

after googling i found that this can be made with getPageWidth method for PagerAdapter:

@Override
public float getPageWidth(int position)
{
    return(0.5f);
}

this work perfectly and no problem was here.

each item in collection has several edittext field's. if i try edit first item (any edittext field) all right, but if i try edit second item on screen (in each pair) focus appear in correct field, but then jump to first edittextfield in first item on screen

for example: each item has one edittext

|item 1        ||item 2        |
|edit text (f1)||edit text (f2)|

i focued (by touch) f2 and i can see hightlight this field, but next time focus appear in f1.. on second touch all works correct

anatoly.kryzhanosky
  • 185
  • 1
  • 1
  • 18
  • As i understand your problem correctly , you are struggling focus issue. Problem could be related to how ViewPager cache different pages and how it recreate the pages in his child view. AFAIK ViewPager creates left child and right child before its starting showing current pager view. so you have to put your own logic to show focusable component in each pager view. – Roll no1 Jan 20 '14 at 09:36
  • check my answer to this post? http://stackoverflow.com/questions/21240063/android-edittext-focus-jumps-to-another-inside-scrollview/22673411#22673411 – Cameron Ketcham Mar 26 '14 at 21:41

0 Answers0