change activity main drawer items text color programmatically android
Java
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
//items text color
int[][] state = new int[][] {
new int[] {-android.R.attr.state_enabled}, // disabled
new int[] {android.R.attr.state_enabled}, // enabled
new int[] {-android.R.attr.state_checked}, // unchecked
new int[] { android.R.attr.state_pressed} // pressed
};
int[] color = new int[] {
Color.WHITE,
Color.WHITE,
Color.WHITE,
Color.WHITE
};
ColorStateList colorStateList1 = new ColorStateList(state, color);
//icons color
int[][] states = new int[][] {
new int[] {-android.R.attr.state_enabled}, // disabled
new int[] {android.R.attr.state_enabled}, // enabled
new int[] {-android.R.attr.state_checked}, // unchecked
new int[] { android.R.attr.state_pressed} // pressed
};
int[] colors = new int[] {
Color.WHITE,
Color.WHITE,
Color.WHITE,
Color.WHITE
};
ColorStateList colorStateList2 = new ColorStateList(states, colors);
navigationView.setItemTextColor(colorStateList1);
navigationView.setItemIconTintList(colorStateList2);
Also in Java:
- Title
- append to arraylist by index java
- Category
- Java
- Title
- fragment button nullpointerexception
- Category
- Java
- Title
- read integer input java
- Category
- Java
- Title
- java letter alphabet index
- Category
- Java
- Title
- set java
- Category
- Java
- Title
- expression régulière seulement un espace java
- Category
- Java
- Title
- how to count an replace substring string in java
- Category
- Java
- Title
- java program to find prime number between 1 and 100
- Category
- Java
- Title
- how to separate no and text in java
- Category
- Java
- Title
- print in java
- Category
- Java
- Title
- java get annotation value
- Category
- Java
- Title
- set color of text for jlabel
- Category
- Java
- Title
- generate objects with for loop java
- Category
- Java
- Title
- jackson ignore value if null
- Category
- Java
- Title
- how to get the screen dimensions in java
- Category
- Java
- Title
- java sql question mark
- Category
- Java
- Title
- reading string after double in java
- Category
- Java
- Title
- java making a screen
- Category
- Java
- Title
- java read string input
- Category
- Java
- Title
- removeeventlistener
- Category
- Java
- Title
- is self divisor java
- Category
- Java
- Title
- java file exists
- Category
- Java
- Title
- java clone method
- Category
- Java
- Title
- prime factorization java
- Category
- Java
- Title
- java == vs equals
- Category
- Java
- Title
- convert array of int to arraylist java
- Category
- Java
- Title
- how to sort collection in java
- Category
- Java
- Title
- how to fill a 2d array in java
- Category
- Java
- Title
- jar file not running after being compiled
- Category
- Java
- Title
- java optional to collection
- Category
- Java
- Title
- how to init an array with objects in java
- Category
- Java
- Title
- set java
- Category
- Java
- Title
- phoneword converter
- Category
- Java
- Title
- center textview programmatically android
- Category
- Java
- Title
- java switch case
- Category
- Java
- Title
- android foreground push notification
- Category
- Java
- Title
- e
- Category
- Java
- Title
- how to convert string to array in java
- Category
- Java
- Title
- get world by name bukkit
- Category
- Java
- Title
- function in java
- Category
- Java
- Title
- vector in java
- Category
- Java
- Title
- same method name with different arguments
- Category
- Java
- Title
- time conversion solution
- Category
- Java
- Title
- java jpa criteriabuilder in xample
- Category
- Java
- Title
- how to find length of array in java
- Category
- Java
- Title
- bootstrap center text vertically
- Category
- Java
- Title
- how to print the map in java
- Category
- Java
- Title
- scan a string using scanner class in java
- Category
- Java
- Title
- change fab image programatically
- Category
- Java
- Title
- What is returned by a producer.send() call in the Java API? A boolean indicating if the call succeeded Future object Future object Unit
- Category
- Java
- Title
- enum with numbers java
- Category
- Java
- Title
- check java version cmd
- Category
- Java
- Title
- java file download
- Category
- Java
- Title
- add two numbers bitwise
- Category
- Java
- Title
- hide elements android
- Category
- Java
- Title
- java how to define a function
- Category
- Java
- Title
- java 8 string to localdate
- Category
- Java
- Title
- jstl core tags
- Category
- Java
- Title
- java create arraly list
- Category
- Java
- Title
- java download file from url to string
- Category
- Java
- Title
- compareto method java
- Category
- Java
- Title
- Java sort Map by values
- Category
- Java
- Title
- loop java
- Category
- Java
- Title
- lightweight java game library
- Category
- Java
- Title
- parallel sorting in java 8
- Category
- Java
- Title
- dataframe to dict without index
- Category
- Java
- Title
- how to cut a certion part from a string in java
- Category
- Java
- Title
- take a value from keyboard java
- Category
- Java
- Title
- android hide and show bottom navigation
- Category
- Java
- Title
- bukkit java set leather armor color from hex
- Category
- Java
- Title
- java split string on two or more spaces except for words in quotes
- Category
- Java
- Title
- getindexrequest elasticsearch
- Category
- Java
- Title
- listview get selected java
- Category
- Java
- Title
- how to draw a triangle in java
- Category
- Java
- Title
- java read integer from text file into array scanner
- Category
- Java
- Title
- java get first char
- Category
- Java
- Title
- write file from a specific location in java
- Category
- Java
- Title
- print a string java
- Category
- Java
- Title
- Removing DOM nodes when traversing a NodeList
- Category
- Java
- Title
- how to count the number of occurrences of an element in a arraylist in java
- Category
- Java
- Title
- how to add a keylistener to a jframe
- Category
- Java
- Title
- java random char a-z
- Category
- Java
- Title
- iterate map in java 8 using stream
- Category
- Java
- Title
- how to make a pre set list java
- Category
- Java
- Title
- java bucket sort
- Category
- Java
- Title
- iterate through hashmap in java
- Category
- Java
- Title
- count the number of words in a string java
- Category
- Java
- Title
- spring framework iterate
- Category
- Java
- Title
- split with scquere braket in java
- Category
- Java
- Title
- difference between compile and execute in java
- Category
- Java
- Title
- nth prime number java
- Category
- Java
- Title
- transformer un string en double java
- Category
- Java
- Title
- html redirect
- Category
- Java
- Title
- android studio remove navigation bar
- Category
- Java
- Title
- reverse number in java
- Category
- Java
- Title
- java get command line output
- Category
- Java
- Title
- java exceptions for catch
- Category
- Java
- Title
- how to add integers in java
- Category
- Java
- Title
- compare list from db and list from request
- Category
- Java
- Title
- how to create an abstract class in java
- Category
- Java