All text in the home now use the string.xml file. For translations purpose.

This commit is contained in:
Tristan Roux
2019-01-26 00:19:19 +01:00
parent 28fa6942f4
commit 5e03c434e3
7 changed files with 57 additions and 13 deletions

View File

@@ -856,6 +856,9 @@
<ItemGroup>
<AndroidResource Include="Resources\layout\PreferenceCategory.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values\strings.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v7.Preference.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.Preference.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.Preference.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.Preference.targets')" />

View File

@@ -72,11 +72,11 @@ namespace MusicApp.Resources.Portable_Class
if (MusicPlayer.UseCastPlayer || (MusicPlayer.queue != null && MusicPlayer.queue?.Count > 0))
{
HomeSection queue = new HomeSection("Queue", SectionType.SinglePlaylist, MusicPlayer.queue);
HomeSection queue = new HomeSection(Resources.GetString(Resource.String.queue), SectionType.SinglePlaylist, MusicPlayer.queue);
adapterItems.Add(queue);
}
HomeSection shuffle = new HomeSection("Shuffle", SectionType.Shuffle, null);
HomeSection shuffle = new HomeSection(Resources.GetString(Resource.String.shuffle), SectionType.Shuffle, null);
adapterItems.Add(shuffle);
Android.Net.Uri musicUri = MediaStore.Audio.Media.ExternalContentUri;
@@ -118,7 +118,7 @@ namespace MusicApp.Resources.Portable_Class
if (songList.Count > 0)
{
HomeSection featured = new HomeSection("Featured", SectionType.SinglePlaylist, songList.GetRange(0, songList.Count > 50 ? 50 : songList.Count));
HomeSection featured = new HomeSection(Resources.GetString(Resource.String.featured), SectionType.SinglePlaylist, songList.GetRange(0, songList.Count > 50 ? 50 : songList.Count));
adapterItems.Add(featured);
}
@@ -396,8 +396,6 @@ namespace MusicApp.Resources.Portable_Class
channelLits.Add(channel);
}
Console.WriteLine("Page loaded");
nextPageToken = response.NextPageToken;
}
catch(Exception ex)
@@ -411,15 +409,15 @@ namespace MusicApp.Resources.Portable_Class
List<Song> channels = channelLits.OrderBy(x => r.Next()).ToList();
channels.RemoveAll(x => selectedTopics.Contains(x.Title));
HomeSection TopicSelector = new HomeSection("Music Genres", SectionType.TopicSelector, channels);
HomeSection TopicSelector = new HomeSection(Resources.GetString(Resource.String.music_genres), SectionType.TopicSelector, channels);
adapter.AddToList(new List<HomeSection> { TopicSelector });
}
public void AddQueue()
{
if (adapterItems[0].SectionTitle != "Queue")
if (adapterItems[0].SectionTitle != Resources.GetString(Resource.String.queue))
{
HomeSection queue = new HomeSection("Queue", SectionType.SinglePlaylist, MusicPlayer.queue);
HomeSection queue = new HomeSection(Resources.GetString(Resource.String.queue), SectionType.SinglePlaylist, MusicPlayer.queue);
adapterItems.Insert(0, queue);
adapter.Insert(0, queue);
}

View File

@@ -7207,6 +7207,9 @@ namespace MusicApp
// aapt resource value: 0x7f0c0081
public const int bottom_sheet_behavior = 2131492993;
// aapt resource value: 0x7f0c00b1
public const int browse = 2131493041;
// aapt resource value: 0x7f0c0000
public const int cast_ad_label = 2131492864;
@@ -7498,9 +7501,18 @@ namespace MusicApp
// aapt resource value: 0x7f0c0085
public const int fab_transformation_sheet_behavior = 2131492997;
// aapt resource value: 0x7f0c00b7
public const int featured = 2131493047;
// aapt resource value: 0x7f0c0086
public const int hide_bottom_view_on_scroll_behavior = 2131492998;
// aapt resource value: 0x7f0c00b0
public const int home = 2131493040;
// aapt resource value: 0x7f0c00b5
public const int more = 2131493045;
// aapt resource value: 0x7f0c0040
public const int mr_button_content_description = 2131492928;
@@ -7576,6 +7588,9 @@ namespace MusicApp
// aapt resource value: 0x7f0c0087
public const int mtrl_chip_close_icon_content_description = 2131492999;
// aapt resource value: 0x7f0c00b8
public const int music_genres = 2131493048;
// aapt resource value: 0x7f0c0088
public const int password_toggle_content_description = 2131493000;
@@ -7591,9 +7606,24 @@ namespace MusicApp
// aapt resource value: 0x7f0c008c
public const int path_password_strike_through = 2131493004;
// aapt resource value: 0x7f0c00b2
public const int playlists = 2131493042;
// aapt resource value: 0x7f0c00b6
public const int queue = 2131493046;
// aapt resource value: 0x7f0c00b9
public const int recommendation_explanation = 2131493049;
// aapt resource value: 0x7f0c0073
public const int search_menu_title = 2131492979;
// aapt resource value: 0x7f0c00b4
public const int shuffle = 2131493044;
// aapt resource value: 0x7f0c00b3
public const int shuffle_all = 2131493043;
// aapt resource value: 0x7f0c008d
public const int status_bar_notification_info_overflow = 2131493005;

View File

@@ -21,7 +21,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SHUFFLE ALL"
android:text="@string/shuffle_all"
android:textColor="#15b7ed"
android:textSize="14sp"
android:textStyle="bold"

View File

@@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:textSize="16dp"
android:alpha=".8"
android:text="used for your recommendation" />
android:text="@string/recommendation_explanation" />
</LinearLayout>
<Button
android:id="@+id/viewMore"

View File

@@ -4,19 +4,19 @@
<item
android:id="@+id/musicLayout"
android:enabled="true"
android:title="Home"
android:title="@string/home"
android:icon="@drawable/Home"
app:showAsAction="ifRoom" />
<item
android:id="@+id/browseLayout"
android:enabled="true"
android:title="Browse"
android:title="@string/browse"
android:icon="@drawable/Folder"
app:showAsAction="ifRoom" />
<item
android:id="@+id/playlistLayout"
android:enabled="true"
android:title="Playlist"
android:title="@string/playlists"
android:icon="@drawable/PlaylistPlay"
app:showAsAction="ifRoom" />
</menu>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<string name="home">Home</string>
<string name="browse">Browse</string>
<string name="playlists">Playlists</string>
<string name="shuffle_all">SHUFFLE ALL</string>
<string name="shuffle">Shuffle</string>
<string name="more">MORE</string>
<string name="queue">Queue</string>
<string name="featured">Featured</string>
<string name="music_genres">Music Genres</string>
<string name="recommendation_explanation">used for your recommendation</string>
</resources>