Beispiel #1
0
 public void CreateGroupCompletedSettingItem(bool groupCompleted)
 {
     _settingsContainer.AddView(
         SettingsActivity.CreateSwitchSettingRow(this, "Group Completed Items", "Choose whether you'd like to group all completed lists together under one list, regardless of how you have it set on AniList", groupCompleted, true, (sender, args) =>
                                                 Presenter.SetGroupCompleted(args.IsChecked)));
     _settingsContainer.AddView(SettingsActivity.CreateSettingDivider(this));
 }
Beispiel #2
0
 public void CreateAutoFillDateForMediaListItem(bool autoFillDateForMediaListItem)
 {
     _settingsContainer.AddView(
         SettingsActivity.CreateSwitchSettingRow(this, "Auto Assign a Start or End Date",
                                                 "When this is enabled, list items that are changed to 'Current' or 'Completed' statuses will have the Start or End date filled appropriately. This will not overwrite an existing date.",
                                                 autoFillDateForMediaListItem, true,
                                                 (sender, args) =>
     {
         Presenter.SetAutoFillDateForMediaListItem(args.IsChecked);
         _recreateActivity = false;
     }));
     _settingsContainer.AddView(SettingsActivity.CreateSettingDivider(this));
 }
Beispiel #3
0
 public void CreateHighlightPriorityMediaListItemsItem(bool highlightPriorityItems)
 {
     _settingsContainer.AddView(
         SettingsActivity.CreateSwitchSettingRow(this, "Highlight Priority Media List Items",
                                                 "Choose whether you'd like to show a highlighted background on all media list items that you've marked as Priority",
                                                 highlightPriorityItems, true,
                                                 (sender, args) =>
     {
         Presenter.SetHighlightPriorityMediaListItems(args.IsChecked);
         _recreateActivity = true;
         Intent.PutExtra(MainActivity.RecreateActivityIntentKey, true);
     }));
     _settingsContainer.AddView(SettingsActivity.CreateSettingDivider(this));
 }
Beispiel #4
0
 public void CreateShowEpisodeAddButtonForRepeatingMediaItem(bool showEpisodeAddButtonForRepeatingMedia)
 {
     _settingsContainer.AddView(
         SettingsActivity.CreateSwitchSettingRow(this, "Show Episode/Chapter Add Button For Repeating Media",
                                                 "Select this to enable the add episode/chapter button on your media that are in the Rewatching/Rereading statuses.",
                                                 showEpisodeAddButtonForRepeatingMedia, true,
                                                 (sender, args) =>
     {
         Presenter.SetShowEpisodeAddButtonForRepeatingMedia(args.IsChecked);
         _recreateActivity = true;
         Intent.PutExtra(MainActivity.RecreateActivityIntentKey, true);
     }));
     _settingsContainer.AddView(SettingsActivity.CreateSettingDivider(this));
 }
Beispiel #5
0
 public void CreateUseSwipeToRefreshOnMediaListsItem(bool useSwipeToRefreshOnMediaLists)
 {
     _settingsContainer.AddView(
         SettingsActivity.CreateSwitchSettingRow(this, "Swipe to Refresh Media Lists",
                                                 "With this enabled, you can swipe down to refresh the content on your media lists",
                                                 useSwipeToRefreshOnMediaLists, true,
                                                 (sender, args) =>
     {
         Presenter.SetUseSwipeToRefreshOnMediaLists(args.IsChecked);
         _recreateActivity = true;
         Intent.PutExtra(MainActivity.RecreateActivityIntentKey, true);
     }));
     _settingsContainer.AddView(SettingsActivity.CreateSettingDivider(this));
 }
Beispiel #6
0
 public void CreateUseLongClickForEpisodeAddItem(bool useLongClickForEpisodeAdd)
 {
     _settingsContainer.AddView(
         SettingsActivity.CreateSwitchSettingRow(this, "Use Long Press When Adding Episodes/Chapters",
                                                 "When this setting is enabled, tapping the plus icon on your anime/manga lists to add an episode/chapter will require you to long press on the icon instead. Use this if you accidentally add episodes when trying to hit the search button.",
                                                 useLongClickForEpisodeAdd, true,
                                                 (sender, args) =>
     {
         Presenter.SetUseLongClickForEpisodeAdd(args.IsChecked);
         _recreateActivity = true;
         Intent.PutExtra(MainActivity.RecreateActivityIntentKey, true);
     }));
     _settingsContainer.AddView(SettingsActivity.CreateSettingDivider(this));
 }
            private void SetupCustomLists(View customListsContainer, LinearLayout customLists)
            {
                var lists = _media.Type == MediaType.Anime
                    ? _mediaListOptions?.AnimeList?.CustomLists
                    : _mediaListOptions?.MangaList?.CustomLists;

                if (lists?.Any() != true)
                {
                    customListsContainer.Visibility = ViewStates.Gone;
                    return;
                }

                var hideSwitchRow =
                    SettingsActivity.CreateSwitchSettingRow(Activity, null, "Hide from status lists", _hideFromStatusLists, false,
                                                            (sender, eventArgs) => {
                    if (eventArgs.IsChecked && _customLists.Count == 0)
                    {
                        (sender as SwitchCompat).Checked = false;
                        Snackbar.Make(_coordLayout, "Must be on at least one list!", Snackbar.LengthShort)
                        .Show();
                        return;
                    }

                    _hideFromStatusLists = eventArgs.IsChecked;
                });
                var hideSwitchView = hideSwitchRow.FindViewById <SwitchCompat>(Resource.Id.SettingItem_Switch);

                foreach (var list in lists)
                {
                    customLists.AddView(SettingsActivity.CreateCheckboxSettingRow(Activity, null, list, _customLists.Contains(list),
                                                                                  (sender, eventArgs) => {
                        if (eventArgs.IsChecked)
                        {
                            _customLists.Add(list);
                        }
                        else
                        {
                            _customLists.Remove(list);

                            if (_customLists.Count == 0)
                            {
                                hideSwitchView.Checked = false;
                            }
                        }
                    }));
                }

                customLists.AddView(SettingsActivity.CreateSettingDivider(Activity));
                customLists.AddView(hideSwitchRow);
            }