SlidingDrawer hidden by image in SurfaceView

I have both a SlidingDrawer and a custom SurfaceView that displays an image. I just tried dragging and dropping a SlidingDrawer and thereby found that it is behind the image in SurfaceView and is completely hidden.

As you can imagine, this will not be very useful for the user and therefore it is necessary that the image always lags behind SlidingDrawer when it was stopped. Is it possible?

If this helps, then this is SlidingDrawer in xml:

<SlidingDrawer
             android:id="@+id/drawer"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:handle="@+id/handle"
             android:content="@+id/content"
             android:layout_alignParentBottom="true">

             <TextView
                 android:id="@id/handle"
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:gravity="center"
                 android:paddingTop="5dip"
                 android:paddingBottom="5dip"
                 android:textStyle="bold"
                 android:text="text"/>


            <include layout="@layout/content"
                 android:id="@id/content"
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"/>

         </SlidingDrawer>

And this is SurfaceView in xml:

<FrameLayout android:id="@+id/FrameLayout01" 
        android:layout_width="fill_parent" android:layout_height="fill_parent">
        <com.android.imagemagic.widgets.ImageManipulationSurfaceView
        android:id="@+id/surfaceArea"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:layout_gravity="center"/> 
    </FrameLayout>  

SurfaceView is normal and uses the following code in the onDraw () method:

@Override
public void onDraw(Canvas canvas) { 
    super.onDraw(canvas);

    //Clear canvas
    Paint paint = new Paint();
    paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
    canvas.drawPaint(paint);
    paint.setXfermode(new PorterDuffXfermode(Mode.SRC));

    // Draw image
    canvas.drawBitmap(image, imageX, imageY, null);
}
+5
source share
3 answers

() : Android: SlidingDrawer SurfaceView. xml SlidingDrawer :

android:background="#00000000";

, . , , , , . elses , Z-index SurfaceView :

sv.setZOrderOnTop(true); 
+5

- , ?

@Override
public void onDraw(Canvas canvas) { 
    //Clear canvas
    Paint paint = new Paint();
    paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
    canvas.drawPaint(paint);
    paint.setXfermode(new PorterDuffXfermode(Mode.SRC));

    // Draw image
    canvas.drawBitmap(image, imageX, imageY, null);

    super.onDraw(canvas);
}

, , overridependingtransition(int enterAnim, int exitAnim) setContentView() .

0

Even I ran into a similar problem. But I found a workaround for this.

Just do slideHandleButton.setText (""); when the box is closed. A button will appear :)

0
source

All Articles