public static SearchResultFragment NewResult(string Title, string ListTitle, bool truncate, string creed, int ID, string Proofs, int matchNum) { Log.Info("Fragment forming", "Grabbing new Creed fragment to display"); SearchResultFragment fragment = new SearchResultFragment(); Bundle spaces = new Bundle(); creed1 = true; catechism1 = false; confession1 = false; spaces.PutInt(number, ID); spaces.PutString(CREED, creed); spaces.PutInt(matchNumb, matchNum); spaces.PutString(PROOFS, Proofs); spaces.PutString(DOCTITLE, ListTitle); spaces.PutBoolean(truncated, truncate); fragment.Arguments = spaces; return(fragment); }
//Displays Search Results public static SearchResultFragment NewResult(string Chapter, string Proofs, string Title, int ID, string ListTitle, bool truncate, int matchnum) { Log.Info("Fragment Forming", "Grabbing new Confession Fragment to Display"); SearchResultFragment fragment = new SearchResultFragment(); Bundle spaces = new Bundle(); confession1 = true; catechism1 = false; creed1 = false; spaces.PutInt(number, ID); spaces.PutInt(matchNumb, matchnum); spaces.PutString(CHAPTER, Chapter); spaces.PutString(PROOFS, Proofs); spaces.PutString(TITLE, Title); spaces.PutString(DOCTITLE, ListTitle); fragment.Arguments = spaces; return(fragment); }
//Displays the search Results public static SearchResultFragment NewResult(string Question, string Answer, string Proofs, string Title, int ID, string ListTitle, int matchNum, bool truncate) { Log.Info("Fragment Forming", "Grabbing new Catechism Fragment to Display"); SearchResultFragment fragment = new SearchResultFragment(); Bundle spaces = new Bundle(); catechism1 = true; confession1 = false; creed1 = false; spaces.PutInt(number, ID); spaces.PutString(ANSWER, Answer); spaces.PutString(QUESTION, Question); spaces.PutInt(matchNumb, matchNum); spaces.PutString(TITLE, Title); spaces.PutString(PROOFS, Proofs); spaces.PutString(DOCTITLE, ListTitle); spaces.PutBoolean(truncated, truncate); fragment.Arguments = spaces; return(fragment); }
//Fetches the fragment for display public override Android.Support.V4.App.Fragment GetItem(int position) { Android.Support.V4.App.Fragment frg; if (docPosition > 0) { position = position + 1; } string docTitle = ""; if (documentList.Title == "Results" || documentList.Title == "") { docTitle = documentList[position].DocTitle; } else { docTitle = documentList.Title; } if (documentList[position].Type == "CONFESSION") { docPosition++; Confession confession = (Confession)documentList[position]; frg = (Android.Support.V4.App.Fragment)SearchResultFragment.NewResult(confession.Chapter, confession.Proofs, confession.Title, confession.IDNumber, docTitle, documentList.Truncate, confession.Matches); } else if (documentList[position].Type == "CATECHISM") { docPosition++; Catechism catechism = (Catechism)documentList[position]; frg = (Android.Support.V4.App.Fragment)SearchResultFragment.NewResult(catechism.Question, catechism.Answer, catechism.Proofs, catechism.Title, catechism.IDNumber, docTitle, catechism.Matches, documentList.Truncate); } else if (documentList[position].Type == "CREED") { docPosition++; Creed creed = (Creed)documentList[position]; frg = (Android.Support.V4.App.Fragment)SearchResultFragment.NewResult(creed.DocTitle, documentList.Title, truncate, creed.CreedText, creed.IDNumber, creed.Proofs, creed.Matches); } else { frg = GetItem(position + 1); } Log.Info("Search Adapter", String.Format("{0} Panel Loaded", position)); return(frg); }