Clover Coverage Report - AnCal Coverage Report
Coverage timestamp: gio dic 18 2014 12:18:42 EST
../../../../../img/srcFileCovDistChart9.png 40% of files have more coverage
12   51   5   3
2   39   0,42   4
4     1,25  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  ViewImgButton       Line # 12 12 5 83,3% 0.8333333
 
No Tests
 
1   
2    package pl.magot.vetch.ancal.views;
3   
4   
5    import android.content.Context;
6    import android.util.AttributeSet;
7    import android.widget.Button;
8    import android.graphics.*;
9    import android.graphics.drawable.Drawable;
10   
11   
 
12    public class ViewImgButton extends Button
13    {
14    protected Drawable icon = null;
15    private int iMarginX = 0;
16   
 
17  0 toggle public ViewImgButton(Context context)
18    {
19  0 super(context);
20    }
21   
 
22  2 toggle @SuppressWarnings("all")
23    public ViewImgButton(Context context, AttributeSet attrs)
24    {
25  2 super(context, attrs);
26    }
27   
 
28  303 toggle @Override
29    protected void onDraw(Canvas canvas)
30    {
31  303 super.onDraw(canvas);
32  303 if (icon != null)
33    {
34  303 int iW = icon.getMinimumWidth();
35  303 int iH = icon.getMinimumHeight();
36   
37  303 int iX = (getWidth() >> 1) - (iW >> 1) + iMarginX;
38  303 int iY = ((getHeight() - getPaddingTop()) >> 1) - (iH >> 1);
39   
40  303 icon.setBounds(iX, iY, iX + iW, iY + iH);
41  303 icon.draw(canvas);
42    }
43    }
44   
 
45  2 toggle public void SetButtonIcon(int iResId, int iMarginX)
46    {
47  2 icon = getResources().getDrawable(iResId);
48  2 this.iMarginX = iMarginX;
49    }
50   
51    }