WEB开发网
开发学院手机开发Android 开发 Android下的扩展SeekBar 阅读

Android下的扩展SeekBar

 2010-05-28 15:36:00 来源:WEB开发网   
核心提示:{super(aoContext, attrs);this.coContext = aoContext;}public int getMin(){return ciMinVal;}public void setMin(int aiMin){ciMinVal = aiMin;}public void setMax(int

{

super(aoContext, attrs);

this.coContext = aoContext;

}

public int getMin()

{

return ciMinVal;

}

public void setMin(int aiMin)

{

ciMinVal = aiMin;

}

public void setMax(int aiMax)

{

ciMaxVal = aiMax;

}

public void setUnit(String asUnit)

{

csUnit = asUnit;

}

public void setKeyProgressIncrement(int aiIncrement)

{

ciIncrement = aiIncrement;

}

public void setValue(int aiVal)

{

ciInitVal = aiVal;

}

protected void onPrepareDialogBuilder(Builder builder)

{

LayoutInflater factory = LayoutInflater.from(coContext);

View loSeekBarView = factory.inflate(R.layout.view_ext_seekbar, null);

builder.setView(loSeekBarView);

coSeekBar = (SeekBar)loSeekBarView.findViewById(R.id.SeekBarControl);

coSeekBar.setOnSeekBarChangeListener(this);

coSeekBar.setMax(ciMaxVal-ciMinVal);

coSeekBar.setKeyProgressIncrement(ciIncrement);

TextView loMinText = (TextView)loSeekBarView.findViewById(R.id.SeekBarMin);

loMinText.setText(ciMinVal+csUnit);

TextView loMaxText = (TextView)loSeekBarView.findViewById(R.id.SeekBarMax);

loMaxText.setText(ciMaxVal+csUnit);

coSeekBarValView = (TextView)loSeekBarView.findViewById(R.id.SeekBarVal);

//initial value

coSeekBar.setProgress(ciInitVal-ciMinVal);

}

public void setSummary(int aiVal)

{

String lsSummary="";

lsSummary = (aiVal) + csUnit;

super.setSummary(lsSummary);

}

protected void onDialogClosed(boolean positiveResult)

{

if (positiveResult)

上一页  1 2 3 4  下一页

Tags:Android 扩展 SeekBar

编辑录入:coldstar [复制链接] [打 印]
赞助商链接