I have a simple View I've created. I'd like to be able to set its class variables via the Eclipse GUI Plugin's Design tool. Or though the .xml. Is this possible?
Here is what I currently have:
package com.lifecoderdev.android.drawing1;
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Toast;
public class BoundedView extends View
{
public String CellName = "No name.";
public BoundedView( Context context )
{
super( context );
}
public BoundedView( Context context, AttributeSet attrs )
{
super( context, attrs );
}
public BoundedView( Context context, AttributeSet attrs, int defStyle )
{
super( context, attrs, defStyle );
}
@Override
public void onDraw(Canvas canvas)
{
}
@Override
public boolean onTouchEvent( MotionEvent event )
{
Toast t = Toast.makeText( getContext(), "Selected: " + CellName + "!", Toast.LENGTH_SHORT );
t.show();
return false;
}
}
The View's only job is to be placed in a relative layout, and when it's clicked, do alert a message. That part works just fine, but I'd really like to be able to set CellName via either XML or the Properties panel.