~w-shackleton/droidpad-android/stable

« back to all changes in this revision

Viewing changes to src/uk/digitalsquid/droidpad/buttons/ToggleButton.java

  • Committer: William Shackleton
  • Date: 2013-04-12 14:42:12 UTC
  • mfrom: (51.3.5 json)
  • mto: This revision was merged to the branch mainline in revision 52.
  • Revision ID: w.shackleton@gmail.com-20130412144212-4f7pueqwee0lc3yd
Imported code to load JSON layouts

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
package uk.digitalsquid.droidpad.buttons;
18
18
 
19
19
import uk.digitalsquid.droidpad.LogTag;
20
 
import android.graphics.Canvas;
21
 
import android.graphics.Point;
22
 
import android.graphics.RectF;
23
 
import android.util.Log;
 
20
import android.graphics.Canvas;
 
21
import android.graphics.PointF;
 
22
import android.graphics.RectF;
 
23
import android.util.Log;
24
24
 
25
25
public class ToggleButton extends Button implements LogTag {
26
26
 
32
32
 
33
33
        public ToggleButton(int x, int y, int sx, int sy, String text, int textSize) {
34
34
                super(x, y, sx, sy, text, textSize);
 
35
        }
 
36
        
 
37
        public ToggleButton(float x, float y, float sx, float sy, boolean free, String text, int textSize) {
 
38
                super(x, y, sx, sy, free, text, textSize);
35
39
        }
36
40
        
37
41
        @Override
38
 
        public void drawInArea(Canvas c, RectF area, Point centre, boolean landscape) {
 
42
        public void drawInArea(Canvas c, RectF area, PointF centre, boolean landscape) {
39
43
                super.drawInArea(c, area, centre, landscape);
40
44
                
41
45
                c.drawCircle(area.right - 10, area.bottom - 10, 5, isSelected() ? pTextS : pThinBorder);
42
46
        }
43
47
        
44
48
        @Override
45
 
        public void onMouseOn(float x, float y) {
 
49
        public void onMouseOn(ScreenInfo info, float x, float y) {
46
50
                // Do nothing.
47
51
        }
48
52