android-recyclerview

Margin between items in recycler view Android

五迷三道 提交于 2020-04-29 06:07:21
问题 Hi I am Following this tutorial: http://www.journaldev.com/10024/android-recyclerview-and-cardview-example-tutorial Now I am facing a weird issue the margin between each CardView item inside RecyclerView is way too much. ISSUE How to reduce the Margin between each item of CardView placed inside RecyclerView ? 回答1: I faced similar issue, with RelativeLayout as the root element for each row in the recyclerview. To solve the issue, find the xml file that holds each row and make sure that the

java.lang.RuntimeException: Adding window failed please give me solution

我的梦境 提交于 2020-04-27 10:24:00
问题 from two days i has been find the solution for this exception please anybody can give solution for this problem . in this current activity we used the recyclerview 1000+ items . java.lang.RuntimeException: Adding window failed Caused by: android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died this is constructor of recycler Adapter class Recycler_Adapter_one_line(Context context, Activity activity, FragmentManager fragmentManager,SQLiteDatabase

java.lang.RuntimeException: Adding window failed please give me solution

痴心易碎 提交于 2020-04-27 10:16:42
问题 from two days i has been find the solution for this exception please anybody can give solution for this problem . in this current activity we used the recyclerview 1000+ items . java.lang.RuntimeException: Adding window failed Caused by: android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died this is constructor of recycler Adapter class Recycler_Adapter_one_line(Context context, Activity activity, FragmentManager fragmentManager,SQLiteDatabase

How can we have searched characters colored when we use searchview in recyclerview?

笑着哭i 提交于 2020-04-24 07:54:09
问题 I have a recyclerview and I want to search in it with help of searchview. I want my searched characters to be colored and be specific. I am programming with Kotlin. 回答1: After a hard effort I found the answer myself. I use a function like this: fun colorsearch(a:String,charText: String):SpannableStringBuilder{ var l = 0 var b:ArrayList<Int> b = ArrayList() var w = 0 var i = 0 if (charText!=""){ label@ while (i < a.length) { var j=0 while (j<charText.length){ Log.v("abc", j.toString()) if (i =

Change text color of only selected item on RecyclerView android Kotlin

一世执手 提交于 2020-04-18 05:45:45
问题 class CustomeAdapterForTopics( val ctx: Context, var clickListener: OnTopicClick, val items: ArrayList<ModelForTopics> ) : RecyclerView.Adapter<TopicViewHolder>() { override fun onBindViewHolder(holder: TopicViewHolder, position: Int) { val user: ModelForTopics = items[position] holder.textViewName.text = user.name holder.initilise(items.get(position), clickListener) // if() { // holder.textViewName.setTextColor(Color.parseColor("#FFA07A")); // // // } else { // holder.textViewName

Preserve view with data of recyclerview list in NavController Fragments

旧巷老猫 提交于 2020-04-18 05:30:48
问题 What approach should be taken to preserve (data & view rendering) of recyclerview list in 2 tabs present within a fragment, which is part of androidx.navigation NavController ? Activity --> Fragment A --> Fragment B (with 2 tabs) --> Fragment C (and back till activity) Each tab of Fragment B has accordion type view (multiple active), made from 1 ParentRecycler view & ChildRecycler view (number of parent recycler view times) (The recycler view list are not bound to change on previous next

Preserve view with data of recyclerview list in NavController Fragments

▼魔方 西西 提交于 2020-04-18 05:29:27
问题 What approach should be taken to preserve (data & view rendering) of recyclerview list in 2 tabs present within a fragment, which is part of androidx.navigation NavController ? Activity --> Fragment A --> Fragment B (with 2 tabs) --> Fragment C (and back till activity) Each tab of Fragment B has accordion type view (multiple active), made from 1 ParentRecycler view & ChildRecycler view (number of parent recycler view times) (The recycler view list are not bound to change on previous next

ConstraintLayout does not have a NavController set for item clicked on RecyclerView

拥有回忆 提交于 2020-04-18 02:40:27
问题 When I click on an item, sometimes it works and sometimes it crashes. Below is the FATAL EXCEPTION after clicking on an item. 2020-03-31 21:59:18.087 15383-15383/com.aliton.myapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.aliton.myapp, PID: 15383 java.lang.IllegalStateException: View androidx.constraintlayout.widget.ConstraintLayout{b3bb13b V.E...C.. .......D 0,336-720,518} does not have a NavController set at androidx.navigation.Navigation.findNavController(Navigation.java:84) at

Recycler View Item flip

社会主义新天地 提交于 2020-04-18 01:21:54
问题 Actually I am using recycler view and adding a layout in the rows and I am using flip animation on cardviews(when clicked on it). The problem is when I add multiple items in the recycler the flip animation works only with the first item. I used toast to make sure that click function is working with other items or not, turns out it's working but flip animation is not working with any other items.Can any one help me out here This is my code override fun onCardClick(item: PacketModel, position:

NullPointerException in RecyclerView espresso test on hdpi device

馋奶兔 提交于 2020-04-17 22:53:27
问题 I have the following test written for RecyclerView @Test fun testHomeActivity_recyclerViewIndex0_configurationChange_displaysWelcomeMessageCorrectly() { launch(HomeActivity::class.java).use { onView(isRoot()).perform(orientationLandscape()) onView( atPositionOnView(R.id.home_recycler_view, 0, R.id.welcome_text_view ) ).check(matches(withText(containsString("Welcome")))) } } It gets passed successfully on my real device, but gets failed on Nexus S hdpi emulator device. With the following error