Questions tagged [android-viewgroup]

A ViewGroup is a special view that can contain other views, called children. The view group is the base class for layouts and views containers

223 questions
1
vote
1 answer

Reusable View Groups

Most of the pages in my application have a progress bar implementation. I would like to create a custom view group which always includes a progress bar. For example, Can I create something…
F.O.O
  • 4,730
  • 4
  • 24
  • 34
1
vote
1 answer

How many ViewGroup (LinearLayout, Relative, Grid, etc..) considered too many?

I tried to find an answer for this specific question but I couldn't. I watched a video https://www.youtube.com/watch?v=NYtB6mlu7vA and I got the impression that over using Layouts generally is expensive. Apps like twitter, use complex designs that…
MoGa
  • 635
  • 6
  • 14
1
vote
2 answers

Is it possible to cast View to ViewGroup?

private void scaleAllViews(ViewGroup parentLayout) { int count = parentLayout.getChildCount(); Log.d(TAG, "scaleAllViews: "+count); View v = null; for (int i = 0; i < count; i++) { try { …
MrRobot9
  • 2,402
  • 4
  • 31
  • 68
1
vote
0 answers

How to implement self-filling ViewGroup

I'm trying to implement ViewGroup that estimates the number of child views that it is able to contain and fills itself with the previously estimated number of child views considering size's constraints provided by parent. I overrided…
ghost
  • 87
  • 1
  • 9
1
vote
1 answer

View cannot be cast to ViewGroup in fragment with sliding menu

This Exception occurred in slidingMenu.attachToActivity(this, SlidingMenu.LEFT); line when I try to show some extra information on Mark click. I want to show the content in sliding menu. "this" object refer to MapActivity class(my custom java…
1
vote
1 answer

Correctly layout children with onLayout in Custom ViewGroup

I am creating a custom ViewGroup. I does need to have 2 FrameLayout one above the other; the one that stays to the bottom must be 20dp, while the other one must cover the rest of the view. onMeasure @Override protected void onMeasure(int…
Alberto Dallaporta
  • 1,382
  • 1
  • 11
  • 23
1
vote
1 answer

Performance diff between two view adding approach

What will be the diff in terms of performance of adding views dynamically ( using add/remove view methods of ViewGroup ) or putting them into a static layout xml file and let it be compiled into a binary form and inflated at runtime ( regular way )…
stdout
  • 2,471
  • 2
  • 31
  • 40
1
vote
1 answer

Customize FlippableStackView

I found this library and I'm trying to customize it. What I'm trying to do is to change the swipe from left-right to right left. This is an image of what I want. I also found that others are trying to do the same thing, as you can read here. I…
1
vote
0 answers

How does a RelativeLayout within a custom ViewGroup get its measurement?

While working to create a custom ViewGroup I ran into a problem. I have created a ViewGroup with the following code: import android.content.Context; import android.graphics.RectF; import android.view.View; import android.view.ViewGroup; import…
Wowzer
  • 1,103
  • 2
  • 12
  • 26
1
vote
0 answers

Can't determine the clicked item in android ViewGroup

I am working with ViewGroup . I want to make a click effect on the item of the group so that User can detect which item is currently clicked. Can anyone please help me? private View getSubCategoryListItemView(final SubCategoryItem si, double…
1
vote
2 answers

Android - get percentage of viewable rect

I'm trying to indicate whether a certain view (say - view A) is 100% visible, meaning, if it's a 100x100 view, I want to make sure all 10000 pixels are shown. Sample: -------------- | | | ___ | | |A| | | --- | | …
Daniel
  • 935
  • 2
  • 6
  • 11
1
vote
1 answer

Passing resource id from Activity to initialize custom ViewGroup

This is a followup of my previous question where @pskink adviced me to implement custom ViewGroup that will paint what I need. I succeeded with a prototype using hard coded values. I want to move it to further level where I can pass initialization…
Leos Literak
  • 8,805
  • 19
  • 81
  • 156
1
vote
0 answers

Android Custom ViewGroup add one child before drawing others

I have a custom ViewGroup that contains an ImageView and a few other TextViews that display white text on the image. I would like to draw ONE dark rectangle under all the textviews to improve the contrast. To accomplish this, in the custom…
Stralo
  • 474
  • 4
  • 16
1
vote
1 answer

Relayout children in CustomViewGroup

I have a Custom ViewGroup and I override onLayout method to layout its children. Every time onLayout called just some of children need to be layout. The problem is when I call requestLayout() the children that i don't layout them are shown from last…
1
vote
0 answers

carousel-layout-android library first load issue

I am using "https://code.google.com/p/carousel-layout-android/" in my android application. When it load first time images in carousel are of different sizes, when I scroll all the images till last item, then its images size becomes ok, like center…