private void updateMenuExtraData() { TextView keyboardsData = (TextView) findViewById(R.id.keyboards_group_extra_data); final int all = KeyboardFactory.getAllAvailableKeyboards(getApplicationContext()).size(); final int enabled = KeyboardFactory.getEnabledKeyboards(getApplicationContext()).size(); keyboardsData.setText(getString(R.string.keyboards_group_extra_template, enabled, all)); TextView themeData = (TextView) findViewById(R.id.theme_extra_data); KeyboardTheme theme = KeyboardThemeFactory.getCurrentKeyboardTheme(getApplicationContext()); if (theme == null) theme = KeyboardThemeFactory.getFallbackTheme(getApplicationContext()); themeData.setText(getString(R.string.selected_add_on_summary, theme.getName())); }
@Override protected int getKeyboardStyleResId(KeyboardTheme theme) { return theme.getThemeResId(); }
@Nullable public Drawable buildDrawable() { final Context packageContext = mTheme.getPackageContext(); if (packageContext == null) return null; return ContextCompat.getDrawable(packageContext, mDrawableResourceId); }