I’d like to give my app users a visual indication that items in a list can be swiped to reveal option buttons. Users are struggling to intuitively recognise that the items can be swiped.
I have other items in other lists that navigate to secondary pages and I indicate this to the user by adding a right-side arrow icon.
It would be really cool if there was a way to “bounce” the first item in the list after I have loaded the first page of data. What I mean by bounce would be to slide the item a little to the left revealing just a bit of the option buttons and then hide again (with a bounce-like animation).
I took both of your suggestions and ended up with a directive and CSS animation that works well.
With the following directive implementation (in TypeScript):
public link(scope: ng.IScope, element: ng.IAugmentedJQuery, attributes: ng.IAttributes, controller: any, transclude: ng.ITranscludeFunction): void {
scope.$on(Constants.Events.SCROLL_INFINITESCROLLCOMPLETE, (event: ng.IAngularEvent) => {
this.$timeout(() => {
let revealElement: Element = element[0].querySelector("ion-item");
if (revealElement) {
let reveal: ng.IAugmentedJQuery = angular.element(revealElement);
reveal.addClass("bounce");
this.$timeout(() => {
// have to do this to hide the options element again for the sliding to work.
reveal.removeClass("bounce");
}, 1000);
}
}, 0);
});
}