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
3
votes
2 answers

Android button on top of Camera preview

I would like to add button on Android CameraPreview. Basically the hierarchy is following: Activity ViewGroup SurfaceView ViewGroup is wrapper around SurfaceView and centers CameraPreview. My current code in Activity.java is working (without…
skornos
  • 3,121
  • 1
  • 26
  • 30
3
votes
1 answer

Android drag drop multiple textviews

I'm currently making an android application for the game battleship. I have made model classes for my ships in the form of a viewgroup with multiple textviews in this viewgroup (4 for battleship, 2 for submarine and so on) My field consists of a…
3
votes
1 answer

Does addView() invoke onMeasure() for all childs?

does adding a child to a ViewGroup (via ViewGroup.addView() ) automatically invoke onMeasure() for all childs?
user2224350
  • 2,262
  • 5
  • 28
  • 54
3
votes
2 answers

android ViewGroup height can't be wrap_content

lots of button will be added in my viewgroup, so I need my viewgroup'height is wrap_content, but whatever I set height in code or xml, it doesn't work, the viewgroup'height always match_parent, so what's wrong with it? how can I set the height is…
Mejonzhan
  • 2,374
  • 1
  • 20
  • 30
3
votes
0 answers

Android RelativeLayout addrule not working while adding inflated views

I am inflating a xml file to a custom view and adding it to a Relative Layout. While adding the custom views to Relative Layout i am setting some rules using the addRule method. But the views are always getting added at top left corner, am i missing…
3
votes
2 answers

How to get child views of a ViewGroup in Android?

I have to get child views of WebView. For some text manipulations, I wonder if there is a way to set attributes of child views, for example: View[] childs = webView.getChilds; View ch = childs[0]; ch.setText("manipulated text");
Hossein POURAKBAR
  • 1,073
  • 2
  • 15
  • 33
3
votes
0 answers

Android: How to scroll the Extended adapterview or viewgroup

Following up this Extending AdapterView I know this can be achieved by this SO post PLEASE NOTE: Trying to understand the how listview and Gallery scrolls & reuses the view. How to scroll the Custom ViewGroup/AdapterView? On going through source…
Mani
  • 2,599
  • 4
  • 30
  • 49
3
votes
1 answer

Passing LayoutParams to ViewGroup not working

I have my own layout public class MyLayout extends ViewGroup Inside that Layout I put some buttons. That works fine. But I trie to add LayoutParams ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(80, 80); Button btn = new…
user1324936
  • 2,187
  • 4
  • 36
  • 49
3
votes
1 answer

Android: Inflating multiple .XML and objects onto one single .XML

Object: (Running API 8) Programmatically, I am trying to inflate the following onto a single layout, main.xml bg_content1.xml bg_content2.xml @+id/img_logo @+id/str_username Note: @+id/img_logo is an id of an ImageView located in…
melvynkim
  • 1,655
  • 3
  • 25
  • 38
3
votes
2 answers

Force custom ViewGroup children type and count

I am making a Custom Layout Android component by extending abstract class ViewGroup (as per this video tutorial by Romain Guy on Parleys.com : http://www.parleys.com/#st=5&id=2191&sl=1). My component should contain children, but I want to restrain…
Francois Zard
  • 341
  • 3
  • 11
2
votes
1 answer

how to fold view from middle in android?

I am learning android and trying to create an effect of folding the view from middle like one in the linked video. http://vimeo.com/37254322 Can anybody give some guidance or point to the right resource. Current android allows to flip the complete…
Kamil Dhuleshia
  • 317
  • 2
  • 3
  • 12
2
votes
0 answers

Custom Viewgroup that can handle Zoom and Scroll

I want to make custom Relative Layout which can handle Zoom and Scroll both. Any good example where i can learn about the Custom RelativeLayout which does the same or little. Thanks for the help.
user1169079
  • 3,053
  • 5
  • 42
  • 71
2
votes
1 answer

View on click should redraw on it's canvas

I'm currently drawing a map that contains hexagons as it's nodes I made a NodeView class to have the image drawn on a Canvas when called. (you can see this image to see the hexagon layout) Every node has it's own NodeView (since each of them have…
2
votes
1 answer

how to add view to viewgroup?

I have a bitmap from a camera shot on my sdcard. i have created a viewgroup which i set as a view to my activity. i'd like create a view programatically, and set the bitmap to the view, then add the view to the viewgroup and display. everything…
turtleboy
  • 8,210
  • 27
  • 100
  • 199
2
votes
1 answer

How to use Scroller in ViewGroup (android)

I have a custom ViewGroup and would like to add scrolling ability to it. Is it possible to use a Scroller object and link it up with view group? I have read somewhere that Scroller does not do any actual scrolling. That means it must be delegating…
resp78
  • 1,414
  • 16
  • 37