增加评测link功能

This commit is contained in:
squallzhjch
2023-07-13 14:09:58 +08:00
parent ae44b848e2
commit 23a3490c20
29 changed files with 1346 additions and 362 deletions

View File

@@ -31,6 +31,28 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/main_activity_home_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/home_map_center"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/main_activity_home_center_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="12sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/main_activity_home_center"
app:layout_constraintRight_toLeftOf="@id/main_activity_home_center"
app:layout_constraintTop_toTopOf="@id/main_activity_home_center" />
<ImageButton
android:id="@+id/main_activity_camera2"
android:layout_width="48dp"
@@ -79,7 +101,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/top_right_drawer_btns_mr"
app:constraint_referenced_ids="main_activity_serach,main_activity_2d_3d,main_activity_camera,main_activity_trace,main_activity_calc_disance,main_activity_note,main_activity_menu"
app:constraint_referenced_ids="main_activity_note,main_activity_task_line,main_activity_serach,main_activity_2d_3d,main_activity_camera,main_activity_trace,main_activity_calc_disance,main_activity_menu"
app:flow_horizontalGap="6dp"
app:flow_wrapMode="aligned"
app:layout_constraintRight_toLeftOf="@id/main_activity_right_fragment"
@@ -90,7 +112,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
app:constraint_referenced_ids="main_activity_serach,main_activity_2d_3d,main_activity_camera,main_activity_trace,main_activity_note,main_activity_calc_disance" />
app:constraint_referenced_ids="main_activity_serach,main_activity_2d_3d,main_activity_camera,main_activity_trace,main_activity_note,main_activity_task_line,main_activity_calc_disance" />
<ImageButton
android:id="@+id/main_activity_serach"
@@ -126,6 +148,12 @@
android:id="@+id/main_activity_note"
style="@style/top_right_drawer_btns_style"
android:onClick="@{()->mainActivity.onClickNewNote()}"
android:src="@drawable/icon_menu_note" />
<ImageButton
android:id="@+id/main_activity_task_line"
style="@style/top_right_drawer_btns_style"
android:onClick="@{()->mainActivity.onClickTaskLink()}"
android:src="@drawable/icon_calc_disance" />
<ImageButton
@@ -517,5 +545,6 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
tools:context="com.navinfo.omqs.ui.fragment.tasklink.TaskLinkMiddleAdapter">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:textColor="@color/white" />
</LinearLayout>

View File

@@ -39,7 +39,7 @@
android:layout_height="40dp"
android:layout_marginTop="9dp"
android:layout_marginRight="14dp"
android:background="@drawable/ripple_fragment_save_botton_bg"
android:background="@drawable/ripple_fragment_save_button_bg"
android:src="@drawable/icon_save"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.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="@dimen/right_fragment_w"
@@ -8,13 +9,13 @@
tools:context=".ui.fragment.note.NoteFragment">
<TextView
android:id="@+id/note_bar"
android:id="@+id/note_bar_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="14dp"
android:drawableLeft="@drawable/selector_btn_back_xml"
android:text="Mark"
android:text="便签"
android:textColor="@color/default_blue_text_color"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="parent"
@@ -26,24 +27,12 @@
android:layout_height="40dp"
android:layout_marginTop="9dp"
android:layout_marginRight="14dp"
android:background="@drawable/ripple_fragment_save_botton_bg"
android:background="@drawable/ripple_fragment_save_button_bg"
android:src="@drawable/icon_save"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/note_bar_cancel"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginRight="10dp"
android:background="@color/transparent"
android:src="@drawable/icon_fragment_close"
android:visibility="gone"
app:layout_constraintRight_toLeftOf="@id/note_bar_save"
app:layout_constraintTop_toTopOf="@id/note_bar_save" />
<ImageButton
android:id="@+id/note_bar_delete"
android:layout_width="40dp"

View File

@@ -0,0 +1,294 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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="@dimen/right_fragment_w"
android:layout_height="match_parent"
android:background="@drawable/shape_right_fragment_bg"
tools:context=".ui.fragment.tasklink.TaskLinkFragment">
<TextView
android:id="@+id/task_link_bar_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="14dp"
android:drawableLeft="@drawable/selector_btn_back_xml"
android:text="测评Link"
android:textColor="@color/default_blue_text_color"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/task_link_bar_save"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="9dp"
android:layout_marginRight="14dp"
android:background="@drawable/ripple_fragment_save_button_bg"
android:src="@drawable/icon_save"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/task_link_bar_delete"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerInParent="true"
android:layout_marginRight="5dp"
android:background="@color/transparent"
android:src="@drawable/icon_delete"
app:layout_constraintBottom_toBottomOf="@id/task_link_bar_save"
app:layout_constraintRight_toLeftOf="@id/task_link_bar_save"
app:layout_constraintTop_toTopOf="@id/task_link_bar_save" />
<androidx.core.widget.NestedScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="6dp"
android:paddingLeft="11dp"
android:paddingTop="6dp"
android:paddingRight="9dp"
android:paddingBottom="6dp"
app:layout_constraintBottom_toTopOf="@id/note_camera"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/task_link_bar_save">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="7dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
style="@style/evaluation_fragment_title_text_style"
android:layout_width="60dp"
android:text="当前任务" />
<TextView
android:id="@+id/task_link_task_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/sketch_back"
style="@style/sketch_operation_style"
android:src="@drawable/sketch_back" />
<View
style="@style/link_gray_style"
android:layout_margin="2dp" />
<ImageView
android:id="@+id/sketch_forward"
style="@style/sketch_operation_style"
android:src="@drawable/sketch_forward" />
<View
style="@style/link_gray_style"
android:layout_margin="2dp" />
<TextView
android:id="@+id/sketch_clear"
style="@style/sketch_operation_style"
android:text="重绘" />
</LinearLayout>
<Button
android:id="@+id/task_link_add_point"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="打点" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:orientation="horizontal">
<TextView
style="@style/evaluation_fragment_title_text_style"
android:layout_width="60dp"
android:text="Link长度" />
<TextView
android:id="@+id/task_link_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0米" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:orientation="horizontal">
<TextView
style="@style/evaluation_fragment_title_text_style"
android:layout_width="60dp"
android:text="种别" />
<TextView
android:id="@+id/task_link_kind"
style="@style/evaluation_fragment_text_style"
android:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:orientation="horizontal">
<TextView
style="@style/evaluation_fragment_title_text_style"
android:layout_width="60dp"
android:text="功能等级" />
<TextView
android:id="@+id/task_link_functional_level"
style="@style/evaluation_fragment_text_style"
android:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:orientation="horizontal">
<TextView
style="@style/evaluation_fragment_title_text_style"
android:layout_width="60dp"
android:text="数据级别" />
<TextView
android:id="@+id/task_link_data_level"
style="@style/evaluation_fragment_text_style"
android:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
style="@style/evaluation_fragment_title_text_style"
android:layout_width="60dp"
android:layout_gravity="top"
android:text="备注" />
<com.navinfo.omqs.ui.widget.MyEditeText
android:id="@+id/note_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_white_2dp_bg"
android:elevation="2dp"
android:gravity="start"
android:hint="请输入备注信息"
android:inputType="textMultiLine"
android:lines="3"
android:maxLines="3"
android:paddingLeft="12dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="多媒体"
android:textColor="@color/default_blue_text_color"
android:textSize="16sp" />
<!--
这种效果也好实现,主要的关键点是 Android:clipChildren=”false” 这个属性。
1.配置ViewPager 和其父布局的 android:clipChildren属性为”false”.
(android:clipChildren表示是否限制子View在其范围内默认为true. 代码设置setClipChildren(false))
因为如果clipChildren属性设置为true,就表明我们要将children给clip掉就是说对于子元素来说超出当前view的部分都会被切掉那我们在这里把它设置成false就表明超出view的部分不要切掉依然显示。
注意setClipChildren(false)在3.0以上版本中,开启了硬件加速后将不能正常工作,所以需要将其设置为软件加速。设置软硬件加速使用 setLayerType(View.LAYER_TYPE_SOFTWARE, null); 也可以在布局文件中添加 android:layerType=”software”
-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/note_picture_left"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="4dp"
android:background="@drawable/icon_picture_left"
android:padding="5dp" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/note_picture_viewpager"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_weight="1"
android:clipChildren="false" />
<ImageView
android:id="@+id/note_picture_right"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="4dp"
android:background="@drawable/icon_picture_right"
android:padding="5dp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/note_voice_recyclerview"
android:layout_width="match_parent"
android:layout_height="120dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<ImageView
android:id="@+id/note_camera"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="10dp"
android:src="@drawable/baseline_camera_alt_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/note_voice" />
<ImageView
android:id="@+id/note_voice"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="10dp"
android:src="@drawable/baseline_keyboard_voice_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/note_camera"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/task_link_middle_recyclerview"
android:layout_width="@dimen/fragment_problem_link_width"
android:layout_height="match_parent"
android:layout_marginTop="55dp"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/shape_middle_fragment_bg" />
</androidx.constraintlayout.widget.ConstraintLayout>