Update server settings to current look
* For each of incoming, outgoing, exchange fragment, create a "settings mode" which slightly alters the layout for use in AccountSettingsXL. * Build a settings mode wrapper layout around the basic fragment * Add new constructor to set "settings mode" and select layout * Add wiring for cancel/next buttons in the fragment * AccountSettingsXL configures each fragment in its settings mode * Remove old actionbar "Next" options (no longer needed) TODO: Pixel perfect adjustments, colors, fonts, etc. Bug: 3188951 Change-Id: Iba26281b214333db301dd40d6c016b6c5a932c2d
This commit is contained in:
parent
a2593be72e
commit
112ed496f8
@ -15,6 +15,8 @@
|
||||
-->
|
||||
|
||||
<!-- Exchange server settings - xlarge - see layout/ for phone UX variant -->
|
||||
<!-- This is used directly by the account setup activity, but during settings it is
|
||||
wrapped in an outer layout (account_settings_exchange_fragment) -->
|
||||
<!-- TODO add back styles for final appearance -->
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -15,6 +15,8 @@
|
||||
-->
|
||||
|
||||
<!-- Incoming server settings - xlarge - see layout/ for phone UX variant -->
|
||||
<!-- This is used directly by the account setup activity, but during settings it is
|
||||
wrapped in an outer layout (account_settings_incoming_fragment) -->
|
||||
<!-- TODO add back styles for final appearance -->
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -15,6 +15,8 @@
|
||||
-->
|
||||
|
||||
<!-- Incoming server settings - xlarge - see layout/ for phone UX variant -->
|
||||
<!-- This is used directly by the account setup activity, but during settings it is
|
||||
wrapped in an outer layout (account_settings_outgoing_fragment) -->
|
||||
<!-- TODO add back styles for final appearance -->
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
|
92
res/layout/account_settings_exchange_fragment.xml
Normal file
92
res/layout/account_settings_exchange_fragment.xml
Normal file
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2010 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- Exchange server settings. This is a wrapper around the "exchange setup" fragment
|
||||
that adds scrollview & buttons and makes it more compatible with a 2-pane PreferenceActivity
|
||||
such as AccountSettingsXL. -->
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="32dip"
|
||||
android:paddingBottom="32dip"
|
||||
android:paddingLeft="16dip"
|
||||
android:paddingRight="16dip"
|
||||
>
|
||||
<!-- Headline and hairline dividers -->
|
||||
<View
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/account_setup_divider_color" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_marginLeft="16dip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/account_setup_exchange_headline"
|
||||
android:textAppearance="@style/accountSettingsHeadline" />
|
||||
|
||||
<View
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/account_setup_divider_color" />
|
||||
|
||||
<!-- Fields entry -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dip"
|
||||
>
|
||||
<include
|
||||
layout="@layout/account_setup_exchange_fragment"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- This spacer fills the viewport and moves the buttons to the bottom -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<!-- Cancel & Done buttons -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginTop="48dip"
|
||||
style="@style/accountSettingsButton"
|
||||
android:text="@string/cancel_action" />
|
||||
<Button
|
||||
android:id="@+id/done"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="48dip"
|
||||
style="@style/accountSettingsButton"
|
||||
android:text="@string/done_action" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
92
res/layout/account_settings_incoming_fragment.xml
Normal file
92
res/layout/account_settings_incoming_fragment.xml
Normal file
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2010 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- Incoming server settings. This is a wrapper around the "incoming setup" fragment
|
||||
that adds scrollview & buttons and makes it more compatible with a 2-pane PreferenceActivity
|
||||
such as AccountSettingsXL. -->
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="32dip"
|
||||
android:paddingBottom="32dip"
|
||||
android:paddingLeft="16dip"
|
||||
android:paddingRight="16dip"
|
||||
>
|
||||
<!-- Headline and hairline dividers -->
|
||||
<View
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/account_setup_divider_color" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_marginLeft="16dip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/account_setup_incoming_headline"
|
||||
android:textAppearance="@style/accountSettingsHeadline" />
|
||||
|
||||
<View
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/account_setup_divider_color" />
|
||||
|
||||
<!-- Fields entry -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dip"
|
||||
>
|
||||
<include
|
||||
layout="@layout/account_setup_incoming_fragment"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- This spacer fills the viewport and moves the buttons to the bottom -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<!-- Cancel & Done buttons -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginTop="48dip"
|
||||
style="@style/accountSettingsButton"
|
||||
android:text="@string/cancel_action" />
|
||||
<Button
|
||||
android:id="@+id/done"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="48dip"
|
||||
style="@style/accountSettingsButton"
|
||||
android:text="@string/done_action" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
92
res/layout/account_settings_outgoing_fragment.xml
Normal file
92
res/layout/account_settings_outgoing_fragment.xml
Normal file
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2010 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- Outgoing server settings. This is a wrapper around the "outgoing setup" fragment
|
||||
that adds scrollview & buttons and makes it more compatible with a 2-pane PreferenceActivity
|
||||
such as AccountSettingsXL. -->
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="32dip"
|
||||
android:paddingBottom="32dip"
|
||||
android:paddingLeft="16dip"
|
||||
android:paddingRight="16dip"
|
||||
>
|
||||
<!-- Headline and hairline dividers -->
|
||||
<View
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/account_setup_divider_color" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_marginLeft="16dip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/account_setup_outgoing_headline"
|
||||
android:textAppearance="@style/accountSettingsHeadline" />
|
||||
|
||||
<View
|
||||
android:layout_marginBottom="16dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/account_setup_divider_color" />
|
||||
|
||||
<!-- Fields entry -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dip"
|
||||
>
|
||||
<include
|
||||
layout="@layout/account_setup_outgoing_fragment"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- This spacer fills the viewport and moves the buttons to the bottom -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<!-- Cancel & Done buttons -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginTop="48dip"
|
||||
style="@style/accountSettingsButton"
|
||||
android:text="@string/cancel_action" />
|
||||
<Button
|
||||
android:id="@+id/done"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="48dip"
|
||||
style="@style/accountSettingsButton"
|
||||
android:text="@string/done_action" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
@ -17,6 +17,11 @@
|
||||
<!-- STOPSHIP need final styles for all of account_setup_* -->
|
||||
<!-- Specializations for xlarge screens - most colors are in values/colors.xml -->
|
||||
<resources>
|
||||
<!-- The headline at the top of every account settings fragments (in preferences) -->
|
||||
<style name="accountSettingsHeadline">
|
||||
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
|
||||
</style>
|
||||
|
||||
<!-- The large headline at the top of every account setup screen -->
|
||||
<style name="accountSetupHeadline">
|
||||
<item name="android:textSize">28sp</item>
|
||||
@ -24,12 +29,21 @@
|
||||
</style>
|
||||
|
||||
<!-- Wizard buttons on the account setup screens -->
|
||||
<!-- STOPSHIP these are estimates -->
|
||||
<style name="accountSetupButton">
|
||||
<item name="android:layout_width">240sp</item>
|
||||
<item name="android:layout_height">70sp</item>
|
||||
<item name="android:textSize">24sp</item>
|
||||
</style>
|
||||
|
||||
<!-- Cancel/Done buttons on the account settings (server settings) fragments -->
|
||||
<!-- STOPSHIP these are estimates -->
|
||||
<style name="accountSettingsButton">
|
||||
<item name="android:layout_width">200sp</item>
|
||||
<item name="android:layout_height">60sp</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<!-- Message compose STOPSHIP not final -->
|
||||
<style name="message_compose_header_field_container_no_tray" parent="PlainEditText">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
|
@ -69,11 +69,11 @@
|
||||
<!-- Actions will be used as buttons and in menu items -->
|
||||
<skip />
|
||||
|
||||
<!-- Used as part of a multi-step process -->
|
||||
<!-- Button name used as part of a multi-step process -->
|
||||
<string name="next_action">Next</string>
|
||||
<!-- Button name used to confirm acceptance of dialog boxes, warnings, errors, etc. -->
|
||||
<!-- Button name used to confirm acceptance of dialog boxes, warnings, errors, etc. -->
|
||||
<string name="okay_action">OK</string>
|
||||
<!-- Button name used to cancel out of dialog boxes -->
|
||||
<!-- Button name used to cancel out of dialog boxes -->
|
||||
<string name="cancel_action">Cancel</string>
|
||||
<!-- Button name used to move to previous step during setup sequence [CHAR_LIMIT=16] -->
|
||||
<string name="previous_action">Previous</string>
|
||||
|
@ -34,6 +34,12 @@
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
</style>
|
||||
|
||||
<!-- The headline at the top of every account settings fragments (in preferences) -->
|
||||
<!-- STOPSHIP copied from xlarge - do something for phone UX -->
|
||||
<style name="accountSettingsHeadline">
|
||||
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
|
||||
</style>
|
||||
|
||||
<!-- The large headline at the top of every account setup screen -->
|
||||
<!-- STOPSHIP copied from xlarge - do something for phone UX -->
|
||||
<style name="accountSetupHeadline">
|
||||
@ -42,13 +48,21 @@
|
||||
</style>
|
||||
|
||||
<!-- Wizard buttons on the account setup screens -->
|
||||
<!-- TODO these are estimates based on TBD phone UX -->
|
||||
<!-- STOPSHIP these are estimates based on TBD phone UX -->
|
||||
<style name="accountSetupButton">
|
||||
<item name="android:layout_width">160sp</item>
|
||||
<item name="android:layout_height">40sp</item>
|
||||
<item name="android:textAppearance">?android:attr/textColorPrimary</item>
|
||||
</style>
|
||||
|
||||
<!-- Cancel/Done buttons on the account settings (server settings) fragments -->
|
||||
<!-- STOPSHIP these are estimates - do something for phone UX -->
|
||||
<style name="accountSettingsButton">
|
||||
<item name="android:layout_width">160sp</item>
|
||||
<item name="android:layout_height">40sp</item>
|
||||
<item name="android:textAppearance">?android:attr/textColorPrimary</item>
|
||||
</style>
|
||||
|
||||
<!-- EditText style without the "tray" -->
|
||||
<style name="PlainEditText" parent="android:Widget.EditText">
|
||||
<item name="android:background">#ffffff</item>
|
||||
|
@ -23,9 +23,9 @@ import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.Button;
|
||||
|
||||
/**
|
||||
* Common base class for server settings fragments, so they can be more easily manipulated by
|
||||
@ -36,13 +36,15 @@ import android.view.MenuItem;
|
||||
* Present "Next" button and respond to its clicks
|
||||
*/
|
||||
public abstract class AccountServerBaseFragment extends Fragment
|
||||
implements AccountCheckSettingsFragment.Callbacks {
|
||||
implements AccountCheckSettingsFragment.Callbacks, OnClickListener {
|
||||
|
||||
private final static String BUNDLE_KEY_SETTINGS = "AccountServerBaseFragment.settings";
|
||||
|
||||
protected Context mContext;
|
||||
protected Callback mCallback = EmptyCallback.INSTANCE;
|
||||
protected boolean mNextButtonEnabled;
|
||||
// STOPSHIP - this is a temp UI for "next" in AccountSettings. Disabled during Account Setup.
|
||||
public boolean mNextButtonDisplayed = true;
|
||||
protected boolean mSettingsMode;
|
||||
// This is null in the setup wizard screens, and non-null in AccountSettings mode
|
||||
public Button mProceedButton;
|
||||
|
||||
/**
|
||||
* Callback interface that owning activities must provide
|
||||
@ -77,6 +79,41 @@ public abstract class AccountServerBaseFragment extends Fragment
|
||||
@Override public void onCheckSettingsComplete(int result, int setupMode) { }
|
||||
}
|
||||
|
||||
/**
|
||||
* At constructor time, set the fragment arguments
|
||||
*/
|
||||
protected void setSetupArguments(boolean settingsMode) {
|
||||
Bundle b = new Bundle();
|
||||
b.putBoolean(BUNDLE_KEY_SETTINGS, true);
|
||||
setArguments(b);
|
||||
}
|
||||
|
||||
/**
|
||||
* At onCreate time, read the fragment arguments
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Get arguments, which modally switch us into "settings" mode (different appearance)
|
||||
mSettingsMode = false;
|
||||
if (getArguments() != null) {
|
||||
mSettingsMode = getArguments().getBoolean(BUNDLE_KEY_SETTINGS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from onCreateView, to do settings mode configuration
|
||||
*/
|
||||
protected void onCreateViewSettingsMode(View view) {
|
||||
if (mSettingsMode) {
|
||||
view.findViewById(R.id.cancel).setOnClickListener(this);
|
||||
mProceedButton = (Button) view.findViewById(R.id.done);
|
||||
mProceedButton.setOnClickListener(this);
|
||||
mProceedButton.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a fragment is first attached to its activity.
|
||||
* {@link #onCreate(Bundle)} will be called after this.
|
||||
@ -93,51 +130,18 @@ public abstract class AccountServerBaseFragment extends Fragment
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to do initial creation of a fragment. This is called after
|
||||
* {@link #onAttach(Activity)} and before {@link #onActivityCreated(Bundle)}.
|
||||
* Implements OnClickListener
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
mNextButtonEnabled = false;
|
||||
}
|
||||
|
||||
// Add a "Next" button when this fragment is displayed
|
||||
// TODO remove this and replace with a button during Account Settings
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
if (mNextButtonDisplayed) {
|
||||
inflater.inflate(R.menu.account_setup_next_option, menu);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable "next" button
|
||||
* TODO remove this and replace with a button during Account Settings
|
||||
*/
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(Menu menu) {
|
||||
if (mNextButtonDisplayed) {
|
||||
MenuItem item = menu.findItem(R.id.next);
|
||||
item.setEnabled(mNextButtonEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Respond to clicks in the "Next" button
|
||||
* TODO remove this and replace with a button during Account Settings
|
||||
*/
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.next:
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.cancel:
|
||||
getActivity().onBackPressed();
|
||||
break;
|
||||
case R.id.done:
|
||||
onNext();
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,16 +156,13 @@ public abstract class AccountServerBaseFragment extends Fragment
|
||||
* Enable/disable the "next" button
|
||||
*/
|
||||
public void enableNextButton(boolean enable) {
|
||||
// We have to set mNextButtonEnabled first, because invalidateOptionsMenu calls
|
||||
// onPrepareOptionsMenu immediately
|
||||
boolean wasEnabled = mNextButtonEnabled;
|
||||
mNextButtonEnabled = enable;
|
||||
|
||||
if (enable != wasEnabled) {
|
||||
getActivity().invalidateOptionsMenu();
|
||||
// If we are in settings "mode" we may be showing our own next button, and we'll
|
||||
// enable it directly, here
|
||||
if (mProceedButton != null) {
|
||||
mProceedButton.setEnabled(enable);
|
||||
}
|
||||
|
||||
// TODO: This supports the legacy activities and will be removed
|
||||
// TODO: This supports the phone UX activities and will be removed
|
||||
mCallback.onEnableProceedButtons(enable);
|
||||
}
|
||||
|
||||
|
@ -531,9 +531,9 @@ public class AccountSettingsXL extends PreferenceActivity {
|
||||
SetupData.init(SetupData.FLOW_MODE_EDIT, account);
|
||||
Fragment f = null;
|
||||
if (setting.equals(AccountSetupIncoming.class)) {
|
||||
f = new AccountSetupIncomingFragment();
|
||||
f = AccountSetupIncomingFragment.newInstance(true);
|
||||
} else if (setting.equals(AccountSetupExchange.class)) {
|
||||
f = new AccountSetupExchangeFragment();
|
||||
f = AccountSetupExchangeFragment.newInstance(true);
|
||||
}
|
||||
startPreferenceFragment(f, true);
|
||||
}
|
||||
@ -561,7 +561,7 @@ public class AccountSettingsXL extends PreferenceActivity {
|
||||
SetupData.init(SetupData.FLOW_MODE_EDIT, account);
|
||||
Fragment f = null;
|
||||
if (setting.equals(AccountSetupOutgoing.class)) {
|
||||
f = new AccountSetupOutgoingFragment();
|
||||
f = AccountSetupOutgoingFragment.newInstance(true);
|
||||
}
|
||||
startPreferenceFragment(f, true);
|
||||
}
|
||||
|
@ -90,9 +90,6 @@ public class AccountSetupExchange extends AccountSetupActivity
|
||||
mFragment = (AccountSetupExchangeFragment)
|
||||
getFragmentManager().findFragmentById(R.id.setup_fragment);
|
||||
mFragment.setCallback(this);
|
||||
// TODO temp code to inhibit the options menu - still needed for AccountSettings
|
||||
mFragment.mNextButtonDisplayed = false;
|
||||
invalidateOptionsMenu();
|
||||
|
||||
mNextButton = (Button) findViewById(R.id.next);
|
||||
mNextButton.setOnClickListener(this);
|
||||
|
@ -69,6 +69,16 @@ public class AccountSetupExchangeFragment extends AccountServerBaseFragment
|
||||
private boolean mLoaded;
|
||||
private String mCacheLoginCredential;
|
||||
|
||||
/**
|
||||
* Create the fragment with parameters - used mainly to force into settings mode (with buttons)
|
||||
* @param settingsMode if true, alters appearance for use in settings (default is "setup")
|
||||
*/
|
||||
public static AccountSetupExchangeFragment newInstance(boolean settingsMode) {
|
||||
AccountSetupExchangeFragment f = new AccountSetupExchangeFragment();
|
||||
f.setSetupArguments(settingsMode);
|
||||
return f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to do initial creation of a fragment. This is called after
|
||||
* {@link #onAttach(Activity)} and before {@link #onActivityCreated(Bundle)}.
|
||||
@ -92,7 +102,11 @@ public class AccountSetupExchangeFragment extends AccountServerBaseFragment
|
||||
if (Email.DEBUG_LIFECYCLE && Email.DEBUG) {
|
||||
Log.d(Email.LOG_TAG, "AccountSetupExchangeFragment onCreateView");
|
||||
}
|
||||
View view = inflater.inflate(R.layout.account_setup_exchange_fragment, container, false);
|
||||
int layoutId = mSettingsMode
|
||||
? R.layout.account_settings_exchange_fragment
|
||||
: R.layout.account_setup_exchange_fragment;
|
||||
|
||||
View view = inflater.inflate(layoutId, container, false);
|
||||
Context context = getActivity();
|
||||
|
||||
mUsernameView = (EditText) view.findViewById(R.id.account_username);
|
||||
@ -127,6 +141,9 @@ public class AccountSetupExchangeFragment extends AccountServerBaseFragment
|
||||
}
|
||||
//EXCHANGE-REMOVE-SECTION-END
|
||||
|
||||
// Additional setup only used while in "settings" mode
|
||||
onCreateViewSettingsMode(view);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -58,9 +58,6 @@ public class AccountSetupIncoming extends AccountSetupActivity
|
||||
|
||||
// Configure fragment
|
||||
mFragment.setCallback(this);
|
||||
// TODO temp code to inhibit the options menu - still needed for AccountSettings
|
||||
mFragment.mNextButtonDisplayed = false;
|
||||
invalidateOptionsMenu();
|
||||
|
||||
mNextButton = (Button) findViewById(R.id.next);
|
||||
mNextButton.setOnClickListener(this);
|
||||
|
@ -85,6 +85,16 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment {
|
||||
private boolean mLoaded;
|
||||
private String mCacheLoginCredential;
|
||||
|
||||
/**
|
||||
* Create the fragment with parameters - used mainly to force into settings mode (with buttons)
|
||||
* @param settingsMode if true, alters appearance for use in settings (default is "setup")
|
||||
*/
|
||||
public static AccountSetupIncomingFragment newInstance(boolean settingsMode) {
|
||||
AccountSetupIncomingFragment f = new AccountSetupIncomingFragment();
|
||||
f.setSetupArguments(settingsMode);
|
||||
return f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to do initial creation of a fragment. This is called after
|
||||
* {@link #onAttach(Activity)} and before {@link #onActivityCreated(Bundle)}.
|
||||
@ -108,7 +118,11 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment {
|
||||
if (Email.DEBUG_LIFECYCLE && Email.DEBUG) {
|
||||
Log.d(Email.LOG_TAG, "AccountSetupIncomingFragment onCreateView");
|
||||
}
|
||||
View view = inflater.inflate(R.layout.account_setup_incoming_fragment, container, false);
|
||||
int layoutId = mSettingsMode
|
||||
? R.layout.account_settings_incoming_fragment
|
||||
: R.layout.account_setup_incoming_fragment;
|
||||
|
||||
View view = inflater.inflate(layoutId, container, false);
|
||||
Context context = getActivity();
|
||||
|
||||
mUsernameView = (EditText) view.findViewById(R.id.account_username);
|
||||
@ -183,6 +197,9 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment {
|
||||
// Only allow digits in the port field.
|
||||
mPortView.setKeyListener(DigitsKeyListener.getInstance("0123456789"));
|
||||
|
||||
// Additional setup only used while in "settings" mode
|
||||
onCreateViewSettingsMode(view);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -58,9 +58,6 @@ public class AccountSetupOutgoing extends Activity
|
||||
|
||||
// Configure fragment
|
||||
mFragment.setCallback(this);
|
||||
// TODO temp code to inhibit the options menu - still needed for AccountSettings
|
||||
mFragment.mNextButtonDisplayed = false;
|
||||
invalidateOptionsMenu();
|
||||
|
||||
mNextButton = (Button) findViewById(R.id.next);
|
||||
mNextButton.setOnClickListener(this);
|
||||
|
@ -76,6 +76,16 @@ public class AccountSetupOutgoingFragment extends AccountServerBaseFragment
|
||||
private boolean mStarted;
|
||||
private boolean mLoaded;
|
||||
|
||||
/**
|
||||
* Create the fragment with parameters - used mainly to force into settings mode (with buttons)
|
||||
* @param settingsMode if true, alters appearance for use in settings (default is "setup")
|
||||
*/
|
||||
public static AccountSetupOutgoingFragment newInstance(boolean settingsMode) {
|
||||
AccountSetupOutgoingFragment f = new AccountSetupOutgoingFragment();
|
||||
f.setSetupArguments(settingsMode);
|
||||
return f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to do initial creation of a fragment. This is called after
|
||||
* {@link #onAttach(Activity)} and before {@link #onActivityCreated(Bundle)}.
|
||||
@ -98,7 +108,11 @@ public class AccountSetupOutgoingFragment extends AccountServerBaseFragment
|
||||
if (Email.DEBUG_LIFECYCLE && Email.DEBUG) {
|
||||
Log.d(Email.LOG_TAG, "AccountSetupOutgoingFragment onCreateView");
|
||||
}
|
||||
View view = inflater.inflate(R.layout.account_setup_outgoing_fragment, container, false);
|
||||
int layoutId = mSettingsMode
|
||||
? R.layout.account_settings_outgoing_fragment
|
||||
: R.layout.account_setup_outgoing_fragment;
|
||||
|
||||
View view = inflater.inflate(layoutId, container, false);
|
||||
Context context = getActivity();
|
||||
|
||||
mUsernameView = (EditText) view.findViewById(R.id.account_username);
|
||||
@ -154,10 +168,12 @@ public class AccountSetupOutgoingFragment extends AccountServerBaseFragment
|
||||
mServerView.addTextChangedListener(validationTextWatcher);
|
||||
mPortView.addTextChangedListener(validationTextWatcher);
|
||||
|
||||
/*
|
||||
* Only allow digits in the port field.
|
||||
*/
|
||||
// Only allow digits in the port field.
|
||||
mPortView.setKeyListener(DigitsKeyListener.getInstance("0123456789"));
|
||||
|
||||
// Additional setup only used while in "settings" mode
|
||||
onCreateViewSettingsMode(view);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user