Code example for SeekBar

Methods: setProgress, getTag

0
 
	public void showMarginDialog() { 
 
		int val1 = settings.getInt(
				Constants.SETTINGS_MARGIN_TOP_BOTTOM_KEY.value(), 10); 
		SeekValue sv1 = (SeekValue) seekBarMarginOne.getTag();
		int val2 = settings.getInt(
				Constants.SETTINGS_MARGIN_RIGHT_LEFT_KEY.value(), 10); 
		SeekValue sv2 = (SeekValue) seekBarMarginTwo.getTag();
		seekBarMarginOne.setProgress(progressFromValue(sv1.min, sv1.max, val1));
		seekBarMarginTwo.setProgress(progressFromValue(sv2.min, sv2.max, val2));
		marginDialog.show();
	} 
 
	public void showFontSizeDialog() { 
		int val = settings.getInt(Constants.SETTINGS_FONT_SIZE.value(), 12);
		SeekValue sv = (SeekValue) seekBarFontSize.getTag();
		seekBarFontSize.setProgress(progressFromValue(sv.min, sv.max, val));
		fontSizeDialog.show();
	}