Questions tagged [android-custom-drawable]

Modifiable and customizable drawable android graphic resources.

Modifiable and customizable drawable android graphic resources. A drawable resource is a general concept for a graphic that can be drawn to the screen and which you can retrieve with APIs such as getDrawable(int) or apply to another XML resource with attributes such as android:drawable and android:icon.

36 questions
27
votes
6 answers

Android: SeekBar with custom drawable

I have SeekBar with custom drawable. Progress element is not rendered from left side exactly but it is moved to right. How can I avoid this?
Michal
  • 3,584
  • 9
  • 47
  • 74
4
votes
2 answers

Acquire Context in custom Drawable class

I have tried to create a custom class in order to implement a text as drawable but I am unable to set Typeface to Paint. Below is the code implementation of the custom class (i.e. TextDrawable). Here I want to get the context of Application to call…
4
votes
1 answer

How to define a rectangle with a circle at the end using Android XML definitions

Is it possible to define a shape like shown on the following image: I tried a layer-list but I could not find a solution close to what I am looking for. I want to use the resulting shape as a background image to a RelativeLayout with a…
OpenHaus
  • 97
  • 2
  • 9
  • 17
4
votes
2 answers

Android: Using multiple shapes as a Button background

How can I use multiple shapes defined in an xml as the background for a button in android? assuming I have multiple shape xml files such as :-
mfc
  • 3,018
  • 5
  • 31
  • 43
3
votes
4 answers

android, custom state_pressed doesn't work

My custom selector like below doesn't work as expected, I don't see the pressed state at all. Any tip? thanks