Uso de GestureOverlayView o algo similar dentro de un Widget de Android

¿Es posible crear un widget que contenga un GestureOverlayView?

Mi objetivo es crear un widget que tenga 4 pilas de botones encima de sí, a la izquierda de un pad de gestos. En mis actividades y fragmentos estoy utilizando actualmente un GestureOverlayView que me permite leer gestos y combinarlos con una biblioteca de patrones de gesto guardados, para determinar una acción específica.

En esta próxima fase del proyecto me gustaría replicar mi panel de gestos que tengo en mis fragmentos y actividades en un widget que se coloca en la pantalla de inicio de Android.

Leí un artículo que decía que FrameLayouts estaba permitido en Android, viendo cómo GestureOverlayView se extiende desde framelayout, mi idealista auto pensó que esto era posible.

Hasta ahora he conseguido un widget con las mismas imágenes y diseños que deseo utilizar, y se muestra sin funcionalidad muy bien. El diseño está abajo:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/main_layout_app" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <LinearLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight=".2" android:background="@drawable/draw_pad_background" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/call" /> <ImageView android:id="@+id/imageView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/text" /> <ImageView android:id="@+id/imageView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/app" /> <ImageView android:id="@+id/imageView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/contact" /> </LinearLayout> <LinearLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight=".03" android:background="@drawable/button_divider" android:orientation="vertical" > </LinearLayout> <RelativeLayout android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight=".85" > <LinearLayout android:id="@+id/llSeparateLayer_app" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <!-- <LinearLayout android:layout_width="fill_parent" android:layout_height="1dip" android:background="#FFFFFF" android:layout_centerVertical="true" /> <ImageView android:layout_height="30dip" android:src="@drawable/call" android:layout_width="wrap_content" android:scaleType="centerInside" android:layout_centerHorizontal="true" /> <LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerInParent="true"> <ImageView android:layout_height="30dip" android:src="@drawable/text" android:layout_width="wrap_content" android:scaleType="centerInside" android:layout_marginTop="30dip" /> </LinearLayout> --> <LinearLayout android:id="@+id/llOpenDSR" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight=".5" android:background="@drawable/draw_pad_background" android:gravity="center" > </LinearLayout> </LinearLayout> </RelativeLayout> </LinearLayout> 

Si agrego la vista de gesto se ve así:

 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/main_layout_app" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <LinearLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight=".2" android:background="@drawable/draw_pad_background" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/call" /> <ImageView android:id="@+id/imageView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/text" /> <ImageView android:id="@+id/imageView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/app" /> <ImageView android:id="@+id/imageView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/contact" /> </LinearLayout> <LinearLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight=".03" android:background="@drawable/button_divider" android:orientation="vertical" > </LinearLayout> <RelativeLayout android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight=".85" > <LinearLayout android:id="@+id/llSeparateLayer_app" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <!-- <LinearLayout android:layout_width="fill_parent" android:layout_height="1dip" android:background="#FFFFFF" android:layout_centerVertical="true" /> <ImageView android:layout_height="30dip" android:src="@drawable/call" android:layout_width="wrap_content" android:scaleType="centerInside" android:layout_centerHorizontal="true" /> <LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerInParent="true"> <ImageView android:layout_height="30dip" android:src="@drawable/text" android:layout_width="wrap_content" android:scaleType="centerInside" android:layout_marginTop="30dip" /> </LinearLayout> --> <LinearLayout android:id="@+id/llOpenDSR" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight=".5" android:background="@drawable/draw_pad_background" android:gravity="center" > </LinearLayout> </LinearLayout> <android.gesture.GestureOverlayView android:id="@+id/appGestures" android:layout_width="fill_parent" android:layout_height="fill_parent" android:eventsInterceptionEnabled="false" android:fadeOffset="400" android:gestureColor="@color/default_gesture_color" android:gestureStrokeAngleThreshold="0.1" android:gestureStrokeLengthThreshold="80" android:gestureStrokeSquarenessThreshold="0.1" android:gestureStrokeType="multiple" android:orientation="horizontal" android:uncertainGestureColor="@color/default_gesture_color_uncertain" > <ImageView android:id="@+id/image_notification" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /> </android.gesture.GestureOverlayView> </RelativeLayout> </LinearLayout> 

Cuando agrego este widget a mi pantalla de inicio obtengo "Problema cargando widget"

Entonces encontré esta parte de la documentación:

"Si bien los widgets pueden entenderse como" mini aplicaciones ", existen ciertas limitaciones que es importante comprender antes de comenzar a diseñar el widget:

Gestos

Debido a que los widgets viven en la pantalla de inicio, tienen que coexistir con la navegación que se establece allí. Esto limita el soporte de gestos que está disponible en un widget en comparación con una aplicación de pantalla completa. Mientras que las aplicaciones, por ejemplo, pueden admitir un paginador de vista que permite al usuario navegar lateralmente entre las pantallas, ese gesto ya se toma en la pantalla de inicio con el propósito de navegar entre los paneles de inicio.

Los únicos gestos disponibles para widgets son:

Toca Deslizar vertical "

http://developer.android.com/design/patterns/widgets.html

Entonces, ¿esto significa que no puedo usar esta vista?

FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.