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

How to properly get a View from a ListAdapter?

How do I properly use ListAdapter.getView(int position, View convertView, ViewGroup parent) method? I'm having trouble finding out what the ViewGroup expect. From what I get: position is the element number that i want convertView is the View that…
GustavoAndrade
  • 247
  • 3
  • 15
2
votes
2 answers

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

I'm getting multiple crashes with this message parameter must be a descendant of this view from various Redmi devices. I have read similar questions on stackoverflow but I couldn't understand their solutions. As these logs don't include the activity…
Sujith S Manjavana
  • 1,417
  • 6
  • 33
  • 60
2
votes
1 answer

Change text of TextView in PopupWindow not working

I'm having problems dynamically changing the text in a TextView in a PopupWindow in Android. I've referenced the TextView element inside the PopupWindow by using a LayoutInflater and ViewGroup but the text is not updating. Any help would be very…
BGM
  • 125
  • 1
  • 1
  • 7
2
votes
1 answer

ViewGroup onLayout Problem

I have a problem with my custom ViewGroup. I layout 3 of the children in a row and use a Scroller to scroll to the middle child. Based on the touch input of the user I change the children that should be displayed and request a new layout. Then I…
dbrettschneider
  • 3,173
  • 1
  • 29
  • 28
2
votes
2 answers

What is causing the 'cannot access ViewGroup ... class file or android.view.ViewGroup' error?

Problem: I'm not exactly sure why I'm receiving an error on my AddNote.java class. This was working before and I see the XML activity is still linked to the class. In fact, this AddNote is nearly identical to the EditNote class and activity, which…
svstackoverflow
  • 665
  • 6
  • 19
2
votes
1 answer

Mask touch gestures - android

OK lets make this basic, I have three pages(viewgroups) which I can scroll through like the home screen. On one of the pages is a gallery. Now the problem is any swipes on the gallery case the pages to change to. Is it possible to restrict trouch…
Koded101
  • 375
  • 4
  • 11
2
votes
2 answers

Custom viewgroup with animated view

I made a custom viewgroup, and I need to use view animation to rotate some views... But they are misbehaving, no matter if I put the startanimation inside onDraw, onLayout or onMeasure, my views flicker (you see them briefly rotated, and then…
speeder
  • 6,197
  • 5
  • 34
  • 51
2
votes
1 answer

adding view programmatically blocking the main thread

There is a flexboxlayout in my UI and I want to dynamically add textviews to it. Please find the code below. private void addOption(String option) { new Thread(new Runnable() { @Override public void run() { TextView…
Anjula
  • 1,690
  • 23
  • 29
2
votes
1 answer

How to Add a Child View to the Center of a ViewGroup

I have created a custom circular ProgressBar following this. Now I want to add this progress bar to the center of my layout. The problem is that it is added to the top left of the activity, no matter how I change LayoutParams attributes passed to…
Mehdi Haghgoo
  • 3,144
  • 7
  • 46
  • 91
2
votes
2 answers

How to add Layout on top of another Layout?

My English is poor. So I threw off the video. I think any programmer looking at this will understand the reason. Thank you in advance I want to learn how to use ReleaseativeLayout correctly, because ConstainLayout is very buggy. Even using it in…
Prost
  • 169
  • 1
  • 7
2
votes
2 answers

Create ViewGroup of ImageView and TextView and display it in FlowLayout Programmatically - Android

I have a Flow layout that display 4 objects for row, but I need display these 4 objects with a textview below each one of them. But it display 2 images and 2 textview, and junp to another row. I tryed to create a ViewGroup to display them together,…
2
votes
1 answer

Can you determine which child view was touched when handling the event in the ViewGroup?

Consider this hypothetical hierarchy... LinearLayoutA <-- I want to handle the touches here... | +-SomeViewX +-SomeOtherViewY +-LinearLayoutB | +-CustomView1 <-- for these three CustomView objects +-CustomView2 …
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
2
votes
0 answers

How I can get the child of a ViewGroup in Cordova with findViewById()?

i have a cordova application and create one FrameLayout and add this to the Parent View. cordovaParent = (FrameLayout) cordova.getActivity().getWindow().getDecorView().findViewById(android.R.id.content); Here: private void addFramelayout(int…
Tarasov
  • 3,625
  • 19
  • 68
  • 128
2
votes
1 answer

ViewGroup How to get child view by location (x, y)?

I am making CustomLayout which can contain some child views. These child views may be overlapped each other. These child view's transform matrix be modified via setRotation setScale etc. How we can get a child by local location (x, y)?: class…
Niza
  • 25
  • 5
2
votes
1 answer

Draw in front of certain child views

I have a ViewGroup that consists on a header and a circle of menu items. Basically I have a closing/opening animation where my item views go behind the header view. Since all views have transparencies, when the item views go behind the header view,…