Hello i have a app which makes 3 wheels from 3 different arrays of words i am trying to make the text size of the words in the array smaller can someone point me in the right direction.
I have tried the textsize in my xml but it dosent seem to work so is there a way around this in the java?
Thanks.
public class PasswActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.passw_layout);
initWheel(R.id.passw_1, new String[] { "One", "Two", "Three" });
initWheel(R.id.passw_2, new String[] { "Four", "Five", "Six" });
initWheel(R.id.passw_3, new String[] { "Seven", "Eight", "Nine" });
Button mix = (Button) findViewById(R.id.btn_mix);
mix.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mixWheel(R.id.passw_1);
mixWheel(R.id.passw_2);
mixWheel(R.id.passw_3);
}
});
}
private boolean wheelScrolled = false;
OnWheelScrollListener scrolledListener = new OnWheelScrollListener() {
public void onScrollingStarted(WheelView wheel) {
wheelScrolled = true;
}
public void onScrollingFinished(WheelView wheel) {
wheelScrolled = false;
}
};
private OnWheelChangedListener changedListener = new OnWheelChangedListener() {
public void onChanged(WheelView wheel, int oldValue, int newValue) {
if (!wheelScrolled) {
}
}
};
private void initWheel(int id, String[] values) {
WheelView wheel = getWheel(id);
wheel.setViewAdapter(new ArrayWheelAdapter<String>(this, values));
wheel.setCurrentItem((int) (Math.random() * 10));
wheel.addChangingListener(changedListener);
wheel.addScrollingListener(scrolledListener);
wheel.setCyclic(true);
wheel.setInterpolator(new AnticipateOvershootInterpolator());
}
private WheelView getWheel(int id) {
return (WheelView) findViewById(id);
}
private boolean testPin(int v1, int v2, int v3, int v4) {
return testWheelValue(R.id.passw_1, v1)
&& testWheelValue(R.id.passw_2, v2)
&& testWheelValue(R.id.passw_3, v3);
}
private boolean testWheelValue(int id, int value) {
return getWheel(id).getCurrentItem() == value;
}
private void mixWheel(int id) {
WheelView wheel = getWheel(id);
wheel.scroll(-25 + (int) (Math.random() * 50), 2000);
}
}
Are you using the kankan open source wheel project? If it’s that or something else, you should really specify because, as far as I know, there is no “wheel” in the android API. You shouldn’t just assume we know what you’re referring to. If you are using the kankan wheel project then you should edit the “
wheel_text_item” xml and adjust thetextsizeof thetextview