chick_mood/app/src/main/res/layout/activity_edit.xml
ddshi adbf5b4a05 fix: 修复UI优化中的文件修改问题
- 添加遗漏的UI优化文件到git提交
- 修复文件换行符警告问题
- 确保所有修改已正确提交

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 15:29:32 +08:00

230 lines
8.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
android:orientation="vertical"
android:background="@color/background_primary">
<!-- 顶部导航栏 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="56dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="@color/white"
android:elevation="4dp">
<ImageView
android:id="@+id/back_button"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_arrow_back"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="返回" />
<TextView
android:id="@+id/time_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="今天 14:30"
android:textSize="16sp"
android:textColor="@color/text_primary"
android:textStyle="bold" />
<!-- 占位,保持中间文字居中 -->
<View
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
</LinearLayout>
<!-- 滚动内容区域 -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp"
android:paddingBottom="120dp">
<!-- 只读信息区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginBottom="32dp">
<ImageView
android:id="@+id/chick_image"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_emotion_happy"
android:scaleType="centerInside" />
<TextView
android:id="@+id/mood_value_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="88"
android:textSize="32sp"
android:textColor="@color/text_primary"
android:textStyle="bold" />
<TextView
android:id="@+id/mood_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/text_secondary" />
</LinearLayout>
<!-- 文本输入区域 -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginBottom="24dp"
android:background="@drawable/shape_edit_text_background">
<EditText
android:id="@+id/text_input"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top|start"
android:hint="记录一下此刻的心情..."
android:inputType="textMultiLine|textCapSentences"
android:maxLength="500"
android:scrollbars="vertical"
android:padding="12dp"
android:background="@android:color/transparent"
android:textColor="@color/text_primary"
android:textColorHint="@color/text_secondary"
android:textSize="16sp" />
</FrameLayout>
<!-- 字符计数 -->
<TextView
android:id="@+id/char_count_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginBottom="24dp"
android:text="0/500"
android:textSize="12sp"
android:textColor="@color/text_secondary" />
<!-- 图片区域 -->
<LinearLayout
android:id="@+id/image_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center">
<!-- 添加图片按钮 -->
<LinearLayout
android:id="@+id/add_image_button"
android:layout_width="match_parent"
android:layout_height="120dp"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/shape_image_background"
android:backgroundTint="@color/background_secondary"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginBottom="8dp"
android:src="@drawable/ic_add_photo"
android:tint="@color/text_secondary" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="添加图片"
android:textSize="14sp"
android:textColor="@color/text_secondary" />
</LinearLayout>
<!-- 图片预览区域 -->
<FrameLayout
android:id="@+id/image_preview"
android:layout_width="match_parent"
android:layout_height="200dp"
android:visibility="gone">
<ImageView
android:id="@+id/preview_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@drawable/shape_image_background"
android:contentDescription="图片预览" />
<!-- 删除图片按钮 -->
<ImageView
android:id="@+id/remove_image_button"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="top|end"
android:layout_margin="8dp"
android:src="@drawable/ic_close"
android:background="@drawable/shape_circle_background"
android:backgroundTint="@color/error_color"
android:tint="@color/white"
android:contentDescription="删除图片"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<!-- 底部保存按钮 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/white"
android:elevation="8dp"
android:padding="16dp">
<TextView
android:id="@+id/save_button"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center"
android:text="保存"
android:textSize="16sp"
android:textColor="@color/white"
android:textStyle="bold"
android:background="@drawable/shape_button_primary"
android:backgroundTint="@color/primary"
android:clickable="true"
android:focusable="true" />
</LinearLayout>
</LinearLayout>