package org.hsbp.spalarm.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import yuku.ambilwarna.AmbilWarnaDialog;

public class Main extends Activity implements AmbilWarnaDialog.OnAmbilWarnaListener
{
    private int currentColor = 0xFFFFFF;
    private final static String CURRENT_COLOR = "org.hsbp.spalarm.android.Main.CURRENT_COLOR";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    @Override
    protected void onSaveInstanceState(final Bundle outState) {
        outState.putInt(CURRENT_COLOR, currentColor);
        super.onSaveInstanceState(outState);
    }

    @Override
    protected void onRestoreInstanceState(final Bundle savedInstanceState) {
        currentColor = savedInstanceState.getInt(CURRENT_COLOR);
        super.onRestoreInstanceState(savedInstanceState);
    }

    public void selectColor(final View v) {
        new AmbilWarnaDialog(this, currentColor, this).show();
    }

    @Override
    public void onOk(final AmbilWarnaDialog dialog, final int color) {
        currentColor = color;
    }

    @Override
    public void onCancel(final AmbilWarnaDialog dialog) { /* ignore */ }
}

@@ -57,16 +57,47 @@
 tivity;%0A
+import android.graphics.Color;%0A
 import a
@@ -303,16 +303,19 @@
 r = 
-0xFFFFFF
+Color.WHITE
 ;%0A  

use symbolic constant