Skip to content

Commit 7f64318

Browse files
sauravtomArnav Gupta
authored andcommitted
add more categories
Signed-off-by: Arnav Gupta <[email protected]>
1 parent b2ce088 commit 7f64318

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ public void onSectionAttached(int number) {
6060
case 4:
6161
mTitle = "Technology";
6262
break;
63+
case 5:
64+
mTitle = "World";
65+
break;
66+
case 6:
67+
mTitle = "Science";
68+
break;
69+
case 7:
70+
mTitle = "Health";
71+
break;
6372
}
6473
}
6574

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
105105
"Sports",
106106
"Entertainment",
107107
"Business",
108-
"Technology"
108+
"Technology",
109+
"World",
110+
"Science",
111+
"Health"
109112
}));
110113
mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
111114
return mDrawerListView;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
public class Utils {
88

9-
public static String[] categoryMap = {"Sports", "Entertainment", "Business", "Technology"};
9+
public static String[] categoryMap = {"Sports", "Entertainment", "Business", "Technology" , "World" , "Science" , "Health"};
1010

1111
}

App/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@
2626
android:layout_height="match_parent"
2727
android:layout_gravity="start"
2828
android:name="in.ac.dtu.subtlenews.NavigationDrawerFragment" />
29-
3029
</android.support.v4.widget.DrawerLayout>

App/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<string name="title_section1">Section 1</string>
66
<string name="title_section2">Section 2</string>
77
<string name="title_section3">Section 3</string>
8+
<string name="title_section4">Section 3</string>
9+
<string name="title_section5">Section 3</string>
810
<string name="navigation_drawer_open">Open navigation drawer</string>
911
<string name="navigation_drawer_close">Close navigation drawer</string>
1012
<string name="action_refresh">Refresh</string>

0 commit comments

Comments
 (0)