I read a half-dozen of threads(particularly this one, who share the issue) about actionBar height, but it seems to no one already get this issue : My actionBar has an unmodifiable blank(bg color) area under itself :
The custom action bar is defined like this :
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityValveassemblyBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
mContentView = binding.fullscreenContent;
mContentView.getWindowInsetsController().setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
mContentView.getWindowInsetsController().hide(WindowInsets.Type.navigationBars()); // HIDE ANDROID UI
// ACTIONBAR
ActionBar actionBar = getSupportActionBar(); // define actionBar
assert actionBar != null;
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); // allow custom
actionBar.setCustomView(R.layout.actionbar_layout); // define custom
As screen said,
<item name="actionBarSize">48dp</item>
<item name="android:windowActionBarOverlay">true</item>
is defined. windowActionBarOverlay = false is the same result.
I can't find what is this area's name, or how to delete it. I can't use these 8 pixels, and until now I only had white bg activites, but I have to use grey background and this line is bothering me so hard.
Edit : and, according to the Layout inspector, this area is... nothing.
Edit2 : with default actionBar and Empty activity :
Edit3 : Add customAction bar layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="38dp"
android:orientation="horizontal"
android:id="@+id/actionbarlinearlayout">
<ImageButton
android:id="@+id/TopLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@string/settings"
android:src="@drawable/ic_back"
android:background="#00000000"
android:onClick="topLeftButton"
/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="50dp"
android:contentDescription="@string/shift"
android:src="@drawable/ic_shift" />
<TextView
android:id="@+id/Shift"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginStart="70dp"
android:layout_marginTop="-17dp"
android:fontFamily="@font/fontnats"
android:text="@string/Morningshift"
android:textColor="@color/black"
android:textSize="30sp"
/>
<ImageButton
android:id="@+id/ShiftReload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="172dp"
android:background="#00FFFFFF"
android:onClick="shiftReload"
android:padding="5.5dp"
android:src="@drawable/ic_reload" />
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_gravity="center"
android:contentDescription="@string/app_name"
android:src="@drawable/ic_logo_bic" />