<?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="wrap_content">

    <!-- 核心修改：外层RelativeLayout限制宽高比为1:1 -->
    <RelativeLayout
        android:id="@+id/layout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:padding="2dp"> <!-- 可选：增加内边距避免圆角被遮挡 -->

        <!-- 关键：通过layout_alignParentXXX强制ImageView填充1:1的父容器 -->
        <ImageView
            android:id="@+id/wallpaper"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentTop="true"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:scaleType="centerCrop"
            android:adjustViewBounds="false" /> <!-- 关闭自适应，强制填充父容器 -->

    </RelativeLayout>

    <!-- 底部间距View保持不变 -->
    <View
        android:id="@+id/space_view"
        android:layout_width="match_parent"
        android:layout_height="22dp"
        android:layout_below="@id/layout"
        android:visibility="gone" />

    <View
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:visibility="invisible"
        android:layout_alignTop="@id/layout"
        android:layout_alignBottom="@id/layout" />

</RelativeLayout>