예제 #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.CompleteRecycler, container, false);

            view.FindViewById(Resource.Id.loading).Visibility = ViewStates.Visible;
            EmptyView = view.FindViewById <TextView>(Resource.Id.empty);
            ListView  = view.FindViewById <RecyclerView>(Resource.Id.recycler);
            ListView.SetLayoutManager(new LinearLayoutManager(Android.App.Application.Context));
            ListView.SetItemAnimator(new DefaultItemAnimator());
            adapter = new BrowseAdapter((song, position) =>
            {
                song = LocalManager.CompleteItem(song);
                SongManager.Play(song);
            }, (song, position) =>
            {
                MainActivity.instance.More(song);
            }, (position) =>
            {
                LocalManager.ShuffleAll();
            });
            ListView.SetAdapter(adapter);

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            PopulateList();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            return(view);
        }
예제 #2
0
파일: Home.cs 프로젝트: pictos/Opus
 private void ListView_ItemClick(object sender, int position)
 {
     if (sections[position].contentType == SectionType.Shuffle)
     {
         LocalManager.ShuffleAll();
     }
 }
예제 #3
0
파일: FolderBrowse.cs 프로젝트: pictos/Opus
        public void More(int position)
        {
            string path        = paths[position];
            string displayPath = pathDisplay[position];

            BottomSheetDialog bottomSheet = new BottomSheetDialog(MainActivity.instance);
            View bottomView = MainActivity.instance.LayoutInflater.Inflate(Resource.Layout.BottomSheet, null);

            bottomView.FindViewById <TextView>(Resource.Id.bsTitle).Text      = displayPath;
            bottomView.FindViewById <TextView>(Resource.Id.bsArtist).Text     = path;
            bottomView.FindViewById <ImageView>(Resource.Id.bsArt).Visibility = ViewStates.Gone;
            bottomSheet.SetContentView(bottomView);

            bottomSheet.FindViewById <ListView>(Resource.Id.bsItems).Adapter = new BottomSheetAdapter(MainActivity.instance, Resource.Layout.BottomSheetText, new List <BottomSheetAction>
            {
                new BottomSheetAction(Resource.Drawable.Folder, Resources.GetString(Resource.String.list_songs), (sender, eventArg) =>
                {
                    ListSongs(displayPath, path);
                    bottomSheet.Dismiss();
                }),
                new BottomSheetAction(Resource.Drawable.Play, Resources.GetString(Resource.String.play_in_order), (sender, eventArg) =>
                {
                    LocalManager.PlayInOrder(path);
                    bottomSheet.Dismiss();
                }),
                new BottomSheetAction(Resource.Drawable.Shuffle, Resources.GetString(Resource.String.random_play), (sender, eventArg) =>
                {
                    LocalManager.ShuffleAll(path);
                    bottomSheet.Dismiss();
                }),
                new BottomSheetAction(Resource.Drawable.PlaylistAdd, Resources.GetString(Resource.String.add_to_playlist), (sender, eventArg) =>
                {
                    GetPlaylist(path);
                    bottomSheet.Dismiss();
                })
            });
            bottomSheet.Show();
        }
예제 #4
0
파일: FolderTracks.cs 프로젝트: pictos/Opus
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.CompleteRecycler, container, false);

            view.FindViewById(Resource.Id.loading).Visibility = ViewStates.Visible;
            EmptyView = view.FindViewById <TextView>(Resource.Id.empty);
            ListView  = view.FindViewById <RecyclerView>(Resource.Id.recycler);
            ListView.SetLayoutManager(new LinearLayoutManager(Android.App.Application.Context));
            ListView.SetItemAnimator(new DefaultItemAnimator());
            adapter = new BrowseAdapter((song, position) =>
            {
                LocalManager.PlayInOrder(path, position, "(" + MediaStore.Audio.Media.InterfaceConsts.Title + " LIKE \"%" + query + "%\" OR " + MediaStore.Audio.Media.InterfaceConsts.Artist + " LIKE \"%" + query + "%\")");
            }, (song, position) =>
            {
                More(song, position);
            }, (position) =>
            {
                LocalManager.ShuffleAll(path);
            });
            ListView.SetAdapter(adapter);

            PopulateList();
            return(view);
        }