For the color of the text - this is
// FOR NAVIGATION VIEW ITEM TEXT COLOR int[][] state = new int[][] { // (Цвет текста всех "включеных" элементов бокового меню ) // (если этот массив не закоментировать, то остальные массивы работать не будут) // new int[] {android.R.attr.state_enabled}, // enabled new int[]{android.R.attr.state_checked}, // checked new int[]{android.R.attr.state_pressed}, // pressed new int[]{} }; int[] color = new int[]{ // Color.GREEN, Color.parseColor("#724646"), Color.parseColor("#724646"), Color.parseColor("#724646") }; ColorStateList csl = new ColorStateList(state, color);
This is for icons.
//FOR NAVIGATION VIEW ITEM ICON COLOR int[][] stateIcon = new int[][]{ // (Цвет текста всех "включеных" элементов бокового меню ) // (если этот массив не закоментировать, то остальные массивы работать не будут) // new int[] {android.R.attr.state_enabled}, // enabled new int[]{android.R.attr.state_checked}, // checked new int[]{android.R.attr.state_pressed}, // pressed new int[]{} }; int[] colorIcon = new int[]{ // Color.GREEN, Color.parseColor("#724646"), Color.parseColor("#724646"), Color.parseColor("#724646") }; ColorStateList csIcon = new ColorStateList(stateIcon, colorIcon);
Further programmatically assign these statelists as:
navigationView.setItemTextColor(csl); navigationView.setItemIconTintList(csIcon);
app:itemBackgroundtry theapp:itemBackground? - Flippy