How to remove divider between Toolbar and RelativeLayout - java

I have RelativeLayout below android.support.v7.widget.Toolbar. They both have the same color. How can I get rid of devider between them?
Here is xml code:
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="#color/HomeColorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
<RelativeLayout
android:layout_below="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="120dp"
android:id="#+id/spaceBelowToolbar"
android:background="#color/HomeColorPrimary"
android:orientation="vertical"
android:elevation="4dp">
</RelativeLayout>
Here is the full xml file :
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/mainBody"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/MainBG">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="#color/HomeColorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
<RelativeLayout
android:layout_below="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="120dp"
android:id="#+id/spaceBelowToolbar"
android:background="#color/HomeColorPrimary"
android:orientation="vertical"
android:elevation="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="42dp"
android:layout_alignParentLeft="true"
android:id="#+id/MoneyValue"
android:textColor="#color/md_white_1000"
android:textSize="45sp"
android:text="$850"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/MoneyValue"
android:id="#+id/Balance"
android:layout_marginLeft="42dp"
android:textSize="25sp"
android:textColor="#color/md_grey_300"
android:text="BALANCE"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="180dp"
android:id="#+id/PercentageValue"
android:textColor="#color/md_white_1000"
android:textSize="45sp"
android:text="93%"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/PercentageValue"
android:textColor="#color/md_grey_300"
android:id="#+id/Budget"
android:layout_marginLeft="180dp"
android:textSize="25sp"
android:text="BUDGET"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/listViewLayout"
android:layout_below="#+id/spaceBelowToolbar"
>
<ExpandableListView
android:id="#+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp">
<com.github.clans.fab.FloatingActionMenu
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:layout_marginBottom="30dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
fab:menu_labels_style="#style/MenuLabelsStyle"
fab:menu_labels_showAnimation="#anim/jump_from_down"
fab:menu_labels_hideAnimation="#anim/jump_to_down"
fab:menu_animationDelayPerItem="0"
fab:menu_shadowColor="#444"
fab:menu_colorNormal="#FFB805"
fab:menu_colorPressed="#F2AB00"
fab:menu_colorRipple="#D99200">
</com.github.clans.fab.FloatingActionMenu>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

The most concise answer and easiest for me was applying it like so based on the comment. However, Since I have my toolbar wrapped by an app overlay I had to apply it to the AppBarLayout widget for it to work.
<!--takes away line with app elevation set to 0 -->
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay"
app:elevation="0dp">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#drawable/email_bg"
app:popupTheme="#style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>

you may have to set a custom background and custom style for the ActionBar. Try using the this actionbar theme, it should set a completely solid background (no divider line):
<!-- Base application theme. -->
<style name="AppTheme"
parent="#android:style/Theme.Holo.Light">
<!--this removes the shadow under the action bar-->
<item name="android:windowContentOverlay">#null</item>
<item name="android:actionBarStyle">#style/MyActionBarStyle</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBarStyle"
parent="#android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">#color/HomeColorPrimary</item>
</style>

Related

How to make such collapsing card view in collapsing toolbar layout?

Before Scrolling the Activity
After Scrolling the Activity
I am trying to make a card view which can collapse on scrolling as i have shown in pictures. But In my view cardview is collapsing but its height doesn't change. I have made collapsing toolbar and image but could not make card view collapse with its height changing as per figure shoen.
This is my code for Activity:
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="#color/white"
android:theme="#style/Theme.Mynew.AppBarOverlay"
app:liftOnScroll="true">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="#android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:titleEnabled="false">
<androidx.cardview.widget.CardView
android:id="#+id/card"
android:layout_width="350dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:isScrollContainer="true"
app:layout_collapseMode="pin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_weight="1"
app:srcCompat="#drawable/ic_baseline_home_24" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_weight="1"
app:srcCompat="#drawable/ic_baseline_grid_on_24/>
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_weight="1"
app:srcCompat="#drawable/trips" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<ImageView
android:id="#+id/imageView3"
android:layout_width="match_parent"
android:layout_height="150dp"
android:fitsSystemWindows="true"
android:scaleType="fitXY"
app:layout_collapseMode="parallax"
app:srcCompat="#drawable/var2" />
<com.google.android.material.appbar.MaterialToolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginTop="35dp"
android:background="#android:color/transparent"
android:fitsSystemWindows="true"
android:minHeight="65dp"
app:contentInsetStart="25dp"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:maxButtonHeight="70dp"
app:navigationIcon="#drawable/dropmenu"
app:navigationIconTint="#color/white"
app:popupTheme="#style/Theme.Mynew.PopupOverlay" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

android Bottom app bar is not taking full width even after setting width to match parent

My bottom app bar is holding bottom navigation view and its shoqing little black strip on left side(pls check Screenshot
) even after setting width to match_parent.
It works fine when I use bottom navigation view without bottom app bar but I want both of them together,
I have tried setting margins right but still it does not move to left and take full width.
My layout file is below,
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.recipeapp.marathi.activities.HomeActivity">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff">
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbarHome"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:title="#string/app_name"
app:titleTextColor="#color/black" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="#layout/content_main" />
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="?attr/actionBarSize"
ads:adSize="BANNER"
ads:adUnitId="#string/admob_banner_adunit_id">
</com.google.android.gms.ads.AdView>
<com.google.android.material.bottomappbar.BottomAppBar
android:background="#color/white"
android:id="#+id/bottomappbar"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:fabCradleMargin="10dp"
app:fabCradleRoundedCornerRadius="10dp"
app:fabCradleVerticalOffset="10dp">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
app:itemIconTint="#color/bottom_nav_item"
app:itemTextColor="#color/bottom_nav_item"
app:menu="#menu/nav_menu" />
</com.google.android.material.bottomappbar.BottomAppBar>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/todo"
android:src="#drawable/ic_share"
app:layout_anchor="#id/bottomappbar"
app:layout_anchorGravity="bottom|center" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.navigation.NavigationView
android:background="#drawable/round_nav"
android:foreground="?attr/selectableItemBackground"
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:visibility="visible"
app:headerLayout="#layout/nav_header_main"
app:menu="#menu/menu_drawer_navigation" />
</androidx.drawerlayout.widget.DrawerLayout>
please help..
Relevant documentation
This question has also been awnsered here and here
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp"
in your com.google.android.material.bottomappbar.BottomAppBar is but far the simplest
Sample code:
<com.google.android.material.bottomappbar.BottomAppBar
android:background="#color/white"
android:id="#+id/bottomappbar"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:fabCradleMargin="10dp"
app:fabCradleRoundedCornerRadius="10dp"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp"
app:fabCradleVerticalOffset="10dp">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
app:itemIconTint="#color/bottom_nav_item"
app:itemTextColor="#color/bottom_nav_item"
app:menu="#menu/menu_drawer_navigation"
/>
</com.google.android.material.bottomappbar.BottomAppBar>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher_background"
app:layout_anchor="#id/bottomappbar"
app:layout_anchorGravity="bottom|center" />

Navigation View in specific activity

I have a problem with Navigation View located under Toolbar. I've read that to set it up correctly apps should use Fragments instead of Activities, but unfortunately I think that it's not my case, coz the whole app is already written using Activities.
I could make NavView work nice in MainActivity (because toolbar is added in it's xml), but the problem is that I don't need NavView on start screen, only in specific activity.
Is it possible to add NavView to only one activity correctly without moving to Fragments?
MainActivity.xml (where it worked perfectly):
<android.support.design.widget.CoordinatorLayout
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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg"
tools:context="ru.asmodeoux.g_lounge.MainActivity">
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="59dp"
android:layout_height="59dp"
android:layout_gravity="top|left"
android:layout_margin="#dimen/fab_margin"
app:backgroundTint="#color/FAB_color"
app:elevation="24dp"
app:layout_anchor="#+id/include"
app:layout_anchorGravity="bottom|right"
app:srcCompat="#drawable/call" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="0dp"
android:minHeight="0dp"
android:textAlignment="center"
app:popupTheme="#style/AppTheme.AppBarOverlay" />
</android.support.design.widget.AppBarLayout>
<include
android:id="#+id/include"
layout="#layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
aboutProduct.xml (where I need to show NavNiew):
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false">
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="#drawable/bg"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/productRoot"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:id="#+id/productImg"
/>
<TextView
android:id="#+id/productDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/productImg"
android:layout_marginBottom="75dp"
android:layout_marginTop="20dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="Place for product description."
android:textAlignment="textStart"
android:textColor="#color/white"
android:textSize="19sp"
android:textStyle="italic" />
</RelativeLayout>
</ScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/productAdd"
android:layout_width="59dp"
android:layout_height="59dp"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
android:backgroundTint="#color/FAB_color"
android:elevation="24dp"
app:srcCompat="#drawable/buy" />
<TextView
android:id="#+id/productPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:layout_marginBottom="#dimen/fab_margin"
android:background="#drawable/rectangle_rounded_some"
android:layout_marginLeft="#dimen/fab_margin"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="100 руб."
android:textAllCaps="false"
android:textColor="#color/black"
android:textSize="37sp" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:layout_width="wrap_content"
app:headerLayout="#layout/navigation_header"
android:background="#color/white"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="#menu/drawer" />
</android.support.v4.widget.DrawerLayout>
Header layout:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/gray">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:text="Что-то ещё?"
android:layout_marginStart="14dp"
android:textColor="#color/white"
android:textAlignment="textStart"
android:layout_marginBottom="8dp"
android:textSize="18sp"
android:textStyle="bold" />
</RelativeLayout>
And a screenshot of how NavView in "aboutProduct" class looks now here
And how it should look like here
As a result I think that the easiest way is to set toolbar there in Theme Editor to "NoActionBar" and add toolbar to every activity by hands.

java android : resize appbarlayout when hide a specific relativelayout

I have a bug in android development.
I would like resize the appbarlayout when I hide a relative layout Contained in it. but the height of appbarlayout is not reloaded and so I have a bar blue.
Here is the result obtained :
I hide this relative layout when my adapter is empty.
Do you have any idea how to remedy this?
xml :
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
android:background="?attr/colorPrimary"/>
/// I want hide this Relative Layout
<RelativeLayout
android:id="#+id/header_recycler_view"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/header_set_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
style="#style/Base.TextAppearance.AppCompat.Subhead" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:onClick="onClickToScrollToBegin"
android:clickable="true"
android:drawableRight="#drawable/ic_double_arrow_up" />
</RelativeLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/swipeContainer"
android:layout_width="match_parent"
app:layout_behavior = "#string/appbar_scrolling_view_behavior"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/rv_recycler_view"
android:scrollbars="vertical"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchorGravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
app:layout_anchor="#+id/rv_recycler_view"
app:layout_behavior="com.brick_reader.brick_reader.FABScrollBehavior"
app:srcCompat="#drawable/ic_search_white_24dp" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="#layout/nav_header_main"
app:menu="#menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
Thank you in advance for your answers.

How to change change text and arrow color on Toolbar?

I am currently building an app using the new material design guidelines.
I am using a Toolbar rather than an action bar.
I want the text, overflow icon, and the arrow/hamburger icon (thing that flips over when you pull out the navigation draw) to be white rather than black, but the rest of my theme needs to be the AppCompat.light theme.
If someone could please explain how i would go about changing these things, i would be very greatful.
I also need to change the colors both in xml and via java code.
And on a sub note, does anyone know how i set a sub-text in the toolbar? I read it is possible, but i cant find any resources on how it is done.
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"
xmlns:android="http://schemas.android.com/apk/res/android"
/>
<com.bacon.corey.audiotimeshift.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:panelHeight="0dp"
sothree:shadowHeight="10dp"
sothree:paralaxOffset="100dp"
sothree:fadeColor="#android:color/transparent"
>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<!-- The main content view -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="0dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:padding="0dip"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="0dp"
android:id="#+id/recordingListMainLayout"
android:foreground="#drawable/dim_shadow_shape_dark"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:padding="0dp"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/mainLayoutContainer"/>
<!--
<android.support.v4.view.ViewPager
android:id="#+id/viewPager"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:padding="0dp"
android:layout_margin="0dp"
/>
-->
</LinearLayout>
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/textview_rounded_corner_background_fam"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="33dp"
android:layout_marginRight="90dp"
android:id="#+id/fabMainText"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Main Option - Quick Record"
android:textAlignment="center"
android:padding="6dp"
android:fontFamily="sans-serif-medium"
/>
</FrameLayout>
<com.bacon.corey.audiotimeshift.FloatingActionsMenu
android:id="#+id/fabMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:gravity="right"
app:fab_addButtonColorNormal="#color/holo_red_light"
app:fab_addButtonColorPressed="#color/c16"
app:fab_addButtonPlusIconColor="#color/white"
app:fab_expandDirection="up"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_marginEnd="10dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/textview_rounded_corner_background_fam"
android:layout_marginRight="14dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Option Four"
android:textAlignment="center"
android:padding="6dp"
android:fontFamily="sans-serif-medium"
/>
</FrameLayout>
<com.bacon.corey.audiotimeshift.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fab_colorNormal="#color/c15"
app:fab_colorPressed="#color/c15"
app:fab_size="mini"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/textview_rounded_corner_background_fam"
android:layout_marginRight="14dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Option Three"
android:textAlignment="center"
android:padding="6dp"
android:fontFamily="sans-serif-medium"
/>
</FrameLayout>
<com.bacon.corey.audiotimeshift.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fab_colorNormal="#color/c8"
app:fab_colorPressed="#color/c8"
app:fab_size="mini"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/textview_rounded_corner_background_fam"
android:layout_marginRight="14dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Option Two"
android:textAlignment="center"
android:padding="6dp"
android:fontFamily="sans-serif-medium"
/>
</FrameLayout>
<com.bacon.corey.audiotimeshift.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fab_colorNormal="#color/a1"
app:fab_colorPressed="#color/a1"
app:fab_size="mini"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/textview_rounded_corner_background_fam"
android:layout_marginRight="14dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Option One"
android:textAlignment="center"
android:padding="6dp"
android:fontFamily="sans-serif-medium"
/>
</FrameLayout>
<com.bacon.corey.audiotimeshift.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fab_colorNormal="#color/a2"
app:fab_colorPressed="#color/a2"
app:fab_size="mini"
/>
</LinearLayout>
</com.bacon.corey.audiotimeshift.FloatingActionsMenu>
</RelativeLayout>
</RelativeLayout>
<!-- The navigation drawer -->
<ListView android:id="#+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#android:color/transparent"
android:dividerHeight="0dp"
android:background="#FFFFFF"/>
</android.support.v4.widget.DrawerLayout>
<!-- Sliding Panel Layout -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:textSize="16sp"
android:id="#+id/slideUpPanel"
>
</FrameLayout>
</com.bacon.corey.audiotimeshift.SlidingUpPanelLayout>
</LinearLayout>
Thanks in advance for any help.
Corey B :)
Here is complete style for your toolbar. Explanation is given inline.
<style name="MyToolbar" parent="#style/ThemeOverlay.AppCompat">
<!-- Title text -->
<item name="android:textColorPrimary">#android:color/white</item>
<!-- Title color in AppCompat.Light -->
<item name="android:textColorPrimaryInverse">#android:color/white</item>
<!-- Menu text-->
<item name="actionMenuTextColor">#android:color/white</item>
<!-- Overflow -->
<item name="android:textColorSecondary">#android:color/white</item>
<!-- This will change drawer icon -->
<item name="drawerArrowStyle">#style/WhiteDrawerIconStyle</item>
<!-- background of the -->
<!-- <item name="android:background">#color/color_primary</item> -->
</style>
<style name="WhiteDrawerIconStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#android:color/white</item>
</style>
On subtitle note: You can use mToolbar.setSubtitle(sutitle);
Put app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
to your Toolbar xml. And arrow turns white.
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="#dimen/toolbar_height"
app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
In your app bar, add this property.
app:theme = "#style/Base.V7.Theme.AppCompat"
That should take care of all the whiting. The referenced theme consists of a toolbar with white items, so the toolbar takes the part of the theme that is relevant to it.
Call mToolbar.setSubtitle as discussed above.

Categories