Bonjour à tous,
Dans le menu drawer d'une application, j'ai en plus du titre de la section un picto. Pour le moment, j'ai mis directement via illustrator le picto à la dimension finale, ce qui a pour effet de "pixeliser et flouter" le rendu. Je souhaite donc conserver l'image en plus grand dans le dossier des drawables et réduire sa dimension quand je l’appelle (comme dans beaucoup de langages en fait (genre <img src="foobar.png" width="X" height="X" alt=""> ).
Je ne sais pas trop où et comment faire ça.

Dans la partie "navigation Items" ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class NavigationItem {
    private String mText;
    private Drawable mDrawable;
 
    public NavigationItem(String text, Drawable drawable) {
        mText = text;
        mDrawable = drawable;
 
    }
 
    public String getText() {
        return mText;
    }
 
    public void setText(String text) {
        mText = text;
    }
 
    public Drawable getDrawable() {
        return mDrawable;
    }
 
    public void setDrawable(Drawable drawable) {
        mDrawable = drawable;
    }
 
}
Ou dans la partie "liste" ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
    @Override
    public void onNavigationDrawerItemSelected(int position) {
        selectItem(position);
    }
 
    public List<NavigationItem> getMenu() {
        List<NavigationItem> items = new ArrayList<NavigationItem>();
        items.add(new NavigationItem("1", getResources().getDrawable(R.drawable.1)));
        items.add(new NavigationItem("2", getResources().getDrawable(R.drawable.2)));
        return items;
    }
Merci par avance.