android-recyclerview

Shared element activity transition on android 5

折月煮酒 提交于 2019-12-31 08:30:10
问题 I wanted to setup a shared element transition when going from one Activity to another. The first Activity has a RecyclerView with items. When an item is clicked that item should animate to the new activity. So i've set a android:transitionName="item" on both the final activity views, as wel as the recycler-view item views. I'm also using this code when going to the next activity: this.startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(this, itemView, "boomrang_item").toBundle(

Using data from Firestore and Firebase RTDB in single RecyclerView

半腔热情 提交于 2019-12-31 07:17:13
问题 I have a RecyclerView which is populated by posts stored in a Firestore database. Each post is written as a document with a unique postID, storing the posted message, a timestamp and a like-counter. //mUploads is defined as private List<Upload> mUploads; //Upload object stores post message, timestamp and likes mUploads = new ArrayList<>(); mFireStoreOrdered = mFireStoreInst.collection("posts").orderBy("time"); mFireStoreOrdered .get() .addOnCompleteListener(new OnCompleteListener

Filter Data from RecyclerView Firebase

北城以北 提交于 2019-12-31 06:08:24
问题 I am trying to implement a searchview in my action bar and for that to filter the RecyclerView Data that I retrieved from Firebase. Right now I am looking for the code that I need to add to the recycleradapter to be able to filter the retrieved data. This is how I added the recyclerView to my MainActivity. Query query = mRef.orderByChild("city"); // everything else FirebaseRecyclerAdapter<City, CityViewHolder> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<City, CityViewHolder>( City

issue on my recyclerview

别来无恙 提交于 2019-12-31 05:20:09
问题 I'm trying to show up recyclerview and retrieve data from firebase but I got problem after adding images which I saved on firebase storage. It closed after scrolling. I have another recyclerview which is using the same database but it doesnt have issue. can you give me solution for this? AllLaundries.java package com.example.rizkafs.laundrize; import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity;

refresh recyclerview items in a fragment

淺唱寂寞╮ 提交于 2019-12-31 05:08:46
问题 my application has 4 tabs with sliding tab layout and i used a view pager in MainActivity a 4 fragment for every tab... i receive data from mysql using volley . cardview . recycler view and JSON i want refresh the list using SwipeRefreshLayout , but the list dosent refresh and i should close the app and restart that in my SwipeRefreshLayout OnRefreshListener i called my getdata() method but i think the better way is refreshing the fragment (Reload). any ideas? thank you all of my fragment

NullPointerException when binding Views in RecyclerView.Adapter

对着背影说爱祢 提交于 2019-12-31 03:04:19
问题 Why do I get a NullPointerException in my ViewHolder 's bindItems() method? I've highlighted the line where I get the NullPointerException . The blogpost_author ID exists, as you can see in the XML, so what's the problem here? How is findViewById<TextView>(R.id.blogpost_author) returning null? Adapter and ViewHolder code: class BlogPostAdapter(val blogList: ArrayList<BlogPost>) : RecyclerView.Adapter<BlogPostAdapter.ViewHolder>() { override fun onCreateViewHolder(parent: ViewGroup, viewType:

Android - RecyclerView inside of Fragment - NullPointerException

痴心易碎 提交于 2019-12-31 02:58:11
问题 I'm trying to use a RecyclerView inside of a Fragment (to use it in a ViewPager ) but I got a NullPointerException when I try to execute: Process: com.yomansk8.birthdaysoundboard, PID: 4448 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView$LayoutManager.onMeasure(android.support.v7.widget.RecyclerView$Recycler, android.support.v7.widget.RecyclerView$State, int, int)' on a null object reference at android.support.v7.widget

selected Image button changes its position in recyclerView when scrolling

安稳与你 提交于 2019-12-31 02:55:15
问题 i have a recyclerview in my MainActivity and i'm showing no of items in list manner through RecyclerView.Adapter . here is my recyclerview_list_items.xml file, <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="10dp"> <ImageView android:id="@+id/person_photo" android:layout_width="50dp" android:layout_height=

Android RecyclerView select first Item

拜拜、爱过 提交于 2019-12-30 18:47:13
问题 I'm using a RecyclerView to implement a NavigationDrawer. I got click events working, but I can't figure out how to have the first item selected on App start and following that keep the selected item higlighted even if the drawer is not shown. All I've been able to find is multi-selection in RecyclerView. 回答1: I actually just implemented this in an app I am working on. So this method worked: First create a variable to track the current selected position at the top of your adapter: private int

Downloading Image in android using asynctask for RecyclerView

一个人想着一个人 提交于 2019-12-30 11:53:51
问题 This my following AsyncTask class code for downloading image for RecyclerView . public class MyDownloadImageAsyncTask extends AsyncTask<String, Void,Bitmap> { private final WeakReference<ImageView> imageViewReference; public MyDownloadImageAsyncTask(ImageView imv) { imageViewReference = new WeakReference<ImageView>(imv); } @Override protected Bitmap doInBackground(String... urls) { Bitmap bitmap = null; for (String url : urls) { bitmap = MyUtility.downloadImage(url); /*if (bitmap != null) {