Skip to main content

card View

 Tutorial membuat card view makanan


hia disini saya akan mengajarkan mengenai card view beserta dengan scrollview , disini saya menyediakan codingan berserta hasil result nya


CODINGAN : 

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout 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=".MainActivity"

    android:background="@color/cardview_light_background">


    <ScrollView

        android:layout_width="match_parent"

        android:layout_height="600dp"

        android:layout_margin="10dp"

        app:layout_constraintTop_toTopOf="parent">



    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:orientation="vertical">



        <TextView

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:paddingTop="20dp"

            android:paddingBottom="35dp"

            android:textColor="#FFFFFF"

            android:text="Syaid Alfarishi"

            android:background="#770DE1"

            android:textStyle="bold"

            android:textAlignment="center"

            android:textSize="25dp"

            />



<android.support.v7.widget.CardView

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    app:cardCornerRadius="10dp"

    app:cardElevation="20dp"

    android:layout_marginTop="10dp"

    android:layout_marginLeft="10dp"

    android:layout_marginRight="10dp"

    android:layout_marginBottom="30dp">


    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:orientation="vertical">



    <TextView

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:text="About Kami"

        android:textStyle="bold"

        android:textSize="25dp"

        android:padding="10dp"/>


    <TextView

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:padding="10dp"

        android:text="kami menyediakan banyak produk yang sangat menarik yang dapat anda lihatr"

        android:textSize="25dp" />


    </LinearLayout>


<!--    ==========================-->


    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:paddingTop="160dp"

        android:paddingLeft="30dp"

        android:orientation="horizontal">


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="share"

            android:textSize="25dp" />


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:textColor="@color/teal_200"

            android:text="Learn More"


            android:textSize="25dp"

            android:paddingLeft="10dp"/>

    </LinearLayout>

    </android.support.v7.widget.CardView>


<android.support.v7.widget.CardView

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    app:cardCornerRadius="10dp"

    app:cardElevation="20dp"

    android:layout_marginLeft="10dp"

    android:layout_marginRight="10dp"

    android:layout_marginBottom="30dp">

    <ImageView

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:scaleType="center"

        android:src="@drawable/nasi"/>





<!--    ==========================-->


    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:paddingTop="160dp"

        android:paddingLeft="30dp"

        android:orientation="vertical">


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="nasi padang"

            android:textSize="27dp" />


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:textColor="#000"

            android:text="nasi padang adalah makanan khas yang berasal dari sumatra barat yang sangat terkenal baik di nusantara maupun di dunia"

            android:textSize="20dp"

            />

    </LinearLayout>


    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:paddingTop="300dp"

        android:paddingLeft="30dp"

        android:orientation="horizontal">


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="share"

            android:textSize="25dp" />


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:textColor="@color/teal_200"

            android:text="Learn More"


            android:textSize="25dp"

            android:paddingLeft="10dp"/>

    </LinearLayout>

    </android.support.v7.widget.CardView>


<android.support.v7.widget.CardView

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    app:cardCornerRadius="10dp"

    app:cardElevation="20dp"

    android:layout_marginLeft="10dp"

    android:layout_marginRight="10dp"

    android:layout_marginBottom="30dp" >


    <ImageView

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:scaleType="center"

        android:src="@drawable/satenormal"/>


<!--    ==========================-->


    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:paddingTop="160dp"

        android:paddingLeft="30dp"

        android:orientation="vertical">


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="sate Madura"

            android:textSize="27dp" />


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:textColor="#000"

            android:text="adalah sate yang sangat terkenal dan mendunia , sate madura terkenal di madura maupun di indonesia"

            android:textSize="20dp"  />

    </LinearLayout>


    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:paddingTop="300dp"

        android:paddingLeft="30dp"

        android:orientation="horizontal">


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="share"

            android:textSize="25dp" />


        <TextView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:textColor="@color/teal_200"

            android:text="Learn More"


            android:textSize="25dp"

            android:paddingLeft="10dp"/>

    </LinearLayout>

    </android.support.v7.widget.CardView>




    </LinearLayout>

    </ScrollView>

</LinearLayout>




HASIL : 











sekian sajalah hasil dari ugas projek yang saya buat


Syaid Alfarishi

XI RPL 2


Comments

Popular posts from this blog

Kuis 1 (Image view)

 Nama : Syaid Alfarishi Kelas : XI RPL 2 Codingan :  <?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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=".MainActivity">     //Penempatan komponen     <TextView         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_marginBottom="10dp"         android:background="@color/purple_500"         android:padding="20dp"         android:text="bahasa pemrogramman"         android:textAlignment="center"         android:textAllC...

Tugas 2 Get dan Set text

 Tugas 2 Get dan set text (xml) halaman main_activity.xml <? xml version ="1.0" encoding ="utf-8" ?> < androidx.constraintlayout.widget.ConstraintLayout 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 =".MainActivity" > < TextView android :id ="@+id/textView6" android :layout_width ="match_parent" android :layout_height ="wrap_content" android :background ="@color/purple_500" android :padding ="8dp" android :text ="DATA SISWA" android :textAlignment ="center" android :textColor ="@color/white" android :textSize =...