make tabbar full width

improve design

hide "Other" tab

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-04-29 11:53:48 +02:00
parent 8c20180545
commit a91ff9e920
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
3 changed files with 8 additions and 10 deletions

View file

@ -130,10 +130,10 @@ class SharedItemsActivity : AppCompatActivity() {
// tabDeckCard.text = "deckcard"
// binding.sharedItemsTabs.addTab(tabDeckCard)
val tabOther: TabLayout.Tab = binding.sharedItemsTabs.newTab()
tabOther.tag = TAB_OTHER
tabOther.setText(R.string.shared_items_other)
binding.sharedItemsTabs.addTab(tabOther)
// val tabOther: TabLayout.Tab = binding.sharedItemsTabs.newTab()
// tabOther.tag = TAB_OTHER
// tabOther.setText(R.string.shared_items_other)
// binding.sharedItemsTabs.addTab(tabOther)
binding.sharedItemsTabs.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab) {

View file

@ -42,15 +42,13 @@
<com.google.android.material.tabs.TabLayout
android:id="@+id/shared_items_tabs"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="@dimen/min_size_clickable_area"
android:layout_marginBottom="8dp"
android:background="@color/appbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/shared_items_toolbar"
app:tabGravity="fill"
app:tabMode="scrollable"
app:tabMode="fixed"
app:tabMaxWidth="0dp"
app:tabTextAppearance="@style/TextAppearanceTab" />
@ -61,6 +59,7 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/shared_items_tabs"
android:layout_marginTop="@dimen/double_margin_between_elements"
tools:listitem="@layout/attachment_item" />

View file

@ -24,7 +24,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/standard_margin"
android:layout_marginTop="@dimen/standard_half_margin"
android:layout_marginEnd="@dimen/standard_margin"
android:layout_marginBottom="@dimen/standard_half_margin"
android:orientation="vertical">