All Projects → FokkeZB → nl.fokkezb.loading

FokkeZB / nl.fokkezb.loading

Licence: other
The widget provides a simple loading mask that can be easily styled and configured.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to nl.fokkezb.loading

titanium-turbo
Axway Amplify module that adds some enhancements for Appcelerator Titanium Alloy
Stars: ✭ 15 (-84.37%)
Mutual labels:  titanium, appcelerator, alloy, axway
titanium-dark-mode
Full support for iOS 13+ / Android 10+ dark mode (semantic colors and images) in Appcelerator Titanium
Stars: ✭ 26 (-72.92%)
Mutual labels:  titanium, appcelerator, axway
nl.fokkezb.button
Bootstrap Button widget for Appcelerator (Titanium)
Stars: ✭ 72 (-25%)
Mutual labels:  titanium, appcelerator, alloy
titanium-arkit
Use the iOS 11 ARKit API in Axway Titanium
Stars: ✭ 28 (-70.83%)
Mutual labels:  titanium, appcelerator, axway
Titanium mobile
🚀 Native iOS- and Android- Apps with JavaScript
Stars: ✭ 2,553 (+2559.38%)
Mutual labels:  titanium, appcelerator, alloy
ti.exoplayer
A native control for playing videos for Titanium. Based on Google ExoPlayer, using Titanium.Media.VideoPlayer API.
Stars: ✭ 17 (-82.29%)
Mutual labels:  titanium, appcelerator, axway
griffin-app-opensource
The Axway Griffin App goes open source!
Stars: ✭ 19 (-80.21%)
Mutual labels:  titanium, appcelerator, axway
ti.playservices
Titanium module for Google Play Services
Stars: ✭ 19 (-80.21%)
Mutual labels:  titanium, appcelerator, axway
titanium-firebase-analytics
Use the Firebase Analytics SDK in Axway Titanium 🚀
Stars: ✭ 33 (-65.62%)
Mutual labels:  titanium, appcelerator, axway
staballoy
Reactive UI framework for Titanium Alloy
Stars: ✭ 18 (-81.25%)
Mutual labels:  titanium, appcelerator, alloy
vscode-appcelerator-titanium
Appcelerator development tools and UI package for Visual Studio Code.
Stars: ✭ 35 (-63.54%)
Mutual labels:  titanium, appcelerator
av.imageview
Titanium native ImageView module that extends the default Titanium ImageView with more capabilities and a different caching system.
Stars: ✭ 97 (+1.04%)
Mutual labels:  titanium, appcelerator
titanium-apple-sign-in
Use the iOS 13+ Apple Sign In API with Titanium
Stars: ✭ 29 (-69.79%)
Mutual labels:  titanium, appcelerator
ti.youtube
A small library to get the URL of the desired YouTube video ID to use it natively in Ti.Media.VideoPlayer.
Stars: ✭ 13 (-86.46%)
Mutual labels:  titanium, alloy
titanium-material
Use the native Material UI/UX framework (https://github.com/CosmicMind/Material) in Titanium!
Stars: ✭ 14 (-85.42%)
Mutual labels:  titanium, appcelerator
ti.map
Use native Apple Maps & Google Maps in iOS and Android with Axway Titanium
Stars: ✭ 49 (-48.96%)
Mutual labels:  titanium, appcelerator
ti.coremotion
Support for the native iOS CoreMotion framework in Appcelerator Titanium
Stars: ✭ 15 (-84.37%)
Mutual labels:  titanium, appcelerator
TiFastlane
With TiFastlane you'll be able to fully optimize the way you submit your app updates and maintain your certificates and provisioning profiles of all your Titanium Apps.
Stars: ✭ 83 (-13.54%)
Mutual labels:  titanium, appcelerator
To.BounceView
A bouncing view widget for Titanium
Stars: ✭ 49 (-48.96%)
Mutual labels:  titanium, appcelerator
ti.moddevguide
Appcelerator Titanium native Module Guide
Stars: ✭ 39 (-59.37%)
Mutual labels:  titanium, appcelerator

ARCHIVED Contact [email protected] if you'd like to take it over.

Loading Mask Widget

Overview

This is a widget for the Alloy MVC framework of Appcelerator's Titanium platform.

The widget provides a simple loading mask that can be easily styled and configured.

By default it uses the native ProgressIndicator for Android but you can easily switch to use the same cross-platform version on both iOS and Android.

Screenshot

Loading Mask Loading Mask

Features

  • Fully stylable via your app.tss.
  • Can be set to be cancelable by user, setting a function to be called in that case.
  • Message and ability to be cancelled can be set every time it's used.
  • Can be via single global instance or local instances.
  • Available as native ProgressIndicator (Android), Window and View.

Quick Start gitTio npm

  • Use gittio install nl.fokkezb.loading to install via gitTio or npm i alloy-widget-nl.fokkezb.loading to install via NPM or:

    • Download the latest release of the widget.
    • Unzip the folder to your project under app/widgets/nl.fokkezb.loading.
    • Add the widget as a dependency to your app/config.json file:
      "dependencies": {
          "nl.fokkezb.loading":"*"
      }
  • Create a global instance of the widget in alloy.js:

    Alloy.Globals.loading = Alloy.createWidget("nl.fokkezb.loading");
  • Show and hide the loading mask when you need it:

    function cancel() {
        alert('Why?!');
    }
        
    function load() {
        Alloy.Globals.loading.show('Your message', false);
            
        setTimeout(function(){
            Alloy.Globals.loading.hide();
        }, 6000);
    }
  • In Titanium 3.3.0 you need to hide the Android Actionbar as described in this blog. If you use Titanium 3.3.1 or later the widget automatically requests for a theme with no actionbar.

Global vs Local

The Quick Start shows how to use the global-mode. You only have to create one global widget instance that will (try to) make sure that there's always one loading mask showing. You can also use one of the 3 available types of loading masks directly as a local instance, as we'll see when we look at the types.

Types

The widget exposes different types of loading masks. All types share the same API so you can easily switch between them.

Native Progress (Android-only)

The global default for Android is to use ProgressIndicator. You can disable this by setting the progress property of the global widget to false or using one of the 2 other types directly in a local instance. The Native Progress type itself can also be used as a local instance:

var myInstance = Alloy.createWidget('nl.fokkezb.loading', 'progress');
myInstance.show('My message', myCancelCallback);	

Window

The only available global mode for iOS is to show a Window. You can also create a local instance:

var myInstance = Alloy.createWidget('nl.fokkezb.loading', 'window');
myInstance.show('My message', myCancelCallback);

View

You can also create the widget as a local view which you can require in any (composite) layout. The typical use case for this is to display the widget over a modal window since the window-type would open behind such a window and be invisible.

index.xml

<Alloy>
    <Window>
	<Widget src="nl.fokkezb.loading" name="view" id="myInstance" />
    </Window>
</Alloy>

index.js

$.myInstance.show('My message', myCancelCallback);

Public API

All types share the same public API:

Attributes

Name Type Access Description
visible boolean read, write You'll get true if the loading mask is currently shown. If set to true or false it will call show() or hide().

Widget instantiation params

Name Values Description
progress (global-only) 'progress', true, false Set to false to use the cross-platform loading mask for Android instead of the default native ProgressIndicator.

Methods

Name Params Description
show ([message][, cancelable]) Shows the loading mask or updates the existing, if it's still the top window. If the second argument is a function, the mask is user-cancelable at which event this method would be called.
update ([message][, cancelable]) Updates the existing message and cancelable function. Not available in global-mode, where you'd simply call show() again.
hide null Hides the loading mask.

Styling

You can style all views from your app.tss. The default styles can be found in window.tss. Be aware that the default styles are applied to classses, but to override from your app.tss you need to following (identical) IDs:

  • #progressIndicator: The native Android ProgressIndicator.
  • #loadingWindow: The window if using the (default) window mode.
  • #loadingMask: The full-screen mask.
    • Set images to true to use the #loadingImages indicator.
  • #loadingOuter: The dark box containing the activityIndicator and message.
  • #loadingInner: Wraps arround the activityIndicator and message to provider padding.
  • #loadingIndicator: The activityIndicator.
  • #loadingImages: The indicator variant using images.
  • #loadingMessage: The message.

Internationalization

You can override the default message (Loading..) by setting the loadingMessage in your strings.xml files.

Changelog

  • 1.8:
    • New view mode to get the loading mask as a view instead of a window.
    • Consistent public API's for all types and modes.
  • 1.7:
    • Uses native ProgressIndicator for Android
    • Uses the theme property to select a theme with no ActionBar.
  • 1.6: Complete rewrite
    • Widget creation now only in controller
    • Styling now only in TSS
    • Setting message and blocking now only via show()
    • Cancel event replaced by callback as second argument for show()
    • Second show() argument now cancelable, reverse of blocking (!!)
    • On Android, hitting the back button on a non-cancelable loading mask will move app to the background
  • 1.5.2: Fixes empty loading mask on second show on Android
  • 1.5.1: Reverted 1.5 change thanks to opacity fix.
  • 1.5: Falls back to Ti.UI.Android.ProgressIndicator for Android
  • 1.4: Support for image indicator
  • 1.3: Fully override widget style from app.tss and reset to default message upon show.
  • 1.2: View replaced by Window, otherwise won't work in non-absolute layout modes.
  • 1.1: New parameter show to automatically show loading mask upon creation.
  • 1.0: Initial version

License

Copyright 2013-2014 Fokke Zandbergen

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].