mukeshsolanki / DrawingView-Android

DrawingView is a simple view that lets you draw on screen using your fingers and lets you save the drawings as images.
MIT License
240 stars 53 forks source link

initializePen() metod doesn't work #3

Closed AGovtvyanitca-softheme closed 8 years ago

AGovtvyanitca-softheme commented 8 years ago

initializePen(); method doesn't work after initializeEraser(); called

Example: In case of user clicked on Eraser button and then on Pen button, view still set in Eraser mode.

package com.diezgames.drawrailwaycarriage;

import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button;

import com.mukesh.DrawingView;

public class NewRailwayCarriageDrawer extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_new_railway_carriage_drawer);
    final DrawingView drawingView = (DrawingView) findViewById(R.id.scratch_pad);
    final Button drawPenBtn = (Button) findViewById(R.id.draw_c_pen);
    final Button drawEraseBtn = (Button) findViewById(R.id.draw_c_erase);
    drawPenBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            drawingView.initializePen();
            drawingView.setPenSize(10.0f);
            Log.d(this.getClass().toString(), "On Pen Btn Clicked");
        }
    });
    drawEraseBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            drawingView.initializeEraser();
            drawingView.setEraserSize(10.0f);
            Log.d(this.getClass().toString(), "On Erase Btn Clicked");
        }
    });
}

}

mukeshsolanki commented 8 years ago

You dont need to call the initializePen(); option if you are calling the setPenSize(); please have a look at the example code for proper working

AGovtvyanitca-softheme commented 8 years ago

@mukeshsolanki The issue still exists if app doesn't call setPenSize or oposite initializePen, both ways doesn't work - Once eraced initialized, user can't use Pen once again.

pvskalyan commented 4 years ago

this issue still there..unable use pen after eraser..in example same issue is happeing