• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps I Have An Error

Hello Everyone! I Am Extremely New To Android And Java Programming.

I Imported The Color Library For Android at code.google.com/p/yuku-android-util/

I Get This Error: The Constructor AbilWarnaDialog is Undefined.

Code:
package com.jvprogramming.drawstudioplus;

import yuku.ambilwarna.AmbilWarnaDialog;
import yuku.ambilwarna.AmbilWarnaDialog.OnAmbilWarnaListener;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

public class MainDrawingView extends View {
    public Paint mPaint = new Paint();
    public Path mPath = new Path();
    
    int initialColor;
    
    
    public MainDrawingView(Context context, AttributeSet attrs) {
        super(context, attrs);
        
        mPaint.setAntiAlias(true);
        mPaint.setStrokeWidth(5f);
        mPaint.setColor(Color.BLACK);
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeJoin(Paint.Join.ROUND);
        
        initialColor = mPaint.getColor();
        
        

    }
    
 
    
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        // Get the coordinates of the touch event.
        float eventX = event.getX();
        float eventY = event.getY();

        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                // Set a new starting point
                mPath.moveTo(eventX, eventY);
                return true;
            case MotionEvent.ACTION_MOVE:
                // Connect the points
                mPath.lineTo(eventX, eventY);
                break;
            default:
                return false;
        }

        // Makes our view repaint and call onDraw
        invalidate();
        return true;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.drawPath(mPath, mPaint);
    }
    
    
    public void pickColor(){
        
        AmbilWarnaDialog dialog = new AmbilWarnaDialog(this, initialColor, new OnAmbilWarnaListener() // Error Is Here {
            
            @Override
            public void onOk(AmbilWarnaDialog dialog, int color) {
                    mPaint.setColor(color);
            }
                    
            @Override
            public void onCancel(AmbilWarnaDialog dialog) {
                    mPaint.setColor(initialColor);
            }
    });

    dialog.show();
        
    }

}

I am trying to make a dialog so a user can pick a color on the app.

Thank You Everyone For Your Help
Jordan V
 
Welcome to AF jordanv108:)

Fox Mulder let me know about your thread where it could get more help.:) So I moved it here to the development forum:)

I hope you you get the help you need;)
Thanks for joining!!
 
Back
Top Bottom