I'm relatively new to Android/smartwatch development, so forgive my nativity. I've been trying to create a simple application which scrolls through values in a list wheel (bit like the time/date picker widgets you see on Android/iPhones), but horizontally as opposed to vertically.
The best fit for my app appears to be the Spinner Wheel widget found here: https://github.com/ai212983/android-spinnerwheel
I can get the provided code & spinner demo working fine on my phone, however when I try and include the widget to my screen layout for the smartwatch, the screen goes blank. Removing the widget again, I can see the rest of my layout elements, so I'm assuming it's the spinner breaking the layout.
I've added the following code to my layout:
<antistatic.spinnerwheel.WheelHorizontalView
android:id="@+id/tspinnerWheel"
android:layout_width="220px"
android:layout_height="65px"
android:layout_above="@+id/textTime"
android:layout_centerHorizontal="true"
android:paddingTop="5px"
android:layout_marginBottom="-26px" />
In my app I have the following code in my overridden onResume() method:
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.zone_screen_test, null);
final AbstractWheel setpoint = (AbstractWheel) layout.findViewById(R.id.textSetpoint);
NumericWheelAdapter setpointAdapter = new NumericWheelAdapter(mContext, 5, 35, "%02d");
setpointAdapter.setItemResource(R.layout.wheel_text_centered);
setpointAdapter.setItemTextResource(R.id.text);
setpoint.setViewAdapter(setpointAdapter);
Can anyone help get the above example or suggest an alternative implementation (I'm looking for a basic spinner - I don't need fade animations etc).