How to create toolbar with left, center and right sections in javaFX?

Spring method for ToolBar section alignment works fine for me. import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.layout.*; import javafx.stage.Stage; public class SectionalToolbar extends Application { @Override public void start(Stage stage) throws Exception { final Pane leftSpacer = new Pane(); HBox.setHgrow( leftSpacer, Priority.SOMETIMES ); final Pane rightSpacer = new Pane(); HBox.setHgrow( rightSpacer, Priority.SOMETIMES ); final … Read more

How animate Burger to Arrow with Appcompat v7 21, Toolbar and DrawerLayout

Have a look here, it describes how you solve it. https://stackoverflow.com/a/26447144 The essential part is the following: <style name=”AppTheme” parent=”Theme.AppCompat.Light”> <item name=”drawerArrowStyle”>@style/DrawerArrowStyle</item> </style> <style name=”DrawerArrowStyle” parent=”Widget.AppCompat.DrawerArrowToggle”> <item name=”spinBars”>true</item> <item name=”color”>@android:color/white</item> </style>

How to set a custom font to the title in toolbar android

Since android.support.v7.appcompat 24.2 Toolbar has method setTitleTextAppearance and you can set its font without external textview. create new style in styles.xml <style name=”RobotoBoldTextAppearance”> <item name=”android:fontFamily”>@font/roboto_condensed_bold</item> </style> and use it mToolbar.setTitleTextAppearance(this, R.style.RobotoBoldTextAppearance);

How to change CollapsingToolbarLayout typeface and size?

Update Before we dive into the code let’s first decide the textSize for our CollapsingToolbarLayout. Google published a website called material.io, this website also explains the best way on how to deal with Typography. The article mentioned about “Heading” category which also explains the recommended font size to use in sp. Although the article never … Read more

How do you set the title color for the new Toolbar?

Option 1) The quick and easy way (Toolbar only) Since appcompat-v7-r23 you can use the following attributes directly on your Toolbar or its style: app:titleTextColor=”@color/primary_text” app:subtitleTextColor=”@color/secondary_text” If your minimum SDK is 23 and you use native Toolbar just change the namespace prefix to android. In Java you can use the following methods: toolbar.setTitleTextColor(Color.WHITE); toolbar.setSubtitleTextColor(Color.WHITE); These … Read more

android/view/view$onUnhandledKeyEventListener (onMeasure error)

I found the answer, but I’m not sure this is the best answer. But this fix all the issue. The error could be because of a bug in the API 28.0.0-alpha3 which may mess around with the backward compatibility (I’m not completely sure about it yet). build.gradle(Module: app) (before fix)–> build.gradle(Module: app) compileSdkVersion 28 targetSdkVersion … Read more

How to change the toolbar text size?

Use app:titleTextAppearance: <android.support.v7.widget.Toolbar 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=”?actionBarSize” android:id=”@+id/toolbar” app:titleTextAppearance=”@style/Toolbar.TitleText” /> and override the default title size in a custom style: <style name=”Toolbar.TitleText” parent=”TextAppearance.Widget.AppCompat.Toolbar.Title”> <item name=”android:textSize”>18sp</item> </style> Result:

How do I make DrawerLayout to display below the Toolbar?

<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <!– The toolbar –> <android.support.v7.widget.Toolbar android:id=”@+id/my_awesome_toolbar” android:layout_height=”wrap_content” android:layout_width=”match_parent” android:minHeight=”?attr/actionBarSize” android:background=”?attr/colorPrimary” /> <android.support.v4.widget.DrawerLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/my_drawer_layout” android:layout_width=”match_parent” android:layout_height=”match_parent”> <!– drawer view –> <LinearLayout android:layout_width=”304dp” android:layout_height=”match_parent” android:layout_gravity=”left|start”> <!– drawer content –> </LinearLayout> <!– normal content view –> <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <!– The rest of content view –> </LinearLayout> </android.support.v4.widget.DrawerLayout> </LinearLayout>