I tried to add this on my Collapsing Toolbar Layout
.
app:expandedTitleTextAppearance="@style/TextAppearance.AppCompat.Title"
app_bar_home.xml
<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:id="@+id/CoordinatorLayout"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/AppBarLayout"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_height="300dp"
android:layout_width="match_parent"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleGravity="center|center_horizontal"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:expandedTitleTextAppearance="@style/TextAppearance.AppCompat.Title">
<ImageView
app:backgroundTint="@color/text"
android:id="@+id/canteen_logo"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:scaleType="fitCenter"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"
app:srcCompat="@drawable/canteen_logo1"
/>
<android.support.v7.widget.Toolbar
android:textAllCaps="true"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/toolbar_popup_style"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
And here's my Styles.xml:
<style name="TextAppearance.AppCompat.Title">
<item name="android:textSize">32sp</item>
</style>
This is what I have in my Home.java and tried to remove them but I still couldn't get it fixed.
CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout)
findViewById(R.id.collapsing_toolbar);
final Typeface sp = Typeface.createFromAsset(this.getAssets(), "fonts/FuturaPTMedium.otf");
final Typeface tf = Typeface.createFromAsset(this.getAssets(), "fonts/FuturaPTBook.otf");
collapsingToolbar.setCollapsedTitleTypeface(sp);
collapsingToolbar.setExpandedTitleTypeface(tf);
setTitle("CANTEEN");