Started working on the Searching functionality for the Song view. #44
This commit is contained in:
@@ -64,6 +64,9 @@
|
||||
<PackageReference Include="sqlite-net-pcl">
|
||||
<Version>1.5.231</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="UXDivers.GorillaPlayer.SDK">
|
||||
<Version>1.5.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.482894" />
|
||||
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
|
||||
|
||||
+47
-44
@@ -9771,113 +9771,113 @@ namespace Mear.Droid
|
||||
// aapt resource value: 0x7f0b0043
|
||||
public const int character_counter_pattern = 2131427395;
|
||||
|
||||
// aapt resource value: 0x7f0b004e
|
||||
public const int download_notification_channel_name = 2131427406;
|
||||
|
||||
// aapt resource value: 0x7f0b004f
|
||||
public const int exo_controls_fastforward_description = 2131427407;
|
||||
public const int download_notification_channel_name = 2131427407;
|
||||
|
||||
// aapt resource value: 0x7f0b0050
|
||||
public const int exo_controls_fullscreen_description = 2131427408;
|
||||
public const int exo_controls_fastforward_description = 2131427408;
|
||||
|
||||
// aapt resource value: 0x7f0b0051
|
||||
public const int exo_controls_next_description = 2131427409;
|
||||
public const int exo_controls_fullscreen_description = 2131427409;
|
||||
|
||||
// aapt resource value: 0x7f0b0052
|
||||
public const int exo_controls_pause_description = 2131427410;
|
||||
public const int exo_controls_next_description = 2131427410;
|
||||
|
||||
// aapt resource value: 0x7f0b0053
|
||||
public const int exo_controls_play_description = 2131427411;
|
||||
public const int exo_controls_pause_description = 2131427411;
|
||||
|
||||
// aapt resource value: 0x7f0b0054
|
||||
public const int exo_controls_previous_description = 2131427412;
|
||||
public const int exo_controls_play_description = 2131427412;
|
||||
|
||||
// aapt resource value: 0x7f0b0055
|
||||
public const int exo_controls_repeat_all_description = 2131427413;
|
||||
public const int exo_controls_previous_description = 2131427413;
|
||||
|
||||
// aapt resource value: 0x7f0b0056
|
||||
public const int exo_controls_repeat_off_description = 2131427414;
|
||||
public const int exo_controls_repeat_all_description = 2131427414;
|
||||
|
||||
// aapt resource value: 0x7f0b0057
|
||||
public const int exo_controls_repeat_one_description = 2131427415;
|
||||
public const int exo_controls_repeat_off_description = 2131427415;
|
||||
|
||||
// aapt resource value: 0x7f0b0058
|
||||
public const int exo_controls_rewind_description = 2131427416;
|
||||
public const int exo_controls_repeat_one_description = 2131427416;
|
||||
|
||||
// aapt resource value: 0x7f0b0059
|
||||
public const int exo_controls_shuffle_description = 2131427417;
|
||||
public const int exo_controls_rewind_description = 2131427417;
|
||||
|
||||
// aapt resource value: 0x7f0b005a
|
||||
public const int exo_controls_stop_description = 2131427418;
|
||||
public const int exo_controls_shuffle_description = 2131427418;
|
||||
|
||||
// aapt resource value: 0x7f0b005b
|
||||
public const int exo_download_completed = 2131427419;
|
||||
public const int exo_controls_stop_description = 2131427419;
|
||||
|
||||
// aapt resource value: 0x7f0b005c
|
||||
public const int exo_download_description = 2131427420;
|
||||
public const int exo_download_completed = 2131427420;
|
||||
|
||||
// aapt resource value: 0x7f0b005d
|
||||
public const int exo_download_downloading = 2131427421;
|
||||
public const int exo_download_description = 2131427421;
|
||||
|
||||
// aapt resource value: 0x7f0b005e
|
||||
public const int exo_download_failed = 2131427422;
|
||||
public const int exo_download_downloading = 2131427422;
|
||||
|
||||
// aapt resource value: 0x7f0b005f
|
||||
public const int exo_download_notification_channel_name = 2131427423;
|
||||
public const int exo_download_failed = 2131427423;
|
||||
|
||||
// aapt resource value: 0x7f0b0060
|
||||
public const int exo_download_removing = 2131427424;
|
||||
public const int exo_download_notification_channel_name = 2131427424;
|
||||
|
||||
// aapt resource value: 0x7f0b0061
|
||||
public const int exo_item_list = 2131427425;
|
||||
|
||||
// aapt resource value: 0x7f0b006f
|
||||
public const int exo_media_action_repeat_all_description = 2131427439;
|
||||
|
||||
// aapt resource value: 0x7f0b0070
|
||||
public const int exo_media_action_repeat_off_description = 2131427440;
|
||||
|
||||
// aapt resource value: 0x7f0b0071
|
||||
public const int exo_media_action_repeat_one_description = 2131427441;
|
||||
public const int exo_download_removing = 2131427425;
|
||||
|
||||
// aapt resource value: 0x7f0b0062
|
||||
public const int exo_track_bitrate = 2131427426;
|
||||
public const int exo_item_list = 2131427426;
|
||||
|
||||
// aapt resource value: 0x7f0b0070
|
||||
public const int exo_media_action_repeat_all_description = 2131427440;
|
||||
|
||||
// aapt resource value: 0x7f0b0071
|
||||
public const int exo_media_action_repeat_off_description = 2131427441;
|
||||
|
||||
// aapt resource value: 0x7f0b0072
|
||||
public const int exo_media_action_repeat_one_description = 2131427442;
|
||||
|
||||
// aapt resource value: 0x7f0b0063
|
||||
public const int exo_track_mono = 2131427427;
|
||||
public const int exo_track_bitrate = 2131427427;
|
||||
|
||||
// aapt resource value: 0x7f0b0064
|
||||
public const int exo_track_resolution = 2131427428;
|
||||
public const int exo_track_mono = 2131427428;
|
||||
|
||||
// aapt resource value: 0x7f0b0065
|
||||
public const int exo_track_selection_auto = 2131427429;
|
||||
public const int exo_track_resolution = 2131427429;
|
||||
|
||||
// aapt resource value: 0x7f0b0066
|
||||
public const int exo_track_selection_none = 2131427430;
|
||||
public const int exo_track_selection_auto = 2131427430;
|
||||
|
||||
// aapt resource value: 0x7f0b0067
|
||||
public const int exo_track_selection_title_audio = 2131427431;
|
||||
public const int exo_track_selection_none = 2131427431;
|
||||
|
||||
// aapt resource value: 0x7f0b0068
|
||||
public const int exo_track_selection_title_text = 2131427432;
|
||||
public const int exo_track_selection_title_audio = 2131427432;
|
||||
|
||||
// aapt resource value: 0x7f0b0069
|
||||
public const int exo_track_selection_title_video = 2131427433;
|
||||
public const int exo_track_selection_title_text = 2131427433;
|
||||
|
||||
// aapt resource value: 0x7f0b006a
|
||||
public const int exo_track_stereo = 2131427434;
|
||||
public const int exo_track_selection_title_video = 2131427434;
|
||||
|
||||
// aapt resource value: 0x7f0b006b
|
||||
public const int exo_track_surround = 2131427435;
|
||||
public const int exo_track_stereo = 2131427435;
|
||||
|
||||
// aapt resource value: 0x7f0b006c
|
||||
public const int exo_track_surround_5_point_1 = 2131427436;
|
||||
public const int exo_track_surround = 2131427436;
|
||||
|
||||
// aapt resource value: 0x7f0b006d
|
||||
public const int exo_track_surround_7_point_1 = 2131427437;
|
||||
public const int exo_track_surround_5_point_1 = 2131427437;
|
||||
|
||||
// aapt resource value: 0x7f0b006e
|
||||
public const int exo_track_unknown = 2131427438;
|
||||
public const int exo_track_surround_7_point_1 = 2131427438;
|
||||
|
||||
// aapt resource value: 0x7f0b006f
|
||||
public const int exo_track_unknown = 2131427439;
|
||||
|
||||
// aapt resource value: 0x7f0b0044
|
||||
public const int fab_transformation_scrim_behavior = 2131427396;
|
||||
@@ -9888,6 +9888,9 @@ namespace Mear.Droid
|
||||
// aapt resource value: 0x7f0b0046
|
||||
public const int hide_bottom_view_on_scroll_behavior = 2131427398;
|
||||
|
||||
// aapt resource value: 0x7f0b004e
|
||||
public const int library_name = 2131427406;
|
||||
|
||||
// aapt resource value: 0x7f0b0000
|
||||
public const int mr_button_content_description = 2131427328;
|
||||
|
||||
|
||||
@@ -11,9 +11,12 @@
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
|
||||
<!-- colorPrimary is used for the default action bar background -->
|
||||
<!--
|
||||
<item name="colorPrimary">#2196F3</item>
|
||||
-->
|
||||
<item name="colorPrimary">#222222</item>
|
||||
<!-- colorPrimaryDark is used for the status bar -->
|
||||
<item name="colorPrimaryDark">#1976D2</item>
|
||||
<item name="colorPrimaryDark">#000000</item>
|
||||
<!-- colorAccent is used as the default value for colorControlActivated
|
||||
which is used to tint widgets -->
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
|
||||
@@ -130,6 +130,9 @@
|
||||
<PackageReference Include="sqlite-net-pcl">
|
||||
<Version>1.5.231</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="UXDivers.GorillaPlayer.SDK">
|
||||
<Version>1.5.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.482894" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
+21
-1
@@ -20,6 +20,13 @@
|
||||
|
||||
<Color x:Key="EntryTextColor">#ffffee</Color>
|
||||
|
||||
<!--
|
||||
<Color x:Key="SearchBarBackgroundColor">#ffffee</Color>
|
||||
<Color x:Key="SearchBarCancelButtonColor">#999999</Color>
|
||||
<Color x:Key="StaticResource SearchBarPlaceholderColor">#ffeeff</Color>
|
||||
-->
|
||||
<Color x:Key="StaticResource SearchBarTextColor">#ffffff</Color>
|
||||
|
||||
<Style TargetType="NavigationPage">
|
||||
<Setter Property="BackgroundColor" Value="{StaticResource NavigationPageBackgroundColor}" />
|
||||
<Setter Property="BarBackgroundColor" Value="{StaticResource NavigationPageColor}" />
|
||||
@@ -30,9 +37,14 @@
|
||||
</Style>
|
||||
<Style TargetType="TabbedPage">
|
||||
<Setter Property="BarTextColor" Value="{StaticResource TabbedBarTextColor}" />
|
||||
<!--
|
||||
<Setter Property="UnselectedTabColor" Value="{StaticResource TabbedUnselectedColor}" />
|
||||
-->
|
||||
<Setter Property="UnselectedTabColor" Value="Green" />
|
||||
<!--
|
||||
<Setter Property="SelectedTabColor" Value="{StaticResource TabbedSelectedColor}" />
|
||||
<Setter Property="BarBackgroundColor" Value="Green" />
|
||||
-->
|
||||
<Setter Property="SelectedTabColor" Value="Yellow" />
|
||||
</Style>
|
||||
<Style TargetType="StackLayout">
|
||||
<Setter Property="BackgroundColor" Value="{StaticResource NavigationPageColor}" />
|
||||
@@ -49,6 +61,14 @@
|
||||
<Style TargetType="Entry">
|
||||
<Setter Property="TextColor" Value="{StaticResource EntryTextColor}" />
|
||||
</Style>
|
||||
<!--
|
||||
<Style TargetType="SearchBar">
|
||||
<Setter Property="BackgroundColor" Value="{StaticResource SearchBarBackgroundColor}" />
|
||||
<Setter Property="CancelButtonColor" Value="{StaticResource SearchBarCancelButtonColor}" />
|
||||
<Setter Property="PlaceholderColor" Value="{StaticResource SearchBarPlaceholderColor}" />
|
||||
<Setter Property="TextColor" Value="{StaticResource SearchBarTextColor}" />
|
||||
</Style>
|
||||
-->
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -13,7 +13,6 @@ namespace Mear
|
||||
InitializeComponent();
|
||||
|
||||
MainPage = new Landing();
|
||||
MainPage.SetValue(NavigationPage.BarBackgroundColorProperty, Color.Black);
|
||||
MainPage.SetValue(NavigationPage.BarTextColorProperty, Color.White);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<PackageReference Include="Plugin.MediaManager" Version="0.6.7" />
|
||||
<PackageReference Include="RestSharp" Version="106.6.9" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.5.231" />
|
||||
<PackageReference Include="UXDivers.GorillaPlayer.SDK" Version="1.5.2" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.0.0.482894" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Mear.ViewModels
|
||||
|
||||
|
||||
#region Methods
|
||||
private void NotifyPropertyChanged(string propertyName)
|
||||
protected void NotifyPropertyChanged(string propertyName)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace Mear.ViewModels
|
||||
#region Fields
|
||||
private ObservableCollection<Song> _songItems;
|
||||
private Command _refreshSongs;
|
||||
private Command _searchSongsCommand;
|
||||
private string _searchedText;
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -33,6 +35,22 @@ namespace Mear.ViewModels
|
||||
get => _refreshSongs;
|
||||
set => _refreshSongs = value;
|
||||
}
|
||||
public Command SearchSongsCommand
|
||||
{
|
||||
get => _searchSongsCommand;
|
||||
set => _searchSongsCommand = value;
|
||||
}
|
||||
|
||||
public string SearchedText
|
||||
{
|
||||
get => _searchedText;
|
||||
set
|
||||
{
|
||||
_searchedText = value;
|
||||
NotifyPropertyChanged("SearchSong");
|
||||
//SearchSongText(_searchedText);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -41,6 +59,7 @@ namespace Mear.ViewModels
|
||||
{
|
||||
_songItems = new ObservableCollection<Song>();
|
||||
_refreshSongs = new Command(async () => await PopulateSongsAsync());
|
||||
_searchSongsCommand = new Command(async () => await SearchSongText());
|
||||
|
||||
PopulateSongs();
|
||||
}
|
||||
@@ -124,6 +143,21 @@ namespace Mear.ViewModels
|
||||
|
||||
IsRefreshing = false;
|
||||
}
|
||||
|
||||
private async Task SearchSongText()
|
||||
{
|
||||
if (_searchedText == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var searchPhrase = _searchedText.Trim();
|
||||
|
||||
const int SEARCH_PHRASE_MIN_LENGTH = 3;
|
||||
if (searchPhrase.Length < SEARCH_PHRASE_MIN_LENGTH) return; // SEARCH_PHRASE_MIN_LENGTH = 3
|
||||
|
||||
_songItems.Where(sng => sng.Title.Contains(_searchedText) || sng.Artist.Contains(_searchedText));
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
</ContentPage.BindingContext>
|
||||
|
||||
<StackLayout>
|
||||
<SearchBar x:Name="SearchSong"
|
||||
Placeholder="Title, Artist"
|
||||
SearchCommand="{Binding SearchSongsCommand}"
|
||||
SearchCommandParameter="{Binding SearchedText, Source=x:Reference Search}"
|
||||
Text="{Binding SerachedText, Mode=TwoWay}">
|
||||
</SearchBar>
|
||||
<ListView x:Name="SongListView"
|
||||
ItemsSource="{Binding SongItems}"
|
||||
VerticalOptions="FillAndExpand"
|
||||
|
||||
Reference in New Issue
Block a user