Office Hours — Today, March 25

Yesterday, March 24

Mar 25
9:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
banannn
has entered the room
Mark M.
hello, banannn!
banannn
hi
Mark M.
how can I help you today?
10:00 AM
banannn
View paste
im developing home and lock screen widget and im looking for solution for some time.
This will be analog clock with some features.
I need to add some irregural shapes, so I extended Drawable class and implemented onDraw() method.
Is there any way to set that drawable in ImageView via RemoteViews? 
It has only method with Uri, int and Bitmap parameters.

I tried to create bitmap from canvas which im using in onDraw method, but i dont like it.
In this solution i need to know actual size of the widget. Is there any way to get it? 
I found only ways to get min and max width and height.
Maybe you recommend to do this in complettely different way.
Mark M.
well, you cannot use a custom View in a RemoteViews
banannn
its not view, its drawable class
Mark M.
you cannot use a custom Drawable class in a RemoteViews either
the other process does not have access to your class
off the cuff, I would support only a couple of specific clock sizes, then use pre-scaled bitmaps for those sizes
but, implementing an analog clock in an app widget hasn't exactly been high on my list of priorities... :-)
and so I have not thought much about a scenario like yours
banannn
ok, thanks, i will think abt that solution ;)
and do you know any way to check exact size of widget? not min and max?
Mark M.
in terms of getting the actual size of the widget, AFAIK there's no way to get that
other than the range data you get on resize events
banannn
ok, thanks. it will save my time looking solution ;)
10:05 AM
Mark M.
if you have another question, go right ahead -- it's a quiet chat room today
banannn
no more question at the moment, thanks
have a nice day
Mark M.
you too!
banannn
has left the room
10:55 AM
Mark M.
turned off guest access

Yesterday, March 24

 

Office Hours

People in this transcript

  • banannn
  • Mark Murphy