Skip to content

Commit 998fe07

Browse files
somenath1435atm1504
authored andcommitted
Added Videos Fragment (#203)
1 parent a9ecf3e commit 998fe07

File tree

6 files changed

+51
-10
lines changed

6 files changed

+51
-10
lines changed

app/src/main/java/com/example/saar/MainActivity.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import android.content.DialogInterface;
55
import android.content.Intent;
66
import android.content.SharedPreferences;
7-
import android.net.Uri;
87
import android.os.Bundle;
98
import android.preference.PreferenceManager;
109
import android.support.v4.app.Fragment;
@@ -36,6 +35,7 @@
3635
import com.example.saar.Team.TeamFragment;
3736
import com.example.saar.Timeline_Events.TimelineFragment;
3837
import com.example.saar.Utils.Utils;
38+
import com.example.saar.Video.VideosFragment;
3939
import com.google.firebase.messaging.FirebaseMessaging;
4040

4141
import de.hdodenhof.circleimageview.CircleImageView;
@@ -245,11 +245,9 @@ private void displaySelectedScreen(int itemId) {
245245
case R.id.nav_share:
246246
fragment = new ShareFragment();
247247
break;
248-
case R.id.nav_map:
249-
//opens map app to display IIT Patna Administration Building
250-
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
251-
Uri.parse("geo:0,0?q=" + getResources().getString(R.string.admin_block)));
252-
startActivity(intent);
248+
case R.id.nav_videos:
249+
fragment = new VideosFragment();
250+
break;
253251
case R.id.nav_contact_us:
254252
fragment = new ContactFragment();
255253
break;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.example.saar.Video;
2+
3+
import android.os.Bundle;
4+
import android.support.annotation.Nullable;
5+
import android.support.v4.app.Fragment;
6+
import android.view.LayoutInflater;
7+
import android.view.View;
8+
import android.view.ViewGroup;
9+
10+
import com.example.saar.R;
11+
12+
public class VideosFragment extends Fragment {
13+
14+
@Override
15+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
16+
Bundle savedInstanceState) {
17+
// Inflate the layout for this fragment
18+
return inflater.inflate(R.layout.fragment_videos, container, false);
19+
}
20+
21+
@Override
22+
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
23+
super.onViewCreated(view, savedInstanceState);
24+
//you can set the title for your toolbar here for different fragments different titles
25+
getActivity().setTitle(R.string.videos);
26+
}
27+
28+
}

app/src/main/res/drawable/ic_place_black_24dp.xml renamed to app/src/main/res/drawable/ic_ondemand_video_black_24dp.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
android:viewportHeight="24.0">
66
<path
77
android:fillColor="#FF000000"
8-
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
8+
android:pathData="M21,3L3,3c-1.11,0 -2,0.89 -2,2v12c0,1.1 0.89,2 2,2h5v2h8v-2h5c1.1,0 1.99,-0.9 1.99,-2L23,5c0,-1.11 -0.9,-2 -2,-2zM21,17L3,17L3,5h18v12zM16,11l-7,4L9,7z"/>
99
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
tools:context=".Video.VideosFragment">
7+
8+
<TextView
9+
android:layout_width="match_parent"
10+
android:layout_height="match_parent"
11+
android:gravity="center"
12+
android:text="Videos" />
13+
14+
</LinearLayout>

app/src/main/res/menu/activity_main_drawer.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
android:title="Share" />
3838

3939
<item
40-
android:id="@+id/nav_map"
41-
android:icon="@drawable/ic_place_black_24dp"
42-
android:title="Map" />
40+
android:id="@+id/nav_videos"
41+
android:icon="@drawable/ic_ondemand_video_black_24dp"
42+
android:title="Videos" />
4343

4444
<item
4545
android:id="@+id/nav_contact_us"

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

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<string name="saar_email">[email protected]</string>
2525
<string name="photo">Photo</string>
2626
<string name="enter_all_fields">Please enter all fields</string>
27+
<string name="videos">Videos</string>
2728

2829
<!--Team Page-->
2930
<string name="member_1">Vivek Garg</string>

0 commit comments

Comments
 (0)