0

I have sample which I should realize in code. Something like pagination. And I chose TabLayout. Mechanically all works as it should be. But it doesn't look right. Picture of sample and my try

Below is a code of what I did. For circles I made simple drawable selector with shape 'oval' and 'state_selected':

<com.google.android.material.tabs.TabLayout
        android:id="@+id/tabLayoutGeneration"
        android:layout_width="match_parent"
        android:layout_height="78sp"
        android:layout_marginTop="10sp"
        app:tabBackground="@drawable/selector_navigation_generator"

        app:tabIndicatorGravity="bottom"
        app:tabMaxWidth="41sp"
        app:tabTextColor="@color/white">

        <com.google.android.material.tabs.TabItem
            android:id="@+id/tabDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="1" />

        <com.google.android.material.tabs.TabItem
            android:id="@+id/tabCity"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="2" />

        <com.google.android.material.tabs.TabItem
            android:id="@+id/tabLocation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="3" />
    </com.google.android.material.tabs.TabLayout> ```
Minatsuki
  • 1
  • 1
  • you should try this stepview lib for your custom view design; https://github.com/tatocaster/StepView – Bhoomika Patel Apr 12 '22 at 06:34
  • @BhoomikaPatel Looks just amazing. But I think something wrong, it can't connect to my project. Did you use it? – Minatsuki Apr 12 '22 at 11:44
  • If you're using a current project template in Android Studio, the `maven {...}` block might cause a problem if you put where that README indicates. Have a look here: https://stackoverflow.com/a/70989593. – Mike M. Apr 12 '22 at 13:07
  • @BhoomikaPatel yea, I read this article some hours ago. So my 'maven' is located where the screenshot says. – Minatsuki Apr 12 '22 at 13:14

0 Answers0