Selaa lähdekoodia

@task: device type ui

bai 3 vuotta sitten
vanhempi
commit
c5abf28100

+ 14 - 8
demo/src/main/AndroidManifest.xml

@@ -26,28 +26,34 @@
         android:supportsRtl="true"
         android:theme="@style/AppTheme">
         <activity
-            android:name=".activities.poc.SceneActivity"
-            android:exported="true">
-
-        </activity>
+            android:name=".activities.poc.RecordInfoActivity"
+            android:exported="true" />
         <activity
-            android:name=".activities.poc.SpaceActivity"
+            android:name=".activities.poc.DeviceTypeActivity"
+            android:exported="true" />
+        <activity
+            android:name=".activities.poc.NewDeviceActivity"
             android:exported="true">
-
-        </activity>
-        <activity android:name=".activities.MainActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
+        <activity
+            android:name=".activities.poc.SceneActivity"
+            android:exported="true" />
+        <activity
+            android:name=".activities.poc.SpaceActivity"
+            android:exported="true" />
+        <activity android:name=".activities.MainActivity" />
         <activity android:name=".activities.GraphyActivity" />
         <activity android:name=".activities.WebViewActivity" />
         <activity android:name=".activities.PocActivity">
 
         </activity>
         <activity android:name="com.zbar.lib.CaptureActivity"/>
+        <activity android:name=".activities.PocActivity" />
     </application>
 
 </manifest>

+ 88 - 0
demo/src/main/java/com/sybotan/android/demo/activities/poc/DeviceTypeActivity.kt

@@ -0,0 +1,88 @@
+package com.sybotan.android.demo.activities.poc
+
+import android.os.Bundle
+import android.support.v7.app.AppCompatActivity
+import android.widget.ImageView
+import android.widget.ListView
+import com.sybotan.android.demo.R
+import com.sybotan.android.demo.adapter.TreeAdapter
+import com.sybotan.android.demo.data.datas
+
+class DeviceTypeActivity : AppCompatActivity() {
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(R.layout.activity_device_type)
+        val typeLv = findViewById<ListView>(R.id.typeLv)
+        val adapter = TreeAdapter(datas(), this, typeLv)
+        typeLv.adapter = adapter
+
+        val backIv = findViewById<ImageView>(R.id.backIv)
+        backIv.setOnClickListener {
+            finish()
+        }
+    }
+}
+
+
+data class DeviceType(
+    val rtn: Rtn
+)
+
+data class Rtn(
+    val content: List<Content>,
+    val message: String,
+    val result: String,
+    val total: Int
+)
+
+data class Content(
+    val aliasCode: String,
+    val aliasName: String,
+    val children: List<Children>,
+    val code: String,
+    val groupCode: String,
+    val name: String,
+    val projectId: String
+)
+
+data class Children(
+    val aliasCode: String,
+    val aliasName: String,
+    val children: List<ChildrenX>,
+    val code: String,
+    val createTime: String,
+    val groupCode: String,
+    val id: String,
+    val lastUpdate: String,
+    val majorCode: String,
+    val name: String,
+    val objType: String,
+    val parentCode: String,
+    val projectId: String,
+    val statistics: StatisticsX,
+    val type: String
+)
+
+data class ChildrenX(
+    val aliasCode: String,
+    val aliasName: String,
+    val code: String,
+    val createTime: String,
+    val groupCode: String,
+    val id: String,
+    val lastUpdate: String,
+    val majorCode: String,
+    val name: String,
+    val objType: String,
+    val parentCode: String,
+    val projectId: String,
+    val statistics: Statistics,
+    val systemCode: String,
+    val type: String
+)
+
+class StatisticsX(
+)
+
+class Statistics(
+)

+ 29 - 0
demo/src/main/java/com/sybotan/android/demo/activities/poc/NewDeviceActivity.kt

@@ -0,0 +1,29 @@
+package com.sybotan.android.demo.activities.poc
+
+import android.os.Bundle
+import android.support.v7.app.AppCompatActivity
+import android.widget.Toast
+import com.sybotan.android.demo.R
+import kotlinx.android.synthetic.main.activity_new_device.*
+import org.jetbrains.anko.startActivity
+
+class NewDeviceActivity : AppCompatActivity() {
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(R.layout.activity_new_device)
+
+        deviceCl.setOnClickListener {
+            startActivity<DeviceTypeActivity>()
+        }
+
+        infoCl.setOnClickListener {
+            startActivity<RecordInfoActivity>()
+        }
+
+        saveBtn.setOnClickListener {
+            Toast.makeText(this@NewDeviceActivity, "hello", Toast.LENGTH_LONG).show()
+        }
+    }
+
+
+}

+ 28 - 0
demo/src/main/java/com/sybotan/android/demo/activities/poc/RecordInfoActivity.kt

@@ -0,0 +1,28 @@
+package com.sybotan.android.demo.activities.poc
+
+import android.os.Bundle
+import android.support.v7.app.AppCompatActivity
+import android.support.v7.widget.AppCompatEditText
+import android.widget.ImageView
+import com.sybotan.android.demo.R
+import com.sybotan.android.demo.base.SimpleTextWatcher
+
+class RecordInfoActivity : AppCompatActivity() {
+    private var info = ""
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(R.layout.activity_record_info)
+        val backIv = findViewById<ImageView>(R.id.backIv)
+        backIv.setOnClickListener {
+            finish()
+        }
+
+        val recordEt = findViewById<AppCompatEditText>(R.id.recordEt)
+        recordEt.addTextChangedListener(object : SimpleTextWatcher() {
+            override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
+                info = s.toString()
+
+            }
+        })
+    }
+}

+ 39 - 0
demo/src/main/java/com/sybotan/android/demo/adapter/TreeAdapter.kt

@@ -0,0 +1,39 @@
+package com.sybotan.android.demo.adapter
+
+import android.content.Context
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ListView
+import android.widget.TextView
+import com.sybotan.android.demo.R
+import com.sybotan.android.demo.data.Data
+import com.sybotan.android.demo.tree.BaseTreeAdapter
+import com.sybotan.android.demo.tree.Node
+
+class TreeAdapter(
+    data: List<Data>, context: Context, listView: ListView
+) : BaseTreeAdapter<Data>(data, context, listView) {
+    override fun getConvertView(
+        node: Node<Data>,
+        position: Int,
+        convertView: View?,
+        parent: ViewGroup?
+    ): View {
+        var view = convertView
+        val holder: Holder
+        if (view == null) {
+            view = mInflater.inflate(R.layout.item_tree, parent, false)
+            holder = Holder()
+            holder.label = view.findViewById(R.id.labelTv)!!
+            view.tag = holder
+        } else {
+            holder = view.tag as Holder
+        }
+        holder.label.text = node.label
+        return view!!
+    }
+
+    inner class Holder {
+        lateinit var label: TextView
+    }
+}

+ 15 - 0
demo/src/main/java/com/sybotan/android/demo/base/SimpleTextWatcher.kt

@@ -0,0 +1,15 @@
+package com.sybotan.android.demo.base
+
+import android.text.Editable
+import android.text.TextWatcher
+
+abstract class SimpleTextWatcher : TextWatcher {
+    override fun afterTextChanged(s: Editable?) {
+    }
+
+    override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
+    }
+
+    override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
+    }
+}

+ 14 - 0
demo/src/main/java/com/sybotan/android/demo/data/Data.kt

@@ -0,0 +1,14 @@
+package com.sybotan.android.demo.data
+
+import com.sybotan.android.demo.tree.TreeNodeId
+import com.sybotan.android.demo.tree.TreeNodeLabel
+import com.sybotan.android.demo.tree.TreeNodePid
+
+
+data class Data(
+    @TreeNodeId val id: Int,
+    @TreeNodePid val pid: Int,
+    @TreeNodeLabel val label: String,
+    val name: String
+)
+

+ 23 - 0
demo/src/main/java/com/sybotan/android/demo/data/Datas.kt

@@ -0,0 +1,23 @@
+package com.sybotan.android.demo.data
+
+
+fun datas(): List<Data> {
+    val list = mutableListOf<Data>()
+
+    list.add(Data(1, 0, "文件管理系统", "文件管理系统"));
+    list.add(Data(2, 1, "游戏", "游戏"));
+    list.add(Data(3, 1, "文档", "文档"));
+    list.add(Data(4, 1, "程序", "程序"));
+    list.add(Data(5, 2, "war3", "war3"));
+    list.add(Data(6, 2, "刀塔传奇", "刀塔传奇"));
+
+    list.add(Data(7, 4, "面向对象", "面向对象"));
+    list.add(Data(8, 4, "非面向对象", "非面向对象"));
+
+    list.add(Data(9, 7, "C++", "C++"));
+    list.add(Data(10, 7, "JAVA", "JAVA"));
+    list.add(Data(11, 7, "Javascript", "Javascript"));
+    list.add(Data(12, 8, "C", "C"));
+
+    return list
+}

+ 77 - 0
demo/src/main/java/com/sybotan/android/demo/tree/BaseTreeAdapter.kt

@@ -0,0 +1,77 @@
+package com.sybotan.android.demo.tree
+
+import android.content.Context
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.BaseAdapter
+import android.widget.ListView
+
+
+abstract class BaseTreeAdapter<T : Any>(
+    data: List<T>,
+    context: Context,
+    listView: ListView,
+    private var nodes: List<Node<T>> = TreeHelper.getTreeNodes(data),
+    private var visibleNodes: List<Node<T>> = TreeHelper.filterVisibleNodes(nodes)
+) : BaseAdapter() {
+    protected val mInflater: LayoutInflater = LayoutInflater.from(context)
+    private var onTreeNodeClickListener: OnTreeNodeClickListener<T>? = null
+
+    init {
+        listView.setOnItemClickListener { parent, view, position, id ->
+            expandOrCollapse(position)
+            onTreeNodeClickListener?.onClick(visibleNodes[position], position);
+        }
+    }
+
+    interface OnTreeNodeClickListener<T> {
+        fun onClick(node: Node<T>, position: Int)
+    }
+
+    fun setOnTreeNodeClickListener(onTreeNodeClickListener: OnTreeNodeClickListener<T>) {
+        this.onTreeNodeClickListener = onTreeNodeClickListener
+    }
+
+    open fun expandOrCollapse(position: Int) {
+        val n = visibleNodes[position]
+        if (n.isLeaf) return
+        n.isExpand = !n.isExpand
+        visibleNodes = TreeHelper.filterVisibleNodes(nodes)
+        notifyDataSetChanged()
+    }
+
+    override fun getCount(): Int {
+        return visibleNodes.size
+    }
+
+    override fun getItem(position: Int): Any {
+        return visibleNodes[position]
+    }
+
+    override fun getItemId(position: Int): Long {
+        return position.toLong()
+    }
+
+    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
+        val node = visibleNodes[position]
+        val holder =
+            getConvertView(
+                node,
+                position,
+                convertView,
+                parent
+            )
+        holder.setPadding(node.level * 48, 3, 3, 3)
+        return holder
+    }
+
+    abstract fun getConvertView(
+        node: Node<T>,
+        position: Int,
+        convertView: View?,
+        parent: ViewGroup?
+    ): View
+}
+
+

+ 61 - 0
demo/src/main/java/com/sybotan/android/demo/tree/Tree.kt

@@ -0,0 +1,61 @@
+package com.sybotan.android.demo.tree
+
+
+@Target(AnnotationTarget.FIELD)
+@Retention(AnnotationRetention.RUNTIME)
+annotation class TreeNodeId
+
+@Target(AnnotationTarget.FIELD)
+@Retention(AnnotationRetention.RUNTIME)
+annotation class TreeNodePid
+
+@Target(AnnotationTarget.FIELD)
+@Retention(AnnotationRetention.RUNTIME)
+annotation class TreeNodeLabel
+
+class Node<T>(val id: Int, val pid: Int, val label: String, val data: T) {
+    /**
+     * 节点层级
+     */
+    val level: Int
+        get() = parent?.let { parent!!.level + 1 } ?: 0
+
+    /**
+     * 展开状态
+     */
+    var isExpand = false
+        set(isExpand) {
+            field = isExpand
+
+            if (!isExpand) {
+                for (node in children) {
+                    node.isExpand = false
+                }
+            }
+        }
+
+    var parent: Node<T>? = null
+
+    var children: MutableList<Node<T>> = mutableListOf()
+
+    /**
+     * is 根节点
+     */
+    val isRoot: Boolean
+        get() = parent == null
+
+    /**
+     * 当前节点父节点是否收缩
+     */
+    val isParentExpand: Boolean
+        get() = parent?.isExpand ?: false
+
+    /**
+     * 是否是叶子节点
+     *
+     * @return
+     */
+    val isLeaf: Boolean
+        get() = children.isEmpty()
+
+}

+ 136 - 0
demo/src/main/java/com/sybotan/android/demo/tree/TreeHelper.kt

@@ -0,0 +1,136 @@
+package com.sybotan.android.demo.tree
+
+object TreeHelper {
+
+    @Throws(IllegalArgumentException::class, IllegalAccessException::class)
+    fun <T : Any> getTreeNodes(list: List<T>): List<Node<T>> {
+
+        val nodes = nodes(list)
+        val rootNodes = rootNodes(nodes)
+
+        val result = mutableListOf<Node<T>>()
+        for (node in rootNodes) {
+            addNode(result, node)
+        }
+
+        return result
+    }
+
+
+    /**
+     * 过滤出可见节点
+     *
+     * @options nodes
+     * @return
+     */
+    fun <T : Any> filterVisibleNodes(nodes: List<Node<T>>): List<Node<T>> {
+        val result = mutableListOf<Node<T>>()
+
+        for (node in nodes) {
+            if (node.isRoot || node.isParentExpand) {
+                result.add(node)
+            }
+        }
+        return result
+    }
+
+
+    /**
+     * 将用户的数据转化为树形数据
+     *
+     * @options datas
+     * @return
+     * @throws IllegalAccessException
+     * @throws IllegalArgumentException
+     */
+    @Throws(IllegalArgumentException::class, IllegalAccessException::class)
+    private fun <T : Any> nodes(list: List<T>): List<Node<T>> {
+        val nodes = ArrayList<Node<T>>()
+        var node: Node<T>
+
+        for (t in list) {
+            var id = -1
+            var pid = -1
+            var label = ""
+            val clazz = t::class.java
+            val fields = clazz.declaredFields
+            for (field in fields) {
+                if (field.getAnnotation(TreeNodeId::class.java) != null) {
+                    field.isAccessible = true
+                    id = field.getInt(t)
+                }
+                if (field.getAnnotation(TreeNodePid::class.java) != null) {
+                    field.isAccessible = true
+                    pid = field.getInt(t)
+                }
+                if (field.getAnnotation(TreeNodeLabel::class.java) != null) {
+                    field.isAccessible = true
+                    label = field.get(t) as String
+                }
+
+                if (id != -1 && pid != -1 && label != "") {  // 需要的属性都已经设置完毕
+                    break
+                }
+            }
+            node = Node(id, pid, label, t)
+            nodes.add(node)
+        }
+
+
+        // 关联节点
+        for (i in nodes.indices) {
+            val n = nodes[i]
+
+            for (j in i + 1 until nodes.size) {
+                val m = nodes[j]
+
+                if (m.pid == n.id) {
+                    n.children.add(m)
+                    m.parent = n
+                } else if (m.id == n.pid) {
+                    m.children.add(n)
+                    n.parent = m
+                }
+            }
+        }
+
+        return nodes
+    }
+
+    /**
+     * 把一个节点的所有孩子节点都放入result
+     *
+     * @options result
+     * @options node
+     */
+    private fun <T : Any> addNode(
+        result: MutableList<Node<T>>,
+        node: Node<T>
+    ) {
+        result.add(node)
+        if (node.isLeaf)
+            return
+
+        for (i in 0 until node.children.size) {
+            addNode(result, node.children[i])
+        }
+
+    }
+
+    /**
+     * 获取根节点
+     *
+     * @options nodes
+     * @return
+     */
+    private fun <T> rootNodes(nodes: List<Node<T>>): List<Node<T>> {
+        val root = mutableListOf<Node<T>>()
+        for (node in nodes) {
+            if (node.isRoot) {
+                root.add(node)
+            }
+        }
+        return root
+    }
+
+}

+ 10 - 0
demo/src/main/res/drawable/ic_round_arrow_right_24.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?attr/colorControlNormal">
+  <path
+      android:fillColor="@android:color/white"
+      android:pathData="M11.71,15.29l2.59,-2.59c0.39,-0.39 0.39,-1.02 0,-1.41L11.71,8.7c-0.63,-0.62 -1.71,-0.18 -1.71,0.71v5.17c0,0.9 1.08,1.34 1.71,0.71z"/>
+</vector>

+ 10 - 0
demo/src/main/res/drawable/ic_round_check_24.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?attr/colorControlNormal">
+  <path
+      android:fillColor="@android:color/white"
+      android:pathData="M9,16.17L5.53,12.7c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41l4.18,4.18c0.39,0.39 1.02,0.39 1.41,0L20.29,7.71c0.39,-0.39 0.39,-1.02 0,-1.41 -0.39,-0.39 -1.02,-0.39 -1.41,0L9,16.17z"/>
+</vector>

+ 10 - 0
demo/src/main/res/drawable/ic_round_chevron_right_24.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?attr/colorControlNormal">
+  <path
+      android:fillColor="@android:color/white"
+      android:pathData="M9.29,6.71c-0.39,0.39 -0.39,1.02 0,1.41L13.17,12l-3.88,3.88c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.39 1.02,0.39 1.41,0l4.59,-4.59c0.39,-0.39 0.39,-1.02 0,-1.41L10.7,6.7c-0.38,-0.38 -1.02,-0.38 -1.41,0.01z"/>
+</vector>

+ 51 - 0
demo/src/main/res/layout/activity_device_type.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".activities.poc.DeviceTypeActivity">
+
+    <android.support.constraint.ConstraintLayout
+        android:id="@+id/topBarCl"
+        android:layout_width="match_parent"
+        android:layout_height="48dp"
+        android:background="@color/blue_600"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <ImageView
+            android:id="@+id/backIv"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginStart="16dp"
+            android:contentDescription="back"
+            android:src="@drawable/ic_round_arrow_back_24"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            android:id="@+id/titleTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="选择设备类型"
+            android:textColor="@color/black_272727"
+            android:textSize="18sp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+    </android.support.constraint.ConstraintLayout>
+
+    <ListView
+        android:id="@+id/typeLv"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/topBarCl" />
+</android.support.constraint.ConstraintLayout>

+ 325 - 0
demo/src/main/res/layout/activity_new_device.xml

@@ -0,0 +1,325 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".activities.poc.NewDeviceActivity">
+
+    <android.support.constraint.ConstraintLayout
+        android:id="@+id/topBarCl"
+        android:layout_width="match_parent"
+        android:layout_height="48dp"
+        android:background="@color/blue_600"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <ImageView
+            android:id="@+id/backIv"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginStart="16dp"
+            android:contentDescription="back"
+            android:src="@drawable/ic_round_arrow_back_24"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            android:id="@+id/titleTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="空间勘测-F1-XXX空间"
+            android:textColor="@color/black_272727"
+            android:textSize="18sp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+    </android.support.constraint.ConstraintLayout>
+
+    <android.support.constraint.ConstraintLayout
+        android:id="@+id/bodyCl"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/topBarCl">
+
+        <android.support.constraint.ConstraintLayout
+            android:id="@+id/positionCl"
+            android:layout_width="0dp"
+            android:layout_height="48dp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+            <ImageView
+                android:id="@+id/positionOkIv"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginStart="16dp"
+                android:src="@drawable/ic_round_check_24"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                tools:ignore="ContentDescription" />
+
+            <TextView
+                android:id="@+id/positionTypeTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:text="1、安装位置"
+                android:textColor="@color/black_272727"
+                android:textSize="16sp"
+                app:layout_constraintBottom_toBottomOf="@id/positionOkIv"
+                app:layout_constraintStart_toEndOf="@id/positionOkIv"
+                app:layout_constraintTop_toTopOf="@id/positionOkIv" />
+
+            <ImageView
+                android:id="@+id/positionDetailIv"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginEnd="16dp"
+                android:src="@drawable/ic_round_chevron_right_24"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/positionInfoTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="16dp"
+                android:text="房顶(x,y,z)"
+                android:textColor="@color/black_272727"
+                android:textSize="14sp"
+                app:layout_constraintBottom_toBottomOf="@id/positionDetailIv"
+                app:layout_constraintEnd_toStartOf="@id/positionDetailIv"
+                app:layout_constraintTop_toTopOf="@id/positionDetailIv"
+                app:layout_constraintVertical_bias="0.5" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:layout_marginStart="16dp"
+                android:layout_marginEnd="16dp"
+                android:background="@color/black_272727"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent" />
+        </android.support.constraint.ConstraintLayout>
+
+        <android.support.constraint.ConstraintLayout
+            android:id="@+id/deviceCl"
+            android:layout_width="0dp"
+            android:layout_height="48dp"
+            app:layout_constraintEnd_toEndOf="@+id/positionCl"
+            app:layout_constraintStart_toStartOf="@+id/positionCl"
+            app:layout_constraintTop_toBottomOf="@+id/positionCl">
+
+            <ImageView
+                android:id="@+id/deviceOkIv"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginStart="16dp"
+                android:src="@drawable/ic_round_check_24"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                tools:ignore="ContentDescription" />
+
+            <TextView
+                android:id="@+id/deviceTypeTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:text="2、选择设备类型"
+                android:textColor="@color/black_272727"
+                android:textSize="16sp"
+                app:layout_constraintBottom_toBottomOf="@id/deviceOkIv"
+                app:layout_constraintStart_toEndOf="@id/deviceOkIv"
+                app:layout_constraintTop_toTopOf="@id/deviceOkIv" />
+
+            <ImageView
+                android:id="@+id/deviceDetailIv"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginEnd="16dp"
+                android:src="@drawable/ic_round_chevron_right_24"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/deviceInfoTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="16dp"
+                android:text="空气传感器"
+                android:textColor="@color/black_272727"
+                android:textSize="14sp"
+                app:layout_constraintBottom_toBottomOf="@id/deviceDetailIv"
+                app:layout_constraintEnd_toStartOf="@id/deviceDetailIv"
+                app:layout_constraintTop_toTopOf="@id/deviceDetailIv" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:layout_marginStart="16dp"
+                android:layout_marginEnd="16dp"
+                android:background="@color/black_272727"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent" />
+        </android.support.constraint.ConstraintLayout>
+
+        <android.support.constraint.ConstraintLayout
+            android:id="@+id/qrCl"
+            android:layout_width="0dp"
+            android:layout_height="48dp"
+            app:layout_constraintEnd_toEndOf="@+id/deviceCl"
+            app:layout_constraintStart_toStartOf="@+id/deviceCl"
+            app:layout_constraintTop_toBottomOf="@+id/deviceCl">
+
+            <ImageView
+                android:id="@+id/qrOkIv"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginStart="16dp"
+                android:src="@drawable/ic_round_check_24"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                tools:ignore="ContentDescription" />
+
+            <TextView
+                android:id="@+id/qrTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:text="3、绑定二维码 | NFC"
+                android:textColor="@color/black_272727"
+                android:textSize="16sp"
+                app:layout_constraintBottom_toBottomOf="@id/qrOkIv"
+                app:layout_constraintStart_toEndOf="@id/qrOkIv"
+                app:layout_constraintTop_toTopOf="@id/qrOkIv" />
+
+            <ImageView
+                android:id="@+id/qrDetailIv"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginEnd="16dp"
+                android:src="@drawable/ic_round_chevron_right_24"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/qrInfoTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="16dp"
+                android:text="2 码"
+                android:textColor="@color/black_272727"
+                android:textSize="14sp"
+                app:layout_constraintBottom_toBottomOf="@id/qrDetailIv"
+                app:layout_constraintEnd_toStartOf="@id/qrDetailIv"
+                app:layout_constraintTop_toTopOf="@id/qrDetailIv" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:layout_marginStart="16dp"
+                android:layout_marginEnd="16dp"
+                android:background="@color/black_272727"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent" />
+        </android.support.constraint.ConstraintLayout>
+
+        <android.support.constraint.ConstraintLayout
+
+            android:id="@+id/infoCl"
+            android:layout_width="0dp"
+            android:layout_height="48dp"
+            app:layout_constraintEnd_toEndOf="@+id/qrCl"
+            app:layout_constraintStart_toStartOf="@+id/qrCl"
+            app:layout_constraintTop_toBottomOf="@+id/qrCl">
+
+            <ImageView
+                android:id="@+id/infoOkIv"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginStart="16dp"
+                android:src="@drawable/ic_round_check_24"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                tools:ignore="ContentDescription" />
+
+            <TextView
+                android:id="@+id/infoTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:text="4、记录文本信息"
+                android:textColor="@color/black_272727"
+                android:textSize="16sp"
+                app:layout_constraintBottom_toBottomOf="@id/infoOkIv"
+                app:layout_constraintStart_toEndOf="@id/infoOkIv"
+                app:layout_constraintTop_toTopOf="@id/infoOkIv" />
+
+            <ImageView
+                android:id="@+id/infoDetailIv"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginEnd="16dp"
+                android:src="@drawable/ic_round_chevron_right_24"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/infoMsgTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="16dp"
+                android:text="1张"
+                android:textColor="@color/black_272727"
+                android:textSize="14sp"
+                app:layout_constraintBottom_toBottomOf="@id/infoDetailIv"
+                app:layout_constraintEnd_toStartOf="@id/infoDetailIv"
+                app:layout_constraintTop_toTopOf="@id/infoDetailIv" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:layout_marginStart="16dp"
+                android:layout_marginEnd="16dp"
+                android:background="@color/black_272727"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent" />
+        </android.support.constraint.ConstraintLayout>
+
+        <Button
+            android:id="@+id/saveBtn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="32dp"
+            android:layout_marginEnd="32dp"
+            android:layout_marginBottom="32dp"
+            android:text="保存"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent" />
+
+    </android.support.constraint.ConstraintLayout>
+
+
+</android.support.constraint.ConstraintLayout>

+ 71 - 0
demo/src/main/res/layout/activity_record_info.xml

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".activities.poc.RecordInfoActivity">
+
+    <android.support.constraint.ConstraintLayout
+        android:id="@+id/topBarCl"
+        android:layout_width="match_parent"
+        android:layout_height="48dp"
+        android:background="@color/blue_600"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <ImageView
+            android:id="@+id/backIv"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginStart="16dp"
+            android:contentDescription="back"
+            android:src="@drawable/ic_round_arrow_back_24"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            android:id="@+id/titleTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="记录文本信息"
+            android:textColor="@color/black_272727"
+            android:textSize="18sp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+    </android.support.constraint.ConstraintLayout>
+
+    <android.support.v7.widget.AppCompatEditText
+        android:id="@+id/recordEt"
+        android:layout_width="match_parent"
+        android:layout_height="184dp"
+        android:layout_marginStart="32dp"
+        android:layout_marginTop="48dp"
+        android:layout_marginEnd="32dp"
+        android:background="#EFEFEF"
+        android:enabled="true"
+        android:gravity="top"
+        android:hint="请填写信息"
+        android:inputType="textMultiLine"
+        android:padding="12dp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/topBarCl" />
+
+    <Button
+        android:id="@+id/saveBtn"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="32dp"
+        android:layout_marginEnd="32dp"
+        android:layout_marginBottom="32dp"
+        android:text="保存"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent" />
+</android.support.constraint.ConstraintLayout>

+ 18 - 0
demo/src/main/res/layout/item_tree.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="48dp">
+
+    <TextView
+        android:id="@+id/labelTv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:text="label"
+        android:textColor="@color/black_272727"
+        android:textSize="16sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+</android.support.constraint.ConstraintLayout>