android-recyclerview

Multiple font size for button not working

社会主义新天地 提交于 2019-12-12 05:42:04
问题 When I tried to set multiple font sizes for button text inside a recycler view it is not working as expected. What I was trying to do is get the first letter of the text and make it a little bigger, add line break and then the actual text and set the whole text in the button.Here is the code I've tried, but is not working as expected (the size is not changing). public void onBindViewHolder(final PopularCityViewHolder holder, int position) { if (shouldShowLoadingView()) return; PopularCity x =

How to use recyclerview with include layout properly?

会有一股神秘感。 提交于 2019-12-12 05:39:53
问题 I want create a list of news feed like simple twitter. I googled it and I suggested use recyclerview. but in my case i already used include view in my main activity layout. I try modify my code but always getting error. here this my codes. activty_master.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout 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"

How to send object value from RecyclerView Item to Another Activity

依然范特西╮ 提交于 2019-12-12 05:38:39
问题 From a JSON array that I am parsing, I want to send a particular object value (using intent putExtra) to another activity. I have read this this question and the accepted answer but I don't want to send all the values, in my case I only want to send the news_id as an integer to NewsDetails.class . And I tried using the accepted answer to do it but I got stuck. MainActivity public class MainActivity extends AppCompatActivity{ private final String TAG = "MainActivity"; //Creating a list of

Change the alpha of recyclerview item with beacon detection

 ̄綄美尐妖づ 提交于 2019-12-12 05:36:54
问题 In a Fragment I have a list of items construct with RecyclerView (adapter and viewholder). Each item of the list is linked with a estimote beacon. So i want to highlight the item view (setAlpha or add a imageView) when the beacon is detected. The beacon detection is in the fragment file : beaconManager.setRangingListener(new BeaconManager.RangingListener() { @Override public void onBeaconsDiscovered(Region region, List<Beacon> list) { if (!list.isEmpty()) { Beacon nearestBeacon = list.get(0);

import gallery images which are stored in phone/memory card into recyclerview

二次信任 提交于 2019-12-12 05:34:51
问题 I am trying to populate recyclerview from gallery images as instagram imports gallery images while you select images from the list to upload. I want to implement similar type of thing. Any suggestions on how to access the gallery images on phone/memory card and populate the recyclerview . Also please do suggest any way to implement instagram like interface for selecting images to upload . 回答1: you can use Android media store to pick pictures,Videos and Audios example code for images: private

Use condition IF in RecyclerView

旧街凉风 提交于 2019-12-12 05:33:18
问题 My app it's online market . I can add product to cart. I am trying change icon from "add to cart" to "in cart". But it doesn't work correctly. If I add only one product and scroll down, all other products icon also changed. In RecyclerView adapter OnBindViewHolder I use condition if . if (getTableBasket().contains(p.getId())) prudactViewHolder.btn_buy.setBackgroundResource(R.drawable.tool); else prudactViewHolder.btn_buy.setBackgroundResource(R.drawable.tool1); .... ArrayList<Integer>

Displaying Multiple Images From Parse.com Using RecyclerView Is Only Displaying One Of My Three Images

丶灬走出姿态 提交于 2019-12-12 05:29:54
问题 I have three images stored in a table class called: "events" and table column called: "image" on Parse.com I used two queries 1 to handle the displaying of the images and one to get another table's information (Those are all Strings) THE PROBLEM IS: The query that i used to get all the images only displays one of the three images in the RecyclerView instead of all three. How can i display all three images from Parse.com inside a RecyclerView? MY MAIN ACTIVITY: public class MainActivity

RecyclerView save elements in JSON

最后都变了- 提交于 2019-12-12 05:26:22
问题 I have recyclerview (in fragment) and fragment with details information to one of the element. All is good, but when my data was saved. I have bad results in my JSON file. All times when i open element of list he add new element inside JSON file, while he must overwrite oneself. My Activity public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.start_page_activity); Log.i(

Why does my StaggeredGrid RecyclerView layout every item, not only visible ones?

寵の児 提交于 2019-12-12 05:06:51
问题 I have a Staggered grid containing 370 items, with images. I want to make sure the items are recycled quickly to be careful with memory, but a ViewHolder is created and then bound for every single item in my adapter and pays no attention to whether children are visible I've tried the following StaggeredGridLayoutManager lm = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL); rv.setLayoutManager(lm); rv.setItemViewCacheSize(20); //Has no effect RecyclerView

recyclerview, on click Highlight and make others not highlighted

南笙酒味 提交于 2019-12-12 04:59:10
问题 I have a recyclerview of credit cards, if you click on one I want it to change the background resource of that one and make all the other ones back to default, for some reason I have been fighting this for about 5 hours and cant get it right. Here is the failing class public class CheckOutCardRecycler extends RecyclerView.Adapter<CheckOutCardRecycler.CardViewHolder>{ private List<Card> checkOutCard; private int screenWidth; private int selected; public CheckOutCardRecycler(Activity activity,