添加实时距离计算功能
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 编辑视图:按钮顺序改为【删除(左)→取消→确定(右)】,新增取消按钮 -->
|
||||
<!-- 编辑视图:新增实时距离开关(单选框组),位于备注输入框与按钮区之间 -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 2. 备注输入框(不变) -->
|
||||
<!-- 2. 备注输入框(不变,调整下方间距为8dp,与新增单选框区过渡更自然) -->
|
||||
<EditText
|
||||
android:id="@+id/et_edit_memo"
|
||||
android:layout_width="match_parent"
|
||||
@@ -44,9 +44,56 @@
|
||||
android:maxLines="4"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/edittext_bg"
|
||||
android:layout_marginBottom="12dp"/>
|
||||
android:layout_marginBottom="8dp"/> <!-- 原12dp→8dp,优化与单选框的间距 -->
|
||||
|
||||
<!-- 3. 按钮区(核心修改:顺序→删除(左)→取消→确定(右),新增取消按钮) -->
|
||||
<!-- 新增3:实时距离开关(单选框组)- 控制isEnableRealPositionDistance属性 -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="12dp"> <!-- 与下方按钮区保持12dp间距,符合原有布局规范 -->
|
||||
|
||||
<!-- 单选框标题(说明用途,文字颜色与经纬度一致,保持风格统一) -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="实时距离计算:"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#666666"
|
||||
android:layout_marginRight="12dp"/> <!-- 与单选框保持12dp间距,避免拥挤 -->
|
||||
|
||||
<!-- 单选框组(RadioGroup):确保“启用/禁用”二选一 -->
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_real_distance_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:checkedButton="@+id/rb_disable"> <!-- 默认选中“禁用”,匹配isEnable默认值false -->
|
||||
|
||||
<!-- 单选框1:禁用实时距离(对应isEnableRealPositionDistance=false) -->
|
||||
<RadioButton
|
||||
android:id="@+id/rb_disable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="禁用"
|
||||
android:textSize="13sp"
|
||||
android:textColor="#333333"
|
||||
android:layout_marginRight="16dp"/> <!-- 与“启用”单选框保持16dp间距 -->
|
||||
|
||||
<!-- 单选框2:启用实时距离(对应isEnableRealPositionDistance=true) -->
|
||||
<RadioButton
|
||||
android:id="@+id/rb_enable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="启用"
|
||||
android:textSize="13sp"
|
||||
android:textColor="#333333"/>
|
||||
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 4. 按钮区(不变:顺序→删除(左)→取消→确定(右)) -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -70,7 +117,7 @@
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<!-- ② 新增:取消按钮(中间,灰色,不保存返回简单视图) -->
|
||||
<!-- ② 取消按钮(中间,灰色,不保存返回简单视图) -->
|
||||
<Button
|
||||
android:id="@+id/btn_edit_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 简单视图:仅显示经纬度+备注,无任何按钮 -->
|
||||
<!-- 简单视图:新增实时距离显示控件(备注下方) -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -35,5 +35,15 @@
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="8dp"/>
|
||||
|
||||
<!-- 新增:实时距离显示(距离计算结果/未启用提示) -->
|
||||
<TextView
|
||||
android:id="@+id/tv_simple_real_distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#2196F3"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="实时距离未启用"/> <!-- 默认提示(isEnable=false时显示) -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user