android-cardview

RecyclerView Adapter and ViewHolder update dynamically

寵の児 提交于 2019-12-18 02:47:31
问题 I am trying to make an app that will be loading news from the network and will be updating dynamically. I am using a RecyclerView and CardView to display the content. I use Jsoup to parse sites. I don't think that my code is needed because my question is more theoretical than practical. I want to understand the process of dynamic updating using notifyDataSetChanged() . In my main activity I get all the headers and add them to list. But I need to wait untill all the items are loaded to start

RecyclerView Adapter and ViewHolder update dynamically

主宰稳场 提交于 2019-12-18 02:47:02
问题 I am trying to make an app that will be loading news from the network and will be updating dynamically. I am using a RecyclerView and CardView to display the content. I use Jsoup to parse sites. I don't think that my code is needed because my question is more theoretical than practical. I want to understand the process of dynamic updating using notifyDataSetChanged() . In my main activity I get all the headers and add them to list. But I need to wait untill all the items are loaded to start

How to add cardview in layout xml in AndroidX

旧街凉风 提交于 2019-12-17 22:57:44
问题 How to add cardview in layout xml in AndroidX After upgraded to AndroidX <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp"> gives a error The following classes could not be found: - android.support.v7.widget.CardView (Fix Build Path, Edit XML, Create Class) dependencies { implementation 'androidx

Unnecessary padding in CardView?

北慕城南 提交于 2019-12-17 22:22:34
问题 I have implemented CardView in my app and everything works fine except there is a little padding around the image if I put radius to the card. It appears like this: But in android docs and in this article the image takes the entire cardview, so can u help me achieve that. My layout file is like: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match

Toolbar inside CardView to create a popup menu (overflow icon)

六眼飞鱼酱① 提交于 2019-12-17 22:08:57
问题 I have a list that looks like google play in a recyclerview with cardview, and works perfect. I need to add a popup menu (with overflow icon), like this: which is the best way to do this ? I researched and found that there are 2 options: 1 - with a toolbar inside the cardview layout. is there a performanece problem with this solution ? 2 - with a imagebutton or imageview with a icon of the overflow, that when you click the menu is created. I need a solution to be compatible with >= API 10

Use Custom Layout in NavigationDrawer With Header And list

孤者浪人 提交于 2019-12-17 13:43:14
问题 How to do add custom layout in NavigationView and design my create custom NavigationView use material design,i want put my drawer icon to right and text left of it something like this 回答1: I Search too much and this is my experience that works fine at first create layout for header. its name is nav_header_main.xml then put it in layouts folders in res and put this code in it.. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

Use Custom Layout in NavigationDrawer With Header And list

狂风中的少年 提交于 2019-12-17 13:42:41
问题 How to do add custom layout in NavigationView and design my create custom NavigationView use material design,i want put my drawer icon to right and text left of it something like this 回答1: I Search too much and this is my experience that works fine at first create layout for header. its name is nav_header_main.xml then put it in layouts folders in res and put this code in it.. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

Error inflating class and android.support.v7.widget.CardView

僤鯓⒐⒋嵵緔 提交于 2019-12-17 05:07:54
问题 I want to use CardView in my project, but when I run my application, I get the following error. I'm using Eclipse . Error: Error inflating class and android.support.v7.widget.CardView The graphical view of my xml file says 'The following classes could not be instantiated: - android.support.v7.widget.CardView (Open Class, Show Error Log) See the Error Log (Window > Show View) for more details.' Please help. This is the layout for my fragment where I have used CardView <FrameLayout xmlns

CardView layout_width=“match_parent” does not match parent RecyclerView width

情到浓时终转凉″ 提交于 2019-12-17 04:47:41
问题 I have a fragment with contains a RecyclerView with layout_width="match_parent": <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin"

RecyclerView inside ScrollView is not working

走远了吗. 提交于 2019-12-16 19:51:29
问题 I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout. Layout template: <RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" /> </ScrollView> </RelativeLayout> Problems: i can scroll until the last element of ScrollView Things i tried: card view inside the