[Solved] How do I create a ListView like the YouTube App? [closed]

The most important thing to apply this kind of design is properly implement adapter, which will represent every piece of data (one video in your situation). More or less in for situation it will look like: <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”wrap_content”> //you main picture <ImageView android:layout_width=”fill_parent” android:layout_height=”fill_parent”> //layout to place other info like number of likes, … Read more

[Solved] Make a similar layout like the one below

Use below layout as item of your RecyclerView <?xml version=”1.0″ encoding=”utf-8″?> <androidx.cardview.widget.CardView xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”wrap_content” app:cardCornerRadius=”15dp” app:cardMaxElevation=”3dp” android:elevation=”3dp” app:cardUseCompatPadding=”true” app:cardBackgroundColor=”@android:color/white”> <LinearLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”horizontal”> <LinearLayout android:layout_weight=”.95″ android:layout_width=”0dp” android:layout_height=”wrap_content” android:orientation=”vertical”> <LinearLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:padding=”15dp”> <TextView android:id=”@+id/tv_received_message_heading” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Received Message:”/> <TextView android:id=”@+id/tv_received_message” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”First Received Message” android:layout_marginStart=”5dp”/> </LinearLayout> <View android:layout_width=”match_parent” android:layout_height=”1dp” android:background=”@color/colorPrimary” android:layout_marginStart=”10dp” … Read more

[Solved] two buttons with onClick in same place

Try with something like this: public class MyActivity extends Activity { Button buttonStart; Button buttonStop; protected void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.content_layout_id); buttonStart = (Button) findViewById(R.id.buttonStart); buttonStop = (Button) findViewById(R.id.buttonStop); buttonStart.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Perform action on click //for example mediaPlayer.start(); if you have a media player } }); buttonStop.setOnClickListener(new … Read more