I am using tablayout in my project , I have only two tabs . and I don't have a viewpager . I want to add a separator or divider in between tabs like below .
Tab1 | Tab2
but currently its showing like
Tab1 Tab2
I have already checked this but in this case they have used a view pager . As I said before I don't have a viewpager .
Here is my code for tablayout
xml
<android.support.design.widget.TabLayout
android:id="@+id/bTabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:layout_alignParentBottom="true"
android:background="@color/feint_blue"
app:tabIndicatorHeight="0dp"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/button_text_color"
app:tabIndicatorColor="@color/color_bottombar_tab_select"
app:tabTextColor="@color/dark_gray"
app:textAllCaps="false"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabGravity="fill" />
java
TabLayout bottomTab;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment, container, false);
bottomTab = (TabLayout) rootView.findViewById(R.id.bTabs);
bottomTab.addTab(bottomTab.newTab().setText("Tab 1"));
bottomTab.addTab(bottomTab.newTab().setText("Tab 2"));
}
Technically , this is what I finally want .
How can I accomplish this ?