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
16
votes
7 answers

Fullscreen in WindowManager

This is my code: params = new WindowManager.LayoutParams( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, …
15
votes
1 answer

stackoverflow error on view drag drop update

I am using ondragListener for view drag . My root is viewgroup with more viewgroup containers into the root and am adding views like imageview/textview inside the containers . If I use the only container(ViewGroup) like linearlayout for drag and…
Night Owl
  • 211
  • 2
  • 6
14
votes
2 answers

Activity.addContentView(View) == ViewGroup.addContentView(View)?

I have a question regarding Android Activitys: An Activity has the Method addContentView(View) while a ViewGroup has a (similar?) addView(View) Method. Unfortunately its undocumented where the View from addContentView is placed. Is it like a…
Rafael T
  • 15,401
  • 15
  • 83
  • 144
14
votes
1 answer

android make custom layout shape

I'm trying to make custom ViewGroup layout shapes, that the layout be star or heart, triangles or even make the lines diagonal. So the the goal is to make collage view for two or more ImageViews. Could someone give me a library or a way to do this…
Marwan Zakariya
  • 489
  • 6
  • 22
13
votes
3 answers

How do you animate a change in a view's padding?

I want to animate the change in the padding of a view. The resting place of the translation animation is the same as the padding I want to apply. TranslateAnimation moveleft = new TranslateAnimation(Animation.ABSOLUTE, 0.0f, …
Tevin J
  • 641
  • 2
  • 11
  • 15
12
votes
2 answers

ViewGroup finish inflate event

I have created a custom layout which extends ViewGroup. Everything is working fine and I am getting the layout as expected. I want to dynamically change an element in the layout. However this is not working as I am calling it in onCreate and till…
PravinCG
  • 7,688
  • 3
  • 30
  • 55
11
votes
4 answers

My app crashes when using addView()

Im a noob at android. My app keeps crashing whenever I use ViewGroup addView() method but works when I use the Activity addContentView() method. The reason I want to use addView() instead of addContentView() is that I want to be able to remove the…
kredj
  • 235
  • 1
  • 5
  • 13
10
votes
7 answers

Android View and ViewGroup

In Android ViewGroup inherits from View. A ViewGroup is a container which holds Views. ViewGroup (LinearLayout) View (TextView) Why did folks at Android defined this relationship as Inheritance instead of composition. As the ViewGroup contains…
Vinoth
  • 5,687
  • 11
  • 44
  • 56
10
votes
3 answers

Can onMeasure be skipped when adding a View to a ViewGroup?

Answered I have a RelativeLayout where I am adding views dynamically as the user scrolls vertically or horizontally. I have rolled my own ViewRecycler since there is potentially thousands of views that could compose the whole of what can be…
Kelly Merrell
  • 1,245
  • 1
  • 10
  • 16
10
votes
0 answers

Use of Constraint Layout for developing TV android Apps

I want to know why android developer documentation is recommending to use view groups such as Relative Layout or Linear Layout to arrange views for developing TV Android Apps and not the current standard i.e. Constraint Layout. Is there any specific…
10
votes
3 answers

Android - View.requestLayout doesn't work in OnLayoutChangeListener

I have to use the GridLayout for my application. The problem of GridLayout is the limitation of weight so I must scale its children size at runtime. I do this by the help of an OnGlobalLayoutListener. The children of my GridLayout are two Buttons…
Barock
  • 427
  • 1
  • 4
  • 12
10
votes
3 answers

RemoveView not working

I'm having an unusual error. I have this inside a custom viewgroup. The method receives a view and add it to the layout but i keep getting the same error: if((ViewGroup)view.getParent() != null){ …
nunoh123
  • 1,087
  • 1
  • 10
  • 17
9
votes
2 answers

how to add a pin marker on image view in android

i am working on a project where i need to add pins on image view as shown in below image. how could we do this. i successfully created a zoomable image view using TouchImageview.java class TouchImageView extends ImageView { Matrix matrix = new…
Deepak Swami
  • 3,838
  • 1
  • 31
  • 46
9
votes
1 answer

Set GestureDetector to all child views

I would like to add a GestureDetector to all views (view groups) of an activity without assigning it manually to every single view. Right now onFling() is only activated when swiping over the background but not when swiping on e.g. button1. package…
Paradiesstaub
  • 2,590
  • 2
  • 18
  • 28
8
votes
1 answer

Programmatically add fragments to viewgroup

basically this is my app(idea) for a tablet landscape orientation: Two Fragments, left fragment is a listfragment populated by a resource.xml file (Got that working). Right fragment is supposed to dynamically change fragment and layout based on…
Killerpixler
  • 4,200
  • 11
  • 42
  • 82
1
2
3
33 34