ai212983 / android-spinnerwheel

Wheel-like spinner widget for Android
http://git.io/spinwheel
Apache License 2.0
639 stars 249 forks source link

define style for current item #61

Closed AhmadVatani closed 7 years ago

AhmadVatani commented 9 years ago

hi how can i define different style for current item? for example i want to change color and size of current item. tnx

arshu-dev commented 9 years ago

I had the same issue #60

I got the solution on my own.

Just need to call the methods in the ArrayWheelAdapter. Below is the example.

AbstractWheel wheel_date = (AbstractWheel) rootView.findViewById(R.id.date_wheel); String[] numbers = new String [7]; numbers = new String[] {"1", "2", "3", "4", "5", "6", "7"};

ArrayWheelAdapter arrayWheelAdapter = new ArrayWheelAdapter(rootView.getContext(), numbers); arrayWheelAdapter.setTextColor(0xffff1744); // Cannot use HEX Codes have to use integer colors arrayWheelAdapter.setTextSize(20); arrayWheelAdapter.setTextTypeface(Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf")); wheel_date.setViewAdapter(arrayWheelAdapter); wheel_date.setInterpolator(new AnticipateOvershootInterpolator());

fakir22 commented 8 years ago

I had the same question. You solution works like a charm, thanks arshu-dev ;)