ogaclejapan / SmartTabLayout

A custom ViewPager title strip which gives continuous feedback to the user when scrolling
Apache License 2.0
7.09k stars 1.34k forks source link

Troubles with positioning on MIUI #166

Closed Bringoff closed 8 years ago

Bringoff commented 8 years ago

I use this lib in my project to display custom tabs. All is ok with stock Android (screenshot). But on MIUI active tab indicator moves out of the bottom of the screen (screenshot). My layout looks like this:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.HostActivity">

<android.support.v4.view.ViewPager
    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/pagerTabLayout" />

<com.ogaclejapan.smarttablayout.SmartTabLayout
    android:id="@id/pagerTabLayout"
    style="@style/BottomNavigationTabs"
    android:layout_alignParentBottom="true" />
</RelativeLayout>

Tabs style is here:

<style name="BottomNavigationTabs">
    <item name="android:layout_width">match_parent</item>
    <item name="android:layout_height">@dimen/main_tab_height</item>
    <item name="android:background">@color/colorBottomNavigation</item>
    <item name="stl_indicatorWidth">@dimen/main_tabs_indicator_width</item>
    <item name="stl_indicatorThickness">@dimen/main_tabs_indicator_height</item>
    <item name="stl_indicatorInterpolation">linear</item>
    <item name="stl_indicatorColor">@color/colorBottomNavigationIndicator</item>
    <item name="stl_drawDecorationAfterTab">true</item>
    <item name="stl_dividerThickness">@dimen/zero_size</item>
    <item name="stl_distributeEvenly">true</item>
</style>

So, I assume that it could be a bug in MIUI, but... It's android and it's life:) I must support it and deal with this. So, I think the lib have to support MIUI.

ogaclejapan commented 8 years ago

Hi, @Bringoff

SmartTabLayout settings are not a problem. May be it a bug in MIUI.

Hmm... Did you try a LinearLayout ?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  >

  <android.support.v4.view.ViewPager
    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    />

  <com.ogaclejapan.smarttablayout.SmartTabLayout
    android:id="@+id/pagerTabLayout"
    style="@style/BottomNavigationTabs"
    />

</LinearLayout>
Bringoff commented 8 years ago

Yes, I did try it, but nothing changed.

ogaclejapan commented 8 years ago

Hmmm, How is other apps? Did you see the same issue for other apps?

@Bringoff Sorry, I have no idea :(

Bringoff commented 8 years ago

Did you see the same issue for other apps?

Looks like no. Well, I have no idea, too.

Bringoff commented 8 years ago

Funny. I have updated my filmware and this problem is gone