Reputation: 668
I have multiple background colors of the keyboard in my app user can select any color for the keyboard background. The problem I am getting is when the user selects any color to apply on the keyboard it's working but the candidate views not change the color its color is the same as the first theme. When I rotate the app screen the candidate view color is also changed. Can you help me please change the candidate view color on runtime?
Upvotes: -1
Views: 234
Reputation: 54
mCandidateView.setBackgroundResource( R.color.colorBlack);
@Override public void onStartInputView(EditorInfo attribute, boolean restarting) { super.onStartInputView(attribute, restarting);
if (modeReceived == MyConstants.Companion.getTHEME_KEYBOARD_MODE_DRAWABLE()) {
try {
int drawablePrefs =
sharedPreferences.getInt(MyConstants.Companion.getTHEME_KEYBOARD_DRAWABLE(), R.color.colorBlack);
if (mInputView != null) {
mInputView.setBackgroundResource(drawablePrefs);
mCandidateView.setBackgroundResource(drawablePrefs);
}
Upvotes: 1