In my Android project, I am working on creating the MyProfile activity. This activity will display a user's profile picture, name, and other bio data on the first screen. Additionally, I would like to make the layout swipeable so that when the screen is swiped up, the current information is pushed up, revealing a list view showing the user's posts.
My approach involves using nested layouts with the layout width and height set dynamically in Java code. However, I'm uncertain if this setup will allow for the desired swipe functionality.
Below is a snippet of my XML code:
<View
android:layout_width="1dp"
android:layout_height="40dp"
android:layout_marginTop="4dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="4dp"
android:background="#c0c0c0"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginBottom="4dp"
android:src="@drawable/touch"
android:layout_gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:id="@+id/mynumofposts"
android:textStyle="bold"
android:text="200"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="40dp"
android:layout_marginTop="4dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="25dp"
android:layout_marginBottom="4dp"
android:background="#c0c0c0"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/nearbycircle"
android:layout_marginBottom="4dp"
android:layout_gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textStyle="bold"
android:id="@+id/mynumoffollowers"
android:text="300"/>
</LinearLayout>
</LinearLayout>
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/myprofilelist"/></LinearLayout>
Despite my progress, I am facing challenges in implementing the swipe-up action to reveal the list view in my application.
I have searched for solutions to similar issues but haven't found anything directly related to my problem yet.
Currently, I aim to achieve a swipeable layout that displays a ListView as shown in this image: https://i.sstatic.net/BXtVr.jpg