Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Not able slide or maximise DraggableView once minimized #108

Open
Shajeel-Afzal opened this issue Dec 23, 2016 · 8 comments
Open

Not able slide or maximise DraggableView once minimized #108

Shajeel-Afzal opened this issue Dec 23, 2016 · 8 comments
Labels

Comments

@Shajeel-Afzal
Copy link

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
Copy link
Owner

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
Copy link

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
Copy link

adesueb commented Feb 22, 2017

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 :

<drag> <desc android:layout_below="@+id/drag_view /> <video /> </drag>

@nitinrana
Copy link

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
Copy link

adesueb commented Feb 23, 2017

<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
Copy link

Thank you

@adesueb
Copy link

adesueb commented Feb 23, 2017

you're welcome..

@shuBomb
Copy link

shuBomb commented Sep 22, 2017

@adesueb : Thanks alot dude

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants