У меня есть мероприятие, в котором есть несколько компонентов и обзор переработчика. Я хочу, чтобы пользовательский интерфейс был таким, чтобы, если я проведу пальцем вверх, я хочу, чтобы весь экран прокручивался вниз; не только просмотрщик. Как я могу сделать это возможным? Я попытался инкапсулировать все мои макеты, кроме макета координатора, с помощью прокрутки, но, похоже, он не работает.
Java-код:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_single_art_call);
Fund = (Button) findViewById(R.id.button2);
/* -------- Obtain the Event ID of the item that the user has selected on the RecyclerView ------*/
Intent intent = getIntent();
Artcall_id = intent.getStringExtra("Artcall_id");
/* ----------------------------------------------------------------------------------------------*/
mEventFundRef = FirebaseDatabase.getInstance().getReference().child("Fund");
mRewardsRef = FirebaseDatabase.getInstance().getReference().child("Rewards").child(Artcall_id);
rewards_list = (RecyclerView) findViewById(R.id.reward_list);
rewards_list.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
rewards_list.setLayoutManager(layoutManager);
}
XML-код:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FundingFlow.SingleArtCall">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/relLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="@+id/genpage_toolbar"
layout="@layout/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
<TextView
android:id="@+id/band_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="24dp"
android:layout_marginTop="186dp"
android:text="Sean Roldan and Friends"
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
android:textSize="24sp" />
<!--Bottom Button -->
<include layout="@layout/fund_button_layout" />
<TextView
android:id="@+id/band_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/band_name"
android:layout_below="@+id/band_name"
android:text="Performing in Hyderabad, India." />
<TextView
android:id="@+id/started_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignStart="@+id/band_name"
android:layout_marginTop="245dp"
android:text="Started by Vishwesh Kirthi"
android:textSize="14sp" />
<TextView
android:id="@+id/genre_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="259dp"
android:text="Indian Folk and Blues"
android:textAppearance="@style/TextAppearance.AppCompat.Button" />
<ImageView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="126dp"
android:layout_alignParentStart="true"
android:layout_below="@+id/relLayout1"
android:src="@color/white" />
<ProgressBar
android:id="@+id/progressBar2"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="338dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="233dp"
android:max="100"
android:progress="60" />
<TextView
android:id="@+id/amt_fund_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignStart="@+id/band_name"
android:layout_marginBottom="191dp"
android:text="Rs. 7,80,000"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
<TextView
android:id="@+id/target_fund_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignStart="@+id/band_name"
android:layout_marginBottom="162dp"
android:text="pledged of Rs. 13,00,000" />
<TextView
android:id="@+id/total_backers_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/textView35"
android:layout_alignTop="@+id/amt_fund_txt"
android:text="120"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
<TextView
android:id="@+id/textView35"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/target_fund_txt"
android:layout_marginEnd="124dp"
android:text="backers" />
<TextView
android:id="@+id/time_left_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/amt_fund_txt"
android:layout_toEndOf="@+id/band_name"
android:text="25"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
<TextView
android:id="@+id/time_qt_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/target_fund_txt"
android:layout_toEndOf="@+id/band_name"
android:text="days to go" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/time_qt_left"
android:id="@+id/relLayout2">
<android.support.v7.widget.RecyclerView
android:id="@+id/reward_list"
android:layout_width="354dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:paddingTop="10dp"
></android.support.v7.widget.RecyclerView>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</android.support.design.widget.CoordinatorLayout>