Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/java/com/example/rickrolled/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ protected void onCreate(Bundle savedInstanceState) {
R.id.allCharactersFragment,
R.id.allLocationsFragment,
R.id.allEpisodesFragment,
R.id.watchlistFragment,
R.id.favouriteEpisodesFragment)
.setDrawerLayout(drawerLayout)
.build();
Expand Down
28 changes: 28 additions & 0 deletions app/src/main/java/com/example/rickrolled/WatchlistFragment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.example.rickrolled;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class WatchlistFragment extends Fragment {

public WatchlistFragment() {
// Required empty public constructor
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_watchlist, container, false);
}
}
16 changes: 16 additions & 0 deletions app/src/main/res/layout/fragment_watchlist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
xmlns:tools = "http://schemas.android.com/tools"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
tools:context = ".WatchlistFragment"
>

<TextView
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_centerInParent = "true"
android:text = "Watchlist fragment opened"
/>

</RelativeLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/menu/drawer_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<item android:id="@id/allEpisodesFragment"
android:title="All Episodes"/>

<item android:id="@+id/watching"
<item android:id="@id/watchlistFragment"
android:title="Watching"/>

<item android:id="@id/favouriteEpisodesFragment"
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/navigation/drawer_nav.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,10 @@
app:destination = "@id/episodeFragment"
/>
</fragment>
<fragment
android:id = "@+id/watchlistFragment"
android:name = "com.example.rickrolled.WatchlistFragment"
android:label = "Watchlist"
tools:layout = "@layout/fragment_watchlist"
/>
</navigation>