Convert server settings to dialog
b/8134410 Change-Id: I3c4c9a02a37571a9c7af10971840fbe39458244e
This commit is contained in:
parent
6e976f1d05
commit
751a029c31
@ -165,7 +165,10 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.setup.AccountCredentials"
|
android:name=".activity.setup.AccountCredentials"
|
||||||
android:label="@string/sign_in_title">
|
android:label="@string/sign_in_title"
|
||||||
|
android:exported="false"
|
||||||
|
android:excludeFromRecents="true"
|
||||||
|
android:theme="@style/AccountSetupDialogActivityTheme">
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
@ -301,10 +304,12 @@
|
|||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".activity.setup.AccountServerSettingsActivity"
|
<activity
|
||||||
android:label="@string/mailbox_settings_activity_title"
|
android:name=".activity.setup.AccountServerSettingsActivity"
|
||||||
android:exported="false">
|
android:label="@string/mailbox_settings_activity_title"
|
||||||
</activity>
|
android:exported="false"
|
||||||
|
android:excludeFromRecents="true"
|
||||||
|
android:theme="@style/AccountSetupDialogActivityTheme" />
|
||||||
<!-- a Headless Activity to load the account from the account id before navigating to the
|
<!-- a Headless Activity to load the account from the account id before navigating to the
|
||||||
Incoming Account Settings fragment -->
|
Incoming Account Settings fragment -->
|
||||||
<activity
|
<activity
|
||||||
|
@ -13,20 +13,30 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent" >
|
android:layout_height="wrap_content"
|
||||||
<LinearLayout
|
android:orientation="vertical"
|
||||||
style="@style/account_setup_fragment_container"
|
android:divider="?android:attr/dividerHorizontal"
|
||||||
android:layout_width="match_parent"
|
android:showDividers="middle" >
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="@dimen/settings_fragment_padding_top" >
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" >
|
android:paddingLeft="@dimen/settings_fragment_padding_side"
|
||||||
|
android:paddingRight="@dimen/settings_fragment_padding_side" >
|
||||||
|
|
||||||
<include
|
<include layout="@layout/account_setup_credentials_fragment" />
|
||||||
layout="@layout/account_setup_credentials_fragment"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<include layout="@layout/account_settings_buttons" />
|
</FrameLayout>
|
||||||
</LinearLayout>
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
<include layout="@layout/account_settings_buttons"/>
|
||||||
|
</LinearLayout>
|
||||||
|
@ -14,9 +14,7 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/account_server_settings_container">
|
android:id="@+id/account_server_settings_container" />
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
@ -18,19 +18,20 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="@dimen/settings_buttons_padding_top"
|
style="?android:attr/buttonBarStyle" >
|
||||||
android:paddingBottom="@dimen/settings_buttons_padding_bottom">
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/cancel"
|
android:id="@+id/cancel"
|
||||||
style="@style/account_settings_button"
|
android:layout_width="0dp"
|
||||||
android:layout_width="0dip"
|
android:layout_height="48sp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@android:string/cancel" />
|
android:text="@android:string/cancel"
|
||||||
|
style="?android:attr/buttonBarButtonStyle" />
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/done"
|
android:id="@+id/done"
|
||||||
style="@style/account_settings_button"
|
android:layout_width="0dp"
|
||||||
android:layout_width="0dip"
|
android:layout_height="48sp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/done" />
|
android:text="@string/done"
|
||||||
</LinearLayout>
|
style="?android:attr/buttonBarButtonStyle" />
|
||||||
|
</LinearLayout>
|
||||||
|
@ -15,38 +15,31 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Incoming server settings. This is a wrapper around the "incoming setup" fragment
|
<!-- 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
|
that adds scrollview & buttons -->
|
||||||
such as AccountSettingsXL. -->
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:fillViewport="true"
|
android:orientation="vertical"
|
||||||
>
|
android:divider="?android:attr/dividerHorizontal"
|
||||||
<LinearLayout
|
android:showDividers="middle" >
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
<ScrollView
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:paddingTop="@dimen/settings_fragment_padding_top"
|
android:layout_height="0dp"
|
||||||
android:paddingLeft="@dimen/settings_fragment_padding_side"
|
android:layout_weight="1"
|
||||||
android:paddingRight="@dimen/settings_fragment_padding_side"
|
android:paddingTop="@dimen/settings_fragment_padding_top" >
|
||||||
>
|
|
||||||
|
|
||||||
<!-- Fields entry -->
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
>
|
android:paddingLeft="@dimen/settings_fragment_padding_side"
|
||||||
<include
|
android:paddingRight="@dimen/settings_fragment_padding_side" >
|
||||||
layout="@layout/account_setup_incoming_fragment"
|
|
||||||
/>
|
<include layout="@layout/account_setup_incoming_fragment" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<!-- This spacer fills the viewport and moves the buttons to the bottom -->
|
</ScrollView>
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dip"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<include layout="@layout/account_settings_buttons" />
|
<include layout="@layout/account_settings_buttons"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
|
||||||
|
@ -15,38 +15,31 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Outgoing server settings. This is a wrapper around the "outgoing setup" fragment
|
<!-- 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
|
that adds scrollview & buttons -->
|
||||||
such as AccountSettingsXL. -->
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:fillViewport="true"
|
android:orientation="vertical"
|
||||||
>
|
android:divider="?android:attr/dividerHorizontal"
|
||||||
<LinearLayout
|
android:showDividers="middle" >
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
<ScrollView
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:paddingTop="@dimen/settings_fragment_padding_top"
|
android:layout_height="0dp"
|
||||||
android:paddingLeft="@dimen/settings_fragment_padding_side"
|
android:layout_weight="1"
|
||||||
android:paddingRight="@dimen/settings_fragment_padding_side"
|
android:paddingTop="@dimen/settings_fragment_padding_top" >
|
||||||
>
|
|
||||||
|
|
||||||
<!-- Fields entry -->
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
>
|
android:paddingLeft="@dimen/settings_fragment_padding_side"
|
||||||
<include
|
android:paddingRight="@dimen/settings_fragment_padding_side" >
|
||||||
layout="@layout/account_setup_outgoing_fragment"
|
|
||||||
/>
|
<include layout="@layout/account_setup_outgoing_fragment" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<!-- This spacer fills the viewport and moves the buttons to the bottom -->
|
</ScrollView>
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dip"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<include layout="@layout/account_settings_buttons" />
|
<include layout="@layout/account_settings_buttons"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
|
||||||
|
26
res/values-v21/styles.xml
Normal file
26
res/values-v21/styles.xml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2009 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<style name="AccountSetupDialogActivityTheme"
|
||||||
|
parent="@android:style/Theme.Material.Light.Dialog.NoActionBar">
|
||||||
|
<!-- ActionBar color -->
|
||||||
|
<item name="android:colorPrimary">@color/actionbar_color</item>
|
||||||
|
<!-- Used by the StatusBar and NavBar (currently broken?) -->
|
||||||
|
<item name="android:colorPrimaryDark">@color/statusbar_color</item>
|
||||||
|
<item name="android:colorAccent">@color/accent_blue</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
@ -15,6 +15,8 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
|
<style name="AccountSetupDialogActivityTheme"
|
||||||
|
parent="@android:style/Theme.Holo.Light.Dialog.NoActionBar" />
|
||||||
<!-- Account Setup Activity -->
|
<!-- Account Setup Activity -->
|
||||||
<style name="account_setup_content">
|
<style name="account_setup_content">
|
||||||
<item name="android:background">@drawable/account_setup_background</item>
|
<item name="android:background">@drawable/account_setup_background</item>
|
||||||
|
@ -32,6 +32,8 @@ public class AccountCredentials extends Activity
|
|||||||
final String emailAddress = getIntent().getStringExtra(EXTRA_EMAIL);
|
final String emailAddress = getIntent().getStringExtra(EXTRA_EMAIL);
|
||||||
final String protocol = getIntent().getStringExtra(EXTRA_PROTOCOL);
|
final String protocol = getIntent().getStringExtra(EXTRA_PROTOCOL);
|
||||||
|
|
||||||
|
setFinishOnTouchOutside(false);
|
||||||
|
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
final AccountSetupCredentialsFragment f =
|
final AccountSetupCredentialsFragment f =
|
||||||
AccountSetupCredentialsFragment.newInstance(emailAddress, protocol,
|
AccountSetupCredentialsFragment.newInstance(emailAddress, protocol,
|
||||||
|
@ -67,8 +67,8 @@ public class AccountServerSettingsActivity extends AccountSetupActivity implemen
|
|||||||
|
|
||||||
mSetupData.setFlowMode(SetupDataFragment.FLOW_MODE_EDIT);
|
mSetupData.setFlowMode(SetupDataFragment.FLOW_MODE_EDIT);
|
||||||
|
|
||||||
// TODO: this activity is ugly as sin
|
|
||||||
setContentView(R.layout.account_server_settings);
|
setContentView(R.layout.account_server_settings);
|
||||||
|
setFinishOnTouchOutside(false);
|
||||||
|
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
final Account account = getIntent().getParcelableExtra(EXTRA_ACCOUNT);
|
final Account account = getIntent().getParcelableExtra(EXTRA_ACCOUNT);
|
||||||
|
Loading…
Reference in New Issue
Block a user