Как бросить относительный план, чтобы перевести и заполнить деятельность поверх других макетов? - PullRequest
0 голосов
/ 08 сентября 2011

У меня есть относительный макет с android: id = "@ + id / RelativeLayout02" и android: layout_alignParentBottom = "true".

Я хочу, чтобы пользователь перетащил этот макет, чтобы он заполнилэкран и плавающий поверх других макетов.

Обратите внимание, что я хотел бы анимировать операцию перетаскивания. Например, если пользователь перетянул относительный макет только в середину экранаполовина экрана должна быть заполнена относительной разметкой.

Вот мой макет xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01"
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="vertical">
<LinearLayout android:id="@+id/LinearLayout01"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20px"
android:orientation="vertical"
android:gravity="center_horizontal"
>
<ImageView android:id="@+id/ImageView01"
  android:layout_width="200dip" 
  android:layout_height="81dip" 
  android:src="@drawable/logo"
android:adjustViewBounds="true"
android:layout_marginTop="15px"/>
<TextView android:id="@+id/TextView01"
  android:layout_width="fill_parent" 
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textColor="#FF9600""/>
</LinearLayout>
<eg.com.innova.smarthome.custom.CustomLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:gravity="center_horizontal"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_below="@id/LinearLayout01">
<ImageButton android:id="@+id/sensors" 
    android:layout_width="wrap_content" 
   android:layout_height="wrap_content"
   android:background="@drawable/sensors"
   android:onClick="sensorImageClick"/>
<ImageButton android:id="@+id/camera_outdoor"
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:background="@drawable/camera_outdoor"
android:onClick="cameraImageClick"/>
<ImageButton android:id="@+id/statistics"
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:background="@drawable/statistics"/>
<ImageButton android:id="@+id/configuration2"
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:background="@drawable/configuration2"
android:layout_margin="10px"/>
</eg.com.innova.smarthome.custom.CustomLayout>
<RelativeLayout android:id="@+id/RelativeLayout02"
 xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_alignParentBottom="true"
android:background="#9CC721"
android:gravity="center_horizontal|center_vertical">
</RelativeLayout>
</RelativeLayout>

Заранее спасибо за ваше руководство.

1 Ответ

1 голос
/ 09 сентября 2011

Я нашел решение своего вопроса.

Задачей является использование SlidingDrawer .

Учебное пособие можно найти здесь .

...