Questions tagged [viewgroup]

ViewGroup is a subclass of the Android View class(parent of all Android graphical widgets) which can contain child views.

ViewGroup is the base class for all Android layouts and views containers. This class is designed to be extended so the user can implement his own layout(which arranges the children following the desired logic, one not covered by the standards layouts) or a new view container. More information about the ViewGroup class can be found at the links below:

503 questions
6
votes
2 answers

Android View.bringToFront() causes flicker

I have several Views within a FrameLayout. There is a transition I have written where each view has a custom Animation class applied. During this transition, I need to bring the View at the bottom of the z-order to the front. I do this with: …
sleep
  • 4,855
  • 5
  • 34
  • 51
6
votes
3 answers

Scroll bar to custom ViewGroup

I have CustomComponent class which extends ViewGroup. Source code of CustomComponent: public class CustomComponent extends ViewGroup { private static final String LOGTAG = "CustomComponent"; private List
Natali
  • 2,934
  • 4
  • 39
  • 53
6
votes
1 answer

Getting a reference to the parent ViewGroup

I am creating a scalable shape by adding a shape and handles as separate views to a ViewGroup. Once a handler is clicked, how do I get a reference to the ViewGroup so that I can scale everything? handle.getParent() returns null. My ViewGroup was…
KcYxA
  • 243
  • 1
  • 3
  • 19
6
votes
2 answers

Android: Using FEATURE_NO_TITLE with custom ViewGroup leaves space on top of the window

I am trying to create a custom ViewGroup, and I want to use it with a full screen application. I am using the "requestWindowFeature(Window.FEATURE_NO_TITLE)" to hide the title bar. The title bar is not showing, but it still consuming space on top of…
lgfischer
  • 1,718
  • 3
  • 13
  • 22
6
votes
2 answers

RelativeLayout: align view to child of sibling viewgroup

I'm trying to make a tab bar in android using a RelativeLayout and a RadioGroup that has an indicator which will slide to indicate the active RadioButton within the RadioGroup. These are customized radio buttons that are effectively rectangles with…
Josh Kovach
  • 7,679
  • 3
  • 45
  • 62
6
votes
1 answer

Adding Views to an Android Viewgroup Programmatically

This seems to be a common question yet documentation is very hard to find. I'm looking for examples that show me how to create my own view group (preferably by extending an already existing one) and then add views programmaticly. Thanks.
Matt Gould
  • 83
  • 1
  • 4
6
votes
1 answer

add Dynamic child views vertically to ConstraintLayout

Android ViewGroup has the following methods to add (child) Views: I know we can easily define horizontal/vertical orientation to LinearLayout in xml/programatically and add child views, eg. Similarly with RelativeLayout, we can use ViewGroup's…
6
votes
5 answers

How to bring a view to front without calling bringToFront()?

There is apparently a bug in Android which breaks View.bringToFront. If I have Views arranged in a GridView and want to bring a View to front by calling bringToFront(), it may get moved to the bottom right position in the GridView. Something shady…
Axarydax
  • 16,353
  • 21
  • 92
  • 151
6
votes
2 answers

NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags'

My app was working fine, and I then included the support design library in the build.gradle compile 'com.android.support:design:23.2.1' Android Studio prompted to download more components and after that I started seeing way too many of these…
Arun Anjay Anantha
  • 159
  • 1
  • 2
  • 8
6
votes
5 answers

ScrollView makes a custom layout invisible

I made a custom Viewgroup which i need to use in my application, but i need to put it in a ScrollView. When the layout is made only with my custom ViewGroup everything works fine, but when I put it in a ScrollView i can't see anything. My…
e_ori
  • 845
  • 1
  • 11
  • 29
6
votes
5 answers

Creating a copy of a View?

I have 2 Activities: A,B.Layout of Activity A,has a viewgroup that user changes it's content.In Activity B,I have to show that viewgroup again,without any change,it must be a real copy of that viewgroup,so texts,colors,dimensions,order(of childs)…
Student Student
  • 960
  • 2
  • 14
  • 24
6
votes
1 answer

force onLayout in a subView whose dimensions doesn't change

I have a Custom ViewGroup with some views inside. In response to an event, a requestLayout is called and in OnLayout some of the views will get a new layout position. One of them maintain its position but needs to be rearranged inside. However this…
Luis
  • 1,282
  • 1
  • 11
  • 25
6
votes
5 answers

java.lang.IllegalArgumentException: parameter must be a descendant of this view Error

I have a strange Error with a ViewGroup. For my main View I use classes in this links ViewFlow project java.lang.IllegalArgumentException: parameter must be a descendant of this view at…
Substitut
  • 373
  • 1
  • 3
  • 9
5
votes
1 answer

Add view to already existing xml viewgroup in code

I would like to be able to add a view to an already existing xml layout in code: LinearLayout ll = (LinearLayout) findViewById(R.layout.common_list); TextView tv = new TextView(this); tv.setLayoutParams(new…
Klau3
  • 317
  • 1
  • 2
  • 9
5
votes
2 answers

Inflating XML layout into a custom ViewGroup

I am trying to inflate xml layout into custom ViewGroup. After inflating the layout, ViewGroup only displays the root view of the layout in-fact it should display the full layout file into the ViewGroup. I have gone through the other similar…
Vinod Maurya
  • 4,167
  • 11
  • 50
  • 81