Remove the welcome walkthrough for astrid lite

pull/14/head
Sam Bosley 12 years ago
parent edc9d630ac
commit 6a4446cca6

@ -89,7 +89,7 @@
android:gravity="center"
android:layout_weight="1"
android:textSize="16sp"
android:textColor="#bfffffff"
android:textColor="#a0ffffff"
android:visibility="gone"/>
<TextView
android:id="@+id/pw_login"

@ -23,11 +23,12 @@ import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABTests;
import com.todoroo.astrid.utility.Constants;
import com.viewpagerindicator.TitleProvider;
public class WelcomePagerAdapter extends PagerAdapter implements TitleProvider
{
private final int[] images = new int[] {
private int[] images = new int[] {
R.drawable.welcome_walkthrough_1,
R.drawable.welcome_walkthrough_2,
R.drawable.welcome_walkthrough_3,
@ -36,7 +37,7 @@ public class WelcomePagerAdapter extends PagerAdapter implements TitleProvider
R.drawable.welcome_walkthrough_6,
0
};
private final int[] title = new int[] {
private int[] title = new int[] {
R.string.welcome_title_1,
R.string.welcome_title_2,
R.string.welcome_title_3,
@ -45,7 +46,7 @@ public class WelcomePagerAdapter extends PagerAdapter implements TitleProvider
R.string.welcome_title_6,
R.string.welcome_title_7,
};
private final int[] body = new int[] {
private int[] body = new int[] {
R.string.welcome_body_1,
R.string.welcome_body_2,
R.string.welcome_body_3,
@ -54,7 +55,7 @@ public class WelcomePagerAdapter extends PagerAdapter implements TitleProvider
R.string.welcome_body_6,
R.string.welcome_body_7,
};
public final int[] layouts = new int[] {
public int[] layouts = new int[] {
R.layout.welcome_walkthrough_page,
R.layout.welcome_walkthrough_page,
R.layout.welcome_walkthrough_page,
@ -81,6 +82,10 @@ public class WelcomePagerAdapter extends PagerAdapter implements TitleProvider
body[body.length - 1] = R.string.welcome_body_7_return;
fallbackLoginPage = R.layout.welcome_walkthrough_page;
} else {
if (Constants.ASTRID_LITE) {
adjustResourcesForLite();
}
// Setup login page from AB tests
fallbackLoginPage = layouts[layouts.length - 1];
if (ABChooser.readChoiceForTest(ABTests.AB_NEW_LOGIN_YES_GOOGLE) != ABChooser.NO_OPTION) {
@ -106,6 +111,13 @@ public class WelcomePagerAdapter extends PagerAdapter implements TitleProvider
}
}
private void adjustResourcesForLite() {
images = new int[] { 0 };
title = new int[] { R.string.welcome_title_7 };
body = new int[] { R.string.welcome_body_7 };
layouts = new int[] { R.layout.welcome_walkthrough_login_page };
}
@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
super.setPrimaryItem(container, position, object);

@ -35,12 +35,11 @@ import com.todoroo.astrid.gtasks.auth.ModernAuthManager;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.viewpagerindicator.CirclePageIndicator;
import com.viewpagerindicator.PageIndicator;
public class WelcomeWalkthrough extends ActFmLoginActivity {
private ViewPager mPager;
private WelcomePagerAdapter mAdapter;
private PageIndicator mIndicator;
private CirclePageIndicator mIndicator;
private View currentView;
private int currentPage;
@ -61,6 +60,9 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mPager);
if (mAdapter.getCount() <= 1) {
mIndicator.setVisibility(View.GONE);
}
}
@Override
@ -186,9 +188,9 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
currentPage = position;
currentView = view;
findViewById(R.id.next).setVisibility(
position == mAdapter.getCount()-1 ? View.GONE : View.VISIBLE);
position == mAdapter.getCount() - 1 ? View.GONE : View.VISIBLE);
if(currentPage == mAdapter.getCount()-1) {
if(currentPage == mAdapter.getCount() - 1) {
if(findViewById(R.id.fb_login) != null) {
setupLoginLater();
} else {
@ -198,8 +200,12 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
finish();
}
};
currentView.findViewById(R.id.welcome_walkthrough_title).setOnClickListener(done);
currentView.findViewById(R.id.welcome_walkthrough_image).setOnClickListener(done);
View title = currentView.findViewById(R.id.welcome_walkthrough_title);
if (title != null)
title.setOnClickListener(done);
View image = currentView.findViewById(R.id.welcome_walkthrough_image);
if (image != null)
image.setOnClickListener(done);
}
}
((CirclePageIndicator) mIndicator).setVisibility(currentPage == mAdapter.getCount()-1 ? View.GONE : View.VISIBLE);

Loading…
Cancel
Save