Support for light colors. The appbar will now automatically change its text and icon color to be visible on light theme colors.
This commit is contained in:
parent
6773342198
commit
1be0d305b1
14 changed files with 271 additions and 146 deletions
|
|
@ -7,7 +7,10 @@
|
|||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar" />
|
||||
style="@style/Toolbar">
|
||||
|
||||
<include layout="@layout/search_bar" />
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
37
app/src/main/res/layout/search_bar.xml
Normal file
37
app/src/main/res/layout/search_bar.xml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/search_src_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dip"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text|textAutoComplete|textNoSuggestions"
|
||||
android:minWidth="@dimen/abc_search_view_text_min_width"
|
||||
android:paddingLeft="@dimen/abc_dropdownitem_text_padding_left"
|
||||
android:paddingRight="@dimen/abc_dropdownitem_text_padding_right"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
<android.support.v7.internal.widget.TintImageView
|
||||
android:id="@+id/search_close_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/abc_searchview_description_clear"
|
||||
android:focusable="true"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="8dip"
|
||||
android:src="@drawable/ic_close_white_24dp" />
|
||||
</LinearLayout>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="com.kabouzeid.gramophone.ui.activities.SearchActivity">
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:icon="@drawable/abc_ic_search_api_mtrl_alpha"
|
||||
android:title="@string/action_search"
|
||||
app:actionViewClass="android.support.v7.widget.SearchView"
|
||||
app:showAsAction="ifRoom|collapseActionView" />
|
||||
</menu>
|
||||
|
|
@ -23,8 +23,11 @@
|
|||
|
||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat</item>
|
||||
|
||||
<!-- FOR EVERYWHERE WE CANT OVERRIDE THE ACCENT COLOR-->
|
||||
<!-- just in case-->
|
||||
<item name="colorAccent">@android:color/white</item>
|
||||
|
||||
<!-- necessary to find the overflow button later in the layout-->
|
||||
<item name="android:actionOverflowButtonStyle">@style/Widget.ActionButton.Overflow</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.MaterialMusic.Base.Light" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
|
|
@ -48,8 +51,11 @@
|
|||
|
||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
|
||||
|
||||
<!-- FOR EVERYWHERE WE CANT OVERRIDE THE ACCENT COLOR-->
|
||||
<!-- just in case-->
|
||||
<item name="colorAccent">@android:color/black</item>
|
||||
|
||||
<!-- necessary to find the overflow button later in the layout-->
|
||||
<item name="android:actionOverflowButtonStyle">@style/Widget.ActionButton.Overflow</item>
|
||||
</style>
|
||||
|
||||
<style name="PlayPauseFabParent">
|
||||
|
|
@ -83,4 +89,9 @@
|
|||
<item name="android:focusableInTouchMode">false</item>
|
||||
<item name="android:focusable">false</item>
|
||||
</style>
|
||||
|
||||
<!-- content description is necessary to find the overflow button later in the layout-->
|
||||
<style name="Widget.ActionButton.Overflow" parent="Widget.AppCompat.ActionButton.Overflow">
|
||||
<item name="android:contentDescription">@string/abc_action_menu_overflow_description</item>
|
||||
</style>
|
||||
</resources>
|
||||
Loading…
Add table
Add a link
Reference in a new issue