Android: delay before show checked checkbox - android-recyclerview

I will start with the example:
One list with a checkbox for each row
a data model
a ui data model
the click on the checkbox modifies the list data model and its liveData.
Who observes the liveData see the change and transforms it into the uiModel then give it to the list adapter and this using the diffUtil updates the list punctually.
All this is "slow", a 2 or 4 hundredths of a second before show the checkbox checked.
When I check the checkbox I have to validate the new dataModel, for instance: in some case I have to show some alert, or to disable some rows.
How do you deal with this type of "issue"?

Related

Does DetailsList expose a callback to add more items to the list(pagination)

I have a scenario where there are total of 150 items that we want to render, but server returns set of items - say 30 at a time.
We want to use DetailsList, however, we did not find any prop that can be used to update (add to) the list of items when user scrolls to the bottom of present list.
I see that DetailsList handles UI virtualization, however it seems we need to pass the entire set of items at the beginning only.

Spinner on clicking an item in DetailsList

How do I show a spinner in a DetailsList? For instance, let's say I have the following items in a DetailsList:
list of items
On clicking the item with the name 'AdipiscingUt.onetoc', show a spinner on the rightmost side of that item (next to 125 KB). Please let me know if you have any suggestions on the same.
Thanks!
You can use selection attribute in <DetailsList> component to catch the selection events. Then create extra column with hidden spinner and display it via selection event.
At least I had the experience when I needed to display the icon status according to each item. I added unique id per each item (using onRender method for columns attribute in <DetailsList>) and use it for identification.

Binding options dropdown filtering with textbox value in Google App Maker

Good day to all,
I need your help to binding an dropdown in Google App Maker.
I have 2 datasources, one for value and other for options and names. The problem is when I try to filter the dropbox with a textbox value.
in TextBox's onValueChange I put this code but it does not work.
var item = widget.parent.descendants;
app.datasources.Prycts_Cmpns.query.clearFilters();
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.query.filters.s_AliasCompany._contains=widget.value;
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.load();
the next code is the datasources options,value and names of the dropdown:
How i can filter this dropdown with the filter?
Thxs
I have a feeling, that
User enters some filter in TextBox
In onValueChange you call clearFilters what wipes user's input
You load Prycts_Cmpns datasource with no filters
So to fix this you can check that the TextBox is bound to app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.query.filters.s_AliasCompany._contains and simplify onValueChnage event handler to this
// at this point filter's value should be already set by binding
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.load();

Save a user popup selection in a custom Automator Action

Using Xcode 5.* for a cocoa-applescript automator action.
Interface is a a simple popup menu that gets populated using an outlet with:
tell thePopupMenu to removeAllItems()
tell thePopupMenu to addItemsWithTitles_(theList)
When the action is used in a workflow (a Service actually), I want the next time it is run and the action dialog shows up (I will have "Options:Show when run" selected), I want the popup menu to change the selection to the last one that was selected. Right now, the default first item shows, even though last time it was run, the user selected a different item in the popup menu.
My thought was that I need to capture a change in the popup menu with a Sent Action handler, and then set some type of default. I have a working handler:
on thePopupMenuSentAction_(sender)
set popupValue to (popupSelectedValue of my parameters()) as string
-- save this selection somewhere???
end
What's the right way to save this? Do I use User Defaults? My Bindings are currenly all tied through Parameter object/controller. If I should use User Defaults, can someone give example code for setting up User Defaults, and then how to get and set a new value using Cocoa-Applescript?
If I can get the name string of the menu item saved somewhere, I can get the string and then change the selection of the popup menu in the
on opened {}
-- set up the action interface
end
handler which gets called just before the action is displayed each time.
Thanks for any help,
Joe
I did mine a bit differently. I will assume you are referring to what XCode calls a "pop up button" (somewhat misleading). I did not use the parameters at all, although that is probably better for larger projects. Have a look at the code:
script Insert_Picture_into_Powerpoint_Slide_Show
property parent : class "AMBundleAction"
property menuChoices : {"Insert a Beginning", "Insert at End"}
property menuSelection : missing value
if (menuSelection as string) is "missing value"
set menuSelection to 0 as integer -- sets default value
end if
end script
I bound Content Values to File's Owner and under Model Key Path I put menuChoices.
Then you just bind the Selected Index to File's Owner and for the Model Key Path type menuSelection.
Defaults
On the initial run, if the user does not click anything, the menuSelection will be missing value. Because I couldn't find a way around this, I created a conditional which tests for this and sets it to the first choice by default (the one that is shown when you add the action).
When the user selections one of the menu choices, the choice is remembered on sequential runs.

AutoCompleteBox (Silverlight 4) displays previously selected items in dropdown list

I intended to use a AutoCompleteBox (silverlight 4) in similar way like a save file dialog works: each time user types a string, only matching items are displayed in dropdown list.
However, this is not the behavior I get from AutoCompleteBox. I will describe the bahavior by example: in my case, I have collection with two strings: "xxx" and "yyy". The AutoCompleteBox is bound to that collection. User start typing "xxx". The dropdown list correctly displays "xxx". User selects "xxx" from the list. User deletes "xxx", and instead of it types "yyy". The dropdown list displays both "xxx" and "yyy".
What I tried to do:
1. Tried to play with FilterMode. If I using "None" mode, both items always being displayed. Any other mode provides the behavior described above.
2. Tried to set my own filtering predicate, by binding to Filter property on the model. In addition, set the FilterMode to "Custom". Any attempt to type inside AutoCompleteBox crashes the application.
I will really appreciate any help, burn on this already two hours..
Thanks
I've encountered the same error and for me it was caused by the styling of the ListBoxItem. Use the default styling and the problem should go away.
https://stackoverflow.com/a/5529940/2568763