MCPcopy Index your code
hub / github.com/NathanWalker/nativescript-loading-indicator

github.com/NathanWalker/nativescript-loading-indicator @v2.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.1 ↗ · + Follow
38 symbols 79 edges 10 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

nativescript-loading-indicator

nativescript-loading-indicator is a plugin for NativeScript which overlays a loading indicator on the current page. Can be used, for example, to prevent the UI being interacted with while data is being fetched from an API, while informing the user that something is happening.

Under the hood, we use MBProgressHUD on iOS, and ProgressDialog on Android.

Installation

tns plugin add nativescript-loading-indicator

Example

var LoadingIndicator = require("nativescript-loading-indicator").LoadingIndicator;

// or with TypeScript:
// import {LoadingIndicator} from "nativescript-loading-indicator";

var loader = new LoadingIndicator();

// optional options
// android and ios have some platform specific options
var options = {
  message: 'Loading...',
  progress: 0.65,
  android: {
    indeterminate: true,
    cancelable: false,
    max: 100,
    progressNumberFormat: "%1d/%2d",
    progressPercentFormat: 0.53,
    progressStyle: 1,
    secondaryProgress: 1
  },
  ios: {
    details: "Additional detail note!",
    square: false,
    margin: 10,
    dimBackground: true,
    color: "#4B9ED6",
    mode: // see iOS specific options below
  }
};

loader.show(options); // options is optional

// Do whatever it is you want to do while the loader is showing, then

loader.hide();

Options

  • message: string Your message!
  • progress: number Set progress display

Android Specific

  • Reference: http://developer.android.com/intl/zh-tw/reference/android/app/ProgressDialog.html

iOS Specific

  • Reference: https://github.com/jdg/MBProgressHUD/blob/master/Demo/Classes/MBHudDemoViewController.m

Quick Mode Reference:

  • MBProgressHUDModeDeterminate
  • MBProgressHUDModeAnnularDeterminate
  • MBProgressHUDModeDeterminateHorizontalBar
  • MBProgressHUDModeText
  • MBProgressHUDModeCustomView
  • use with customView: string - local path to an image file

Screenshots

Loading indicator on iOS

Loading indicator on Android

Extension points exported contracts — how you extend this code

OptionsAndroid (Interface)
(no doc)
src/interfaces.ts
OptionsIOS (Interface)
(no doc)
src/interfaces.ts
OptionsCommon (Interface)
(no doc)
src/interfaces.ts

Core symbols most depended-on inside this repo

show
called by 24
src/ios/mbprogress-hud.ts
demoLoader
called by 8
demo/app/main-view-model.ts
hide
called by 4
src/ios/mbprogress-hud.ts
demoProgress
called by 3
demo/app/main-view-model.ts
_getRootWindow
called by 2
src/ios/mbprogress-hud.ts
_getContext
called by 1
src/android/progress-dialog.ts
demoLoader
called by 1
demo/app/main-view-model-android.ts
demoProgress
called by 1
demo/app/main-view-model-android.ts

Shape

Method 25
Class 8
Interface 3
Function 2

Languages

TypeScript100%

Modules by API surface

demo/app/main-view-model.ts16 symbols
demo/app/main-view-model-android.ts7 symbols
src/ios/mbprogress-hud.ts5 symbols
src/android/progress-dialog.ts5 symbols
src/interfaces.ts3 symbols
demo/app/main-page.ts1 symbols
demo/app/main-page-android.ts1 symbols

For agents

$ claude mcp add nativescript-loading-indicator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact