增加道路名显示和详细信息功能
This commit is contained in:
11
app/src/main/res/drawable/baseline_cancel_24.xml
Normal file
11
app/src/main/res/drawable/baseline_cancel_24.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="#91909A"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z,M12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z" />
|
||||
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/shape_road_name_bg.xml
Normal file
10
app/src/main/res/drawable/shape_road_name_bg.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#BA0C122B" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dp"
|
||||
android:bottomRightRadius="6dp"
|
||||
android:topLeftRadius="6dp"
|
||||
android:topRightRadius="6dp" />
|
||||
</shape>
|
||||
@@ -44,25 +44,36 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/main_activity_top_sign_recyclerview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/main_activity_sign_recyclerview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:maxHeight="350dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/main_activity_top_sign_recyclerview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="280dp"
|
||||
android:layout_marginTop="2dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/main_activity_sign_more_info_fragment"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="80dp"
|
||||
android:minHeight="140dp"
|
||||
app:layout_constraintLeft_toLeftOf="@id/main_activity_top_sign_recyclerview"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/main_activity_sign_more_info_bg"
|
||||
android:layout_width="240dp"
|
||||
@@ -229,6 +240,23 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_bottom_sheet_bg"
|
||||
app:layout_constraintRight_toLeftOf="@id/main_activity_middle_fragment" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/main_activity_road_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_road_name_bg"
|
||||
android:onClick="@{()->mainActivity.openRoadNameFragment()}"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/main_activity_geometry"
|
||||
app:layout_constraintLeft_toLeftOf="@id/main_activity_top_sign_recyclerview" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_zoom_out"
|
||||
android:layout_width="@dimen/zoom_btns_w"
|
||||
@@ -421,9 +449,9 @@
|
||||
android:id="@+id/main_bottom_route"
|
||||
style="@style/main_activity_bottom_sheet_icon"
|
||||
android:background="@drawable/icon_main_bottom_route"
|
||||
android:onClick="@{()->mainActivity.onClickRouteFragment()}"
|
||||
app:layout_constraintBottom_toTopOf="@id/main_bottom_route_text"
|
||||
app:layout_constraintLeft_toRightOf="@id/main_bottom_offline_map"
|
||||
android:onClick="@{()->mainActivity.onClickRouteFragment()}"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_bottom_sheet_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/main_bottom_task"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
@@ -432,10 +460,10 @@
|
||||
android:id="@+id/main_bottom_route_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="@{()->mainActivity.onClickRouteFragment()}"
|
||||
android:text="路径规划"
|
||||
android:textColor="@color/blue"
|
||||
android:textSize="10sp"
|
||||
android:onClick="@{()->mainActivity.onClickRouteFragment()}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/main_activity_bottom_sheet_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@id/main_bottom_route"
|
||||
app:layout_constraintRight_toRightOf="@id/main_bottom_route"
|
||||
|
||||
26
app/src/main/res/layout/adapter_road_name.xml
Normal file
26
app/src/main/res/layout/adapter_road_name.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@id/title"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textColor="@color/white" />
|
||||
</RelativeLayout>
|
||||
36
app/src/main/res/layout/fragment_sign_roadname.xml
Normal file
36
app/src/main/res/layout/fragment_sign_roadname.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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:clickable="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/main_sign_moreinfo_bg"
|
||||
android:padding="8dp"
|
||||
tools:context=".ui.fragment.sign.RoadNameInfoFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/roadname_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/icon_main_moreinfo_text_left"
|
||||
android:drawablePadding="4dp"
|
||||
android:text="条件点限速"
|
||||
android:textColor="@color/orange" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/roadname_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/roadname_title"
|
||||
android:layout_alignBottom="@id/roadname_title"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/baseline_cancel_24" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/roadname_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/roadname_title"
|
||||
android:layout_marginTop="5dp" />
|
||||
</RelativeLayout>
|
||||
Reference in New Issue
Block a user