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:
@@ -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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
@@ -66,6 +73,9 @@ namespace Mear.ViewModels
|
|||||||
|
|
||||||
IsRefreshing = false;
|
IsRefreshing = false;
|
||||||
}
|
}
|
||||||
|
private async Task SearchAlbum()
|
||||||
|
{
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
@@ -66,6 +73,9 @@ namespace Mear.ViewModels
|
|||||||
|
|
||||||
IsRefreshing = false;
|
IsRefreshing = false;
|
||||||
}
|
}
|
||||||
|
private async Task SearchArtists()
|
||||||
|
{
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,12 @@
|
|||||||
<vm:AlbumViewModel />
|
<vm:AlbumViewModel />
|
||||||
</ContentPage.BindingContext>
|
</ContentPage.BindingContext>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<ListView x:Name="AlbumListView"
|
<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"
|
||||||
ItemsSource="{Binding AlbumItems}"
|
ItemsSource="{Binding AlbumItems}"
|
||||||
VerticalOptions="FillAndExpand"
|
VerticalOptions="FillAndExpand"
|
||||||
HasUnevenRows="False"
|
HasUnevenRows="False"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -13,7 +13,12 @@
|
|||||||
</ContentPage.BindingContext>
|
</ContentPage.BindingContext>
|
||||||
|
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<ListView x:Name="ArtistListView"
|
<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"
|
||||||
ItemsSource="{Binding ArtistItems}"
|
ItemsSource="{Binding ArtistItems}"
|
||||||
VerticalOptions="FillAndExpand"
|
VerticalOptions="FillAndExpand"
|
||||||
HasUnevenRows="False"
|
HasUnevenRows="False"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
<StackLayout Orientation="Horizontal">
|
||||||
ItemsSource="{Binding ContributorItems}"
|
<Label Text="Kun Deng"
|
||||||
HasUnevenRows="True" >
|
FontSize="Small" />
|
||||||
<ListView.ItemTemplate>
|
<Label Text="- Author"
|
||||||
<DataTemplate>
|
FontSize="Small" />
|
||||||
<ViewCell>
|
</StackLayout>
|
||||||
<StackLayout Orientation="Horizontal">
|
<StackLayout Orientation="Horizontal">
|
||||||
<Label Text="{Binding Contributor}" />
|
<Label Text="zularizal"
|
||||||
<Label Text="{Binding Role}" />
|
FontSize="Small" />
|
||||||
</StackLayout>
|
<Label Text="- Graphic Designer"
|
||||||
</ViewCell>
|
FontSize="Small" />
|
||||||
</DataTemplate>
|
</StackLayout>
|
||||||
</ListView.ItemTemplate>
|
</StackLayout>
|
||||||
</ListView>
|
<Label Text="M.I.T. Open Source License" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</pages:PopupPage>
|
</pages:PopupPage>
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ namespace Mear.Views
|
|||||||
{
|
{
|
||||||
var msg = ex.Message;
|
var msg = ex.Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(sender as ListView).SelectedItem = null;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user