// Path: u148/app/src/main/java/com/chenjishi/u148/utils/Constants.java
// public interface Constants {
// 
//     String KEY_FEED = "feed";
//     String KEY_FEED_LIST = "feed_list";
//     String KEY_FEED_INDEX = "index";
// 
//     int MODE_DAY = 0;
//     int MODE_NIGHT = 1;
// 
//     String EVENT_ARTICLE_SHARE = "ArticleShare";
//     String EVENT_IMAGE_SHARE = "ArticleShare";
// 
//     String PARAM_TITLE = "title";
//     String PARAM_URL = "url";
// 
//     String BASE_URL = "http://api.u148.net/json/";
// 
//     String API_FEED_LIST = BASE_URL + "%1$d/%2$d";
//     String API_ARTICLE = BASE_URL + "article/%1$s";
//     String API_ADD_FAVORITE = BASE_URL + "favourite?id=%1$s&token=%2$s";
//     String API_DELETE_FAVORITE = BASE_URL + "del_favourite?id=%1$s&token=%2$s";
//     String API_LOGIN = BASE_URL + "login";
//     String API_REGISTER = BASE_URL + "register";
//     String API_COMMENTS_GET = BASE_URL + "get_comment/%1$s/%2$d";
//     String API_COMMENT_POST = BASE_URL + "comment";
//     String API_FAVORITE_GET = BASE_URL + "get_favourite/0/%1$d?token=%2$s";
//     String API_UPGRADE = BASE_URL + "version";
//     String API_SEARCH = BASE_URL + "search/%1$d?keyword=%2$s";
//     String XIAO_MI = "http://app.mi.com/details?id=com.chenjishi.u148&ref=search";
// }


import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.chenjishi.u148.R;
import com.chenjishi.u148.utils.Constants;
        setCurrentItem(mSelectedTabIndex);
        requestLayout();
    }

    @Override
    public void setViewPager(ViewPager view, int initialPosition) {
        setViewPager(view);
        setCurrentItem(initialPosition);
    }

    @Override
    public void setCurrentItem(int item) {
        if (mViewPager == null) {
            throw new IllegalStateException("ViewPager has not been bound.");
        }
        mSelectedTabIndex = item;
        mViewPager.setCurrentItem(item);

        final int tabCount = mTabLayout.getChildCount();
        for (int i = 0; i < tabCount; i++) {
            final View child = mTabLayout.getChildAt(i);
            final boolean isSelected = (i == item);
            child.setSelected(isSelected);
            if (isSelected) {
                animateToTab(item);
            }
        }
    }

    public void setTheme(int theme) {
// Path: u148/app/src/main/java/com/chenjishi/u148/utils/Constants.java
// public interface Constants {
// 
//     String KEY_FEED = "feed";
//     String KEY_FEED_LIST = "feed_list";
//     String KEY_FEED_INDEX = "index";
// 
//     int MODE_DAY = 0;
//     int MODE_NIGHT = 1;
// 
//     String EVENT_ARTICLE_SHARE = "ArticleShare";
//     String EVENT_IMAGE_SHARE = "ArticleShare";
// 
//     String PARAM_TITLE = "title";
//     String PARAM_URL = "url";
// 
//     String BASE_URL = "http://api.u148.net/json/";
// 
//     String API_FEED_LIST = BASE_URL + "%1$d/%2$d";
//     String API_ARTICLE = BASE_URL + "article/%1$s";
//     String API_ADD_FAVORITE = BASE_URL + "favourite?id=%1$s&token=%2$s";
//     String API_DELETE_FAVORITE = BASE_URL + "del_favourite?id=%1$s&token=%2$s";
//     String API_LOGIN = BASE_URL + "login";
//     String API_REGISTER = BASE_URL + "register";
//     String API_COMMENTS_GET = BASE_URL + "get_comment/%1$s/%2$d";
//     String API_COMMENT_POST = BASE_URL + "comment";
//     String API_FAVORITE_GET = BASE_URL + "get_favourite/0/%1$d?token=%2$s";
//     String API_UPGRADE = BASE_URL + "version";
//     String API_SEARCH = BASE_URL + "search/%1$d?keyword=%2$s";
//     String XIAO_MI = "http://app.mi.com/details?id=com.chenjishi.u148&ref=search";
// }


// Path: u148/app/src/main/java/com/chenjishi/u148/widget/TabPageIndicator.java
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.chenjishi.u148.R;
import com.chenjishi.u148.utils.Constants;

        setCurrentItem(mSelectedTabIndex);
        requestLayout();
    }

    @Override
    public void setViewPager(ViewPager view, int initialPosition) {
        setViewPager(view);
        setCurrentItem(initialPosition);
    }

    @Override
    public void setCurrentItem(int item) {
        if (mViewPager == null) {
            throw new IllegalStateException("ViewPager has not been bound.");
        }
        mSelectedTabIndex = item;
        mViewPager.setCurrentItem(item);

        final int tabCount = mTabLayout.getChildCount();
        for (int i = 0; i < tabCount; i++) {
            final View child = mTabLayout.getChildAt(i);
            final boolean isSelected = (i == item);
            child.setSelected(isSelected);
            if (isSelected) {
                animateToTab(item);
            }
        }
    }

    public void setTheme(int theme) {
        final boolean isNight = theme == Constants.MODE_NIGHT;