Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ed1b39f authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Fix material style errors in suggestion popup window.

This CL addresses the material style errors from UX team.

- Corners should have a radius of 2dp.
To use the same way with floating toolbar, make the popup window transparent and
set floatingToolbarPopupBackgroundDrawable as the layout background. By this
change, TextSuggestionsPopupWindow style is no longer necessary, removed it.

- Background color for both sections should be #FFFFFF.
It turned out that the window default background is not white. By addressing
above item, this issue is fixed too.

- Divider line alpha=.12
This is fixed by using attr/listDivider instead of attr/dividerHorizontal.

- Remove 8dp padding below last suggestion
Removed 8dip paddingBottom from ListView.

Bug: 15347319

Change-Id: I579c0cc5b7f0dd337bff54af77828b8af25b13d2
parent a0b16caf
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcel;
@@ -3098,10 +3099,6 @@ public class Editor {
        private SuggestionSpan mMisspelledSpan;

        private class CustomPopupWindow extends PopupWindow {
            public CustomPopupWindow(Context context, int defStyleAttr) {
                super(context, null, defStyleAttr);
            }

            @Override
            public void dismiss() {
                if (!isShowing()) {
@@ -3126,9 +3123,9 @@ public class Editor {

        @Override
        protected void createPopupWindow() {
            mPopupWindow = new CustomPopupWindow(mTextView.getContext(),
                com.android.internal.R.attr.textSuggestionsWindowStyle);
            mPopupWindow = new CustomPopupWindow();
            mPopupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
            mPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
            mPopupWindow.setFocusable(true);
            mPopupWindow.setClippingEnabled(false);
        }
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:background="@drawable/text_edit_suggestions_window"
    android:dropDownSelector="@drawable/list_selector_background"
    android:divider="@null">
    <ListView
        android:id="@+id/suggestionContainer"
+5 −3
Original line number Diff line number Diff line
@@ -14,17 +14,19 @@
     limitations under the License.
-->

<!-- Background of the popup window is the same as the one of the floating toolbar.
     Use floating toolbar background style. -->
<LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:divider="?android:attr/dividerHorizontal"
    android:background="?android:attr/floatingToolbarPopupBackgroundDrawable"
    android:divider="?android:attr/listDivider"
    android:showDividers="middle" >
    <ListView
        android:id="@+id/suggestionContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:paddingTop="8dip"
        android:paddingBottom="8dip"
        android:paddingBottom="0dip"
        android:divider="@null" />
    <LinearLayout
        android:layout_width="match_parent"
+0 −7
Original line number Diff line number Diff line
@@ -1199,13 +1199,6 @@ please see styles_device_defaults.xml.
        <item name="windowExitAnimation">@anim/fast_fade_out</item>
    </style>

    <!-- Style for the popup window that contains text suggestions. -->
    <style name="Widget.TextSuggestionsPopupWindow">
        <item name="dropDownSelector">@drawable/list_selector_background</item>
        <item name="popupBackground">@drawable/text_edit_suggestions_window</item>
        <item name="dropDownWidth">wrap_content</item>
    </style>

    <style name="Widget.ActionBar">
        <item name="background">@drawable/action_bar_background</item>
        <item name="displayOptions">useLogo|showHome|showTitle</item>
+0 −2
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ easier.
    <style name="Widget.DeviceDefault.Spinner.DropDown" parent="Widget.Material.Spinner.DropDown"/>
    <style name="Widget.DeviceDefault.StackView" parent="Widget.Material.StackView"/>
    <style name="Widget.DeviceDefault.TextSelectHandle" parent="Widget.Material.TextSelectHandle"/>
    <style name="Widget.DeviceDefault.TextSuggestionsPopupWindow" parent="Widget.Material.TextSuggestionsPopupWindow"/>
    <style name="Widget.DeviceDefault.TextView.ListSeparator" parent="Widget.Material.TextView.ListSeparator"/>
    <style name="Widget.DeviceDefault.TimePicker" parent="Widget.Material.TimePicker"/>

@@ -199,7 +198,6 @@ easier.
    <style name="Widget.DeviceDefault.Light.Spinner.DropDown" parent="Widget.Material.Light.Spinner.DropDown"/>
    <style name="Widget.DeviceDefault.Light.TextView.ListSeparator" parent="Widget.Material.Light.TextView.ListSeparator"/>
    <style name="Widget.DeviceDefault.Light.TimePicker" parent="Widget.Material.Light.TimePicker"/>
    <style name="Widget.DeviceDefault.Light.TextSuggestionsPopupWindow" parent="Widget.Material.Light.TextSuggestionsPopupWindow"/>

    <!-- Text Appearance Styles -->
    <style name="TextAppearance.DeviceDefault" parent="TextAppearance.Material"/>
Loading