committed by
GitHub
94 changed files with 2066 additions and 965 deletions
@ -0,0 +1,66 @@ |
|||||
|
<animated-vector |
||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:aapt="http://schemas.android.com/aapt"> |
||||
|
<aapt:attr name="android:drawable"> |
||||
|
<vector |
||||
|
android:name="vector" |
||||
|
android:width="128dp" |
||||
|
android:height="128dp" |
||||
|
android:viewportWidth="128" |
||||
|
android:viewportHeight="128"> |
||||
|
<group |
||||
|
android:name="wrapper" |
||||
|
android:translateX="21" |
||||
|
android:translateY="21"> |
||||
|
<group android:name="group"> |
||||
|
<path |
||||
|
android:name="path" |
||||
|
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z" |
||||
|
android:strokeWidth="1"/> |
||||
|
<path |
||||
|
android:name="path_1" |
||||
|
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z" |
||||
|
android:strokeWidth="1" |
||||
|
android:fillType="evenOdd"/> |
||||
|
<path |
||||
|
android:name="path_2" |
||||
|
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z" |
||||
|
android:strokeWidth="1"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</vector> |
||||
|
</aapt:attr> |
||||
|
<target android:name="path"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_1"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_2"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
</animated-vector> |
||||
@ -0,0 +1,71 @@ |
|||||
|
<animated-vector |
||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:aapt="http://schemas.android.com/aapt"> |
||||
|
<aapt:attr name="android:drawable"> |
||||
|
<vector |
||||
|
android:name="vector" |
||||
|
android:width="128dp" |
||||
|
android:height="128dp" |
||||
|
android:viewportWidth="128" |
||||
|
android:viewportHeight="128"> |
||||
|
<group |
||||
|
android:name="wrapper" |
||||
|
android:translateX="21" |
||||
|
android:translateY="21"> |
||||
|
<group android:name="group"> |
||||
|
<path |
||||
|
android:name="path" |
||||
|
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1"/> |
||||
|
<path |
||||
|
android:name="path_1" |
||||
|
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1" |
||||
|
android:fillType="evenOdd"/> |
||||
|
<path |
||||
|
android:name="path_2" |
||||
|
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</vector> |
||||
|
</aapt:attr> |
||||
|
<target android:name="path_2"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:startOffset="100" |
||||
|
android:duration="900" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="500" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_1"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:startOffset="100" |
||||
|
android:duration="900" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
</animated-vector> |
||||
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||
|
<resources> |
||||
|
|
||||
|
<style name="MyTheme"> |
||||
|
</style> |
||||
|
|
||||
|
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar"> |
||||
|
<item name="android:windowActionBar">false</item> |
||||
|
<item name="android:windowBackground">@null</item> |
||||
|
<item name="android:windowNoTitle">true</item> |
||||
|
<item name="android:windowSplashScreenBackground">@color/splash_background</item> |
||||
|
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avalonia_anim</item> |
||||
|
<item name="android:windowSplashScreenAnimationDuration">1000</item> |
||||
|
<item name="postSplashScreenTheme">@style/MyTheme.Main</item> |
||||
|
|
||||
|
</style> |
||||
|
<style name="MyTheme.Main" |
||||
|
parent ="MyTheme.NoActionBar"> |
||||
|
<item name="android:windowIsTranslucent">true</item> |
||||
|
</style> |
||||
|
</resources> |
||||
@ -1,35 +0,0 @@ |
|||||
using Android.App; |
|
||||
using Android.Content; |
|
||||
using Android.Content.PM; |
|
||||
using Android.OS; |
|
||||
using Avalonia.Android; |
|
||||
|
|
||||
namespace ControlCatalog.Android |
|
||||
{ |
|
||||
[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] |
|
||||
public class SplashActivity : AvaloniaSplashActivity<App> |
|
||||
{ |
|
||||
protected override Avalonia.AppBuilder CustomizeAppBuilder(Avalonia.AppBuilder builder) |
|
||||
{ |
|
||||
return base.CustomizeAppBuilder(builder) |
|
||||
.AfterSetup(_ => |
|
||||
{ |
|
||||
Pages.EmbedSample.Implementation = new EmbedSampleAndroid(); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
protected override void OnCreate(Bundle? savedInstanceState) |
|
||||
{ |
|
||||
base.OnCreate(savedInstanceState); |
|
||||
} |
|
||||
|
|
||||
protected override void OnResume() |
|
||||
{ |
|
||||
base.OnResume(); |
|
||||
|
|
||||
StartActivity(new Intent(Application.Context, typeof(MainActivity))); |
|
||||
|
|
||||
Finish(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,12 +1,11 @@ |
|||||
using Android.App; |
using Android.App; |
||||
using Android.Content.PM; |
using Android.Content.PM; |
||||
using Avalonia; |
|
||||
using Avalonia.Android; |
using Avalonia.Android; |
||||
|
|
||||
namespace MobileSandbox.Android |
namespace MobileSandbox.Android |
||||
{ |
{ |
||||
[Activity(Label = "MobileSandbox.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] |
[Activity(Label = "MobileSandbox.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] |
||||
public class MainActivity : AvaloniaMainActivity |
public class MainActivity : AvaloniaMainActivity<App> |
||||
{ |
{ |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,66 @@ |
|||||
|
<animated-vector |
||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:aapt="http://schemas.android.com/aapt"> |
||||
|
<aapt:attr name="android:drawable"> |
||||
|
<vector |
||||
|
android:name="vector" |
||||
|
android:width="128dp" |
||||
|
android:height="128dp" |
||||
|
android:viewportWidth="128" |
||||
|
android:viewportHeight="128"> |
||||
|
<group |
||||
|
android:name="wrapper" |
||||
|
android:translateX="21" |
||||
|
android:translateY="21"> |
||||
|
<group android:name="group"> |
||||
|
<path |
||||
|
android:name="path" |
||||
|
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z" |
||||
|
android:strokeWidth="1"/> |
||||
|
<path |
||||
|
android:name="path_1" |
||||
|
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z" |
||||
|
android:strokeWidth="1" |
||||
|
android:fillType="evenOdd"/> |
||||
|
<path |
||||
|
android:name="path_2" |
||||
|
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z" |
||||
|
android:strokeWidth="1"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</vector> |
||||
|
</aapt:attr> |
||||
|
<target android:name="path"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_1"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_2"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
</animated-vector> |
||||
@ -0,0 +1,71 @@ |
|||||
|
<animated-vector |
||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:aapt="http://schemas.android.com/aapt"> |
||||
|
<aapt:attr name="android:drawable"> |
||||
|
<vector |
||||
|
android:name="vector" |
||||
|
android:width="128dp" |
||||
|
android:height="128dp" |
||||
|
android:viewportWidth="128" |
||||
|
android:viewportHeight="128"> |
||||
|
<group |
||||
|
android:name="wrapper" |
||||
|
android:translateX="21" |
||||
|
android:translateY="21"> |
||||
|
<group android:name="group"> |
||||
|
<path |
||||
|
android:name="path" |
||||
|
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1"/> |
||||
|
<path |
||||
|
android:name="path_1" |
||||
|
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1" |
||||
|
android:fillType="evenOdd"/> |
||||
|
<path |
||||
|
android:name="path_2" |
||||
|
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</vector> |
||||
|
</aapt:attr> |
||||
|
<target android:name="path_2"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:startOffset="100" |
||||
|
android:duration="900" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="500" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_1"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:startOffset="100" |
||||
|
android:duration="900" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
</animated-vector> |
||||
@ -0,0 +1,4 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<resources> |
||||
|
<color name="splash_background">#212121</color> |
||||
|
</resources> |
||||
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||
|
<resources> |
||||
|
|
||||
|
<style name="MyTheme"> |
||||
|
</style> |
||||
|
|
||||
|
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar"> |
||||
|
<item name="android:windowActionBar">false</item> |
||||
|
<item name="android:windowBackground">@null</item> |
||||
|
<item name="android:windowNoTitle">true</item> |
||||
|
<item name="android:windowSplashScreenBackground">@color/splash_background</item> |
||||
|
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avalonia_anim</item> |
||||
|
<item name="android:windowSplashScreenAnimationDuration">1000</item> |
||||
|
|
||||
|
</style> |
||||
|
</resources> |
||||
@ -1,17 +0,0 @@ |
|||||
using Android.App; |
|
||||
using Android.Content; |
|
||||
using Avalonia.Android; |
|
||||
|
|
||||
namespace MobileSandbox.Android |
|
||||
{ |
|
||||
[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] |
|
||||
public class SplashActivity : AvaloniaSplashActivity<App> |
|
||||
{ |
|
||||
protected override void OnResume() |
|
||||
{ |
|
||||
base.OnResume(); |
|
||||
|
|
||||
StartActivity(new Intent(Application.Context, typeof(MainActivity))); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,66 @@ |
|||||
|
<animated-vector |
||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:aapt="http://schemas.android.com/aapt"> |
||||
|
<aapt:attr name="android:drawable"> |
||||
|
<vector |
||||
|
android:name="vector" |
||||
|
android:width="128dp" |
||||
|
android:height="128dp" |
||||
|
android:viewportWidth="128" |
||||
|
android:viewportHeight="128"> |
||||
|
<group |
||||
|
android:name="wrapper" |
||||
|
android:translateX="21" |
||||
|
android:translateY="21"> |
||||
|
<group android:name="group"> |
||||
|
<path |
||||
|
android:name="path" |
||||
|
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z" |
||||
|
android:strokeWidth="1"/> |
||||
|
<path |
||||
|
android:name="path_1" |
||||
|
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z" |
||||
|
android:strokeWidth="1" |
||||
|
android:fillType="evenOdd"/> |
||||
|
<path |
||||
|
android:name="path_2" |
||||
|
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z" |
||||
|
android:strokeWidth="1"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</vector> |
||||
|
</aapt:attr> |
||||
|
<target android:name="path"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_1"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_2"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="1000" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
</animated-vector> |
||||
@ -0,0 +1,71 @@ |
|||||
|
<animated-vector |
||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:aapt="http://schemas.android.com/aapt"> |
||||
|
<aapt:attr name="android:drawable"> |
||||
|
<vector |
||||
|
android:name="vector" |
||||
|
android:width="128dp" |
||||
|
android:height="128dp" |
||||
|
android:viewportWidth="128" |
||||
|
android:viewportHeight="128"> |
||||
|
<group |
||||
|
android:name="wrapper" |
||||
|
android:translateX="21" |
||||
|
android:translateY="21"> |
||||
|
<group android:name="group"> |
||||
|
<path |
||||
|
android:name="path" |
||||
|
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1"/> |
||||
|
<path |
||||
|
android:name="path_1" |
||||
|
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1" |
||||
|
android:fillType="evenOdd"/> |
||||
|
<path |
||||
|
android:name="path_2" |
||||
|
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z" |
||||
|
android:fillColor="#00ffffff" |
||||
|
android:strokeWidth="1"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</vector> |
||||
|
</aapt:attr> |
||||
|
<target android:name="path_2"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:startOffset="100" |
||||
|
android:duration="900" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:duration="500" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#f9f9fb" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
<target android:name="path_1"> |
||||
|
<aapt:attr name="android:animation"> |
||||
|
<objectAnimator |
||||
|
android:propertyName="fillColor" |
||||
|
android:startOffset="100" |
||||
|
android:duration="900" |
||||
|
android:valueFrom="#00ffffff" |
||||
|
android:valueTo="#161c2d" |
||||
|
android:valueType="colorType" |
||||
|
android:interpolator="@android:interpolator/fast_out_slow_in"/> |
||||
|
</aapt:attr> |
||||
|
</target> |
||||
|
</animated-vector> |
||||
@ -0,0 +1,4 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<resources> |
||||
|
<color name="splash_background">#212121</color> |
||||
|
</resources> |
||||
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||
|
<resources> |
||||
|
|
||||
|
<style name="MyTheme"> |
||||
|
</style> |
||||
|
|
||||
|
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar"> |
||||
|
<item name="android:windowActionBar">false</item> |
||||
|
<item name="android:windowBackground">@null</item> |
||||
|
<item name="android:windowNoTitle">true</item> |
||||
|
<item name="android:windowSplashScreenBackground">@color/splash_background</item> |
||||
|
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avalonia_anim</item> |
||||
|
<item name="android:windowSplashScreenAnimationDuration">1000</item> |
||||
|
|
||||
|
</style> |
||||
|
</resources> |
||||
@ -1,30 +0,0 @@ |
|||||
using Android.App; |
|
||||
using Android.Content; |
|
||||
using Android.OS; |
|
||||
using Avalonia; |
|
||||
using Avalonia.Android; |
|
||||
using Application = Android.App.Application; |
|
||||
|
|
||||
namespace SafeAreaDemo.Android |
|
||||
{ |
|
||||
[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] |
|
||||
public class SplashActivity : AvaloniaSplashActivity<App> |
|
||||
{ |
|
||||
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) |
|
||||
{ |
|
||||
return base.CustomizeAppBuilder(builder); |
|
||||
} |
|
||||
|
|
||||
protected override void OnCreate(Bundle? savedInstanceState) |
|
||||
{ |
|
||||
base.OnCreate(savedInstanceState); |
|
||||
} |
|
||||
|
|
||||
protected override void OnResume() |
|
||||
{ |
|
||||
base.OnResume(); |
|
||||
|
|
||||
StartActivity(new Intent(Application.Context, typeof(MainActivity))); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,4 +1,11 @@ |
|||||
<Window xmlns="https://github.com/avaloniaui" |
<Window xmlns="https://github.com/avaloniaui" |
||||
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' |
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' |
||||
x:Class="Sandbox.MainWindow"> |
x:Class="Sandbox.MainWindow"> |
||||
|
|
||||
|
<ScrollViewer> |
||||
|
<StackPanel> |
||||
|
<Button Margin="0 100000000000000000 0 0">0</Button> |
||||
|
<Button>1</Button> |
||||
|
</StackPanel> |
||||
|
</ScrollViewer> |
||||
</Window> |
</Window> |
||||
|
|||||
@ -0,0 +1,60 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Avalonia.Android |
||||
|
{ |
||||
|
partial class AvaloniaMainActivity<TApp> where TApp : Application, new() |
||||
|
{ |
||||
|
protected virtual AppBuilder CustomizeAppBuilder(AppBuilder builder) => builder.UseAndroid(); |
||||
|
|
||||
|
private static AppBuilder? s_appBuilder; |
||||
|
internal static object ViewContent; |
||||
|
|
||||
|
public object Content |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
return ViewContent; |
||||
|
} |
||||
|
set |
||||
|
{ |
||||
|
ViewContent = value; |
||||
|
if (View != null) |
||||
|
View.Content = value; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected AppBuilder CreateAppBuilder() |
||||
|
{ |
||||
|
var builder = AppBuilder.Configure<TApp>(); |
||||
|
|
||||
|
return CustomizeAppBuilder(builder); |
||||
|
} |
||||
|
|
||||
|
private void InitializeApp() |
||||
|
{ |
||||
|
if (s_appBuilder == null) |
||||
|
{ |
||||
|
var builder = CreateAppBuilder(); |
||||
|
|
||||
|
builder.SetupWithLifetime(new SingleViewLifetime()); |
||||
|
|
||||
|
s_appBuilder = builder; |
||||
|
} |
||||
|
|
||||
|
View = new AvaloniaView(this); |
||||
|
if (ViewContent != null) |
||||
|
{ |
||||
|
View.Content = ViewContent; |
||||
|
} |
||||
|
|
||||
|
if (Avalonia.Application.Current.ApplicationLifetime is SingleViewLifetime lifetime) |
||||
|
{ |
||||
|
lifetime.View = View; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,40 +0,0 @@ |
|||||
using Android.OS; |
|
||||
using AndroidX.AppCompat.App; |
|
||||
|
|
||||
namespace Avalonia.Android |
|
||||
{ |
|
||||
public abstract class AvaloniaSplashActivity : AppCompatActivity |
|
||||
{ |
|
||||
protected abstract AppBuilder CreateAppBuilder(); |
|
||||
|
|
||||
private static AppBuilder s_appBuilder; |
|
||||
|
|
||||
protected override void OnCreate(Bundle? savedInstanceState) |
|
||||
{ |
|
||||
base.OnCreate(savedInstanceState); |
|
||||
|
|
||||
if (s_appBuilder == null) |
|
||||
{ |
|
||||
var builder = CreateAppBuilder(); |
|
||||
|
|
||||
var lifetime = new SingleViewLifetime(); |
|
||||
|
|
||||
builder.SetupWithLifetime(lifetime); |
|
||||
|
|
||||
s_appBuilder = builder; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public abstract class AvaloniaSplashActivity<TApp> : AvaloniaSplashActivity where TApp : Application, new() |
|
||||
{ |
|
||||
protected virtual AppBuilder CustomizeAppBuilder(AppBuilder builder) => builder.UseAndroid(); |
|
||||
|
|
||||
protected override AppBuilder CreateAppBuilder() |
|
||||
{ |
|
||||
var builder = AppBuilder.Configure<TApp>(); |
|
||||
|
|
||||
return CustomizeAppBuilder(builder); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,145 @@ |
|||||
|
using System; |
||||
|
using System.Globalization; |
||||
|
using System.Numerics; |
||||
|
using Avalonia.Rendering.Composition.Expressions; |
||||
|
using Avalonia.Utilities; |
||||
|
|
||||
|
namespace Avalonia; |
||||
|
|
||||
|
public readonly record struct Vector3D(double X, double Y, double Z) |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Parses a <see cref="Vector"/> string.
|
||||
|
/// </summary>
|
||||
|
/// <param name="s">The string.</param>
|
||||
|
/// <returns>The <see cref="Vector3D"/>.</returns>
|
||||
|
public static Vector3D Parse(string s) |
||||
|
{ |
||||
|
using (var tokenizer = new StringTokenizer(s, CultureInfo.InvariantCulture, exceptionMessage: "Invalid Vector.")) |
||||
|
{ |
||||
|
return new Vector3D( |
||||
|
tokenizer.ReadDouble(), |
||||
|
tokenizer.ReadDouble(), |
||||
|
tokenizer.ReadDouble() |
||||
|
); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
internal Vector3 ToVector3() => new Vector3((float)X, (float)Y, (float)Z); |
||||
|
|
||||
|
internal Vector3D(Vector3 v) : this(v.X, v.Y, v.Z) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public static implicit operator Vector3D(Vector3 vector) => new(vector); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Calculates the dot product of two vectors.
|
||||
|
/// </summary>
|
||||
|
public static double Dot(Vector3D vector1, Vector3D vector2) => |
||||
|
(vector1.X * vector2.X) |
||||
|
+ (vector1.Y * vector2.Y) |
||||
|
+ (vector1.Z * vector2.Z); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Adds the second to the first vector
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Add(Vector3D left, Vector3D right) => |
||||
|
new Vector3D(left.X + right.X, left.Y + right.Y, left.Z + right.Z); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Adds the second to the first vector
|
||||
|
/// </summary>
|
||||
|
public static Vector3D operator +(Vector3D left, Vector3D right) => Add(left, right); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Subtracts the second from the first vector
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Substract(Vector3D left, Vector3D right) => |
||||
|
new Vector3D(left.X - right.X, left.Y - right.Y, left.Z - right.Z); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Subtracts the second from the first vector
|
||||
|
/// </summary>
|
||||
|
public static Vector3D operator -(Vector3D left, Vector3D right) => Substract(left, right); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Negates the vector
|
||||
|
/// </summary>
|
||||
|
public static Vector3D operator -(Vector3D v) => new(-v.X, -v.Y, -v.Z); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Multiplies the first vector by the second.
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Multiply(Vector3D left, Vector3D right) => |
||||
|
new(left.X * right.X, left.Y * right.Y, left.Z * right.Z); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Multiplies the vector by the given scalar.
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Multiply(Vector3D left, double right) => |
||||
|
new(left.X * right, left.Y * right, left.Z * right); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Multiplies the vector by the given scalar.
|
||||
|
/// </summary>
|
||||
|
public static Vector3D operator *(Vector3D left, double right) => Multiply(left, right); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Divides the first vector by the second.
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Divide(Vector3D left, Vector3D right) => |
||||
|
new(left.X / right.X, left.Y / right.Y, left.Z / right.Z); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Divides the vector by the given scalar.
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Divide(Vector3D left, double right) => |
||||
|
new(left.X / right, left.Y / right, left.Z / right); |
||||
|
|
||||
|
/// <summary>Returns a vector whose elements are the absolute values of each of the specified vector's elements.</summary>
|
||||
|
public Vector3D Abs() => new(Math.Abs(X), Math.Abs(Y), Math.Abs(Z)); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Restricts a vector between a minimum and a maximum value.
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Clamp(Vector3D value, Vector3D min, Vector3D max) => |
||||
|
Min(Max(value, min), max); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Max(Vector3D left, Vector3D right) => |
||||
|
new(Math.Max(left.X, right.X), Math.Max(left.Y, right.Y), Math.Max(left.Z, right.Z)); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Min(Vector3D left, Vector3D right) => |
||||
|
new(Math.Min(left.X, right.X), Math.Min(left.Y, right.Y), Math.Min(left.Z, right.Z)); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Length of the vector.
|
||||
|
/// </summary>
|
||||
|
public double Length => Math.Sqrt(Dot(this, this)); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Returns a normalized version of this vector.
|
||||
|
/// </summary>
|
||||
|
public static Vector3D Normalize(Vector3D value) => Divide(value, value.Length); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Computes the squared Euclidean distance between the two given points.
|
||||
|
/// </summary>
|
||||
|
public static double DistanceSquared(Vector3D value1, Vector3D value2) |
||||
|
{ |
||||
|
var difference = Vector3D.Substract(value1, value2); |
||||
|
return Dot(difference, difference); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Computes the Euclidean distance between the two given points.
|
||||
|
/// </summary>
|
||||
|
public static double Distance(Vector3D value1, Vector3D value2) => Math.Sqrt(DistanceSquared(value1, value2)); |
||||
|
} |
||||
@ -0,0 +1,156 @@ |
|||||
|
using System; |
||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Avalonia.Controls.Primitives; |
||||
|
using Avalonia.Layout; |
||||
|
|
||||
|
namespace Avalonia.Controls.Utils |
||||
|
{ |
||||
|
internal class VirtualizingSnapPointsList : IReadOnlyList<double> |
||||
|
{ |
||||
|
private const int ExtraCount = 2; |
||||
|
private readonly RealizedStackElements _realizedElements; |
||||
|
private readonly Orientation _orientation; |
||||
|
private readonly Orientation _parentOrientation; |
||||
|
private readonly SnapPointsAlignment _snapPointsAlignment; |
||||
|
private readonly double _size; |
||||
|
private readonly int _start = -1; |
||||
|
private readonly int _end; |
||||
|
|
||||
|
public VirtualizingSnapPointsList(RealizedStackElements realizedElements, int count, Orientation orientation, Orientation parentOrientation, SnapPointsAlignment snapPointsAlignment, double size) |
||||
|
{ |
||||
|
_realizedElements = realizedElements; |
||||
|
_orientation = orientation; |
||||
|
_parentOrientation = parentOrientation; |
||||
|
_snapPointsAlignment = snapPointsAlignment; |
||||
|
_size = size; |
||||
|
if (parentOrientation == orientation) |
||||
|
{ |
||||
|
_start = Math.Max(0, _realizedElements.FirstIndex - ExtraCount); |
||||
|
_end = Math.Min(count - 1, _realizedElements.LastIndex + ExtraCount); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public double this[int index] |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
if(index < 0 || index >= Count) |
||||
|
throw new ArgumentOutOfRangeException("index"); |
||||
|
|
||||
|
index += _start; |
||||
|
|
||||
|
double snapPoint = 0; |
||||
|
var averageElementSize = _size; |
||||
|
|
||||
|
Control? container; |
||||
|
switch (_orientation) |
||||
|
{ |
||||
|
case Orientation.Horizontal: |
||||
|
container = _realizedElements.GetElement(index); |
||||
|
if (container != null) |
||||
|
{ |
||||
|
switch (_snapPointsAlignment) |
||||
|
{ |
||||
|
case SnapPointsAlignment.Near: |
||||
|
snapPoint = container.Bounds.Left; |
||||
|
break; |
||||
|
case SnapPointsAlignment.Center: |
||||
|
snapPoint = container.Bounds.Center.X; |
||||
|
break; |
||||
|
case SnapPointsAlignment.Far: |
||||
|
snapPoint = container.Bounds.Right; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
var ind = index; |
||||
|
if (index > _realizedElements.LastIndex) |
||||
|
{ |
||||
|
ind -= _realizedElements.LastIndex + 1; |
||||
|
} |
||||
|
snapPoint = ind * averageElementSize; |
||||
|
switch (_snapPointsAlignment) |
||||
|
{ |
||||
|
case SnapPointsAlignment.Center: |
||||
|
snapPoint += averageElementSize / 2; |
||||
|
break; |
||||
|
case SnapPointsAlignment.Far: |
||||
|
snapPoint += averageElementSize; |
||||
|
break; |
||||
|
} |
||||
|
if (index > _realizedElements.LastIndex) |
||||
|
{ |
||||
|
var lastElement = _realizedElements.GetElement(_realizedElements.LastIndex); |
||||
|
if (lastElement != null) |
||||
|
{ |
||||
|
snapPoint += lastElement.Bounds.Right; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
break; |
||||
|
case Orientation.Vertical: |
||||
|
container = _realizedElements.GetElement(index); |
||||
|
if (container != null) |
||||
|
{ |
||||
|
switch (_snapPointsAlignment) |
||||
|
{ |
||||
|
case SnapPointsAlignment.Near: |
||||
|
snapPoint = container.Bounds.Top; |
||||
|
break; |
||||
|
case SnapPointsAlignment.Center: |
||||
|
snapPoint = container.Bounds.Center.Y; |
||||
|
break; |
||||
|
case SnapPointsAlignment.Far: |
||||
|
snapPoint = container.Bounds.Bottom; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
var ind = index; |
||||
|
if(index > _realizedElements.LastIndex) |
||||
|
{ |
||||
|
ind -= _realizedElements.LastIndex + 1; |
||||
|
} |
||||
|
snapPoint = ind * averageElementSize; |
||||
|
switch (_snapPointsAlignment) |
||||
|
{ |
||||
|
case SnapPointsAlignment.Center: |
||||
|
snapPoint += averageElementSize / 2; |
||||
|
break; |
||||
|
case SnapPointsAlignment.Far: |
||||
|
snapPoint += averageElementSize; |
||||
|
break; |
||||
|
} |
||||
|
if (index > _realizedElements.LastIndex) |
||||
|
{ |
||||
|
var lastElement = _realizedElements.GetElement(_realizedElements.LastIndex); |
||||
|
if (lastElement != null) |
||||
|
{ |
||||
|
snapPoint += lastElement.Bounds.Bottom; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
return snapPoint; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public int Count => _parentOrientation != _orientation ? 0 : _end - _start + 1; |
||||
|
|
||||
|
public IEnumerator<double> GetEnumerator() |
||||
|
{ |
||||
|
for (var i = 0; i < Count; i++) |
||||
|
yield return this[i]; |
||||
|
} |
||||
|
|
||||
|
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); |
||||
|
} |
||||
|
} |
||||
@ -1,22 +1,25 @@ |
|||||
<Styles xmlns="https://github.com/avaloniaui" |
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
x:ClassModifier="internal"> |
x:ClassModifier="internal"> |
||||
<Style Selector="TextBlock" > |
<x:Double x:Key="ControlContentThemeFontSize">14</x:Double> |
||||
<Setter Property="FontSize" Value="14" /> |
<x:Double x:Key="ContentControlFontSize">14</x:Double> |
||||
</Style> |
<x:Double x:Key="TextControlThemeMinHeight">24</x:Double> |
||||
<Styles.Resources> |
<x:Double x:Key="TextControlThemeMinWidth">32</x:Double> |
||||
<x:Double x:Key="ControlContentThemeFontSize">14</x:Double> |
<Thickness x:Key="TextControlThemePadding">4, 2</Thickness> |
||||
<x:Double x:Key="ContentControlFontSize">14</x:Double> |
<Thickness x:Key="ListBoxItemPadding">4,2</Thickness> |
||||
<x:Double x:Key="TextControlThemeMinHeight">24</x:Double> |
<x:Double x:Key="ListViewItemMinHeight">24</x:Double> |
||||
<Thickness x:Key="TextControlThemePadding">2,2,6,1</Thickness> |
<Thickness x:Key="ComboBoxItemThemePadding">11,5,11,7</Thickness> |
||||
<x:Double x:Key="ListViewItemMinHeight">32</x:Double> |
<Thickness x:Key="MenuFlyoutItemThemePaddingNarrow">4 4 8 4</Thickness> |
||||
<x:Double x:Key="TreeViewItemMinHeight">24</x:Double> |
<Thickness x:Key="MenuBarItemPadding">5, 2</Thickness> |
||||
<Thickness x:Key="TimePickerHostPadding">0,1,0,2</Thickness> |
<x:Double x:Key="TreeViewItemMinHeight">24</x:Double> |
||||
<Thickness x:Key="DatePickerHostPadding">0,1,0,2</Thickness> |
<Thickness x:Key="TimePickerHostPadding">0,1,0,2</Thickness> |
||||
<Thickness x:Key="DatePickerHostMonthPadding">9,0,0,1</Thickness> |
<Thickness x:Key="DatePickerHostPadding">0,1,0,2</Thickness> |
||||
<Thickness x:Key="ComboBoxEditableTextPadding">10,0,30,0</Thickness> |
<Thickness x:Key="DatePickerHostMonthPadding">9,0,0,1</Thickness> |
||||
<x:Double x:Key="ComboBoxMinHeight">24</x:Double> |
<Thickness x:Key="ComboBoxEditableTextPadding">10,0,30,0</Thickness> |
||||
<Thickness x:Key="ComboBoxPadding">12,1,0,3</Thickness> |
<x:Double x:Key="ComboBoxMinHeight">24</x:Double> |
||||
<x:Double x:Key="NavigationViewItemOnLeftMinHeight">32</x:Double> |
<Thickness x:Key="ComboBoxPadding">12,1,0,3</Thickness> |
||||
</Styles.Resources> |
<x:Double x:Key="NavigationViewItemOnLeftMinHeight">32</x:Double> |
||||
</Styles> |
<x:Double x:Key="TabItemMinHeight">28</x:Double> |
||||
|
<Thickness x:Key="TabItemHeaderMargin">6, 0</Thickness> |
||||
|
<Thickness x:Key="ButtonPadding">6,4</Thickness> |
||||
|
</ResourceDictionary> |
||||
|
|||||
Loading…
Reference in new issue