It's hard to explain -- but all the toolbars I've tried adding in my project seem to be stuck in the corner.
I made a test layout to show it clearly:Test blueprint toolbar
Click on image for a larger version of the image.
This is the xml:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="1000dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
</LinearLayout>
I've tried using different layouts. Also unable to drag the toolbar to resize it.
And the code
<android.support.constraint.ConstraintLayout 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:id="@+id/auth_request_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AuthRequestActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/activity_auth_request_toolbar"
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_alignParentTop="true"
android:background="@color/somecompanycolor"
android:minHeight="@dimen/toolbar_height"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<fragment
android:id="@+id/activity_auth_request_fragment"
android:name="someexternalsdk"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentBottom="true"
android:layout_below="@id/activity_auth_request_toolbar" />
</android.support.constraint.ConstraintLayout>
My code to set the toolbar:
mToolbar = findViewById(R.id.activity_auth_request_toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle("Request");
For more info, I'm targeting 28.0.0-rc02, max sdk version 28, min 15.
Does anyone know what I'm doing wrong?