expandablelistview
How to disable the collapsing of an ExpandableListView?
You can define a OnGroupClickListener which returns true, like so: expandableList.setOnGroupClickListener(new OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { return true; // This way the expander cannot be collapsed } });
GridView inside Expandable list in android
I’ve done tons of searches my own for solving this situation, but didn’t find anything so far, so i’ve made a workaround. This workaround assumes that you know / can retrieve the width of your columns, and the height of your grid cell renderers (the dp size set in your layout xmls). You should insert … Read more
Expand ListView item with animation
I think I was looking for the same as was asked, I was looking for a way to animate the expanding of the listview item as some new content is shown (I was just changing the visibility on some views from GONE to VISIBLE). I had used the answer by mirroredAbstraction to help me apply … Read more
Android setOnCheckedChangeListener calls again when old view comes back
What version of Android are you using? It seems to be an issue for multiple components, especially with a checkedChange() method (CheckBox, RadioButton) and I can’t provide a good explanation why it is happening. I would assume because it registers the change of the position state and grabs the change of other properties? A similar … Read more
Put on the right the indicator of an ExpandableListView in Android
I don’t know a way to do that from XML but i’ll tell you a way to do so dynamically in your adapter. First you have to remove group indicator from your xml <ExpandableListView […] android:groupIndicator=”@null” /> Then in your layout of the parent add an imageview in the right position of your layout. Then … Read more
How to create Expandable ListView in Flutter
Try this: import ‘package:flutter/material.dart’; void main() => runApp(MaterialApp(home: MyApp(), debugShowCheckedModeBanner: false,),); class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { @override Widget build(BuildContext context) { return Scaffold( body: ListView.builder( itemCount: vehicles.length, itemBuilder: (context, i) { return ExpansionTile( title: Text(vehicles[i].title, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold, fontStyle: FontStyle.italic),), children: <Widget>[ … Read more
ExpandableListView Group View Expand Default
Now I got solution and it will work perfectly.. Please use this.. ExpandableListView Exlist; Exlist.expandGroup(0); Exlist.expandGroup(1);
Android: ClassCastException when adding a header view to ExpandableListView
Ok, I figured this one out. I got rid of the runtime error by programatically setting the View’s LayoutParams to ListView LayoutParams, like so: headerView.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.FILL_PARENT, ListView.LayoutParams.WRAP_CONTENT)); before adding the view. The reason being is found in the Android docs: http://developer.android.com/reference/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams) which states that: These supply parameters to the parent of this view specifying how … Read more
Show only one child of expandable list at a time
Just to confirm bos’s answer in code: expandableList.setOnGroupExpandListener(new OnGroupExpandListener() { int previousGroup = -1; @Override public void onGroupExpand(int groupPosition) { if(groupPosition != previousGroup) expandableList.collapseGroup(previousGroup); previousGroup = groupPosition; } });