com.flyco.tablayout.utils.UnreadMsgUtils Java Examples

The following examples show how to use com.flyco.tablayout.utils.UnreadMsgUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SegmentTabLayout.java    From likequanmintv with Apache License 2.0 6 votes vote down vote up
/**
 * 显示未读消息
 *
 * @param position 显示tab位置
 * @param num      num小于等于0显示红点,num大于0显示数字
 */
public void showMsg(int position, int num) {
    if (position >= mTabCount) {
        position = mTabCount - 1;
    }

    View tabView = mTabsContainer.getChildAt(position);
    MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);
    if (tipView != null) {
        UnreadMsgUtils.show(tipView, num);

        if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {
            return;
        }

        setMsgMargin(position, 2, 2);

        mInitSetMap.put(position, true);
    }
}
 
Example #2
Source File: CommonTabLayout.java    From likequanmintv with Apache License 2.0 6 votes vote down vote up
/**
 * 显示未读消息
 *
 * @param position 显示tab位置
 * @param num      num小于等于0显示红点,num大于0显示数字
 */
public void showMsg(int position, int num) {
    if (position >= mTabCount) {
        position = mTabCount - 1;
    }

    View tabView = mTabsContainer.getChildAt(position);
    MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);
    if (tipView != null) {
        UnreadMsgUtils.show(tipView, num);

        if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {
            return;
        }

        if (!mIconVisible) {
            setMsgMargin(position, 2, 2);
        } else {
            setMsgMargin(position, 0,
                    mIconGravity == Gravity.LEFT || mIconGravity == Gravity.RIGHT ? 4 : 0);
        }

        mInitSetMap.put(position, true);
    }
}
 
Example #3
Source File: SlidingTabLayout.java    From likequanmintv with Apache License 2.0 6 votes vote down vote up
/**
 * 显示未读消息
 *
 * @param position 显示tab位置
 * @param num      num小于等于0显示红点,num大于0显示数字
 */
public void showMsg(int position, int num) {
    if (position >= mTabCount) {
        position = mTabCount - 1;
    }

    View tabView = mTabsContainer.getChildAt(position);
    MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);
    if (tipView != null) {
        UnreadMsgUtils.show(tipView, num);

        if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {
            return;
        }

        setMsgMargin(position, 4, 2);
        mInitSetMap.put(position, true);
    }
}
 
Example #4
Source File: SegmentTabLayout.java    From FlycoTabLayout with MIT License 6 votes vote down vote up
/**
 * 显示未读消息
 *
 * @param position 显示tab位置
 * @param num      num小于等于0显示红点,num大于0显示数字
 */
public void showMsg(int position, int num) {
    if (position >= mTabCount) {
        position = mTabCount - 1;
    }

    View tabView = mTabsContainer.getChildAt(position);
    MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);
    if (tipView != null) {
        UnreadMsgUtils.show(tipView, num);

        if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {
            return;
        }

        setMsgMargin(position, 2, 2);

        mInitSetMap.put(position, true);
    }
}
 
Example #5
Source File: CommonTabLayout.java    From FlycoTabLayout with MIT License 6 votes vote down vote up
/**
 * 显示未读消息
 *
 * @param position 显示tab位置
 * @param num      num小于等于0显示红点,num大于0显示数字
 */
public void showMsg(int position, int num) {
    if (position >= mTabCount) {
        position = mTabCount - 1;
    }

    View tabView = mTabsContainer.getChildAt(position);
    MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);
    if (tipView != null) {
        UnreadMsgUtils.show(tipView, num);

        if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {
            return;
        }

        if (!mIconVisible) {
            setMsgMargin(position, 2, 2);
        } else {
            setMsgMargin(position, 0,
                    mIconGravity == Gravity.LEFT || mIconGravity == Gravity.RIGHT ? 4 : 0);
        }

        mInitSetMap.put(position, true);
    }
}
 
Example #6
Source File: SlidingTabLayout.java    From FlycoTabLayout with MIT License 6 votes vote down vote up
/**
 * 显示未读消息
 *
 * @param position 显示tab位置
 * @param num      num小于等于0显示红点,num大于0显示数字
 */
public void showMsg(int position, int num) {
    if (position >= mTabCount) {
        position = mTabCount - 1;
    }

    View tabView = mTabsContainer.getChildAt(position);
    MsgView tipView = (MsgView) tabView.findViewById(R.id.rtv_msg_tip);
    if (tipView != null) {
        UnreadMsgUtils.show(tipView, num);

        if (mInitSetMap.get(position) != null && mInitSetMap.get(position)) {
            return;
        }

        setMsgMargin(position, 4, 2);
        mInitSetMap.put(position, true);
    }
}