make imageview accroding to cardview design

cardview with image and text in android studio
cardview android
circular imageview with cardview'' android
rounded imageview android
rounded corner imageview in android example
android rounded corners only top
android curved layout
android imageview rounded corners transparent

I have a CardView with rounded corners, I want to have an ImageView like cardview but it's not working.

I have implemented this code in another project it's working fine but it's not working in my project

please check my code i don't find any solution please help me.

my XML file

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/rlimg"
    android:orientation="vertical"
    android:layout_width="@dimen/_150sdp"
    android:layout_height="wrap_content">

    <android.support.v7.widget.CardView
        android:id="@+id/card_view"
        android:layout_width="@dimen/_150sdp"
        android:layout_height="wrap_content"
        app:cardElevation="@dimen/_3sdp"
        android:elevation="@dimen/_12sdp"
        android:layout_centerHorizontal="true"
        app:cardUseCompatPadding="true"
        app:cardPreventCornerOverlap="false"
        android:innerRadius="0dp"
        android:radius="0dp"
        app:cardCornerRadius="@dimen/_10sdp"
        android:shape="ring"
        android:thicknessRatio="1.9">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/imgperformarbg"
                android:layout_width="match_parent"
                android:layout_height="@dimen/_100sdp"
                android:fitsSystemWindows="true"
                android:scaleType="centerCrop"
                android:src="@drawable/publiek" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="@dimen/_100sdp"
                android:layout_gravity="bottom"
                android:scaleType="fitXY"
                android:src="@drawable/gradient"/>
        </RelativeLayout>

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/card_view"
        android:layout_marginLeft="@dimen/_4sdp"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Name"
            android:layout_marginBottom="@dimen/_5sdp"
            android:textColor="#E6000000"
            android:lineSpacingMultiplier=".9"
            android:minLines="1"
            android:maxLines="2"
            android:textSize="@dimen/_12sdp"
            android:id="@+id/txtperformarname"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Detail"
            android:layout_marginBottom="@dimen/_5sdp"
            android:textColor="#CC000000"
            android:textSize="@dimen/_10sdp"
            android:layout_below="@+id/txtperformarname"
            android:visibility="visible"
            android:id="@+id/txtdetails"/>
    </LinearLayout>
</RelativeLayout>

Gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.jenya.tix_tm"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 7
        versionName "1.0.6"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    //sdp
    implementation 'com.intuit.sdp:sdp-android:1.0.5'
    //BottomNavigationViewEx library
    implementation 'com.github.ittianyu:BottomNavigationViewEx:1.1.9'
    //glide
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    //cardview
    implementation 'com.android.support:cardview-v7:27.1.1'
    //volley
    implementation 'com.android.volley:volley:1.1.0'
    //recyclerview multi
    implementation 'com.github.takusemba:multisnaprecyclerview:1.3.3'
    //slider indecator
    implementation 'me.relex:circleindicator:1.2.2@aar'
    //font
    implementation 'com.elmargomez.typer:typerlib:1.0.0'
    //fab_loading
    implementation 'io.saeid:fab-loading:1.0.0'
    //loading_dots
    implementation 'com.github.bhargavms:DotLoader:1.1.1'
}

However, the material design guidelines states that card should have rounded corners and not square corners.

please help me I am new here

Any help would be highly appreciated.


you are mention card view library

com.android.support:cardview-v7:27.1.1

How can I create a CardView and ImageView with a rounded border , Android CardView is a component that used to implement card layout effect. will list some car images with text in a recycler view use grid layout manager. findViewById(R.id.card_view_image_title); // Get car image view  Each cardview has one imageview representing the post image, one textview for post title and another one for post snippet. We will design detail activity from scratch and will learn how to use


please use this

<?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"
    android:id="@+id/rlimg"
    android:orientation="vertical"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <android.support.v7.widget.CardView
        android:id="@+id/card_view"
android:layout_width="match_parent"
        android:layout_height="wrap_content"

        android:layout_centerHorizontal="true"
        app:cardUseCompatPadding="true"
        app:cardPreventCornerOverlap="false"
        android:innerRadius="0dp"
        android:radius="0dp"

        android:shape="ring"
        android:thicknessRatio="1.9">

        <RelativeLayout

            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/imgperformarbg"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fitsSystemWindows="true"
                android:scaleType="centerCrop"
                android:src="@drawable/h" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:scaleType="fitXY"
                android:src="@drawable/h"/>

        </RelativeLayout
            >

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/card_view"
        android:orientation="vertical">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Name"
            android:textColor="#E6000000"
            android:lineSpacingMultiplier=".9"
            android:minLines="1"
            android:maxLines="2"
            android:id="@+id/txtperformarname"
            />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Detail"

            android:textColor="#CC000000"

            android:layout_below="@+id/txtperformarname"
            android:visibility="visible"
            android:id="@+id/txtdetails"
            />
    </LinearLayout>



</RelativeLayout>

Android CardView With Image And Text Example, If you want to make a rounded layout like below, it will be pretty simple to create it <android.support.v7.widget.CardView android:id="@+id/parent_layout" and rounded rectangle shapes are supported according to the documentation. For this one, you can remove the background shape from ImageView and set only  We are going to create a list of country items. Each country will contain a photo representation of the country’ photo and name. The CardView will contain two Views – ImageView and TextView. The ImageView will hold the country photo while the TextView will hold the country name.


The problem wasn't the layout or Glide. A few weeks ago I added this:

android:hardwareAccelerated="false" android:largeHeap="true"

to my Manifest because of memory management problems (my app would stop responding in Geneymotion). Turns out it created more problems than solving them.

Android UI: Creating a layout rounded only in the top, Add the card view to the layout. <android.support.v7.widget.CardView android:​layout_width="match_parent" android:orientation="vertical"> <ImageView A card is a sheet of material that serves as an entry point to more detailed information. Cards may contain a photo, text, and a link about a single subject. They may display content containing elements of varying size, such as photos with captions of variable length. (from: Google Material Design) Add the card view library to your project.


Android: Card View, I have a CardView with rounded corners, I want to have an ImageView at the top like shown in the example taken from the material design  The CardView is the element of Android Material Design. A CardView also a view group. The CardView adds into Activity using an XML file. Each card will represent a row in the RecyclerView. A CardView is a new widget that shows all the information on a card. A CardView is like a container where you can place images and as well as textView.


Make ImageView fit width of CardView, RecyclerView and CardView are part of Android Material Design. Android CardView holds an ImageView along with two TextViews in a Nested Linear Layout. add dependency and sync : implementation 'com.android.support:cardview-v7:28.0.0' this video is simple use carview weather in android studio for beginners use xml langues coding and gradient color


Android RecyclerView, Android CardView Example Tutorial , Pull To Refresh / SwipeRefreshLayout · CardView · ViewPager · Animation · Snackbar ScaleType configuration properties for ImageView in Android are CENTER, an image view and different button on the screen in a relative layout. set the ScaleType for image using setScaleType() method according to Button and  this video is simple create dashboard ui and coding from design to xml file as using cardview in android studio and easy simple use for beginner. i hope this video can help you. Category