hide next button at the end

pull/14/head
Tim Su 13 years ago
parent 716dc95f54
commit 487da40552

@ -42,6 +42,7 @@
android:textColor="#444444"
android:textSize="20dip"
android:textStyle="bold"
android:paddingRight="10dip"
android:shadowRadius="2"
android:shadowDy="1"
android:shadowColor="@android:color/white" />

@ -67,7 +67,13 @@ public class ViewPagerAdapter extends PagerAdapter implements TitleProvider
images[images.length - 1] = R.drawable.welcome_walkthrough_1;
body[body.length - 1] = R.string.welcome_body_7_return;
}
}
@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
super.setPrimaryItem(container, position, object);
parent.onPageChanged(container, position);
}
@ -97,7 +103,7 @@ public class ViewPagerAdapter extends PagerAdapter implements TitleProvider
}
((ViewPager) pager).addView(pageView, 0);
parent.pageScrolled(position, pageView);
parent.instantiatePage(position);
return pageView;
}

@ -56,15 +56,20 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
protected int getTitleResource() {
return 0;
}
public void pageScrolled(int position, View view){
currentView = view;
currentPage = position;
public void instantiatePage(int position){
if (position == mAdapter.getCount()-1) {
initializeUI();
}
}
public void onPageChanged(View view, int position) {
currentPage = position;
currentView = view;
findViewById(R.id.next).setVisibility(
position == mAdapter.getCount()-1 ? View.GONE : View.VISIBLE);
}
@Override
protected void initializeUI() {

Loading…
Cancel
Save