Add settings import on Welcome

This commit is contained in:
Uni- 2013-03-05 16:31:45 +09:00
parent 91a32e9c92
commit 4f5ab86be3
3 changed files with 25 additions and 6 deletions

View File

@ -23,6 +23,14 @@
android:textColor="?android:attr/textColorPrimary"
android:textSize="14sp" />
<Button
android:id="@+id/import_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:minWidth="@dimen/button_minWidth"
android:text="@string/settings_import" />
<View
android:layout_width="fill_parent"
android:layout_height="0dip"

View File

@ -326,6 +326,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
private static String SELECTED_CONTEXT_ACCOUNT = "selectedContextAccount";
public static final String EXTRA_STARTUP = "startup";
public static final String EXTRA_IMPORTFIRST = "importfirst";
public static void listAccounts(Context context) {
@ -365,7 +366,9 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
//onNewIntent(intent);
// see if we should show the welcome message
if (accounts.length < 1) {
if (intent.getBooleanExtra(EXTRA_IMPORTFIRST, false)) {
onImport();
} else if (accounts.length < 1) {
WelcomeMessage.showWelcomeMessage(this);
finish();
return;
@ -525,10 +528,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
accounts = Preferences.getPreferences(this).getAccounts();
// see if we should show the welcome message
if (accounts.length < 1) {
WelcomeMessage.showWelcomeMessage(this);
finish();
}
// if (accounts.length < 1) {
// WelcomeMessage.showWelcomeMessage(this);
// finish();
// }
List<BaseAccount> newAccounts;
if (!K9.isHideSpecialAccounts() && accounts.length > 0) {

View File

@ -10,6 +10,7 @@ import android.widget.Button;
import android.widget.TextView;
import com.fsck.k9.R;
import com.fsck.k9.activity.Accounts;
import com.fsck.k9.activity.K9Activity;
import com.fsck.k9.helper.HtmlConverter;
@ -33,13 +34,20 @@ public class WelcomeMessage extends K9Activity implements OnClickListener{
welcome.setMovementMethod(LinkMovementMethod.getInstance());
((Button) findViewById(R.id.next)).setOnClickListener(this);
((Button) findViewById(R.id.import_settings)).setOnClickListener(this);
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.next) {
switch (view.getId()) {
case R.id.next:
AccountSetupBasics.actionNewAccount(this);
finish();
break;
case R.id.import_settings:
startActivity(new Intent(getApplicationContext(), Accounts.class)
.putExtra(Accounts.EXTRA_IMPORTFIRST, true));
finish();
}
}
}