We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently the code contains a hardcoded divide by 2 and thus pan gestures only work correctly on XHDPI screens.
To solve this i added a property and changed he signature of the NativeGestureRecognizerFactory class like:
/// <summary> /// Gets or sets the metrics. /// </summary> /// /// <value> /// The metrics. /// </value> public static float Density { get; private set; } /// <summary> /// Constructor. /// </summary> /// /// <param name="metrics"> The metrics. </param> public NativeGestureRecognizerFactory(float Density) { NativeGestureRecognizerFactory.Density = Density; }
I corrected the hardcoded numbers in NativePanGestureRecognizer.OnMove() from
_rawTranslation.X += _velocity.X / 2; _rawTranslation.Y += _velocity.Y / 2;
into
_rawTranslation.X += _velocity.X / NativeGestureRecognizerFactory.Density; // xxhdpi:3 xhdpi:2 _rawTranslation.Y += _velocity.Y / NativeGestureRecognizerFactory.Density; // xxhdpi:3 xhdpi:2
Finally in MainActivity of the android specific Xamarin.Forms project I changed the creation of the factory to read
As i could not find code to retrieve the Density inside the NativeGestureRecognizerFactory I opted for the static property.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently the code contains a hardcoded divide by 2 and thus pan gestures only work correctly on XHDPI screens.
To solve this i added a property and changed he signature of the NativeGestureRecognizerFactory class like:
I corrected the hardcoded numbers in NativePanGestureRecognizer.OnMove() from
into
Finally in MainActivity of the android specific Xamarin.Forms project I changed the creation of the factory to read
As i could not find code to retrieve the Density inside the NativeGestureRecognizerFactory I opted for the static property.
The text was updated successfully, but these errors were encountered: