diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/framework/RWT/RWTButton.java b/app/src/main/java/org/ntlab/radishforandroidstudio/framework/RWT/RWTButton.java index ba01933..5482b4f 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/framework/RWT/RWTButton.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/framework/RWT/RWTButton.java @@ -1,38 +1,34 @@ package org.ntlab.radishforandroidstudio.framework.RWT; -import android.view.InputEvent; +import android.content.Context; +import android.support.v7.widget.AppCompatButton; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.View; +import android.widget.LinearLayout; -import org.ntlab.radishforandroidstudio.framework.listener.TouchListener; +public class RWTButton extends AppCompatButton implements View.OnTouchListener { + public RWTButton(Context context) { + super(context); + init(); + } -public class RWTButton implements TouchListener { - private RWTSprite[] sprite = new RWTSprite[2]; + public RWTButton(Context context, AttributeSet attrs) { + super(context, attrs); + init(); + } - public RWTButton(final RWTLayer layer) { - sprite = new RWTSprite[2]; - sprite[0] = new RWTSprite(); - sprite[1] = new RWTSprite(); + public RWTButton(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(); + } - layer.addDrawable(sprite[0]); - layer.addDrawable(sprite[1]); + public void init() { } @Override - public boolean onEvent(InputEvent event) { - return false; - } - - @Override - public boolean onTouch(InputEvent event) { - return false; - } - - @Override - public boolean onLongPress(InputEvent event) { - return false; - } - - @Override - public boolean onRelease(InputEvent event) { + public boolean onTouch(View v, MotionEvent event) { + System.out.println("touch!!"); return false; } }