Edited styles & fixed bug with extra shadow in toolbar.

This commit is contained in:
Dmitry Yunitsky 2015-07-03 15:38:06 +03:00 committed by Alex Zolotarev
parent 1254acb666
commit 139680ce09
10 changed files with 52 additions and 48 deletions

View file

@ -6,10 +6,11 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:theme="@style/MwmWidget.Toolbar">
android:theme="@style/MwmWidget.ToolbarTheme">
<TextView
android:id="@+id/tv__update_all"

View file

@ -6,16 +6,17 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="@dimen/search_box_height"
android:theme="@style/MwmWidget.Toolbar">
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.ToolbarTheme">
<TextView
android:id="@+id/tv__update_all"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_gravity="right"
android:background="?attr/selectableItemBackgroundBorderless"
android:gravity="center_vertical"
android:padding="@dimen/margin_small"
android:text="@string/downloader_update_all"

View file

@ -6,9 +6,10 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.Toolbar">
android:theme="@style/MwmWidget.ToolbarTheme">
<TextView
android:id="@+id/tv__save"

View file

@ -6,9 +6,10 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.Toolbar">
android:theme="@style/MwmWidget.ToolbarTheme">
<TextView
android:id="@+id/tv__save"

View file

@ -17,12 +17,12 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="@null"
android:textCursorDrawable="@drawable/cursor_drawable"
android:hint="@string/search"
android:imeOptions="actionSearch|flagNoExtractUi"
android:inputType="text"
android:padding="@dimen/margin_tiny"
android:singleLine="true"/>
android:singleLine="true"
android:textCursorDrawable="@drawable/cursor_drawable"/>
<ProgressBar
android:id="@+id/search_progress"
@ -33,33 +33,27 @@
android:layout_weight="0"
android:background="@android:color/transparent"/>
<FrameLayout
android:id="@+id/container_cancel_voice_input_search"
<ImageView
android:id="@+id/search_image_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:background="@android:color/transparent">
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@null"
android:padding="@dimen/margin_medium"
android:src="@drawable/ic_close_w"/>
<ImageView
android:id="@+id/search_image_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="?attr/clickableBackground"
android:contentDescription="@null"
android:padding="@dimen/margin_medium"
android:src="@drawable/ic_close_w"/>
<ImageView
android:id="@+id/search_voice_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="?attr/clickableBackground"
android:contentDescription="@null"
android:padding="@dimen/margin_medium"
android:src="@drawable/ic_mic_white"
android:visibility="gone"/>
</FrameLayout>
<ImageView
android:id="@+id/search_voice_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@null"
android:padding="@dimen/margin_medium"
android:src="@drawable/ic_mic_white"
android:visibility="gone"/>
</LinearLayout>

View file

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.Toolbar"
style="@style/MwmWidget.ToolbarStyle"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.Toolbar"/>
<!-- style is needed, too, because some attrs(insets, eg) are not supported in theme-->
android:theme="@style/MwmWidget.ToolbarTheme"/>

View file

@ -6,15 +6,14 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.Toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.Toolbar"/>
android:theme="@style/MwmWidget.ToolbarTheme"/>
<FrameLayout
android:id="@+id/fl__elevation"
style="@style/MwmWidget.FrameLayout.Elevation"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<!-- style is needed, too, because some attrs(insets, eg) are not supported in theme-->
</LinearLayout>

View file

@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.Toolbar"
style="@style/MwmWidget.ToolbarStyle"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:theme="@style/MwmWidget.Toolbar">
<!-- style is needed, too, because some attrs(insets, eg) are not supported in theme-->
android:theme="@style/MwmWidget.ToolbarTheme">
<include
android:id="@+id/search_box"

View file

@ -94,18 +94,23 @@
<item name="android:fontFamily">@string/robotoRegular</item>
</style>
<style name="MwmWidget.Toolbar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<style name="MwmWidget.ToolbarStyle" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:background">?attr/colorPrimary</item>
<item name="android:elevation">4dp</item>
<item name="android:gravity">center_vertical</item>
<item name="android:displayOptions">homeAsUp|showTitle</item>
<item name="colorAccent">@android:color/white</item>
<item name="contentInsetStart">72dp</item>
<item name="android:titleTextAppearance">@style/MwmTextAppearance.Toolbar.Title</item>
<item name="titleTextAppearance">@style/MwmTextAppearance.Toolbar.Title</item>
<item name="contentInsetLeft">72dp</item>
<item name="android:contentInsetStart">72dp</item>
<item name="android:contentInsetLeft">72dp</item>
</style>
<style name="MwmWidget.ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:gravity">center_vertical</item>
<item name="colorAccent">@android:color/white</item>
</style>
<style name="MwmWidget.ListView" parent="Widget.AppCompat.ListView">
<item name="android:fadingEdge">none</item>
<item name="android:divider">@color/base_black_divider</item>
@ -250,7 +255,7 @@
<style name="MwmTextAppearance.Body3.Light">
<item name="android:textSize">@dimen/text_size_body_3</item>
<item name="android:textColor">@color/text_light_subtitle</item>
<item name="android:textColor">@color/text_light</item>
</style>
<style name="MwmTextAppearance.IconTitle">
@ -264,7 +269,7 @@
<item name="android:textAllCaps">true</item>
</style>
<style name="MwmTextAppearance.Toolbar.Button" parent="MwmTextAppearance.Body1.Light">
<style name="MwmTextAppearance.Toolbar.Button" parent="MwmTextAppearance.Body3.Light">
<item name="android:textAllCaps">true</item>
</style>
@ -272,6 +277,10 @@
<item name="android:textColorHint">?attr/colorAccent</item>
</style>
<style name="MwmTextAppearance.Toolbar.Title" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">@dimen/text_size_toolbar</item>
</style>
<!-- Text appearance -->
</resources>

View file

@ -145,13 +145,13 @@ public class SearchFragment extends BaseMwmListFragment implements View.OnClickL
if (s.length() == 0)
{
UiUtils.invisible(mBtnClearQuery);
UiUtils.hide(mBtnClearQuery);
UiUtils.showIf(InputUtils.isVoiceInputSupported(getActivity()), mBtnVoice);
}
else
{
UiUtils.show(mBtnClearQuery);
UiUtils.invisible(mBtnVoice);
UiUtils.hide(mBtnVoice);
}
}