pedrovgs / DraggablePanel

Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.
Apache License 2.0
2.99k stars 606 forks source link

Not able slide or maximise DraggableView once minimized #108

Open Shajeel-Afzal opened 7 years ago

Shajeel-Afzal commented 7 years ago

I am using this library to show YouTube like VideoView at the right bottom. I have used DraggableView for that. The problem is that I am not able to drag it up to maximize or slide it left or right to close it. My layout is shown below:

<?xml version="1.0" encoding="utf-8"?>
<com.github.pedrovgs.DraggableView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:EMVideoView="http://schemas.android.com/apk/res-auto"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:draggable_view="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:animateLayoutChanges="true"
    android:fitsSystemWindows="false"
    android:orientation="vertical"
    android:id="@+id/draggable_view"
    draggable_view:bottom_view_id="@+id/text_container_ll"
    draggable_view:enable_click_to_maximize_view="false"
    draggable_view:enable_click_to_minimize_view="true"
    draggable_view:top_view_id="@+id/video_view"
    draggable_view:top_view_margin_bottom="@dimen/activity_vertical_margin"
    draggable_view:top_view_margin_right="@dimen/activity_horizontal_margin"
    draggable_view:top_view_x_scale_factor="@dimen/x_scale_factor"
    draggable_view:top_view_y_scale_factor="@dimen/y_scale_factor">

    <com.devbrackets.android.exomedia.ui.widget.EMVideoView
        android:id="@+id/video_view"
        android:layout_width="match_parent"
        android:layout_height="250dp"
        EMVideoView:useDefaultControls="true" />

    <FrameLayout
        android:id="@+id/text_container_ll"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="2">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/videos_fragment_recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <com.bartoszlipinski.recyclerviewheader2.RecyclerViewHeader
            android:id="@+id/header"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|top">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
...
            </LinearLayout>
        </com.bartoszlipinski.recyclerviewheader2.RecyclerViewHeader>
    </FrameLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="22dp">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#40000000"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
    </LinearLayout>
</com.github.pedrovgs.DraggableView>

Am I missing any step?

Regards Shajeel

pedrovgs commented 7 years ago

Hi @Shajeel-Afzal. Looking at your layout I can't see any obvious error. Could you create a sample project reproducing the issue so we can review what's going on?

nitinrana commented 7 years ago

I have the same problem. I am not able to slide or maximize DraggableView once minimized. Could you please help me to solve this problem.

adesueb commented 7 years ago

hi all, the important thing is your video must specified on bottom and your background or description view is specified on top and do not forget to add android:layout_below="@+id/drag_view to your description" (drag_view is not in your layout xml but do not make it confuse, just add it)

the video must specified on bottom but actually your video is on top of description. So the simple sample looks like :

`

nitinrana commented 7 years ago

This is my project layout . Could you please help me to solve this problem. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ll_container" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white">

<ListView
    android:id="@+id/list_view"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:dividerHeight="1dp">

</ListView>

<com.github.pedrovgs.DraggableView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:draggable_view="http://schemas.android.com/apk/res-auto"
    android:id="@+id/draggable_view"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/white"
    draggable_view:bottom_view_id="@+id/ll"
    draggable_view:top_view_height="200dp"
    draggable_view:top_view_id="@+id/image1"
    draggable_view:top_view_margin_bottom="@dimen/top_fragment_margin"
    draggable_view:top_view_margin_right="@dimen/top_fragment_margin"
    draggable_view:top_view_x_scale_factor="@dimen/x_scale_factor"
    draggable_view:top_view_y_scale_factor="@dimen/y_scale_factor">

    <ImageView
        android:id="@+id/image1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <LinearLayout
        android:id="@+id/ll"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:orientation="vertical">

        <TextView
            android:id="@+id/textView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center" />

    </LinearLayout>

</com.github.pedrovgs.DraggableView>

`

adesueb commented 7 years ago
<ListView
    android:id="@+id/list_view"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:dividerHeight="1dp"/>
<com.github.pedrovgs.DraggableView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:draggable_view="http://schemas.android.com/apk/res-auto"
    android:id="@+id/draggable_view"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/white"
    draggable_view:bottom_view_id="@+id/ll"
    draggable_view:top_view_height="200dp"
    draggable_view:top_view_id="@+id/image1"
    draggable_view:top_view_margin_bottom="@dimen/top_fragment_margin"
    draggable_view:top_view_margin_right="@dimen/top_fragment_margin"
    draggable_view:top_view_x_scale_factor="@dimen/x_scale_factor"
    draggable_view:top_view_y_scale_factor="@dimen/y_scale_factor">
    <LinearLayout
        android:id="@+id/ll"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/drag_view"
        android:background="@color/white"
        android:orientation="vertical">
        <TextView
            android:id="@+id/textView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center" />
    </LinearLayout>
    <ImageView
        android:id="@+id/image1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</com.github.pedrovgs.DraggableView>

i hope that will help you..

nitinrana commented 7 years ago

Thank you

adesueb commented 7 years ago

you're welcome..

shuBomb commented 6 years ago

@adesueb : Thanks alot dude