Added skeleton Searching functionality to the Album and Artist tabbed views in addition to the Song view. Added contributors and the License to the About settings # 53 #44

This commit is contained in:
amazing-username
2019-06-13 15:58:17 -07:00
parent 19e6f8aa44
commit 1706bec261
14 changed files with 71 additions and 39 deletions
+1 -4
View File
@@ -42,13 +42,10 @@ namespace Mear.Droid
{ {
if (Popup.SendBackPressed(base.OnBackPressed)) if (Popup.SendBackPressed(base.OnBackPressed))
{ {
var demo = 0;
} }
else else
{ {
var demo = 0; }
}
base.OnBackPressed();
} }
} }
} }
+1 -2
View File
@@ -81,8 +81,7 @@ namespace Mear.Playback
switch (control) switch (control)
{ {
case PlayControls.PLAYOFFLINE: case PlayControls.PLAYOFFLINE:
var songPath = song.SongPath; await PlaySong(song);
await PlaySong(songPath);
var plyCountRepo = new DBPlayCountRepository(); var plyCountRepo = new DBPlayCountRepository();
plyCountRepo.AffectPlayCount(song); plyCountRepo.AffectPlayCount(song);
InitializeRepeatMode(); InitializeRepeatMode();
@@ -70,6 +70,7 @@ namespace Mear.Repositories.Database
} }
else else
{ {
plyCount.PlayCounter++;
_Db.Update(plyCount); _Db.Update(plyCount);
} }
} }
+10
View File
@@ -17,6 +17,7 @@ namespace Mear.ViewModels
#region Fields #region Fields
private ObservableCollection<Album> _albumItems; private ObservableCollection<Album> _albumItems;
private Command _refreshAlbums; private Command _refreshAlbums;
private Command _searchAlbumCommand;
#endregion #endregion
@@ -30,6 +31,11 @@ namespace Mear.ViewModels
{ {
get => _refreshAlbums; get => _refreshAlbums;
} }
public Command SearchAlbumCommand
{
get => _searchAlbumCommand;
set => _searchAlbumCommand = value;
}
#endregion #endregion
@@ -38,6 +44,7 @@ namespace Mear.ViewModels
{ {
_albumItems = new ObservableCollection<Album>(); _albumItems = new ObservableCollection<Album>();
_refreshAlbums = new Command(async () => await PopulateAlbumsAsync()); _refreshAlbums = new Command(async () => await PopulateAlbumsAsync());
_searchAlbumCommand = new Command(async () => await SearchAlbum());
PopulateAlbumsAsync(); PopulateAlbumsAsync();
} }
@@ -65,6 +72,9 @@ namespace Mear.ViewModels
} }
IsRefreshing = false; IsRefreshing = false;
}
private async Task SearchAlbum()
{
} }
#endregion #endregion
} }
+10
View File
@@ -17,6 +17,7 @@ namespace Mear.ViewModels
#region Fields #region Fields
private ObservableCollection<Artist> _artistItems; private ObservableCollection<Artist> _artistItems;
private Command _refreshArtists; private Command _refreshArtists;
private Command _searchArtistCommand;
#endregion #endregion
@@ -30,6 +31,11 @@ namespace Mear.ViewModels
{ {
get => _refreshArtists; get => _refreshArtists;
} }
public Command SearchArtistCommand
{
get => _searchArtistCommand;
set => _searchArtistCommand = value;
}
#endregion #endregion
@@ -38,6 +44,7 @@ namespace Mear.ViewModels
{ {
_artistItems = new ObservableCollection<Artist>(); _artistItems = new ObservableCollection<Artist>();
_refreshArtists = new Command(async () => await PopulateArtistsAsync()); _refreshArtists = new Command(async () => await PopulateArtistsAsync());
_searchArtistCommand = new Command(async () => await SearchArtists());
PopulateArtistsAsync(); PopulateArtistsAsync();
} }
@@ -65,6 +72,9 @@ namespace Mear.ViewModels
} }
IsRefreshing = false; IsRefreshing = false;
}
private async Task SearchArtists()
{
} }
#endregion #endregion
} }
+12
View File
@@ -13,6 +13,7 @@ namespace Mear.ViewModels
#region INotifyPropertyChanged #region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
#endregion #endregion
protected string _searchedText;
private bool _isRefreshing; private bool _isRefreshing;
#endregion #endregion
@@ -27,6 +28,17 @@ namespace Mear.ViewModels
NotifyPropertyChanged("IsRefreshing"); NotifyPropertyChanged("IsRefreshing");
} }
} }
public string SearchedText
{
get => _searchedText;
set
{
_searchedText = value;
NotifyPropertyChanged("SearchSong");
//SearchSongText(_searchedText);
}
}
#endregion #endregion
-11
View File
@@ -19,7 +19,6 @@ namespace Mear.ViewModels
private ObservableCollection<Song> _songItems; private ObservableCollection<Song> _songItems;
private Command _refreshSongs; private Command _refreshSongs;
private Command _searchSongsCommand; private Command _searchSongsCommand;
private string _searchedText;
#endregion #endregion
@@ -41,16 +40,6 @@ namespace Mear.ViewModels
set => _searchSongsCommand = value; set => _searchSongsCommand = value;
} }
public string SearchedText
{
get => _searchedText;
set
{
_searchedText = value;
NotifyPropertyChanged("SearchSong");
//SearchSongText(_searchedText);
}
}
#endregion #endregion
+5
View File
@@ -12,6 +12,11 @@
<vm:AlbumViewModel /> <vm:AlbumViewModel />
</ContentPage.BindingContext> </ContentPage.BindingContext>
<StackLayout> <StackLayout>
<SearchBar x:Name="SearchAlbum"
Placeholder="Album"
SearchCommand="{Binding SearchAlbumCommand}"
SearchCommandParameter="{Binding SearchedText, Source=x:Reference Search}"
Text="{Binding SearchedText, Mode=TwoWay}" />
<ListView x:Name="AlbumListView" <ListView x:Name="AlbumListView"
ItemsSource="{Binding AlbumItems}" ItemsSource="{Binding AlbumItems}"
VerticalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Mear.Views
#region Events #region Events
private void AlbumListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) private void AlbumListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{ {
var albumItem = (sender as ListView).SelectedItem = null;
} }
#endregion #endregion
#endregion #endregion
+5
View File
@@ -13,6 +13,11 @@
</ContentPage.BindingContext> </ContentPage.BindingContext>
<StackLayout> <StackLayout>
<SearchBar x:Name="SearchArtist"
Placeholder="Artist"
SearchCommand="{Binding SearchArtistCommand}"
SearchCommandParameter="{Binding SearchedText, Source=x:Reference Search}"
Text="{Binding SearchedText, Mode=TwoWay}" />
<ListView x:Name="ArtistListView" <ListView x:Name="ArtistListView"
ItemsSource="{Binding ArtistItems}" ItemsSource="{Binding ArtistItems}"
VerticalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Mear.Views
#region Events #region Events
private void ArtistListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) private void ArtistListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{ {
var artistItem = (sender as ListView).SelectedItem = null;
} }
#endregion #endregion
#endregion #endregion
+2 -1
View File
@@ -27,6 +27,7 @@ namespace Mear.Views.Popups
} }
#endregion #endregion
#region Methods #region Methods
#region PopUpInit #region PopUpInit
protected override void OnAppearing() protected override void OnAppearing()
@@ -87,7 +88,7 @@ namespace Mear.Views.Popups
protected override bool OnBackgroundClicked() protected override bool OnBackgroundClicked()
{ {
return base.OnBackgroundClicked(); return true;
} }
#endregion #endregion
#endregion #endregion
+17 -16
View File
@@ -23,24 +23,25 @@
HorizontalOptions="Center" HorizontalOptions="Center"
Padding="40, 40, 40, 40"> Padding="40, 40, 40, 40">
<Label <Label
Text="Mear"/> Text="Mear"
FontSize="Large"/>
<Label <Label
Text="Pre-developement release version" /> Text="Pre-developement release version"
<ListView x:Name="ContributorsView" FontSize="Medium"/>
VerticalOptions="Center" <StackLayout>
HorizontalOptions="Center"
ItemsSource="{Binding ContributorItems}"
HasUnevenRows="True" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal"> <StackLayout Orientation="Horizontal">
<Label Text="{Binding Contributor}" /> <Label Text="Kun Deng"
<Label Text="{Binding Role}" /> FontSize="Small" />
<Label Text="- Author"
FontSize="Small" />
</StackLayout> </StackLayout>
</ViewCell> <StackLayout Orientation="Horizontal">
</DataTemplate> <Label Text="zularizal"
</ListView.ItemTemplate> FontSize="Small" />
</ListView> <Label Text="- Graphic Designer"
FontSize="Small" />
</StackLayout>
</StackLayout>
<Label Text="M.I.T. Open Source License" />
</StackLayout> </StackLayout>
</pages:PopupPage> </pages:PopupPage>
+2
View File
@@ -55,6 +55,8 @@ namespace Mear.Views
{ {
var msg = ex.Message; var msg = ex.Message;
} }
(sender as ListView).SelectedItem = null;
} }
#endregion #endregion
#endregion #endregion