Questions tagged [android-viewgroup]

A ViewGroup is a special view that can contain other views, called children. The view group is the base class for layouts and views containers

223 questions
0
votes
0 answers

Android set view position inside a viewgroup

I have a rank of players in a viewgroup displayed programmatically. A player has a class and a method to show it inside the viewgroup: public void show(Activity a, ViewGroup container) { LayoutInflater inflater = (LayoutInflater)…
geggiamarti
  • 129
  • 1
  • 12
0
votes
1 answer

How to handle "Unable to start activity java.util.ConcurrentModificationException"

After updating my app, crashlytics started reporting this issue. with this logcat androidx.activity.ComponentActivity.onCreate (ComponentActivity.java:149) androidx.fragment.app.FragmentActivity.onCreate…
0
votes
0 answers

Replacing specific fragment by using fragment transaction

In Android, I have added several fragments in Linear Layout by using Fragment Transaction. Is there any specific way by which a specific fragment in the Linear Layout can be replaced and not all of them? We can remove any fragment by using the…
0
votes
0 answers

Center ViewGroup views with Android-DraggableGridViewPager

I want to thanks zzhouj first of all, but I'm trying to use his Android-DraggableGridViewPager with some errors. this is his class: Android-DraggableGridViewPager RAW This is my layout:
0
votes
1 answer

view group similar to chip group

Is there a View group similar to a chip group that just takes normal views? I'm essentially after a kind of grid recycler view that doesn't scroll and instead just takes available space like a bunch of horizontal linear layouts inside a vertical…
martinseal1987
  • 1,862
  • 8
  • 44
  • 77
0
votes
1 answer

How to replicate a ViewGroup n times in another ViewGroup but with different values for Views?

I am working on an Android application in which I have to create a card with multiple TextView and ImageView inside it. But these views are replicated multiple times in the card with different images and text (The attached picture summarizes my…
Abdul Mateen
  • 1,418
  • 1
  • 14
  • 32
0
votes
2 answers

ViewGroup set all item width to maximum required by the child

I want to set all my children present inside my Linerlayout to have equal width base on the maximum width required to display the longest child view.
BalaramNayak
  • 1,295
  • 13
  • 16
0
votes
2 answers

The specified child already has a parent. Console says must call removeView() on the child's parent first

I see all questions and answers about this error but I can't solve this. @Override public View getView(int i, View view, ViewGroup viewGroup) { View v = view; ViewHolder holder; if (v == null) { v =…
CompEng
  • 7,161
  • 16
  • 68
  • 122
0
votes
0 answers

Drag select like in RecyclerView for LinearLayout

I would like to implement DragSelect feature in LinearLayout. For RecyclerView it already exists for example: here But in LinearLayout it gets more complicated. Because onTouch events. The use case would be for day selection. This is a Custom class…
0
votes
0 answers

what is the difference between AddView() and View.Draw()?

What is the difference between AddView() (adds views to the layout) and View.Draw() (adds view to the canvas) methods, they both add views to the view in the layout, is there any performance difference between the two? I have a situation where i can…
0
votes
0 answers

How to force canvas drawn views to be in an exact dimension?

I'm trying to force a drawn view to be in an exact dimension. No matter how I try it ignores the dimensions. Code: My view to be drawn in 250x250 pixels: public class MyCustomView extends View { public MyCustomView(Context context) { …
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
0
votes
1 answer

Add view to ViewGroup only if there is enough space left

I have scrollable horizontal RecyclerView filled with same size items. I need to change behaviour of that ViewGroup and have 4 requirements: not scrollable as many items as space left (all items needs to be displayed with full size) if there is…
0
votes
1 answer

Views inside a linearlayout are not correctly displayed after re-initializing them programmatically

I have a linear-layout "draggableBallsContainer" that includes 10 vertically-aligned balls which can be dragged and dropped. After dragging and dropping some of the balls into another layout, I want to re-initialize "draggableBallsContainer" by…
hba
  • 13
  • 3
0
votes
1 answer

How to structure Android views in xml logically

I want to put view elements that belong together in a container (e.g. a label and input field). This is useful for example to show/hide these elements all at once. The container, however, is only to group them logically, i.e. I don't want to change…
mihca
  • 997
  • 1
  • 10
  • 29