Skip to main content

Using cardview in your app for list





USING CARDVIEW IN YOUR ANDROID APP



Code:





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



<ScrollView android:layout_width="match_parent"

    android:layout_height="match_parent"

    xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto">





    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:background="#D0FF09"

        android:orientation="vertical">





        <android.support.v7.widget.CardView android:layout_width="match_parent"

            android:layout_height="200dp"

            android:layout_marginTop="10dp"

            android:layout_margin="5dp"

            app:cardCornerRadius="25dp"

            >





            <LinearLayout

                android:layout_width="match_parent"

                android:orientation="vertical"

                android:weightSum="2"

                android:layout_height="fill_parent">



                <ImageView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_weight="0.30"

                    android:src="@drawable/back1"

                    android:scaleType="fitXY"

                    />

                <TextView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_weight="1.70"

                    android:text="THIS IS A LAUNCHER ICON"

                    android:textSize="25dp"

                    android:gravity="center"

                    />





            </LinearLayout>



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













        <android.support.v7.widget.CardView android:layout_width="match_parent"

            android:layout_height="200dp"



            android:layout_marginTop="10dp"

            android:layout_margin="5dp"

            app:cardCornerRadius="25dp"

            >





            <LinearLayout

                android:layout_width="match_parent"

                android:orientation="vertical"

                android:weightSum="2"

                android:layout_height="fill_parent">



                <ImageView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_weight="0.30"

                    android:src="@drawable/back1"

                    android:scaleType="fitXY"

                    />

                <TextView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_weight="1.70"

                    android:text="THIS IS A LAUNCHER ICON"

                    android:textSize="25dp"

                    android:gravity="center"

                    />





            </LinearLayout>



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



        <android.support.v7.widget.CardView android:layout_width="match_parent"

            android:layout_height="200dp"



            android:layout_marginTop="10dp"

            android:layout_margin="5dp"

            app:cardCornerRadius="25dp"

            >





            <LinearLayout

                android:layout_width="match_parent"

                android:orientation="vertical"

                android:weightSum="2"

                android:layout_height="fill_parent">



                <ImageView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_weight="0.30"

                    android:src="@drawable/back1"

                    android:scaleType="fitXY"

                    />

                <TextView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_weight="1.70"

                    android:text="THIS IS A LAUNCHER ICON"

                    android:textSize="25dp"

                    android:gravity="center"

                    />





            </LinearLayout>



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



        <android.support.v7.widget.CardView android:layout_width="match_parent"

            android:layout_height="200dp"



            android:layout_marginTop="10dp"

            android:layout_margin="5dp"

            app:cardCornerRadius="25dp"

            >





            <LinearLayout

                android:layout_width="match_parent"

                android:orientation="vertical"

                android:weightSum="2"

                android:layout_height="fill_parent">



                <ImageView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_weight="0.30"

                    android:src="@drawable/back1"

                    android:scaleType="fitXY"

                    />

                <TextView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_weight="1.70"

                    android:text="THIS IS A LAUNCHER ICON"

                    android:textSize="25dp"

                    android:gravity="center"

                    />





            </LinearLayout>



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





    </LinearLayout>







</ScrollView>



Keywords:

cardview android material design
cardview android github
recyclerview and cardview android example
cardview with image and text in android
cardview android dependency
android cardview with image and text example
cardview material design
recyclerview android tutorial

Comments

Popular posts from this blog

Make your own tic-tac-toe game on Android

Now stay tuned with the new videos.Just click the button mention below of youtube: App Code for MainActivity.java: import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class MainActivity extends AppCompatActivity implements View.OnClickListener { int chance=0;     Button btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8,btn9,reset;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);     btn1=(Button)findViewById(R.id.btn1);     btn2=(Button)findViewById(R.id.btn2);     btn3=(Button)findViewById(R.id.btn3);     btn4=(Button)findViewById(R.id.btn4);     btn5=(Button)findViewById(R.id.btn5);     btn6=(Button)findViewById(R.id.btn6);     btn7=(Button)findViewById(R.id.btn7);     btn8=(Button)findViewById(R.id.btn8);  

How to Become an Ethical Shopper

In today's society, many of us are becoming more aware of the impact our purchasing decisions have on the environment, society, and the economy. With concerns about issues such as climate change, child labor, and unethical production practices, many consumers are taking steps to become more ethical shoppers. But what exactly does it mean to be an ethical shopper, and how can you become one? In this blog, we will explore what it means to be an ethical shopper and provide some tips on how to make more ethical purchasing decisions. What is ethical shopping? Ethical shopping is the practice of making purchasing decisions that take into account the social, environmental, and economic impact of the products we buy. This can include things like buying products that are produced in a sustainable way, supporting companies that treat their workers fairly, and avoiding products that are made using unethical labor practices or harmful chemicals. By being an ethical

Part 1: Make your own game in Python

Python Code[Just Copy paste the code and you are done] : # Import a library of functions called 'pygame' import pygame # Initialize the game engine pygame.init() gamedisplay = pygame.display.set_mode((700, 500)) pygame.display.set_caption("Cool Game") clock=pygame.time.Clock() crashed=False while not crashed: for event in pygame.event.get(): if event.type == pygame.QUIT: crashed= True print(event) pygame.display.update() clock.tick(60) pygame.quit() quit() In command prompt: pip install pygame Keywords : puruworldofficial python game engine 2d, python game library, python game development, pygame game, python game creator, python game programming tutorial for beginners, pygame tutorial, python based games, Game development in python, build your own game in python with pygame, build your own game in python, make your own game in python, invent your own game in python, how to make a game in python for beginners, python game programmi