@ -20,13 +20,18 @@ import java.util.ArrayList;
import gr.thmmy.mthmmy.R ;
import gr.thmmy.mthmmy.R ;
import gr.thmmy.mthmmy.model.Bookmark ;
import gr.thmmy.mthmmy.model.Bookmark ;
/ * *
* A { @link Fragment } subclass .
* Use the { @link TopicBookmarksFragment # newInstance } factory method to
* create an instance of this fragment .
* /
public class TopicBookmarksFragment extends Fragment {
public class TopicBookmarksFragment extends Fragment {
protected static final String ARG_SECTION_NUMBER = "SECTION_NUMBER" ;
protected static final String ARG_SECTION_NUMBER = "SECTION_NUMBER" ;
protected static final String ARG_TOPIC_BOOKMARKS = "BOARD_BOOKMARKS" ;
protected static final String ARG_TOPIC_BOOKMARKS = "TOPIC _BOOKMARKS" ;
public static final String INTERACTION_CLICK_TOPIC_BOOKMARK = "CLICK_BOARD_BOOKMARK" ;
public static final String INTERACTION_CLICK_TOPIC_BOOKMARK = "CLICK_TOPIC _BOOKMARK" ;
public static final String INTERACTION_TOGGLE_TOPIC_NOTIFICATION = "TOGGLE_TOPIC_NOTIFICATION" ;
public static final String INTERACTION_TOGGLE_TOPIC_NOTIFICATION = "TOGGLE_TOPIC_NOTIFICATION" ;
public static final String INTERACTION_REMOVE_TOPIC_BOOKMARK = "REMOVE_BOARD _BOOKMARK" ;
public static final String INTERACTION_REMOVE_TOPIC_BOOKMARK = "REMOVE_TOPIC _BOOKMARK" ;
ArrayList < Bookmark > topicBookmarks = null ;
ArrayList < Bookmark > topicBookmarks = null ;
@ -43,11 +48,11 @@ public class TopicBookmarksFragment extends Fragment {
*
*
* @return A new instance of fragment Forum .
* @return A new instance of fragment Forum .
* /
* /
public static TopicBookmarksFragment newInstance ( int sectionNumber , String board Bookmarks) {
public static TopicBookmarksFragment newInstance ( int sectionNumber , String topic Bookmarks) {
TopicBookmarksFragment fragment = new TopicBookmarksFragment ( ) ;
TopicBookmarksFragment fragment = new TopicBookmarksFragment ( ) ;
Bundle args = new Bundle ( ) ;
Bundle args = new Bundle ( ) ;
args . putInt ( ARG_SECTION_NUMBER , sectionNumber ) ;
args . putInt ( ARG_SECTION_NUMBER , sectionNumber ) ;
args . putString ( ARG_TOPIC_BOOKMARKS , board Bookmarks) ;
args . putString ( ARG_TOPIC_BOOKMARKS , topic Bookmarks) ;
fragment . setArguments ( args ) ;
fragment . setArguments ( args ) ;
return fragment ;
return fragment ;
}
}
@ -56,9 +61,9 @@ public class TopicBookmarksFragment extends Fragment {
public void onCreate ( Bundle savedInstanceState ) {
public void onCreate ( Bundle savedInstanceState ) {
super . onCreate ( savedInstanceState ) ;
super . onCreate ( savedInstanceState ) ;
if ( getArguments ( ) ! = null ) {
if ( getArguments ( ) ! = null ) {
String bundledBoard Bookmarks = getArguments ( ) . getString ( ARG_TOPIC_BOOKMARKS ) ;
String bundledTopic Bookmarks = getArguments ( ) . getString ( ARG_TOPIC_BOOKMARKS ) ;
if ( bundledBoard Bookmarks ! = null ) {
if ( bundledTopic Bookmarks ! = null ) {
topicBookmarks = Bookmark . arrayFromString ( bundledBoard Bookmarks ) ;
topicBookmarks = Bookmark . arrayFromString ( bundledTopic Bookmarks ) ;
}
}
}
}
@ -78,7 +83,7 @@ public class TopicBookmarksFragment extends Fragment {
Bundle savedInstanceState ) {
Bundle savedInstanceState ) {
// Inflates the layout for this fragment
// Inflates the layout for this fragment
final View rootView = layoutInflater . inflate ( R . layout . fragment_bookmarks , container , false ) ;
final View rootView = layoutInflater . inflate ( R . layout . fragment_bookmarks , container , false ) ;
//bookmarks_board _container
//bookmarks_topic _container
final LinearLayout bookmarksLinearView = rootView . findViewById ( R . id . bookmarks_container ) ;
final LinearLayout bookmarksLinearView = rootView . findViewById ( R . id . bookmarks_container ) ;
if ( this . topicBookmarks ! = null & & ! this . topicBookmarks . isEmpty ( ) ) {
if ( this . topicBookmarks ! = null & & ! this . topicBookmarks . isEmpty ( ) ) {