引用: 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));