How to create custom widget in android -


i working on birthday wish app. want create set reminder of friends birthday on main screen of mobile. want view of custom widget. can me how create widget in android dynamically? using coding.

public class dynamicimagebutton extends imageview {      public dynamicimagebutton(final context context, final attributeset attrs) {         super(context, attrs);     }      @override     protected void onmeasure(final int widthmeasurespec, final int heightmeasurespec) {         final drawable d = this.getdrawable();          if (d != null) {             // ceil not round - avoid thin vertical gaps along left/right edges         final int width = measurespec.getsize(widthmeasurespec);         final int height = (int) math.ceil(width * (float) d.getintrinsicheight() / d.getintrinsicwidth()-10);             this.setmeasureddimension(width, height);         } else {             super.onmeasure(widthmeasurespec, heightmeasurespec);         }     } } 

this be


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -