-1

I am trying to update my app and wanted to make the toolbar look like the black playerthis type of. As of now i am able to set the search and navigation but how to put the pager title strip in the middle as inside viewpager i cannot use gravity i tried the margin and padding not working at all. this is my xml

   <com.antonyt.infiniteviewpager.InfiniteViewPager
    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <me.alexrs.fontpagertitlestrip.lib.FontPagerTitleStrip
        android:id="@+id/titlestrip"
        android:layout_width="wrap_content"
        android:layout_height="50dp"
        android:layout_marginEnd="50dp"
        android:layout_marginStart="50dp"
        android:background="@color/material_fragment_top"

        app:fontFamily="@font/font"

        app:theme="@style/AppTheme.PopupOverlay" />

</com.antonyt.infiniteviewpager.InfiniteViewPager>

<android.support.v7.widget.Toolbar 
  xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="50dp"

    app:theme="@style/CustomActionBar" />

how i can put the pagertitlestrip in the middle

It is overlaping So I want to put the padding but not able to do it at all

Neelay Srivastava
  • 1,041
  • 3
  • 15
  • 46

1 Answers1

0

Seems like you want to change StatusBarColor.

try setStatusBarColor(int)and set colour of your toolbar or you can make it transparent All you need to do is set these properties in your theme:

<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>

Your activity / container layout you wish to have a transparent status bar needs this property set:

android:fitsSystemWindows="true"

but since you never specified API you're using I refer you to different question, you should find the answer.

How to change the status bar color in android

Android Completely transparent Status Bar?

Sylwek845
  • 145
  • 9