Skip to content

Commit

Permalink
feat: Register Samples app as Android TV application
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Apr 3, 2023
1 parent 689311a commit bf3a832
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/SamplesApp/SamplesApp.Droid/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace SamplesApp.Droid
{
[global::Android.App.ApplicationAttribute(
Label = "@string/ApplicationName",
Banner = "@drawable/banner",
LargeHeap = true,
HardwareAccelerated = true,
Theme = "@style/AppTheme"
Expand Down
4 changes: 3 additions & 1 deletion src/SamplesApp/SamplesApp.Droid/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ namespace SamplesApp.Droid
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden
)]
[IntentFilter(
new[] { Android.Content.Intent.ActionMain },
Categories = new[] { Android.Content.Intent.CategoryLauncher, Android.Content.Intent.CategoryLeanbackLauncher })]
[IntentFilter(
new[] {
Android.Content.Intent.ActionView
},
Categories = new[] {
Android.Content.Intent.CategoryDefault,
Android.Content.Intent.CategoryBrowsable,
Android.Content.Intent.CategoryLeanbackLauncher
},
DataScheme = "uno-samples-test")]
public class MainActivity : Windows.UI.Xaml.ApplicationActivity
Expand Down
3 changes: 3 additions & 0 deletions src/SamplesApp/SamplesApp.Droid/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@
[assembly: UsesPermission("android.permission.USE_FULL_SCREEN_INTENT")]
[assembly: UsesPermission("android.permission.WRITE_EXTERNAL_STORAGE")]
[assembly: UsesPermission("android.permission.CAMERA")]

[assembly: UsesFeature("android.software.leanback", Required = false)]
[assembly: UsesFeature("android.hardware.touchscreen", Required = false)]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@
<AndroidResource Include="Resources\values\Strings.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\Icon.png" />
<AndroidResource Include="Resources\drawable-xhdpi\Icon.png" />
<AndroidResource Include="Resources\drawable-xhdpi\banner.png" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\AndroidManifest.xml">
Expand Down

0 comments on commit bf3a832

Please sign in to comment.