QMUI框架使用教程_持续更新

引用: implementation ‘com.qmuiteam:qmui:1.4.0’
功能列表: https://qmuiteam.com/android/documents/

标题栏:

**<com.qmuiteam.qmui.widget.QMUITopBar
            android:id="@+id/bast_top_bar"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:visibility="gone"
            app:qmui_topbar_title_color="@color/white">

        </com.qmuiteam.qmui.widget.QMUITopBar>**
        得在代码中设置标题,然后左边的图标大概是48*48

效果图 下面图标是点击变大的
在这里插入图片描述
安卓经典ViewPager+tablayout:

<com.sim.chongwukongjing.ui.wigdet.NoScrollViewPager
        android:id="@+id/main_view_page"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1">


    </com.sim.chongwukongjing.ui.wigdet.NoScrollViewPager>

    <View
        android:id="@+id/main_view"
        style="@style/h_line"
        android:layout_height="1px"
        android:layout_above="@id/rl_bottom" />

    <RelativeLayout
        android:id="@+id/rl_bottom"
        android:layout_width="match_parent"
        android:layout_height="100dp"

        android:layout_alignParentBottom="true">

        <com.qmuiteam.qmui.widget.QMUITabSegment
            android:id="@+id/main_tab_segment"
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:background="@drawable/background_gradient"
            android:isScrollContainer="true"
            app:qmui_tab_icon_position="top">

        </com.qmuiteam.qmui.widget.QMUITabSegment>
    </RelativeLayout>

tablayout的一些配置可以在QMUITabSegment类中最上面看下,//添加tab就用下面的方法:
mainTabSegment.addTab(
new QMUITabSegment.Tab(
ContextCompat.getDrawable(this, R.drawable.), 普通图标  48*48
ContextCompat.getDrawable(this, R.drawable.), 选中图标 48*48
getString(R.string.yeliang),           文字
false,
true));

默认屏蔽左右滑动的viewPage

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

import com.qmuiteam.qmui.widget.QMUIViewPager;

/**
 * 默认屏蔽左右滑动的viewPage
 * 继承自QMUIViewPager,也可以直接继承自ViewPage
 * Created by jiahengfei on 2017/12/28 0028.
 */
public class NoScrollViewPager extends QMUIViewPager {

    private boolean noScroll = true;

    public NoScrollViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NoScrollViewPager(Context context) {
        super(context);
    }

    public void setNoScroll(boolean noScroll) {
        this.noScroll = noScroll;
    }

    @Override
    public void scrollTo(int x, int y) {
        super.scrollTo(x, y);
    }

    @Override
    public boolean onTouchEvent(MotionEvent arg0) {
        if (noScroll) {
            return false;
        } else {
            return super.onTouchEvent(arg0);
        }
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent arg0) {
        if (noScroll) {
            return false;
        } else {
            return super.onInterceptTouchEvent(arg0);
        }
    }

    @Override
    public void setCurrentItem(int item, boolean smoothScroll) {
        super.setCurrentItem(item, smoothScroll);
    }

    @Override
    public void setCurrentItem(int item) {
        super.setCurrentItem(item);
    }

}

效果图
在这里插入图片描述

group_list_item_gegngaishebeimignc.setText(“更改设备名称”);
//group_list_item_gegngaishebeimignc.showNewTip(true);
group_list_item_gegngaishebeimignc.setRedDotPosition(QMUICommonListItemView.REDDOT_POSITION_RIGHT);
group_list_item_gegngaishebeimignc.showRedDot(true);
group_list_item_gegngaishebeimignc.setImageDrawable(getResources().getDrawable(R.drawable.diqiu));

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值