So I got following problem: I'm currently developing a sensor app and I'd like to check if the sensors are available or not. If they aren't, I want to change the color of a button (which starts an activity where the value of the sensor is being displayed) to grey. Sadly, I can't just change the background color of the button because I'm using the Circle Button Library by Markushi. This button looks like this:
<at.markushi.ui.CircleButton
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/gyroscope"
app:cb_color="@color/colorMain"
app:cb_pressedRingWidth="8dip"
android:id="@+id/gyroscope"
android:layout_alignLeft="@+id/temperature"
android:layout_alignStart="@+id/temperature"
android:layout_below="@+id/title"/>
As you can see this attribute defines the color.
app:cb_color="@color/colorMain"
My Question is: How can I change this color programmaticly in this method?
public void testSensors() {
if (testManager.getDefaultSensor(Sensor.TYPE_TEMPERATURE) == null) {
}
}
EDIT: setColor doesn't really work. There is this border left. (see image) Also: I'm using #616161 as the new color.
EDIT2: Found out, that the border is caused by the transparent circle thing which gets bigger, when the button is pressed. So basically removing this circle thing will be fine. I try to find an answer on my own :)