A tag for questions related to building and using custom graphical widgets on the Android platform.

learn more… | top users | synonyms

0
votes
3answers
44 views

getWidth() and getHeight() for custom view give wrong values [duplicate]

I've got a Custom View where I draw a grid onto a canvas. I want the grid to be drawn so that the outer edges of the grid coincide with the edges of the device screen. I use the getWidth() and ...
0
votes
0answers
7 views

How to redraw just a part using android view default canvas

i have a custom drawing view, when i draw a new stoke etc., the new stroke is added , then the view is redraw, it will do a for loop on all objects to redraw and reject objects that don't have ...
1
vote
0answers
15 views

Playing music in onFocusChangeListner()

I am Trying to Play/pause music when my custom View looses focus(when LockScreen Button is Pressed) i tried to implement onFocusChangeListner(), This code is working fine when activity gets created ...
0
votes
0answers
22 views

Set value of enum in xml from resource

I am building a custom attribute for a custom view which is an enum type. I know that every optional value must be with a name and value. I want that the value will be given from another resource as ...
0
votes
0answers
16 views

How to implement pan boundaries for custom view

I am trying to put pan/scroll boundaries on a custom view that I have made. My custom view is essentially a grid of lines drawn onto the canvas in the onDraw method. Panning itself works fine and is ...
-5
votes
0answers
25 views

How to show custom checkbox on top left corner of thumbnail image in android [closed]

how to show thumbnail image of person with custom checkbox on top left corner of thumbnail image in listview android.
0
votes
2answers
25 views

Custom View with custom xml attribute: How to refeference a layout

does anybody know, how to get a referenced xml layout, programmatically (in code) for my custom widget. I have already created a custom declare-styleable, with my desired attributes and I know how to ...
1
vote
1answer
26 views

How to check if an attribute is a Dimension, Integer or Resource ID

I'm trying to make a relatively simple custom view where, depending on the location of the code, the XML describes a discrete value ("100dp") or a resource value ("@dimen/standardWidth"). I'm not ...
2
votes
1answer
41 views

How to extend a complex Android view like the GridView?

Background: I'm looking for a way to extend the GridView I need implement a col- and row-span like in HTML. I have hunderds of elements so I cannot use e.g. a TableLayout. However that would be too ...
0
votes
0answers
17 views

Is it possible for a custom view, intended to slide over the main activity, to partially show itself, while the main activity is in focus.

I want a view which is partially visible on the main activity and if we click on it, it slides up and shows up completely. Something like "click to show details". One workaround I have thought of is ...
0
votes
0answers
31 views

Invalidate or requestLayout to redraw customview?

I have created a customView which has an object as property and up to this object's attributes my view needs to draw different bitmaps. So whenever i set this object on my view, i called ...
0
votes
1answer
19 views

Only the first of three custom views draws properly

I have a custom ScoreView that consists of two lines of text (a name and a score). Behind that text, I am drawing a bar representing the score. I have a fragment that contains three such ScoreViews. ...
0
votes
1answer
52 views

Tabs go to top if i set customView of ActionBar on Android

I add tabs and viewpager to my project. actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); Everything is perfect until i set custom view of actionBar: ...
8
votes
7answers
231 views

give dynamic font size as per device density

i want to give different different font size as per device resolution. now which is the best way. to define font size. device resolution in pixel. 320*480, 480*800, 720*1280, 1024*600, etc..
5
votes
4answers
129 views
+50

How to reference one control from another during inflation?

I am trying to reference a sibling control through XML. To declare an attribute to reference an id from MyTextView: <?xml version="1.0" encoding="utf-8"?> <resources> ...

1 2 3 4 5 33
15 30 50 per page