android-recyclerview

Set height & gravity of Span item in GridLayoutManager

房东的猫 提交于 2019-12-12 04:25:04
问题 I'm working with Grid Layout Manager in Recycler View . I can : show one View Group inside Grid Layout like image below. Able to set Space Item Decoration Able to set different Span Size Lookup . My issue is : Not able to set Height of each Span row inside, as 5 small circles in above image. (I want to set smaller height) The span item can not set gravity to center when it stay alone, as Big circle in above image I tried to find method setFullSize() (exists when working with

getBaseline of TextView returns -1

天涯浪子 提交于 2019-12-12 04:22:48
问题 I am trying to align two TextView one is inside HorizontalScrollView , and both are children of LinerLayout . When I am trying to call getBaseLine of TextView inside onWindowAttached of RecyclerView Adapter it always returns -1. Yes, the parent view of TextView , LinerLayout has android:baselineAligned="true" Edit : Adding Code Layout <LinearLayout android:id="@+id/linearLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android

Android Horizontal RecyclerView with ListViews as items

心已入冬 提交于 2019-12-12 04:16:25
问题 List wireframe. I'm trying to build a list like the one in the picture where I have a horizontal RecyclerView with ListViews (or RecyclerViews) as items. Can you give me an example on how to build this? 回答1: Try this:- MainActivity.java import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import java.util.ArrayList;

E/RecyclerView﹕ No adapter attached; skipping layout

蹲街弑〆低调 提交于 2019-12-12 04:13:02
问题 By the title of this question, its easily understandable that, the adapter of recyclerview is not set inside a UI thread. But in my case to avoid that I have tried doing it even on UI thread but still no luck. I am using FirebaseUI for my app. Below is the code snippet: public static void getUserFromUserId(@NonNull DatabaseReference dbRef, @NonNull String userId) { dbRef.child(USERS).child(userId) .addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange

RecyclerView content not using full width of fragment parent

核能气质少年 提交于 2019-12-12 04:11:53
问题 So I have a recyclerview that is within a fragment and when the content is loaded into the recyclerview it does not occupy the full width of the screen. Weird thing is that i am using this code for another project practically the same and there are no issues. The fragment layout is like this <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/windowBackground" xmlns:app=

Create CardView with dynamic custom list inside

馋奶兔 提交于 2019-12-12 04:06:52
问题 I create a RecyclerView with CardViews in my app. Now I want to add inside each CardView a new List of custom Views, with a custom layout (see example Image). When the add button is pressed, there should be insert a new row of this layout inside the card. How do I realize that? In the internet I readed, that a ListView inside the CardView is not possible, because a ListView is scrollable, and there should not be two scrollable Views on the activity (thats what I found..) the red marked row is

How to get other views in same ViewHolder at same position as the onClicked view (use in a RecyclerView Adapter)

巧了我就是萌 提交于 2019-12-12 04:03:34
问题 I have a RecyclerView in my app that displays a row containing pictures and photographs downloaded from the internet. There is a photo and a button on screen. When the user clicks a button, I want to make another view visible on top of the on screen photo. I have a CustomViewHolder that holds all the views for the RecyclerView and a CustomRecyclerViewAdapter that displays the viewholder views. The onClick method for the button is overridden in the CustomViewHolder as below - public static

Recycler NetworkImageView Scrolling back and forward, out of memory and resizing issues

a 夏天 提交于 2019-12-12 03:56:11
问题 I am working to add an image from the gallery horizontally using recycler view as follows. I could able to add images next to each other. The following code works but crashes sometimes because of out of memory concerns. RecyclerViewAdapter , I am calling setSelectedPic method to load the image. @Override public void onBindViewHolder(final ListViewHolder holder, int position) { PostProductImageLIst item = mItems.get(position); ImageUtil.setSelectedPic(holder.imgViewIcon, item.getPath()); }

How to take textview data from recycler view to another activity?

匆匆过客 提交于 2019-12-12 03:52:55
问题 I want to take textview data from recycler view to another activity.I want to take workshop_name TextView to Otheractivity. Here is my code. MechSearchActivity.java public class MechSearchActivity extends AppCompatActivity { List<SearchResponse.WorkshopDataBean> workshopList; RecyclerView recyclerView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.search_mec); recyclerView = (RecyclerView) findViewById(R.id.rv

how to set progress bar when recycler view is clicked

▼魔方 西西 提交于 2019-12-12 03:47:17
问题 I have an app which gets data from json and displays it on recycler view and when each recycler view is clicked it opens a new activity to show full content. all i want to know is how to show a progress dialog befrore the second activity shows thanks. Here is my code public CustomViewHolder(View view, Context ctx, ArrayList<FeedItem> feeditem) { super(view); view.setOnClickListener(this); this.ctx = ctx; this.feeditem = feeditem; this.imageView = (ImageView) view.findViewById(R.id.thumbnail);