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
1
vote
1 answer

Got error IllegalStateException: already recycled once at ViewGroup.java class?

Why IllegalStateException occur? (already recycled once) This exception is coming from ViewGroup.java class and is unable to resolve that error. And this crash did not occur in my device but the In users phone app crashes with a given…
Yaqoob Bhatti
  • 1,271
  • 3
  • 14
  • 30
1
vote
3 answers

create View with curved edge and rounded corners in android

I am trying to make a custom view in android like in the picture with curve edges and rounded corners. How to achieve this?
1
vote
3 answers

ImageView image not appearing in ViewGroup

I have an ImageView as a child of a ViewGroup that is part of a GridView. The drawable of the ImageView does not appear, however I can see the background color, and if I use the drawable in setBackgroundDrawable instead, it is displayed. I've tried…
Dave
  • 168
  • 1
  • 17
1
vote
1 answer

Adding a layout to a Viewgroup.

My issues is the following I'm trying to add a layout to a viewgroup my code goes like this: View Dyn = (View) findViewById(R.id.lca1); ViewGroup Layout1 = (ViewGroup) findViewById(R.id.l1); View inflatedView = View.inflate(this, R.id.lcar1,…
MR Mido
  • 1,618
  • 4
  • 25
  • 35
1
vote
0 answers

Zooming a ImageView in a ViewGroup

I have different ImageView in a ViewGroup. Every ImageView has onTouch event like this: public boolean onTouch(View v,MotionEvent event){ ImageView view = (ImageView)v; // Dump touch event to log dumpEvent(event); //…
franzisco
  • 11
  • 1
1
vote
2 answers

Tracing a MotionEvent in a ViewGroup

I have a class extends ViewGroup and want to get every MotionEvent from it. So far I have this: class TestViewGroup extends ViewGroup { public TestViewGroup(Context context) { super(context); } @Override public boolean…
Brian
  • 7,955
  • 16
  • 66
  • 107
1
vote
1 answer

Animating a ViewGroup without animating child views

I have been having a lot of trouble lately trying to get my custom ViewGroup to animate (scale/translate animation) independently it's child views. Worth noting is that my custom ViewGroup is visible and not just a container, thus the need to…
Emil Sjölander
  • 1,773
  • 4
  • 19
  • 27
1
vote
1 answer

Android custom expandable/collapsable view with child elements

I am working on a custom expandable view in android. The goal is that I can add child elements in the xml files and they will be expanded and collapsed when the user clicks the expand/collapse button as on the picture below. The…
dagoston93
  • 57
  • 8
1
vote
1 answer

Animate viewgroup without animating children

i have built a custom viewgroup and m beginning to implement animations tot his viewgroup. the problem i am having is that i need the viewgroup to be able to animate without it's children being animated by the same animation. Lets say i am scaling…
Emil Sjölander
  • 1,773
  • 4
  • 19
  • 27
1
vote
0 answers

How to inflate RelativeLayout in custom ViewGroup

I have a custom animated ViewGroup (based heavily on SlidingTab). In my app, I've stripped this down to just a single TextView that behaves just like the SlidingTab (the slider on your lock screen). This works great, but the TextView that slides is…
1
vote
1 answer

Android Resizing another view in an onlayout method

I got this problem : I have a custom viewgroup that handles a surfaceview on which I render the camera preview. On the onLayout method, I resize this surfaceView to correctly display the camera. This custom viewgroup is in a relative layout behind…
timelzayus
  • 73
  • 2
  • 4
1
vote
1 answer

Is there any way to convert a ViewGroup into a button for accessibility?

I have a custom view with four Textview inside a constraint layout. The problem is that i´m implementing accessibility, and this view must be a child of some kind of button, to inherit the behavior of "..., Button" sayd by Talkback. Is there a way…
1
vote
0 answers

Trying to add ViewGroup into Linear layout of different activities

I'm trying to add ViewGroup into Linear layout after adding that into the previous activity's layout but getting the exception of IllegalStateException. Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must…
1
vote
1 answer

Add button dynamically to fingerpaint android api demos

Now i would like to add button dynamically in FingerPaint api demos. But the problem is that i ain't familiar with creating layout dynamically in java file. does somebody know how can i implement this class to add buttons in title bar? Any code…
geekmyo
  • 179
  • 4
  • 19
1
vote
1 answer

How do you set layout_width/height from View constructor

Within a RecyclerView, I'm creating new CustomViews and then setting their Layout Parameters, like so: @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { CustomView customView= new…
Tobiq
  • 2,489
  • 19
  • 38