Merge "don't use hidden constants (to refer Downloads table columns)"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a3d54c4..89e93dc 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -185,8 +185,10 @@
android:resource="@xml/bookmarks_searchable" />
</activity>
- <activity android:name="AddBookmarkPage" android:label="Save bookmark" android:theme="@style/Dialog.Holo"
- android:configChanges="orientation|keyboardHidden" android:windowSoftInputMode="stateHidden">
+ <activity android:name="AddBookmarkPage" android:label="Save bookmark"
+ android:theme="@style/Dialog"
+ android:configChanges="orientation|keyboardHidden"
+ android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<category android:name="android.intent.category.DEFAULT" />
diff --git a/res/drawable-hdpi/divider_vert.9.png b/res/drawable-hdpi/divider_vert.9.png
new file mode 100644
index 0000000..2c5646e
--- /dev/null
+++ b/res/drawable-hdpi/divider_vert.9.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_pressed.png b/res/drawable-hdpi/ic_pressed.png
new file mode 100644
index 0000000..fd1c7d9
--- /dev/null
+++ b/res/drawable-hdpi/ic_pressed.png
Binary files differ
diff --git a/res/layout-land/http_authentication.xml b/res/layout-land/http_authentication.xml
index c008ceb..3fa7e4f 100644
--- a/res/layout-land/http_authentication.xml
+++ b/res/layout-land/http_authentication.xml
@@ -18,7 +18,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
- android:orientation="vertical">
+ android:orientation="vertical" >
<TableLayout
android:layout_width="match_parent"
@@ -28,15 +28,11 @@
<TableRow>
<TextView android:id="@+id/username_view"
- android:textSize="18sp"
- android:textColor="@color/username_text"
android:text="@string/username"
android:gravity="right"
android:layout_marginLeft="20dip" />
<EditText android:id="@+id/username_edit"
- android:textSize="18sp"
- android:textColor="@color/username_edit"
android:scrollHorizontally="true"
android:autoText="false"
android:capitalize="none"
@@ -49,15 +45,11 @@
<TableRow>
<TextView android:id="@+id/password_view"
- android:textSize="18sp"
- android:textColor="@color/password_text"
android:text="@string/password"
android:gravity="right"
android:layout_marginLeft="20dip" />
<EditText android:id="@+id/password_edit"
- android:textSize="18sp"
- android:textColor="@color/password_edit"
android:scrollHorizontally="true"
android:autoText="false"
android:capitalize="none"
diff --git a/res/layout-land/ssl_certificate.xml b/res/layout-land/ssl_certificate.xml
index 44c5904..6505fe5 100644
--- a/res/layout-land/ssl_certificate.xml
+++ b/res/layout-land/ssl_certificate.xml
@@ -56,8 +56,6 @@
android:id="@+id/issued_to_header"
android:text="@string/issued_to"
android:textStyle="bold"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="20dip"
@@ -69,15 +67,11 @@
<TextView
android:id="@+id/to_common_header"
android:text="@string/common_name"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip" />
<TextView
android:id="@+id/to_common"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
@@ -89,15 +83,11 @@
<TextView
android:id="@+id/to_org_header"
android:text="@string/org_name"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip" />
<TextView
android:id="@+id/to_org"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
@@ -109,15 +99,11 @@
<TextView
android:id="@+id/to_org_unit_header"
android:text="@string/org_unit"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip" />
<TextView
android:id="@+id/to_org_unit"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
@@ -129,8 +115,6 @@
android:id="@+id/issued_to_header"
android:text="@string/issued_by"
android:textStyle="bold"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="20dip"
@@ -142,15 +126,11 @@
<TextView
android:id="@+id/by_common_header"
android:text="@string/common_name"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip" />
<TextView
android:id="@+id/by_common"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
@@ -162,15 +142,11 @@
<TextView
android:id="@+id/by_org_header"
android:text="@string/org_name"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip" />
<TextView
android:id="@+id/by_org"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
@@ -182,15 +158,11 @@
<TextView
android:id="@+id/by_org_unit_header"
android:text="@string/org_unit"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip" />
<TextView
android:id="@+id/by_org_unit"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
@@ -204,8 +176,6 @@
android:layout_width="wrap_content"
android:text="@string/validity_period"
android:textStyle="bold"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_marginBottom="7dip" />
@@ -217,8 +187,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/issued_on"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip" />
@@ -226,8 +194,6 @@
android:id="@+id/issued_on"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
@@ -242,8 +208,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expires_on"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip" />
@@ -251,8 +215,6 @@
android:id="@+id/expires_on"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
diff --git a/res/layout/http_authentication.xml b/res/layout/http_authentication.xml
index cc785c9..cee3a42 100644
--- a/res/layout/http_authentication.xml
+++ b/res/layout/http_authentication.xml
@@ -18,14 +18,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
- android:orientation="vertical">
+ android:orientation="vertical"
+ >
<TextView
android:id="@+id/username_view"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="18sp"
- android:textColor="@color/username_text"
android:text="@string/username"
android:gravity="left"
android:layout_marginTop="12dip"
@@ -34,8 +33,6 @@
<EditText
android:id="@+id/username_edit"
- android:textSize="18sp"
- android:textColor="@color/username_edit"
android:scrollHorizontally="true"
android:inputType="text"
android:gravity="fill_horizontal"
@@ -48,8 +45,6 @@
android:id="@+id/password_view"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="18sp"
- android:textColor="@color/password_text"
android:text="@string/password"
android:gravity="left"
android:layout_marginLeft="20dip"
@@ -57,8 +52,6 @@
<EditText
android:id="@+id/password_edit"
- android:textSize="18sp"
- android:textColor="@color/password_edit"
android:scrollHorizontally="true"
android:inputType="textPassword"
android:gravity="fill_horizontal"
diff --git a/res/layout/page_info.xml b/res/layout/page_info.xml
index 275fcf4..7feb24e 100644
--- a/res/layout/page_info.xml
+++ b/res/layout/page_info.xml
@@ -31,8 +31,6 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textStyle="bold"
- android:textSize="14sp"
- android:textColor="@color/white"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_marginTop="12dip"
@@ -49,8 +47,6 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/page_info_address"
- android:textSize="14sp"
- android:textColor="@color/white"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
@@ -60,8 +56,6 @@
android:id="@+id/address"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/white"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
diff --git a/res/layout/ssl_certificate.xml b/res/layout/ssl_certificate.xml
index a137d66..28f50a3 100644
--- a/res/layout/ssl_certificate.xml
+++ b/res/layout/ssl_certificate.xml
@@ -57,8 +57,6 @@
android:layout_width="wrap_content"
android:text="@string/issued_to"
android:textStyle="bold"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_marginBottom="10dip" />
@@ -69,8 +67,6 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/common_name"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip" />
@@ -79,8 +75,6 @@
android:id="@+id/to_common"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
@@ -92,8 +86,6 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/org_name"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip" />
@@ -102,8 +94,6 @@
android:id="@+id/to_org"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
@@ -115,8 +105,6 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/org_unit"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip" />
@@ -125,8 +113,6 @@
android:id="@+id/to_org_unit"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
@@ -139,8 +125,6 @@
android:layout_width="wrap_content"
android:text="@string/issued_by"
android:textStyle="bold"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_marginBottom="10dip" />
@@ -151,8 +135,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/common_name"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip" />
@@ -161,8 +143,6 @@
android:id="@+id/by_common"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
@@ -174,8 +154,6 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/org_name"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip" />
@@ -184,8 +162,6 @@
android:id="@+id/by_org"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
@@ -197,8 +173,6 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/org_unit"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip" />
@@ -207,8 +181,6 @@
android:id="@+id/by_org_unit"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
@@ -221,8 +193,6 @@
android:layout_width="wrap_content"
android:text="@string/validity_period"
android:textStyle="bold"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_marginBottom="10dip" />
@@ -233,8 +203,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/issued_on"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip" />
@@ -243,8 +211,6 @@
android:id="@+id/issued_on"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
@@ -256,8 +222,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expires_on"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_label"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip" />
@@ -266,8 +230,6 @@
android:id="@+id/expires_on"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textSize="14sp"
- android:textColor="@color/ssl_text_value"
android:gravity="left"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
diff --git a/res/layout/ssl_success.xml b/res/layout/ssl_success.xml
index e819f23..16f7f58 100644
--- a/res/layout/ssl_success.xml
+++ b/res/layout/ssl_success.xml
@@ -34,8 +34,7 @@
android:layout_width="wrap_content"
android:gravity="left"
android:layout_weight="1"
- android:textSize="18sp"
- android:textColor="@color/ssl_text_label"
+ android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
android:layout_marginBottom="12dip" />
diff --git a/res/layout/ssl_warning.xml b/res/layout/ssl_warning.xml
index 285c189..749629d 100644
--- a/res/layout/ssl_warning.xml
+++ b/res/layout/ssl_warning.xml
@@ -31,8 +31,7 @@
android:id="@+id/warning"
android:gravity="left"
android:layout_weight="1"
- android:textSize="18sp"
- android:textColor="@color/ssl_text_label"
+ android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10dip"
android:layout_marginRight="20dip"
android:layout_marginBottom="12dip" />
diff --git a/res/layout/ssl_warnings.xml b/res/layout/ssl_warnings.xml
index 7e43256..3fe73d3 100644
--- a/res/layout/ssl_warnings.xml
+++ b/res/layout/ssl_warnings.xml
@@ -30,8 +30,7 @@
android:id="@+id/warnings_header"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:textSize="18sp"
- android:textColor="@color/ssl_text_label"
+ android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="left"
android:text="@string/ssl_warnings_header"
android:layout_marginRight="20dip"
diff --git a/res/layout/suggestion_item.xml b/res/layout/suggestion_item.xml
index 37e1f2a..45af644 100644
--- a/res/layout/suggestion_item.xml
+++ b/res/layout/suggestion_item.xml
@@ -24,7 +24,8 @@
android:layout_height="56dip"
android:orientation="horizontal"
android:gravity="center_vertical"
- android:baselineAligned="false">
+ android:baselineAligned="false"
+ >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -39,16 +40,13 @@
android:layout_height="wrap_content" >
<TextView
android:id="@android:id/text1"
- style="?android:attr/dropDownItemStyle"
- android:textAppearance="?android:attr/textAppearanceMediumInverse"
+ style="@style/SuggestionLineMedium"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@android:id/text2"
- style="?android:attr/dropDownItemStyle"
- android:textAppearance="?android:attr/textAppearanceSmallInverse"
- android:textColor="#323232"
+ style="@style/SuggestionLineSmall"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/res/layout/title_bar.xml b/res/layout/title_bar.xml
index d6a77e0..a7e50b7 100644
--- a/res/layout/title_bar.xml
+++ b/res/layout/title_bar.xml
@@ -65,8 +65,6 @@
android:layout_width="0dip"
android:layout_weight="1.0"
android:layout_marginLeft="3dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/black"
android:gravity="center_vertical"
android:singleLine="true"
android:ellipsize="end"
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
index 51dea1c..57bcb91 100644
--- a/res/values-xlarge/styles.xml
+++ b/res/values-xlarge/styles.xml
@@ -17,6 +17,7 @@
* limitations under the License.
*/
-->
+
<resources>
<style name="BrowserTheme" parent="@android:Theme.Holo">
<item name="android:windowBackground">@color/white</item>
@@ -24,20 +25,10 @@
<item name="android:windowActionBar">true</item>
<item name="android:windowNoTitle">false</item>
<item name="android:actionBarStyle">@style/ActionBarStyle</item>
- <item name="android:windowContentOverlay">@null</item>
- <item name="android:actionModeBackground">@drawable/cab_bg</item>
- <item name="android:actionModeCloseDrawable">@drawable/ic_menu_cab_close</item>
<item name="android:actionButtonStyle">@style/ActionButton</item>
- <item name="android:actionOverflowButtonStyle">@style/Overflow</item>
</style>
- <style name="Dialog.Holo" parent="android:Theme.Holo">
- <item name="android:windowFrame">@null</item>
- <item name="android:windowBackground">@drawable/dialog_full</item>
- <item name="android:windowIsFloating">true</item>
- <item name="android:windowContentOverlay">@null</item>
- <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
- <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
- <item name="android:colorBackgroundCacheHint">@null</item>
+ <style name="Dialog" parent="@android:style/Theme.Holo.Dialog" >
+ <item name="android:windowActionBar">false</item>
</style>
<style name="BookmarkTheme" parent="@android:Theme.Holo">
<item name="android:windowActionBar">false</item>
@@ -50,7 +41,6 @@
<item name="android:windowIsTranslucent">true</item>
</style>
<style name="ShortCutTheme" parent="@android:Theme.Holo">
- <item name="android:windowContentOverlay">@null</item>
</style>
<style name="ActionBarStyle">
<item name="android:height">48dip</item>
@@ -59,17 +49,12 @@
<item name="android:displayOptions">hideHome</item>
</style>
<style name="ActionButton">
- <item name="android:height">12dip</item>
<item name="android:background">@drawable/browserbarbutton</item>
</style>
- <style name="Overflow">
- <item name="android:src">@drawable/ic_menu_overflow</item>
- <item name="android:paddingLeft">16dip</item>
- <item name="android:paddingRight">16dip</item>
+ <style name="SuggestionLineMedium"
+ parent="@android:style/TextAppearance.Holo.Medium.Inverse">
</style>
- <style name="TitleBar">
- <item name="android:windowEnterAnimation">@anim/title_bar_enter</item>
- <item name="android:windowExitAnimation">@anim/title_bar_exit</item>
+ <style name="SuggestionLineSmall"
+ parent="@android:style/TextAppearance.Holo.Small.Inverse">
</style>
</resources>
-
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 95105e1..822c3b4 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -20,20 +20,8 @@
<!-- FIXME: Change the name of this file! It is now being used generically
for the browser -->
<resources>
- <color name="username_text">#ffffffff</color>
- <color name="username_edit">#ff000000</color>
-
- <color name="password_text">#ffffffff</color>
- <color name="password_edit">#ff000000</color>
-
- <color name="ssl_text_label">#ffffffff</color>
- <color name="ssl_text_value">#ffffffff</color>
-
<color name="white">#ffffffff</color>
<color name="black">#ff000000</color>
- <color name="tab_title_selected">#ffffffff</color>
- <color name="tab_title_unselected">#ff808080</color>
-
<color name="geolocation_permissions_prompt_background">#ffdddddd</color>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 895c1d0..a1ca842 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -18,10 +18,13 @@
*/
-->
<resources>
- <style name="BrowserTheme" parent="@android:Theme.Holo">
+ <style name="BrowserTheme" parent="@android:Theme.Black">
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
+ <style name="Dialog" parent="@android:style/Theme.Dialog">
+ <item name="android:background">@color/black</item>
+ </style>
<style name="ActionBar" parent="@android:style/Widget.ActionBar">
<item name="android:background">@color/black</item>
</style>
@@ -45,12 +48,15 @@
<item name="android:background">@drawable/browserbarbutton</item>
</style>
<style name="TabTitleSelected" parent="@android:style/TextAppearance.Small">
- <item name="android:textColor">@color/tab_title_selected</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">bold</item>
</style>
<style name="TabTitleUnselected" parent="@android:style/TextAppearance.Small">
- <item name="android:textColor">@color/tab_title_unselected</item>
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:textStyle">normal</item>
</style>
+ <style name="SuggestionLineMedium" parent="@android:style/TextAppearance.Medium">
+ </style>
+ <style name="SuggestionLineSmall" parent="@android:style/TextAppearance.Small">
+ </style>
</resources>
-
diff --git a/src/com/android/browser/AutoFillSettingsFragment.java b/src/com/android/browser/AutoFillSettingsFragment.java
index 608c3de..7728149 100644
--- a/src/com/android/browser/AutoFillSettingsFragment.java
+++ b/src/com/android/browser/AutoFillSettingsFragment.java
@@ -43,6 +43,11 @@
private EditText mCountryEdit;
private EditText mPhoneEdit;
+ // For now we support just one profile so it's safe to hardcode the
+ // id to 1 here. In the future this unique identifier will be set
+ // dynamically.
+ private int mUniqueId = 1;
+
public AutoFillSettingsFragment() {
}
@@ -75,6 +80,7 @@
public void onClick(View button) {
BrowserSettings.getInstance().setAutoFillProfile(getActivity(),
new AutoFillProfile(
+ mUniqueId,
mFullNameEdit.getText().toString(),
mEmailEdit.getText().toString(),
mCompanyEdit.getText().toString(),
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 96b6fd2..3b8aaa4 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -133,9 +133,11 @@
private AutoFillProfile mAutoFillProfile;
- // TODO: For now we only support one autofill profile. Add support for
- // multiple profiles later.
- private int mActiveAutoFillProfileId = 1;
+ // Default to zero. In the case no profile is set up, the initial
+ // value will come from the AutoFillSettingsFragment when the user
+ // creates a profile. Otherwise, we'll read the ID of the last used
+ // profile from the prefs db.
+ private int autoFillActiveProfileId;
// Preference keys that are used outside this class
public final static String PREF_CLEAR_CACHE = "privacy_clear_cache";
@@ -159,6 +161,7 @@
"privacy_clear_geolocation_access";
public final static String PREF_AUTOFILL_ENABLED = "autofill_enabled";
public final static String PREF_AUTOFILL_PROFILE = "autofill_profile";
+ public final static String PREF_AUTOFILL_ACTIVE_PROFILE_ID = "autofill_active_profile_id";
private static final String DESKTOP_USERAGENT = "Mozilla/5.0 (Macintosh; " +
"U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, " +
@@ -313,11 +316,15 @@
pageCacheCapacity = 1;
}
+ // Read the last active AutoFill profile id.
+ autoFillActiveProfileId = p.getInt(
+ PREF_AUTOFILL_ACTIVE_PROFILE_ID, autoFillActiveProfileId);
+
// Load the autofill profile data from the database. We use a database separate
// to the browser preference DB to make it easier to support multiple profiles
// and switching between them.
AutoFillProfileDatabase autoFillDb = AutoFillProfileDatabase.getInstance(ctx);
- Cursor c = autoFillDb.getProfile(mActiveAutoFillProfileId);
+ Cursor c = autoFillDb.getProfile(autoFillActiveProfileId);
if (c.getCount() > 0) {
c.moveToFirst();
@@ -342,9 +349,9 @@
AutoFillProfileDatabase.Profiles.COUNTRY));
String phone = c.getString(c.getColumnIndex(
AutoFillProfileDatabase.Profiles.PHONE_NUMBER));
- mAutoFillProfile = new AutoFillProfile(fullName, email, company,
- addressLine1, addressLine2, city, state, zip, country,
- phone);
+ mAutoFillProfile = new AutoFillProfile(autoFillActiveProfileId,
+ fullName, email, company, addressLine1, addressLine2, city,
+ state, zip, country, phone);
}
c.close();
autoFillDb.close();
@@ -528,6 +535,7 @@
public void setAutoFillProfile(Context ctx, AutoFillProfile profile) {
mAutoFillProfile = profile;
+ setActiveAutoFillProfileId(ctx, profile.getUniqueId());
// Update the AutoFill DB
new SaveProfileToDbTask(ctx).execute(mAutoFillProfile);
@@ -537,6 +545,14 @@
return mAutoFillProfile;
}
+ private void setActiveAutoFillProfileId(Context context, int activeProfileId) {
+ autoFillActiveProfileId = activeProfileId;
+ Editor ed = PreferenceManager.
+ getDefaultSharedPreferences(context).edit();
+ ed.putInt(PREF_AUTOFILL_ACTIVE_PROFILE_ID, activeProfileId);
+ ed.apply();
+ }
+
/**
* Add a WebSettings object to the list of observers that will be updated
* when update() is called.
@@ -689,6 +705,8 @@
rememberPasswords = true;
saveFormData = true;
autoFillEnabled = false;
+ // TODO: Should remove the autofill profile fully and
+ // set the active profile id to 0.
openInBackground = false;
autoFitPage = true;
landscapeOnly = false;
@@ -713,7 +731,8 @@
protected Void doInBackground(AutoFillProfile... values) {
mAutoFillProfileDb = AutoFillProfileDatabase.getInstance(mContext);
- mAutoFillProfileDb.addOrUpdateProfile(mActiveAutoFillProfileId, values[0]);
+ assert autoFillActiveProfileId > 0;
+ mAutoFillProfileDb.addOrUpdateProfile(autoFillActiveProfileId, values[0]);
return null;
}