• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    Objective-C
  • License
    Other
  • Created over 11 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of extended functionality for the UI components of Titanium SDK

Napp UI

This module extends the native UI components provided by the Titanium Mobile SDK. We are more properties to a bunch of UI components, giving you more freedom for styling and functionality.

This is not a set of new UI components. Instead, we are extending the existing framework.

See this module as a collection of extended functionality. I did not invent all of the below functionality, but want to put these together in one united module.

Add the module to your project

Simply add the following lines to your tiapp.xml file:

<modules>
    <module platform="iphone">dk.napp.ui</module> 
</modules>

How to use

Instantiate the module through require(); This will modify and override the native Titanium classes with the NappUI methods.

Note: Creating a NappUI object is optional, but may be useful if methods, properties or custom proxy objects are defined.

var NappUI = require("dk.napp.ui");

The following lists the UI components and its new extended functionality.

Window

  • Add a blur effect
    • 1.0: No blur effect
    • 0: Maximum blur effect
var win = Ti.UI.createWindow({
    blur:0.2
});
  • Static Blur effect (a la' iOS 7)
    • enabled: true or flase
    • type
    • tint (applicable when using the tint type)
var win = Ti.UI.createWindow({
	staticBlur: {
		enabled: true,
		type: "tint",
		tint: "#00ff00"
	}
});

//See example/app.js for all applicable types

View

  • Add drop shadow to your view
  • Add a blur effect to the view
var view = Ti.UI.createView({
    shadow:{
        shadowRadius:10,
        shadowOpacity:1,
        shadowOffset:{x:2, y:2}
    },
    blur:0.75
});
  • Static Blur effect (a la' iOS 7)
    • enabled: true or flase
    • type
    • tint (applicable when using the tint type)
var view = Ti.UI.createView({
	staticBlur: {
		enabled: true,
		type: "light"
	}
});

//See example/app.js for all applicable types

ImageView

  • Add pan, rotate or/and pinch control to your image view
  • Eventlisteners for each new gesture control
var image = Ti.UI.createImageView({
    image:"image.png",
    recognizeSimultaneously:"pinching,rotate",
    rotateGesture:true,
    pinchingGesture:true,
    panGesture:true
});

image.addEventListener('pan', function(e){});
image.addEventListener('panend', function(e){});

image.addEventListener('rotate', function(e){});
image.addEventListener('rotateend', function(e){});

image.addEventListener('pinching', function(e){});
image.addEventListener('pinchingend', function(e){});

image.addEventListener('pan', function(e){});
image.addEventListener('panend', function(e){});

WebView

  • Custom WebView scroll speed (Same TableView / ScrollView scroll speed)
  • Remove scroll bounce shadow
  • Remove scroll delay
  • Communication between WebView and Titanium app
  • Change UserAgent
  • Add custom headers
var webView = Ti.UI.createWebView({
    normalScrollSpeed: true,
    removeShadow: true,
    removeScrollDelay: true,
    userAgentForiOS: 'My Awesome Application UserAgent'
    url: 'http://www.appcelerator.com'
});
webView.addEventListener('fromWebView', function(){});
webView.setCustomHeaders({'my-customheader-1': 'custom-header-value', 'add-as-many-headers-as-you-need': 'value'});

ScrollableView

  • Set the indicator color for the Paging Control
  • Set the current indicator color for the Paging Control
var scrollableView = Ti.UI.createScrollableView({
 	views:[view1,view2,view3],
 	showPagingControl:true,
	pagingControlCurrentIndicatorColor:"blue",
	pagingControlIndicatorColor: "red"
});

TabGroup

  • Custom active tab indicator image
  • Custom active tab icon color
  • Custom tab background image
  • Custom tab background color (Same Ti.UI.TabGroup.tabsBackgroundColor property)
var tabGroup = Ti.UI.createTabGroup({
    customBackgroundColor: "#151515",
    customBackgroundImage: "/images/tabbg.png",
    customActiveIndicator: "/images/activeIndicator.png",
    customActiveIconColor: "#FF3300"
});

TextField

  • Added hintTextColor
var textfield = Ti.UI.createTextField({
	hintTextColor:"red"
});

SearchBar

  • SearchField BackgroundImage
  • Custom Cancel button
    • barColor - background gradient of the button. (similar to navbar)
    • color - color of the button title
    • title - change the default Cancel text
    • font - set the font of the button
  • Appearance of the keyboard
  • Disable the search icon
var searchBar = Ti.UI.createSearchBar({
	searchFieldBackgroundImage:"searchbg.png",
	showsScopeBar:true,
	scopeButtonTitles:["hello", "yes"],
	customCancel:{
		barColor:"#333",
		color:"#ddd",
		title:"Hit me",
		font:{
			fontSize:16,
			fontWeight:"bold",
			fontFamily:"Georgia"
		}
	},
	appearance:Titanium.UI.KEYBOARD_APPEARANCE_ALERT,
	barColor:"transparent",
	disableSearchIcon:true //disables the search icon in the left side
});

Picker

  • Mask the background to invisible.
var picker = Ti.UI.createPicker({
	mask:{
	  	left:14,
	  	top:10,
	  	width:293,
		height:196
  	}
});

Toolbar

  • TintColor
var toolbar = Ti.UI.iOS.createToolbar({
    items:[send, flexSpace, camera],
    tintColor:"red"
});

NavigationWindow

  • Close all windows in the navigationWindow, and return to the very first window in the group.
navWindow.popToRoot();

Changelog

  • 1.2.3

    • Remove Attributed Text since its supported by Ti SDK.
  • 1.2.2

    • min SDK changed to 3.2.0.GA
    • Removed NavGroup and added NavigationWindow
  • 1.2.1

    • Added support for custom headers in webviews
  • 1.2

    • Static Blurs (a la' iOS 7) for Ti.UI.Window and Ti.UI.Views - by @dezinezync
  • 1.1.5

    • Attributed Text: Fix for Strings containing Emoji characters
  • 1.1.4

    • Attributed Text: Fixed touch location bug causing application to crash
    • Attributed Text: Fixed highlight range bug
    • Attributed Text: ARC for memory management
    • Attributed Text: Lower memory consumption. Good to use in TiUITableViews *wink*
  • 1.1.3

    • Attributed Text: Highlight links when selected
    • Attributed Text: LongPress event
  • 1.1.2

    • Attributed Text: Set range instead of text when defining attributes. Range can be useful when you get a predefined range eg. Twitter API
    • Attributed Text Links: Set links on specific text/range and listen to a tap event.
  • 1.1.1

    • Attributed Text: Bug Fixes
    • Attributed Text: Set base color for the text
  • 1.1

    • Attributed Text for TiUILabel - by @dezinezync
  • 1.0.4

    • Removed the need for requiring NappUI.js. Modifed the symbol preloader file to a module asset. See ticket 5.
  • 1.0.3

    • Added popToRoot() to extend NavigationGroup. Feature request #3
    • Changed setBlurred(true) to setBlur(0.2). Feature request #1
  • 1.0.2

    • Aded NappUI.js for better use of this module. This is due to some limitations of the Titanium Module SDK.
  • 1.0.1

    • Bugfix - invalid build, and some functions did not work as expected.
  • 1.0

    • Init commit, working module.

Author

Mads Møller
web: http://www.napp.dk
email: [email protected]
twitter: @nappdev

License

Copyright (c) 2010-2013 Mads Møller

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

More Repositories

1

TiSocial.Framework

iOS6+ Social.Framework. Appcelerator apps are able to share content to Facebook and Twitter.
Objective-C
257
star
2

NappDrawer

A side drawer navigation container view controller for Appcelerator Titanium.
Objective-C
247
star
3

napp.alloy.adapter.restapi

RestAPI Sync Adapter for Titanium Alloy Framework
JavaScript
197
star
4

napp.alloy.adapter.restsql

SQL & RestAPI Sync Adapter for Titanium Alloy Framework
JavaScript
144
star
5

NappSlideMenu

a new UI component for Appcelerator Titanium
Objective-C
128
star
6

NappAppearance

Use the power of iOS UIAppearance on Titanium UI components
Objective-C
69
star
7

NappDownloadManager

Download Manager for Appcelerator Titanium
Java
61
star
8

NappTestFlight

TestFlight for appcelerator
Python
43
star
9

NappImageView

iOS ImageView that supports ContentModes: AspectFit, AspectFill and Center
Objective-C
42
star
10

NappPDFCreator

This iOS module lets you generate PDF files from HTML or URL.
Objective-C
31
star
11

NappScrollViewExtended

TiUIScrollView extended with Pull To Refresh and Infinite Scrolling functionalities.
Objective-C
30
star
12

NappWaveformView

iOS module for titanium - Shows a graph of an audio file
Objective-C
29
star
13

GitLab-CI-Scripts

My Gitlab CI scripts
29
star
14

Alloy-Widgets-Adapters

List of Titanium Alloy Widgets and Adapters. Please send me your repo!
28
star
15

AudioPlayerWidget

Alloy widget for playing audio
JavaScript
20
star
16

NappSearchBarExtended

TiUISearchBar extended. Gives the developer more freedom to style the UI component
Python
20
star
17

NappFlashLight

Flashlight Titanium module for iOS and Android.
Python
19
star
18

Napp2DScrollView

Android bidirectional ScrollView for Appcelerator
Java
17
star
19

NappJockey

Communication between Titanium and webpage running remotely
Java
17
star
20

NappBugsnag

Bugsnag for Appcelerator Titanium
C
15
star
21

NappUrbanAirshipGCM

Urban Airship with Google Cloud Messaging support
Java
10
star
22

NappNUI

NUI for Appcelerator Titanium. NUI is a css styling UI Kit for iOS.
Objective-C
6
star
23

AlloyAdapterTemplate

Alloy Adapter StarterKit
JavaScript
5
star
24

mac-setup

setup a macOS quickly using brew and cask
Ruby
5
star
25

webhooks

Simple and powerful Webhooks for Laravel
PHP
5
star
26

lambda-office-to-pdf-processor

Convert Office file to PDF at scale
JavaScript
4
star
27

otp

One Time Password for Laravel
PHP
3
star
28

laravel-octane-test

Lets test Laravel Octane
PHP
3
star
29

pdftron-php-docker

PDFTron Docker image for PHP
Dockerfile
2
star
30

async-aws-laravel

test repo for laravel integration with Async AWS
PHP
1
star
31

Dock

Local Laravel Development based on Docker
Shell
1
star