You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The titleTextView has the font applied defined with android:titleTextStyle. However, the font defined with android:subtitleTextStyle is NOT applied to the subtitleTextView. Instead the subtitleTextView has the titleTextView's font applied.
After debugging a little bit, I think I found the reason: When encountering a Toolbar, the titleTextView and subtitleTextView are both assigned the string " " (for determining the view type later). After that, onViewCreatedInternal() is called for the Toolbar's children applying the font defined by "fontPath" in the corresponding text style. When determining the view type, i.e. titleTextView or subtitleTextView, the isActionBarTitle() method returns "true" for both views, resulting in titleTextStyle style being applied to both titleTextView and subtitleTextView. The isActionBarTitle() method compares the textView's getText() with the parent Toolbar's getTitle() value, which is also true when the view being checked is the subtitleTextView since both the title and subtitle have the same value (" ") assigned.
Instead, the titleTextView and subtitleTextView should be assigned different strings in order to determine the view type correctly.
The text was updated successfully, but these errors were encountered:
Duplicate of #404
I've defined android:actionBarStyle in styles.xml as following:
The titleTextView has the font applied defined with android:titleTextStyle. However, the font defined with android:subtitleTextStyle is NOT applied to the subtitleTextView. Instead the subtitleTextView has the titleTextView's font applied.
After debugging a little bit, I think I found the reason: When encountering a Toolbar, the titleTextView and subtitleTextView are both assigned the string " " (for determining the view type later). After that, onViewCreatedInternal() is called for the Toolbar's children applying the font defined by "fontPath" in the corresponding text style. When determining the view type, i.e. titleTextView or subtitleTextView, the isActionBarTitle() method returns "true" for both views, resulting in titleTextStyle style being applied to both titleTextView and subtitleTextView. The isActionBarTitle() method compares the textView's getText() with the parent Toolbar's getTitle() value, which is also true when the view being checked is the subtitleTextView since both the title and subtitle have the same value (" ") assigned.
Instead, the titleTextView and subtitleTextView should be assigned different strings in order to determine the view type correctly.
The text was updated successfully, but these errors were encountered: