I have a custom keyboard in my application, want to change text color at runtime based on user preference. I'm able to set KeyTextColor in XML, but no such attribute to set it programmatically. This is how i set in Xml :
<?xml version="1.0" encoding="utf-8"?>
<app:android.inputmethodservice.KeyboardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/keyboard"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:keyBackground="@drawable/key_background"
android:keyPreviewHeight="@dimen/dp_0"
android:keyTextSize="40sp"
android:keyTextColor="#00C853">//I set green text color here
</app:android.inputmethodservice.KeyboardView>
Want to set the same KeyTextColor from the program . Any ideas?