All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.android.controlcenter.preference.JadexDoublePreference Maven / Gradle / Ivy

Go to download

The Jadex rules tools package contains tools for the Jadex active components infrastructure.

The newest version!
package jadex.android.controlcenter.preference;

import android.content.Context;
import android.text.InputType;
import android.view.View;
import android.widget.EditText;

public class JadexDoublePreference extends JadexStringPreference {

	public JadexDoublePreference(Context context) {
		super(context);
	}
	
	@Override
	protected View onCreateDialogView() {
		View onCreateDialogView = super.onCreateDialogView();
		EditText text = getEditText();
		text.setInputType(InputType.TYPE_CLASS_NUMBER);
		return onCreateDialogView;
	}
	
	@Override
	public void setValue(Object value) {
//		Double doubleValue = (Double) value;
		super.setValue("" + value);
	}
	
	public double getInt() {
		return Double.parseDouble(getText());
	}

	@Override
	protected boolean callChangeListener(Object newValue) {
		return super.callChangeListener(Double.parseDouble((String) newValue));
	}
	
	

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy