Allow ability to show welcome activity from settings

pull/14/head
Tim Su 13 years ago
parent 7412481730
commit 14f8d81ae8

@ -328,6 +328,7 @@
<string name="p_showed_collaborators_help">showed_collaborators_help</string>
<string name="p_showed_when_shortcut">showed_when_shortcut</string>
<string name="p_showed_when_row">showed_when_row</string>
<string name="p_tutorial">tutorial</string>
<!-- ============================================================ OTHER == -->

@ -3,6 +3,8 @@
<string name="welcome_show_eula">Accept EULA to get started!</string>
<string name="welcome_setting">Show Tutorial</string>
<string name="welcome_title_1">Welcome to Astrid!</string>
<string name="welcome_title_2">Make lists</string>
<string name="welcome_title_3">Share lists</string>
@ -11,6 +13,8 @@
<string name="welcome_title_6">Discover</string>
<string name="welcome_title_7">Connect now\nto get started!</string>
<string name="welcome_title_7_return">That\'s it!</string>
<string name="welcome_body_1">The perfect personal\nto-do list that works great\nwith friends</string>
<string name="welcome_body_2">Perfect for any list:\nto read, to watch, to buy,\nto visit, to do!</string>
<string name="welcome_body_3">Share lists\nwith friends, housemates,\nor your sweetheart!</string>
@ -19,4 +23,6 @@
<string name="welcome_body_6">Additional features,\nproductivity tips, and\nsuggestions from friends</string>
<string name="welcome_body_7">Login</string>
<string name="welcome_body_7_return">Tap Astrid to return.</string>
</resources>

@ -3,8 +3,9 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/EPr_title">
<PreferenceScreen android:title="" android:key="@string/p_about" />
<PreferenceScreen android:title="" android:key="@string/p_help"/>
<PreferenceScreen android:title="@string/p_about" android:key="@string/p_about" />
<PreferenceScreen android:title="@string/welcome_setting" android:key="@string/p_tutorial"/>
<PreferenceScreen android:title="@string/p_help" android:key="@string/p_help"/>
<PreferenceCategory
android:title="@string/EPr_appearance_header">
<com.todoroo.astrid.ui.MultilineListPreference

@ -38,6 +38,7 @@ import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.andlib.utility.TodorooPreferenceActivity;
import com.todoroo.astrid.actfm.ActFmLoginActivity;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.data.Task;
@ -52,6 +53,7 @@ import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.utility.Flags;
import com.todoroo.astrid.voice.VoiceInputAssistant;
import com.todoroo.astrid.voice.VoiceOutputService;
import com.todoroo.astrid.welcome.tutorial.WelcomeWalkthrough;
/**
* Displays the preference screen for users to edit their preferences
@ -61,10 +63,8 @@ import com.todoroo.astrid.voice.VoiceOutputService;
*/
public class EditPreferences extends TodorooPreferenceActivity {
private static final int ABOUT_PREFERENCE = 0; // see preferences.xml for order of prefs
private static final int HELP_PREFERENCE = 1;
private static final int APPEARANCE_PREFERENCE = 2;
private static final int POWER_PACK_PREFERENCE = 3;
private static final int APPEARANCE_PREFERENCE = 3;
private static final int POWER_PACK_PREFERENCE = 4;
public static final int RESULT_CODE_THEME_CHANGED = 1;
@ -101,9 +101,9 @@ public class EditPreferences extends TodorooPreferenceActivity {
screen.getPreference(POWER_PACK_PREFERENCE).setEnabled(addOnService.hasPowerPack());
final Resources r = getResources();
// About pref
Preference preference = screen.getPreference(ABOUT_PREFERENCE);
preference.setTitle(r.getString(R.string.p_about));
// first-order preferences
Preference preference = screen.findPreference(getString(R.string.p_about));
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference p) {
showAbout();
@ -111,9 +111,20 @@ public class EditPreferences extends TodorooPreferenceActivity {
}
});
Preference helpPref = screen.getPreference(HELP_PREFERENCE);
helpPref.setTitle(r.getString(R.string.p_help));
helpPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
preference = screen.findPreference(getString(R.string.p_tutorial));
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference p) {
Intent showWelcomeLogin = new Intent(EditPreferences.this, WelcomeWalkthrough.class);
showWelcomeLogin.putExtra(ActFmLoginActivity.SHOW_TOAST, false);
showWelcomeLogin.putExtra(WelcomeWalkthrough.TOKEN_MANUAL_SHOW, true);
startActivity(showWelcomeLogin);
return true;
}
});
preference = screen.findPreference(getString(R.string.p_help));
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference p) {
showHelp();

@ -174,17 +174,11 @@ public final class UpgradeService {
StringBuilder changeLog = new StringBuilder();
if (from >= V3_9_2 && from < V3_9_2_2) {
newVersionString(changeLog, "3.9.2.2", new String[] {
"Reduced APK size",
"Fixed bugs with Google Task sync",
});
}
if (from < V3_9_2) {
newVersionString(changeLog, "3.9.2 (01/13/12)", new String[] {
"Made selecting dates and times easier:",
"New tutorial walkthrough for new users",
"Stomped on a few bugs",
newVersionString(changeLog, "3.9.2.2 (1/19/12)", new String[] {
"Astrid now recognizes words like 'tomorrow', 'monday', '!!!' and '2 pm' to set date and importance",
"New tutorial walkthrough for new users. Access it from the settings menu!",
"Reduced APK size",
"Minor UI tweaks, bug fixes",
"Feedback welcomed!"
});
}
@ -192,7 +186,7 @@ public final class UpgradeService {
if (from >= V3_9_1 && from < V3_9_1_1) {
newVersionString(changeLog, "3.9.1.1 (01/06/12)", new String[] {
"Fixed a few bugs:",
" Crash when selecting certain lists",
" Crash when selecting certain lists",
" Some lists not displayed",
" Wrong text color when assigning tasks in Night theme"
});

@ -13,6 +13,9 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.viewpagerindicator.TitleProvider;
public class ViewPagerAdapter extends PagerAdapter implements TitleProvider
@ -60,10 +63,20 @@ public class ViewPagerAdapter extends PagerAdapter implements TitleProvider
};
private final Context context;
public WelcomeWalkthrough parent;
@Autowired ActFmPreferenceService actFmPreferenceService;
public ViewPagerAdapter( Context context )
public ViewPagerAdapter( Context context, boolean manual)
{
this.context = context;
DependencyInjectionService.getInstance().inject(this);
if(manual) {
layouts[layouts.length - 1] = R.layout.welcome_walkthrough_page;
title[title.length - 1] = R.string.welcome_title_7_return;
images[images.length - 1] = R.drawable.welcome_walkthrough_1;
body[body.length - 1] = R.string.welcome_body_7_return;
}
}
@ -81,14 +94,15 @@ public class ViewPagerAdapter extends PagerAdapter implements TitleProvider
View pageView = inflater.inflate(layouts[position], null, true);
pageView.setLayoutParams( new ViewGroup.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT));
if (position != getCount()-1){
ImageView imageView = (ImageView) pageView.findViewById(R.id.welcome_walkthrough_image);
imageView.setImageResource(images[position]);
if (pageView.findViewById(R.id.welcome_walkthrough_image) != null) {
ImageView imageView = (ImageView) pageView.findViewById(R.id.welcome_walkthrough_image);
imageView.setImageResource(images[position]);
TextView titleView = (TextView) pageView.findViewById(R.id.welcome_walkthrough_title);
titleView.setText(title[position]);
TextView titleView = (TextView) pageView.findViewById(R.id.welcome_walkthrough_title);
titleView.setText(title[position]);
TextView bodyView = (TextView) pageView.findViewById(R.id.welcome_walkthrough_body);
bodyView.setText(body[position]);
TextView bodyView = (TextView) pageView.findViewById(R.id.welcome_walkthrough_body);
bodyView.setText(body[position]);
}
((ViewPager)pager).addView( pageView, 0 );

@ -31,12 +31,14 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
public static final String KEY_SHOWED_WELCOME_LOGIN = "key_showed_welcome_login"; //$NON-NLS-1$
public static final String TOKEN_MANUAL_SHOW = "manual"; //$NON-NLS-1$
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
mAdapter = new ViewPagerAdapter(this);
mAdapter = new ViewPagerAdapter(this, getIntent().hasExtra(TOKEN_MANUAL_SHOW));
mAdapter.parent = this;
mPager = (ViewPager)findViewById(R.id.pager);
@ -44,6 +46,7 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mPager);
}
@Override
protected int getContentViewResource() {
@ -68,10 +71,22 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
protected void initializeUI() {
if(mAdapter == null)
return;
if(currentPage == mAdapter.getCount()-1){
super.initializeUI();
setupTermsOfService();
setupLoginLater();
if(currentPage == mAdapter.getCount()-1) {
if(findViewById(R.id.fb_login) != null) {
super.initializeUI();
setupTermsOfService();
setupLoginLater();
} else {
OnClickListener done = new OnClickListener() {
@Override
public void onClick(View arg0) {
finish();
}
};
currentView.findViewById(R.id.welcome_walkthrough_title).setOnClickListener(done);
currentView.findViewById(R.id.welcome_walkthrough_image).setOnClickListener(done);
}
}
}
@ -106,12 +121,6 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
Button pwLogin = (Button) findViewById(R.id.pw_login);
pwLogin.setOnClickListener(signUpListener);
}
/*
protected void setupWalkthroughLogin() {
Button loginButton = (Button)currentView.findViewById(R.id.walkthrough_login);
loginButton.setOnClickListener(showWalkthroughLoginListener);
}*/
protected void setupLoginLater() {
TextView loginLater = (TextView)currentView.findViewById(R.id.login_later);

Loading…
Cancel
Save