question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

expandedTitleGravity="center_horizontal" not working.

See original GitHub issue

xml:

` <android.support.design.widget.AppBarLayout android:id=“@+id/app_bar” android:layout_width=“match_parent” android:layout_height=“wrap_content” android:fitsSystemWindows=“true” android:theme=“@style/AppTheme.AppBarOverlay”>

    <android.support.design.widget.SubtitleCollapsingToolbarLayout
        android:id="@+id/toolbar_layout"
        android:layout_width="match_parent"
        android:minHeight="@dimen/contact_profile_toolbar_min_height"
        app:contentScrim="?colorPrimary"
        app:expandedTitleMarginTop="@dimen/contact_profile_toolbar_lyt_ext_title_margin_top"
        app:layout_scrollFlags="scroll|exitUntilCollapsed"
        app:expandedTitleMargin="@dimen/contact_profile_toolbar_lyt_ext_title_margin"
        android:layout_height="@dimen/contact_profile_toolbar_lyt_height"
        app:subtitle="CollapsingToolbarLayout"
        app:title="Subtitle"
        android:fitsSystemWindows="true"
        app:expandedTitleGravity="center_horizontal">

        <View
            android:id="@+id/background"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_collapseMode="parallax"
            android:scaleType="centerCrop"
            android:background="@color/colorPrimary" />

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin"
            app:popupTheme="@style/AppTheme.PopupOverlay">

            <Space
                android:id="@+id/circle_collapsed_target"
                android:layout_width="@dimen/contact_profile_circle_collapsed"
                android:layout_height="@dimen/contact_profile_circle_collapsed"/>

        </android.support.v7.widget.Toolbar>

    <!--</android.support.design.widget.CollapsingToolbarLayout>-->
    </android.support.design.widget.SubtitleCollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout> `

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hendraanggriancommented, May 12, 2017

@michael-snow Version 0.4.5 is out to specifically address this issue. Title and subtitle now has separate x points for text centering with center_horizontal gravity. It should also support other gravities but too be honest I’m too lazy to test them all.

1reaction
hendraanggriancommented, May 7, 2017

Version 0.4.1 is out, it now supports center_horizontal gravity, but unfortunately not much else. I will need couple of days to test the remaining gravity.

In the meantime, please try it and let me know if it works for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Collapsing Toolbar title not centered - Stack Overflow
The title is centerend when it is expanded and should stay centered when it is collapsing. With my layout which is below, my...
Read more >
LinearLayout | Android Developers
A layout that arranges other views either horizontally in a single column or vertically ... For example, the snippet above sets android:gravity to...
Read more >
Alignment and alignment guides - a free Hacking with iOS
SwiftUI gives us a number of valuable ways of controlling the way views are aligned, and I want to walk you through each...
Read more >
Using DialogFragment | CodePath Android Cliffnotes
setTitle(title); // Show soft keyboard automatically and request focus to field ... and showing the dialog in an Activity extending AppCompatActivity :
Read more >
Grid system - Bootstrap
Use flexbox alignment utilities to vertically and horizontally align columns. Internet Explorer 10-11 do not support vertical alignment of flex items when the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found