android-cardview

Text Clipping in Textview

☆樱花仙子☆ 提交于 2019-12-14 03:32:58
问题 I am adding Text in textview but it clipping at start and I have tried adding padding, margin start and textalignment center or end. XML CODE <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" android:background="#eb2f06" android:gravity="center" android:orientation="vertical" tools:context="

How to position CardViews next to each other?

风流意气都作罢 提交于 2019-12-13 22:16:33
问题 I want to make Google PlayStore-like-CardView layout . However, I do not manage to put Card Views side-by-side, rather they are being listed Vertically, top down. SCREENSHOT: cardview.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView android:id="@+id/card_view" android:layout_width="150dp" android:layout_height="200dp" android:layout_margin="5dp" android:layout_gravity="center" card_view:cardCornerRadius="2dp" card_view:contentPadding="10dp" xmlns:android="http:/

RecyclerView Not Displaying Any CardView Items

谁说胖子不能爱 提交于 2019-12-13 08:25:45
问题 I have switched from ListView to RecyclerView and am not seeing any items displayed on my mobile device. I know for a fact that it doesn't have to do with the getItemCount() method as I have hardcoded a number to that return to test it. Here is my initialization, I used Firebase to pull new data: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Firebase.setAndroidContext(this); setContentView(R.layout.activity_discussion); toolbar = (Toolbar)

Technical Details of Android Lollipop Settings View

独自空忆成欢 提交于 2019-12-13 06:47:06
问题 I am trying to figure out how would you implement something like an Android Settings View for both phones and tablets? It doesn't look like a ListView or RecyclerView utilizing CardView? Which Android class or component would you use to implement/design a similar looking ListView? Its sort of a 2 column layout on tablets and one column layout on phones: Any sample code or tips would be appreciated. 回答1: You can accomplish this by using a combination of RecyclerView and CardView for the

How to change text based on time and date?

我只是一个虾纸丫 提交于 2019-12-13 04:47:13
问题 So I need one of two options but don't know where to start with either. I have a list card views in a recyclerview. Each card view needs to have countdown timer implemented and able to run simultaneously. (Seems like the harder option) OR Update the text in a card view based on if a specified time has elapsed or system time reaches a specified minute and hour. 回答1: To make the cards with different timers you will need threads. And the easiest way in Android is AsyncTask . So you create a

Encountering lag when updating a CardView item in a RecycleView

旧巷老猫 提交于 2019-12-13 01:37:50
问题 i'm having an issue working with CardViews . I`ve created a CardView containing 1 TextView and 2 ImageViews , which gets displayed in an RecycleView . When i try to update the contents of one of the CardViews (created 5 cards for testing) the interface starts to lag when scrolling over the updated card, but goes back to normal when i pass the item. It only happens when ImageViews are present , when substituting the ImageViews for say, TextViews with some random text in them, it works normally

Multi select CardView in ListView

做~自己de王妃 提交于 2019-12-12 20:34:17
问题 I want to multi select custom ListView row, I designed it using CardView and all events happens on this card, I want to implement Contextual Action bar 'CAB' when the user long press the card, actually I made it but can't change the row color state when selected like this, I used the code from this answer: and make CardView checkable using this code: public class CheckableCard extends CardView implements Checkable { private boolean mChecked; private final static int[] CHECKED_STATE_SET = {

cannot find Symbol class ActionBarActivity (Android Recycled View)

▼魔方 西西 提交于 2019-12-12 13:18:48
问题 I have some problem when i build graddle.. i don't understand where is the probleme, i read many things about that, but i can't find the solution.. i have already: download the Repository , put in the dependencies and the latest SDK version . I try to make CardView in the HomeActivity.xml . I have also MyViewHolder.java , PageAdapter.java and `MyObject.java so.. i need some help If you want the other file, i have made 3 TabLayout . the code is in the MainActivity.java. Information:Gradle

CardView setCardBackgroundColor won't work

人走茶凉 提交于 2019-12-12 10:56:19
问题 I have made an adapter of CardView through the RecyclerView for me to use the same template of card for this feature of mine. The objective is to create certain cards with different colors , based on the parameter inc_status in INCCards.java . But it doesn't just seem to work. Here's the source code for the template card: item_inc_card.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width=

Setting margin programmatically to CardView

和自甴很熟 提交于 2019-12-12 10:30:39
问题 I have a CardView in my XML layout and I need to set margins to it programmatically (This is because I don't need margin at all times. Based on few conditions, I either set or remove the margin). Here's how I did it: CardView.LayoutParams layoutParams = (CardView.LayoutParams) myCardView.getLayoutParams(); layoutParams.setMargins(0, 0, SystemHelper.dpToPx(2), 0); myCardView.setLayoutParams(layoutParams); This worked fine. It put 2dp margin at the bottom of my CardView . However, I get this in