Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android: Changed MobileLibraryBrowserFragment to a simple Fragment in…
…stead of ListFragment. Added grid view to MobileLibraryBrowserFragment for albums (the album art isn't loaded yet though). Related to issue #406.
- Loading branch information
1 parent
c811cb1
commit bafc706
Showing
10 changed files
with
504 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
MPfm/MPfm.Android/Classes/Adapters/MobileLibraryBrowserGridAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Copyright © 2011-2013 Yanick Castonguay | ||
// | ||
// This file is part of MPfm. | ||
// | ||
// MPfm is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// MPfm is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with MPfm. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Android.App; | ||
using Android.Graphics; | ||
using Android.Views; | ||
using Android.Widget; | ||
using MPfm.Android.Classes.Objects; | ||
using MPfm.MVP.Models; | ||
|
||
namespace MPfm.Android.Classes.Adapters | ||
{ | ||
public class MobileLibraryBrowserGridAdapter : BaseAdapter<LibraryBrowserEntity> | ||
{ | ||
readonly Activity _context; | ||
List<LibraryBrowserEntity> _items; | ||
|
||
public MobileLibraryBrowserGridAdapter(Activity context, List<LibraryBrowserEntity> items) | ||
{ | ||
_context = context; | ||
_items = items; | ||
} | ||
|
||
public void SetData(IEnumerable<LibraryBrowserEntity> items) | ||
{ | ||
_items = items.ToList(); | ||
NotifyDataSetChanged(); | ||
} | ||
|
||
public override long GetItemId(int position) | ||
{ | ||
return position; | ||
} | ||
|
||
public override LibraryBrowserEntity this[int position] | ||
{ | ||
get { return _items[position]; } | ||
} | ||
|
||
public override int Count | ||
{ | ||
get { return _items.Count; } | ||
} | ||
|
||
public override View GetView(int position, View convertView, ViewGroup parent) | ||
{ | ||
var item = _items[position]; | ||
View view = convertView; | ||
if (view == null) // no view to re-use, create new | ||
view = _context.LayoutInflater.Inflate(Resource.Layout.AlbumCell, null); | ||
|
||
//view.SetBackgroundColor(Color.White); | ||
|
||
var title = view.FindViewById<TextView>(Resource.Id.genericcell_title); | ||
title.Text = _items[position].Title; | ||
|
||
var image = view.FindViewById<ImageView>(Resource.Id.genericcell_image); | ||
image.SetBackgroundColor(Color.White); | ||
|
||
return view; | ||
} | ||
} | ||
} |
52 changes: 0 additions & 52 deletions
52
MPfm/MPfm.Android/Classes/Fragments/Base/BaseListFragment.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.