Fix wear page indicator

This commit is contained in:
Andries Smit 2021-12-01 14:16:00 +01:00
parent 5ae7346123
commit 8ae63eff29
5 changed files with 20 additions and 10 deletions

View file

@ -41,16 +41,18 @@ public class BolusActivity extends ViewSelectorActivity {
pager.setOnPageChangeListener(new GridViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int row, int column, float rowOffset, float columnOffset, int rowOffsetPixels, int columnOffsetPixels) {
dotsPageIndicator.onPageScrolled(row, column, rowOffset, columnOffset, rowOffsetPixels,
columnOffsetPixels);
}
@Override
public void onPageSelected(int row, int column) {
dotsPageIndicator.onPageSelected(row, column);
View view = pager.getChildAt(column);
view.requestFocus();
}
@Override
public void onPageScrollStateChanged(int state) {
dotsPageIndicator.onPageScrollStateChanged(state);
}
});
}

View file

@ -56,16 +56,18 @@ public class CPPActivity extends ViewSelectorActivity {
pager.setOnPageChangeListener(new GridViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int row, int column, float rowOffset, float columnOffset, int rowOffsetPixels, int columnOffsetPixels) {
dotsPageIndicator.onPageScrolled(row, column, rowOffset, columnOffset, rowOffsetPixels,
columnOffsetPixels);
}
@Override
public void onPageSelected(int row, int column) {
dotsPageIndicator.onPageSelected(row, column);
View view = pager.getChildAt(column);
view.requestFocus();
}
@Override
public void onPageScrollStateChanged(int state) {
dotsPageIndicator.onPageScrollStateChanged(state);
}
});
}

View file

@ -43,16 +43,18 @@ public class ECarbActivity extends ViewSelectorActivity {
pager.setOnPageChangeListener(new GridViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int row, int column, float rowOffset, float columnOffset, int rowOffsetPixels, int columnOffsetPixels) {
dotsPageIndicator.onPageScrolled(row, column, rowOffset, columnOffset, rowOffsetPixels,
columnOffsetPixels);
}
@Override
public void onPageSelected(int row, int column) {
dotsPageIndicator.onPageSelected(row, column);
View view = pager.getChildAt(column);
view.requestFocus();
}
@Override
public void onPageScrollStateChanged(int state) {
dotsPageIndicator.onPageScrollStateChanged(state);
}
});
}

View file

@ -51,16 +51,18 @@ public class TempTargetActivity extends ViewSelectorActivity {
pager.setOnPageChangeListener(new GridViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int row, int column, float rowOffset, float columnOffset, int rowOffsetPixels, int columnOffsetPixels) {
dotsPageIndicator.onPageScrolled(row, column, rowOffset, columnOffset, rowOffsetPixels,
columnOffsetPixels);
}
@Override
public void onPageSelected(int row, int column) {
dotsPageIndicator.onPageSelected(row, column);
View view = pager.getChildAt(column);
view.requestFocus();
}
@Override
public void onPageScrollStateChanged(int state) {
dotsPageIndicator.onPageScrollStateChanged(state);
}
});
}

View file

@ -48,16 +48,18 @@ public class WizardActivity extends ViewSelectorActivity {
pager.setOnPageChangeListener(new GridViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int row, int column, float rowOffset, float columnOffset, int rowOffsetPixels, int columnOffsetPixels) {
dotsPageIndicator.onPageScrolled(row, column, rowOffset, columnOffset, rowOffsetPixels,
columnOffsetPixels);
}
@Override
public void onPageSelected(int row, int column) {
dotsPageIndicator.onPageSelected(row, column);
View view = pager.getChildAt(column);
view.requestFocus();
}
@Override
public void onPageScrollStateChanged(int state) {
dotsPageIndicator.onPageScrollStateChanged(state);
}
});
}