Я использую AndroidSlidingUpPanel, и я хотел бы иметь VideoView в скользящем макете. Так, в коде, я использую следующие строки, чтобы определить область сопротивления (для сворачивания и разворачивания скользящей схемы):VideoView в ScrollView не работает в AndroidSlidingUpPanel
SlidingUpPanelLayout layout = (SlidingUpPanelLayout)
findViewById(R.id.sliding_layout);
layout.setDragView(findViewById(R.id.main_title_bar));
layout.setEnableDragViewTouchEvents(true);
и код XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
tools:context=".VideoMapPanel" >
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:panelHeight="68dp"
sothree:shadowHeight="4dp"
sothree:paralaxOffset="100dp"
sothree:dragView="@+id/dragView"
>
<!-- MAIN CONTENT -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_toolbar"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
sothree:theme="@style/ActionBar"
android:layout_width="match_parent"/>
<TextView
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
android:gravity="center"
android:text="Main Content"
android:clickable="true"
android:focusable="false"
android:focusableInTouchMode="true"
android:textSize="16sp" />
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
</FrameLayout>
<!-- SLIDING LAYOUT -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eeeeee"
android:orientation="vertical"
android:clickable="true"
android:focusable="false"
android:id="@+id/dragView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:id="@+id/main_title_bar"
android:orientation="horizontal">
<TextView
android:id="@+id/tvName"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="20sp"
android:textColor="@android:color/black"
android:textStyle="bold"
android:gravity="center_vertical"
android:paddingLeft="10dp"/>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="50dip"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:visibility="gone" >
</ProgressBar>
<ImageView
android:id="@+id/tvLogo"
android:layout_width="50dip"
android:layout_height="match_parent"
android:paddingRight="10dp"
android:gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:id="@+id/menuLayout"
android:layout_width="match_parent"
android:layout_height="68dp"
android:orientation="horizontal">
<ImageButton
android:id="@+id/fbLogo"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:src="@drawable/facebook_logo"
/>
<ImageButton
android:id="@+id/twitterLogo"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:src="@drawable/twitter_logo"
/>
<ImageButton
android:id="@+id/webLogo"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:src="@drawable/web_logo"
/>
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:clickable="true"
android:id="@+id/tvDescriptionLayout"
android:layout_gravity="center" >
<com.myapp.ex.ExpandableTextView
android:id="@+id/tvDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@android:color/black"
android:gravity="center_vertical"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"/>
<VideoView
android:id="@+id/liveView"
android:clickable="true"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_below="@id/tvDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</RelativeLayout>
</ScrollView>
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</RelativeLayout>
этого вопрос что ScrollView не работает, когда я пытаюсь прокрутить содержимое, а видео не отображается в VideoView.
Проверьте это: http://stackoverflow.com/questions/22478361/slidinguppanellayout-and-scrollview –