Skip to content

Commit c2bd244

Browse files
author
saurav
committed
Added icons in the navigation drawer
1 parent 2ac831d commit c2bd244

File tree

11 files changed

+30
-1
lines changed

11 files changed

+30
-1
lines changed

App/src/main/java/in/ac/dtu/subtlenews/NavigationDrawerFragment.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,35 @@ public View getView(int pos, View convertView, ViewGroup parent) {
318318
navigationTitle.setTextColor(Color.WHITE);
319319
navigationIcon.setBackgroundResource(R.drawable.ic_launcher);
320320

321+
String s = mCategoryMap[pos].toString();
322+
if (s.equals("World")) {
323+
navigationIcon.setBackgroundResource(R.drawable.world);
324+
325+
} else if (s.equals("India")) {
326+
navigationIcon.setBackgroundResource(R.drawable.india);
327+
328+
}
329+
else if (s.equals("Entertainment")) {
330+
navigationIcon.setBackgroundResource(R.drawable.entertainment);
331+
332+
} else if (s.equals("Technology")) {
333+
navigationIcon.setBackgroundResource(R.drawable.technology);
334+
335+
} else if (s.equals("Business")) {
336+
navigationIcon.setBackgroundResource(R.drawable.business);
337+
338+
} else if (s.equals("Science")) {
339+
navigationIcon.setBackgroundResource(R.drawable.science);
340+
341+
} else if (s.equals("Sports")) {
342+
navigationIcon.setBackgroundResource(R.drawable.sports);
343+
344+
} else if (s.equals("Health")) {
345+
navigationIcon.setBackgroundResource(R.drawable.health);
346+
347+
}
348+
349+
321350
return rowView;
322351
}
323352
}
5.54 KB
Loading
1.72 KB
Loading
1.81 KB
Loading
4.54 KB
Loading
7.88 KB
Loading
4.8 KB
Loading
2.14 KB
Loading
1.17 KB
Loading
8.07 KB
Loading

0 commit comments

Comments
 (0)