android-cardview

How to make span count and icon size automatic

孤人 提交于 2020-01-21 06:06:46
问题 I am using recycler view with card view to show icons in my application. I am not able to figure out how to resize the app icons and increase/decrease the span count automatically depending on the screen size. Here is what I am doing to display it and the spen count is fixed to 3. RecyclerView mrv = (RecyclerView) findViewById(R.id.recyclerview_id); RecyclerViewAdapter myAdapter = new RecyclerViewAdapter(this, lsStore); mrv.setLayoutManager(new GridLayoutManager(this, 3)); mrv.setAdapter

How to make span count and icon size automatic

≯℡__Kan透↙ 提交于 2020-01-21 06:06:14
问题 I am using recycler view with card view to show icons in my application. I am not able to figure out how to resize the app icons and increase/decrease the span count automatically depending on the screen size. Here is what I am doing to display it and the spen count is fixed to 3. RecyclerView mrv = (RecyclerView) findViewById(R.id.recyclerview_id); RecyclerViewAdapter myAdapter = new RecyclerViewAdapter(this, lsStore); mrv.setLayoutManager(new GridLayoutManager(this, 3)); mrv.setAdapter

Copy to clipboard the content of a cardview

耗尽温柔 提交于 2020-01-20 09:35:13
问题 I've implemented a recycler card view and want to use a button click method to copy the content of cardView. There aretwo texts in cardview and i want to copy the content only, different for different cards. How can I do this? Here is my Cardview adapter. public static class ViewHolder extends RecyclerView.ViewHolder{ Button copyButton; Button shareButton; TextView title; TextView content; public ViewHolder(View itemView) { super(itemView); this.title = (TextView)itemView.findViewById(R.id

how can I implement ui the same as on the image

☆樱花仙子☆ 提交于 2020-01-17 14:05:49
问题 I am developing news app and I want to implement constrainlayout inside CardView and achieve ui the same as image below but I could achieve what I want below my xml file where I have implemented constrainlayout inside cardview <TextView android:id="@+id/articleTitle" android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/articleTitle" tools:ignore="NotSibling

CardView dynamic shadow depends not only on elevation

狂风中的少年 提交于 2020-01-16 11:22:38
问题 While developing my app I'd created a RecyclerView with expandable CardViews inside and then mentioned "hey, why does the elevation is changing a bit while I'm animating only vertical size of card and opacity of extension?" . And then I've found what it's not an elevation who chages -- it's only a shadow changed. Does anybody heard smth about it? Is it just an undescribed thing of interface drawing? I have no objections for cool feature, but it just a bit confused me (I've even spend about an

Android CardView padding and minHeight

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-15 14:25:48
问题 Today I updated support dependencies in my project and I found some issues with the new CardView . Previous version: compile 'com.android.support:cardview-v7:21.0.0-rc1@aar' Current version: compile 'com.android.support:cardview-v7:21.0.0@aar' First of all it looks like minHeight doesn't work any more. One of the solutions is to put any ViewGroup inside the card and set the minimum height, but it looks like a bug for me. The second issue for me are paddings. With the new library release

Android CardView padding and minHeight

孤者浪人 提交于 2020-01-15 14:24:24
问题 Today I updated support dependencies in my project and I found some issues with the new CardView . Previous version: compile 'com.android.support:cardview-v7:21.0.0-rc1@aar' Current version: compile 'com.android.support:cardview-v7:21.0.0@aar' First of all it looks like minHeight doesn't work any more. One of the solutions is to put any ViewGroup inside the card and set the minimum height, but it looks like a bug for me. The second issue for me are paddings. With the new library release

CarView Group with select an deselecting items in android

非 Y 不嫁゛ 提交于 2020-01-15 12:02:31
问题 Here the Branch items are aligned on a cardview within the recycleview as a button. I need to implement a click on each cardview and the color should change, but the point is that each time i click another cardView the selected cardView before should deselected. I don't even have a logic to implement this. Please help with an easy method 回答1: You can try this, public class yourRecyclerViewAdapter extends RecyclerView.Adapter<yourRecyclerViewAdapter.yourViewHolder> { private static int

error while inflating class android.support.v7.widget.CardView

狂风中的少年 提交于 2020-01-15 03:49:07
问题 we already have a bunch of similar question to this but all of them was related to backward compatibility or they are on eclipse (as far i understand) but i think problem is occurring while inflating the cardView class it was working fine on my emulator (SDK 23) but when am trying it on my other emulator (SDK 19) am getting this error and the error is pointing me to this line : @Override public RecyclerView.ViewHolder onCreateViewHolderImpl(ViewGroup viewGroup, final ParallaxRecyclerAdapter

RecyclerView onBindViewHolder onclicklistener behavior

淺唱寂寞╮ 提交于 2020-01-13 07:06:48
问题 I am trying to load a recycler view that lists cards, each card has four elements. two text views(posttext, score are the id) and two buttons(minusOne and plusOne). The code below loads the textview's content and buttons properly on all cards. I try to implement the following behavior. onbuttonclick of plusOne button, the score will be changed and the minusOne button is hidden. The strange part is, the scores get updated properly on respective cards. But the hiding part appears to happen in