Ver código fonte

added pan on pointer press for image view, fixed android app name

Veloe 1 ano atrás
pai
commit
a94b6275d2

+ 1 - 1
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp.Android/MainActivity.cs

@@ -9,7 +9,7 @@ using VeloeAvaloniaKemonoPartyApp.Services;
 namespace VeloeAvaloniaKemonoPartyApp.Android
 {
     [Activity(
-        Label = "VeloeAvaloniaKemonoPartyApp.Android",
+        Label = "VeloeKemonoParty",
         Theme = "@style/MyTheme.NoActionBar",
         Icon = "@drawable/icon",
         MainLauncher = true,

+ 3 - 2
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp.Android/Properties/AndroidManifest.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
 	<uses-permission android:name="android.permission.INTERNET" />
-	<application android:label="VeloeAvaloniaKemonoPartyApp" android:icon="@drawable/Icon" />
-</manifest>
+	<application android:label="VeloeKemonoParty" android:icon="@drawable/Icon" />
+	<uses-sdk />
+</manifest>

+ 4 - 4
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp.Android/VeloeAvaloniaKemonoPartyApp.Android.csproj

@@ -4,13 +4,13 @@
     <TargetFramework>net8.0-android34.0</TargetFramework>
     <SupportedOSPlatformVersion>29</SupportedOSPlatformVersion>
     <Nullable>enable</Nullable>
-    <ApplicationId>com.CompanyName.VeloeAvaloniaKemonoPartyApp</ApplicationId>
+    <ApplicationId>com.Veloe.AvaloniaKemonoParty</ApplicationId>
     <ApplicationVersion>1</ApplicationVersion>
-    <ApplicationDisplayVersion>1.0.0.90</ApplicationDisplayVersion>
+    <ApplicationDisplayVersion>1.0.0.102</ApplicationDisplayVersion>
     <AndroidPackageFormat>apk</AndroidPackageFormat>
     <AndroidEnableProfiledAot>False</AndroidEnableProfiledAot>
-    <AssemblyVersion>1.0.0.90</AssemblyVersion>
-    <FileVersion>1.0.0.90</FileVersion>
+    <AssemblyVersion>1.0.0.102</AssemblyVersion>
+    <FileVersion>1.0.0.102</FileVersion>
   </PropertyGroup>
 
   <ItemGroup>

+ 2 - 2
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp.Browser/VeloeAvaloniaKemonoPartyApp.Browser.csproj

@@ -4,8 +4,8 @@
     <RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
     <WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
     <OutputType>Exe</OutputType>
-    <AssemblyVersion>1.0.0.7</AssemblyVersion>
-    <FileVersion>1.0.0.7</FileVersion>
+    <AssemblyVersion>1.0.0.8</AssemblyVersion>
+    <FileVersion>1.0.0.8</FileVersion>
   </PropertyGroup>
 
   <ItemGroup>

+ 2 - 2
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp.Desktop/VeloeAvaloniaKemonoPartyApp.Desktop.csproj

@@ -10,8 +10,8 @@
 
   <PropertyGroup>
     <ApplicationManifest>app.manifest</ApplicationManifest>
-    <AssemblyVersion>1.0.0.87</AssemblyVersion>
-    <FileVersion>1.0.0.87</FileVersion>
+    <AssemblyVersion>1.0.0.89</AssemblyVersion>
+    <FileVersion>1.0.0.89</FileVersion>
   </PropertyGroup>
 
   <ItemGroup>

+ 2 - 2
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp.iOS/VeloeAvaloniaKemonoPartyApp.iOS.csproj

@@ -4,8 +4,8 @@
     <TargetFramework>net8.0-ios</TargetFramework>
     <SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
     <Nullable>enable</Nullable>
-    <AssemblyVersion>1.0.0.7</AssemblyVersion>
-    <FileVersion>1.0.0.7</FileVersion>
+    <AssemblyVersion>1.0.0.8</AssemblyVersion>
+    <FileVersion>1.0.0.8</FileVersion>
   </PropertyGroup>
 
   <ItemGroup>

+ 2 - 2
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp.csproj

@@ -4,8 +4,8 @@
     <Nullable>enable</Nullable>
     <LangVersion>latest</LangVersion>
     <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
-    <AssemblyVersion>1.0.0.227</AssemblyVersion>
-    <FileVersion>1.0.0.227</FileVersion>
+    <AssemblyVersion>1.0.0.249</AssemblyVersion>
+    <FileVersion>1.0.0.249</FileVersion>
   </PropertyGroup>
 
   

+ 1 - 1
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp/Views/ImageZoomView.axaml

@@ -14,7 +14,7 @@
 					Gestures.Pinch="ZoomImage" 
 					Gestures.PinchEnded="ZoomImageEnd" 
 					Gestures.DoubleTapped="ZoomImageToDefault">
-		<Image Source="{Binding Cover}">
+		<Image Source="{Binding Cover}" PointerPressed="PanStart" PointerReleased="PanStop" PointerMoved="PanImage">
 			<Image.GestureRecognizers>
 				<PinchGestureRecognizer/>
 			</Image.GestureRecognizers>

+ 27 - 2
VeloeAvaloniaKemonoPartyApp/VeloeAvaloniaKemonoPartyApp/Views/ImageZoomView.axaml.cs

@@ -14,6 +14,9 @@ public partial class ImageZoomView : UserControl
         InitializeComponent();
     }
 
+    private bool _mousePressed = false;
+    private Point _previousPoint;
+
     public void ZoomImage(object? source, PinchEventArgs args)
     {
         this.GetControl<ZoomBorder>("ZoomBorder").ZoomTo(args.Scale,args.ScaleOrigin.X,args.ScaleOrigin.Y);
@@ -26,7 +29,29 @@ public partial class ImageZoomView : UserControl
 
     public void ZoomImageToDefault(object? source, RoutedEventArgs args) 
     {
-        var zoomBorder = this.GetControl<ZoomBorder>("ZoomBorder");
-        zoomBorder.Uniform();
+        this.GetControl<ZoomBorder>("ZoomBorder").Uniform();
+    }
+
+    public void PanStart(object? source, PointerPressedEventArgs args) 
+    { 
+        _mousePressed = true; 
+        _previousPoint = args.GetPosition(this.GetControl<ZoomBorder>("ZoomBorder"));  
     }
+
+    public void PanImage(object? source, PointerEventArgs args)
+    {
+        if (_mousePressed)
+        {
+            var zoomBorder = this.GetControl<ZoomBorder>("ZoomBorder");
+            var point = args.GetPosition(zoomBorder);
+            zoomBorder.PanDelta(point.X-_previousPoint.X,point.Y-_previousPoint.Y);
+            _previousPoint = point;
+        }
+    }
+
+    public void PanStop(object? source, PointerReleasedEventArgs args) 
+    { 
+        _mousePressed = false; 
+    }
+
 }