MagicFoundation / Alcinoe

Alcinoe Component Library For Delphi. Full opengl video player, WebRTC delphi wrapper, native ios/android TEdit, Improuved firemonkey controls, Firebase cloud messaging, Android/ios facebook sdk login, Json/Bson Parser, ImageMagick wrapper, MongoDb client And much more
Apache License 2.0
993 stars 220 forks source link

Demo, blur, render, json #335

Closed OnePeople-source closed 2 weeks ago

OnePeople-source commented 1 month ago

Hello. I really like your library. Thank you very much for such a great job. First, in your demo application, the scale animation button has an artifact (screenshot attached). Second, have you considered the blur function for the rectangle background taking into account the background? Third, I use your json parser, namely the MyJsonDoc.childnodes['contribs'].childnodes[i] structure, but if some element is missing, an exception pops up, is it possible to add a nil check there. Fourth, a modern request for enabling location detection needs to be added to geolocation. And one more thing, callback methods are used a lot in Android, they have to be delegated manually, maybe you know some automation tools for this process. Thank you again for such professional work. IMG_20241001_011024 Screenshot_2024-10-01-01-08-09-29_f7aa348215f5d566f9e4ca860f474209

Zeus64 commented 1 month ago

Hello,

regarding the scale artifact it's corrected, it's because of this bug :

https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-1723

I already fix it in the patched delphi source file. I hope to merge the master at the end of this week to work with delphi Athens 12.2.

Second, have you considered the blur function for the rectangle background taking into account the background?

I not understand what you mean ?

Third, I use your json parser, namely the MyJsonDoc.childnodes['contribs'].childnodes[i] structure, but if some element is missing, an exception pops up, is it possible to add a nil check there

you must do like this (if you are looking for a text node at contribs.path.to) : MyJsonDoc.getChildNodeValueText(['contribs', 'path', 'to'], ''{default value if not exist}); or for exemple for an integer node at contribs.path.to MyJsonDoc.getChildNodeValueInt(['contribs', 'path', 'to'], 0{default value if not exist});

if it's within an array you have no choice var LNode := MyJsonDoc.findNode('contribs'); if Lnode <> nil then for var i := 0 to LNode.childnodes.count - 1 do dosomething(LNode.childnodes[i]);

Fourth, a modern request for enabling location detection needs to be added to geolocation

No understand what you mean ?

And one more thing, callback methods are used a lot in Android, they have to be delegated manually, maybe you know some automation tools for this process.

This too i not udnerstand what you mean :(

OnePeople-source commented 1 month ago

No understand what you mean ?

Geolocation dialog enable show

           var LLocationRequest := TJLocationRequest_Builder.JavaClass.init(200)
                                      //.setDurationMillis(durationMillis: Int64) - Sets the duration of this request. - The default value is Long.MAX_VALUE.
                                      //.setGranularity(granularity: Integer) - Sets the Granularity of locations returned for this request. - The default value is Granularity.GRANULARITY_PERMISSION_LEVEL.
                                      .setIntervalMillis(200) //- Sets the desired interval of location updates.
                                      .setMaxUpdateAgeMillis(0) //- Sets the maximum age of an initial historical location delivered for this request. - The default value is IMPLICIT_MAX_UPDATE_AGE.
                                      //.setMaxUpdateDelayMillis(maxUpdateDelayMillis: Int64) - Sets the longest a location update may be delayed. - The default value is 0.
                                      //.setMaxUpdates(maxUpdates: Integer) - Sets the maximum number of updates delivered to this request. - The default value is Integer.MAX_VALUE.
                                     // .setMinUpdateDistanceMeters(0) // - Sets the maximum number of updates delivered to this request. - The default value is 0.
                                      .setMinUpdateIntervalMillis(100)// - Sets the fastest allowed interval of location updates.  - The default value is IMPLICIT_MIN_UPDATE_INTERVAL
                                      .setPriority(TJPriority.JavaClass.PRIORITY_HIGH_ACCURACY) // - Sets the Priority of the location request. - The default value is Priority.PRIORITY_BALANCED_POWER_ACCURACY.
                                      .setWaitForAccurateLocation(false)// - If set to true and this request is Priority.PRIORITY_HIGH_ACCURACY, this will delay delivery of initial low accuracy locations for a small amount of time in case a high accuracy location can be delivered instead. - The default value is true.
                                      .build();

           var LLocationSettingsRequest := TJLocationSettingsRequest_Builder.JavaClass.init
           .addLocationRequest(LLocationRequest)
           .setAlwaysShow(true)
           .build();

           FMessageSubscriptionID := TMessageManager.DefaultManager.SubscribeToMessage(
                                TMessageResultNotification,
                                HandleActivityMessage);
           MyOnFailureListener := TMyOnFailureListener.Create(Form1);
           MyOnFailureListener.onFailured := onFailureLocation;

           locTask := TJLocationServices.JavaClass.getSettingsClient(TAndroidHelper.Activity).checkLocationSettings(LLocationSettingsRequest);

           locTask.addOnFailureListener(MyOnFailureListener);

Blur how it, but only how current rectangle property "shadow" https://github.com/skia4delphi/acrylicscroll-sample

Use callback in attach. How do it automative& https://dropmefiles.com/gS6tC

OnePeople-source commented 1 month ago

if it's within an array you have no choice var LNode := MyJsonDoc.findNode('contribs'); if Lnode <> nil then for var i := 0 to LNode.childnodes.count - 1 do dosomething(LNode.childnodes[i]);

Thanks for answer, but i suggest replace it:

function TALJSONNodeA.GetChildNode(const path: array of ansiString): TALJSONNodeA;
var I: integer;
begin
  result := Self;
  for I := low(path) to high(path) do begin
    result := result.ChildNodes.findNode(path[I]);
    if (result = nil) then exit;
  end;
end;

at:

function TALJSONNodeA.GetChildNode(const path: array of TValue): TALJSONNodeA;
  var
  I: integer;
begin
  result := Self;
  for I := low(path) to high(path) do
  begin
    if path[i].IsType<String> then
       result := result.ChildNodes.findNode(path[I].ToString);

    if path[i].IsType<Integer> then
       result := result.ChildNodes[path[i].AsInteger];

    if (result = nil) then exit;
  end;
end;
Zeus64 commented 2 weeks ago

Hello, everything has been fixed in the latest committed version (The artifact problem)