Open tmm1 opened 5 years ago
@tmm1 I copied this file from the library into my project /Toolbar-Center-Title/library/src/main/java/com/ravikoradiya/library/CenterTitle.kt
changed following toolbar import to corresponding androidx one :
import android.support.v7.widget.Toolbar
import androidx.appcompat.widget.Toolbar
and it worked like a charm with androidx :) PS: No need to add a gradle dependency this way.
<androidx.appcompat.widget.Toolbar android:layout_height="?android:attr/actionBarSize" android:layout_width="match_parent" android:id="@+id/toolbar" android:layout_alignParentTop="true" android:background="@color/colorAccent"
/>
<androidx.appcompat.widget.Toolbar android:layout_height="?android:attr/actionBarSize" android:layout_width="match_parent" android:id="@+id/toolbar" android:layout_alignParentTop="true" android:background="@color/colorAccent"
/>
@masqueNada can you explain more how you did it? Where to put what?
I tried to use this library as such:
but the text is not centered.
Does it work with androidx?