#### `QmTopBar`


----


 接入方法
 
 
  项目的根 build.gradle加入
  ````
  maven {
            url 'https://hub.zmcms.cn/repository/maven-public/'
        }
 ````
  app 的 build.gradle 中加入      
        
        
 ````
 debugImplementation 'com.qmai.android.sdk:widgetlib:1.1.1-SNAPSHOT'
 releaseImplementation 'com.qmai.android.sdk:widgetlib:1.1.1'
 
 ````
 
 ----------
 
 用法
 ```
 <com.qimai.android.widgetlib.topbar.QmTopBar
            android:id="@+id/toolbar" 
            android:layout_width="match_parent"
            app:title_color="@color/colorPrimary"
            app:title_text_size="@dimen/QmTopBar_dp_18"
            app:right_drawable_id="@drawable/more"
            app:right_text="确定"
            app:need_separator="true"
            app:right_text_color="@color/colorAccent"
            app:title_text="详情"
            android:layout_height="45dp"/>
 ```
 ![效果](https://git.zmcms.cn/wangwei/widget/blob/master/img/topar_nomal.png)
 ```           
            
 ///-----------------------------------------
      // 是否需要分割线
      <attr name="need_separator" format="boolean"/>

        <attr name="separator_color" format="color"/>
        <attr name="separator_height" format="dimension"/>
        <!-- titlebar背景颜色-->
        <attr name="bg_color" format="color"/>
        // 返回按钮的图片
        <attr name="left_back_drawable_id" format="reference"/>
        // title 相关
        <attr name="title_text_size" format="dimension"/>
        <attr name="title_color" format="color"/>
        <attr name="title_text" format="string"/>
         // 右边按钮相关
        <attr name="right_drawable_id" format="reference"/>
        
        //  右边文案相关
        <attr name="right_text" format="string"/>
        <attr name="right_text_color" format="color"/>
        <attr name="right_text_size" format="dimension"/>
        <attr name="right_text_background" format="reference"/>            
 ```
 修改title
 ````
   toolbar.centerTextProperty = toolbar.centerTextProperty.apply {
                text = "修改"
                textColor = ContextCompat.getColor(this@MainActivity, R.color.abc_btn_colored_borderless_text_material)
            }

 ````
 
 自定义左边view
 ````
  var text = TextView(this)
            text.text = "取消"
            text.setTextColor(Color.RED)
            text.textSize = 16f
            toolbar.customLeftView(text, null)
 
 ````
 是否显示 下面的线 
 
 ````
             toolbar.qmTopBarNeedSeparator = true/false

 ````
 
 设置按钮监听
 
 ````
 toolbar.registerViewClickListener {
    // 可重写一个多个方法
            backImgClick {
                finish()

            }
            rightImgClick {
                Toast.makeText(this@MainActivity, "rightImg", Toast.LENGTH_SHORT).show()
            }

            rightTextClick {
                Toast.makeText(this@MainActivity, "rightText", Toast.LENGTH_SHORT).show()

            }

        }
 ````
 
 
 
 
 
 
#### changelog

version 1.1.1  创建项目