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
4
votes
1 answer

Android: custom views get drawn at wrong x,y coordinates

I'm trying to create a custom view, inherit from view group, and layout custom sub-views inside this view group in a customized way. Basically I'm trying to create a calendar view similar to the one in outlook, where each event takes up screen…
user884248
  • 2,134
  • 3
  • 32
  • 57
4
votes
2 answers

ViewGroup Animation Not Working

I'm trying to do an easy translation animation in Android. The following doesn't work: public class MyView extends ViewGroup { ... TranslateAnimation animation = new TranslateAnimation(0, 0, 0, -500); animation.setDuration(300); …
MrGrinst
  • 970
  • 3
  • 9
  • 20
4
votes
1 answer

Close reward video ad in Android

I am designing an app that includes a rewarded video before giving the player another life. For user experience and engagement, I want to ensure that this rewarded video is closed after 30 seconds and the user is taken back to the app. We are using…
Adam Link
  • 2,783
  • 4
  • 30
  • 44
4
votes
1 answer

Draw bitmaps on top of the Navigation bar in Android

In my application, I need to draw a bitmap on top of all the apps running. I created a view which is invisible and overlays on top of all the apps. with this overlay view I can draw bitmaps at the given position , But I am unable to draw the bitmap…
sash
  • 1,124
  • 2
  • 15
  • 32
4
votes
2 answers

How can I make an android ViewGroup and all its child Views dynamically maintain equal width based on the widest child?

I want my android layout to behave like so: Suppose SomeLayout is a parent of Widget1, Layout2, and Widget2, which are displayed in that order from top to bottom, like…
FireWingLead
  • 439
  • 6
  • 19
4
votes
0 answers

Android's viewGroup.removeAllViews() is extremely slow, any alternative?

Traceviewing my code in ddms I found out that ViewGroup.removeAllViews() seems pretty slow when applied to a linearlayout (1sec for 40 items). Is there any alternative to empty my layout? details: ViewGroup.dispatchDetachedFromWindows () V…
Simon
  • 193
  • 1
  • 9
4
votes
2 answers

Dynamically hide a viewstub when a new one is created

I made a viewstub that is inflated and created again many times. The layout it uses includes a "delete" button that hides the viewstub (or deflates it). When I'm creating a new viewstub I call this code: ViewStub eventStub = new ViewStub(this); …
user1889890
4
votes
0 answers

Merging ImageView to a single Bitmap image (Android)

I have more than one ImageView that I am adding dynamically into a layout class that extends ViewGroup, there is one for the background, and more than one other ImageView that are draggable on top of the background. I want to merge those ImageView…
Jean-Paul Manuel
  • 546
  • 2
  • 12
  • 29
4
votes
1 answer

Android, How to set animation listener for view group?

I have an image view which acts as menu. When user click it a view group (including 5 other image view) will slide from left to right. When user click on menu again view group slides from right to left. I can simulate this behavior but after…
Hesam
  • 52,260
  • 74
  • 224
  • 365
3
votes
2 answers

Custom Relative Layout scaling?

I am trying to make Custom RelativeLayout which can scale and scroll. Right now I have tried to achieve scale. Now I have made the custom Relative layout as parent layout of another relative layout which contains touchable Imageview as its child.…
user1169079
  • 3,053
  • 5
  • 42
  • 71
3
votes
3 answers

Android StackOverflowError in ViewGroup.resetResolvedTextDirection when adding ListView to LinearLayout

I had asked one question about this error before (Android StackOverflowError in ViewGroup.resetResolvedTextDirection), however now I managed to reproduce the error in the emulator and narrowed down the specific place where this problem occurs. When…
Aleks G
  • 56,435
  • 29
  • 168
  • 265
3
votes
1 answer

Adding a ViewGroup to a ViewGroup

I would like to be able to programmatically add a viewgroup to another viewgroup. Both have been defined in xml as follows, along with my onCreate method: main.xml:
frazer
  • 426
  • 2
  • 6
  • 18
3
votes
1 answer

behaviour of addViewInLayout() of ViewGroup in android

I am creating custom ViewGroup in which I am using onLayout method in which I call the addViewInLayout() of the ViewGroup but it is adding the View only horizontally. How to force it to add View vertically like ListView is doing for Android Looking…
Deepak Goel
  • 5,624
  • 6
  • 39
  • 53
3
votes
3 answers

Animate GridView Children

I was wondering if there is a way that I can animate my GridView's Children to their new positions. So, for example, slide in from the left and when at the end of a row, slide off to the right. This will give the effect of each child moving to its…
Mimminito
  • 2,803
  • 3
  • 21
  • 27
3
votes
1 answer

How to populate a compound viewgroup extending from LinearLayout?

I am trying to create a compound viewgroup after inflating the group from an XML file. The viewgroup is composed as: A LinearLayout Root, 2 child LinearLayouts. I am able to see the layout correctly in the layout editor; however, when I attempt to…