Skip to content

Commit c36f454

Browse files
Bradley MartinBradley Martin
authored andcommitted
rename, TS clean, wip (ios)
1 parent 71679ec commit c36f454

25 files changed

+455
-557
lines changed

.gitignore

Lines changed: 9 additions & 238 deletions
Original file line numberDiff line numberDiff line change
@@ -1,239 +1,10 @@
1-
## Ignore Visual Studio temporary files, build results, and
2-
## files generated by popular Visual Studio add-ons.
3-
4-
# User-specific files
5-
*.suo
6-
*.user
7-
*.userosscache
8-
*.sln.docstates
9-
.sln
10-
*.sln
11-
# User-specific files (MonoDevelop/Xamarin Studio)
12-
*.userprefs
13-
demo/node_modules/
14-
demo/platforms/
15-
16-
# Build results
17-
[Dd]ebug/
18-
[Dd]ebugPublic/
19-
[Rr]elease/
20-
[Rr]eleases/
21-
x64/
22-
x86/
23-
bld/
24-
[Bb]in/
25-
[Oo]bj/
26-
27-
# Visual Studio 2015 cache/options directory
1+
.vs
282
.vs/
29-
# Uncomment if you have tasks that create the project's static files in wwwroot
30-
#wwwroot/
31-
32-
# MSTest test Results
33-
[Tt]est[Rr]esult*/
34-
[Bb]uild[Ll]og.*
35-
36-
# NUNIT
37-
*.VisualState.xml
38-
TestResult.xml
39-
40-
# Build Results of an ATL Project
41-
[Dd]ebugPS/
42-
[Rr]eleasePS/
43-
dlldata.c
44-
45-
# DNX
46-
project.lock.json
47-
artifacts/
48-
49-
*_i.c
50-
*_p.c
51-
*_i.h
52-
*.ilk
53-
*.meta
54-
*.obj
55-
*.pch
56-
*.pdb
57-
*.pgc
58-
*.pgd
59-
*.rsp
60-
*.sbr
61-
*.tlb
62-
*.tli
63-
*.tlh
64-
*.tmp
65-
*.tmp_proj
66-
*.log
67-
*.vspscc
68-
*.vssscc
69-
.builds
70-
*.pidb
71-
*.svclog
72-
*.scc
73-
74-
# Chutzpah Test files
75-
_Chutzpah*
76-
77-
# Visual C++ cache files
78-
ipch/
79-
*.aps
80-
*.ncb
81-
*.opendb
82-
*.opensdf
83-
*.sdf
84-
*.cachefile
85-
86-
# Visual Studio profiler
87-
*.psess
88-
*.vsp
89-
*.vspx
90-
*.sap
91-
92-
# TFS 2012 Local Workspace
93-
$tf/
94-
95-
# Guidance Automation Toolkit
96-
*.gpState
97-
98-
# ReSharper is a .NET coding add-in
99-
_ReSharper*/
100-
*.[Rr]e[Ss]harper
101-
*.DotSettings.user
102-
103-
# JustCode is a .NET coding add-in
104-
.JustCode
105-
106-
# TeamCity is a build add-in
107-
_TeamCity*
108-
109-
# DotCover is a Code Coverage Tool
110-
*.dotCover
111-
112-
# NCrunch
113-
_NCrunch_*
114-
.*crunch*.local.xml
115-
nCrunchTemp_*
116-
117-
# MightyMoose
118-
*.mm.*
119-
AutoTest.Net/
120-
121-
# Web workbench (sass)
122-
.sass-cache/
123-
124-
# Installshield output folder
125-
[Ee]xpress/
126-
127-
# DocProject is a documentation generator add-in
128-
DocProject/buildhelp/
129-
DocProject/Help/*.HxT
130-
DocProject/Help/*.HxC
131-
DocProject/Help/*.hhc
132-
DocProject/Help/*.hhk
133-
DocProject/Help/*.hhp
134-
DocProject/Help/Html2
135-
DocProject/Help/html
136-
137-
# Click-Once directory
138-
publish/
139-
140-
# Publish Web Output
141-
*.[Pp]ublish.xml
142-
*.azurePubxml
143-
# TODO: Comment the next line if you want to checkin your web deploy settings
144-
# but database connection strings (with potential passwords) will be unencrypted
145-
*.pubxml
146-
*.publishproj
147-
148-
# NuGet Packages
149-
*.nupkg
150-
# The packages folder can be ignored because of Package Restore
151-
**/packages/*
152-
# except build/, which is used as an MSBuild target.
153-
!**/packages/build/
154-
# Uncomment if necessary however generally it will be regenerated when needed
155-
#!**/packages/repositories.config
156-
# NuGet v3's project.json files produces more ignoreable files
157-
*.nuget.props
158-
*.nuget.targets
159-
160-
# Microsoft Azure Build Output
161-
csx/
162-
*.build.csdef
163-
164-
# Microsoft Azure Emulator
165-
ecf/
166-
rcf/
167-
168-
# Microsoft Azure ApplicationInsights config file
169-
ApplicationInsights.config
170-
171-
# Windows Store app package directory
172-
AppPackages/
173-
BundleArtifacts/
174-
175-
# Visual Studio cache files
176-
# files ending in .cache can be ignored
177-
*.[Cc]ache
178-
# but keep track of directories ending in .cache
179-
!*.[Cc]ache/
180-
181-
# Others
182-
ClientBin/
183-
~$*
184-
*~
185-
*.dbmdl
186-
*.dbproj.schemaview
187-
*.pfx
188-
*.publishsettings
189-
node_modules/
190-
orleans.codegen.cs
191-
192-
# RIA/Silverlight projects
193-
Generated_Code/
194-
195-
# Backup & report files from converting an old project file
196-
# to a newer Visual Studio version. Backup files are not needed,
197-
# because we have git ;-)
198-
_UpgradeReport_Files/
199-
Backup*/
200-
UpgradeLog*.XML
201-
UpgradeLog*.htm
202-
203-
# SQL Server files
204-
*.mdf
205-
*.ldf
206-
207-
# Business Intelligence projects
208-
*.rdl.data
209-
*.bim.layout
210-
*.bim_*.settings
211-
212-
# Microsoft Fakes
213-
FakesAssemblies/
214-
215-
# GhostDoc plugin setting file
216-
*.GhostDoc.xml
217-
218-
# Node.js Tools for Visual Studio
219-
.ntvs_analysis.dat
220-
221-
# Visual Studio 6 build log
222-
*.plg
223-
224-
# Visual Studio 6 workspace options file
225-
*.opt
226-
227-
# Visual Studio LightSwitch build output
228-
**/*.HTMLClient/GeneratedArtifacts
229-
**/*.DesktopClient/GeneratedArtifacts
230-
**/*.DesktopClient/ModelManifest.xml
231-
**/*.Server/GeneratedArtifacts
232-
**/*.Server/ModelManifest.xml
233-
_Pvt_Extensions
234-
235-
# Paket dependency manager
236-
.paket/paket.exe
237-
238-
# FAKE - F# Make
239-
.fake/
3+
*.js
4+
*.map
5+
demo/platforms
6+
demo/node_modules
7+
demo/hooks
8+
demo/tsconfig.json
9+
.DS_Store
10+
*.gitattributes

.npmignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ nativescript-videoplayer.sln
55
.sln
66
*.sln
77
demo/
8-
sample1.png
9-
sample2.png
8+
screens/
9+
*.gitattributes

README.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[![npm](https://img.shields.io/npm/v/nativescript-signaturepad.svg)](https://www.npmjs.com/package/nativescript-signaturepad)
22
[![npm](https://img.shields.io/npm/dt/nativescript-signaturepad.svg?label=npm%20downloads)](https://www.npmjs.com/package/nativescript-signaturepad)
33

4-
# NativeScript-SignaturePad :pencil:
5-
NativeScript plugin to provide a way to capture signatures (or any drawing) from the device.
4+
# NativeScript-DrawingPad :pencil:
5+
NativeScript plugin to provide a way to capture any drawing (signatures are a common use case) from the device.
66
You can use this component to capture really anything you want that can be drawn on the screen. Go crazy with it!!!
77

88
## WARNING - iOS is in development and should be available soon. ANDROID ONLY for now.
@@ -15,22 +15,22 @@ Android | iOS
1515
## Installation
1616
From your command prompt/termial go to your app's root folder and execute:
1717

18-
`npm install nativescript-signaturepad`
18+
`npm install nativescript-drawingpad`
1919

2020
## Usage
2121
#### XML:
2222
```XML
2323
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
24-
xmlns:SignaturePad="nativescript-signaturepad">
24+
xmlns:DrawingPad="nativescript-drawingpad">
2525
<StackLayout>
26-
<SignaturePad:SignaturePad
26+
<DrawingPad:DrawingPad
2727
height="200"
2828
id="drawingPad"
2929
penColor="#ff4081"
3030
penWidth="3" />
3131

32-
<button text="Get Drawing" tap="getDrawing" />
33-
<button text="Clear Drawing" tap="clearDrawing" />
32+
<button text="Get Drawing" tap="getDrawingAsPic" />
33+
<button text="Clear Drawing" tap="clearUserDrawing" />
3434
</StackLayout>
3535
</Page>
3636
```
@@ -40,20 +40,30 @@ From your command prompt/termial go to your app's root folder and execute:
4040
var frame = require("ui/frame");
4141

4242
// To get the drawing...
43-
function getDrawing(args) {
43+
function getDrawingAsPic(args) {
4444
// get reference to the drawing pad
4545
var pad = frame.topmost().currentPage.getViewById("drawingPad");
46-
// then access the 'drawing' property (Bitmap on Android) of the signaturepad
47-
var drawingImage = pad.drawing;
46+
// then get the drawing (Bitmap on Android) of the drawingpad
47+
var drawingImage;
48+
pad.getDrawing().then(function(data) {
49+
console.log(data);
50+
drawingImage = data;
51+
}, function(err) {
52+
console.log(err);
53+
})
4854
}
49-
exports.getDrawing = getDrawing;
55+
exports.getDrawingAsPic = getDrawingAsPic;
5056

5157
// If you want to clear the signature/drawing...
52-
function clearDrawing(args) {
58+
function clearUserDrawing(args) {
5359
var pad = frame.topmost().currentPage.getViewById("drawingPad");
54-
pad.clearDrawing();
60+
pad.clearDrawing().then(function() {
61+
console.log('DrawingPad cleared.');
62+
}, function(err) {
63+
console.log(err);
64+
});
5565
}
56-
exports.clearDrawing = clearDrawing;
66+
exports.clearUserDrawing = clearUserDrawing;
5767
```
5868

5969
## Attributes
@@ -65,8 +75,13 @@ Attribute to specify the pen (stroke) color to use.
6575

6676
Attribute to specify the pen (stroke) width to use.
6777

78+
## Methods
79+
**getDrawing()** - Promise *(returns image if successful)*
80+
81+
**clearDrawing()** - clears the drawing from the DrawingPad view.
82+
6883
## Sample Screenshots
6984

7085
Sample 1 | Sample 2
7186
-------- | ---------
72-
![Sample1](sample1.png) | ![Sample2](sample2.png)
87+
![Sample1](screens/sample1.png) | ![Sample2](screens/sample2.png)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="__PACKAGE__"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
7+
<supports-screens
8+
android:smallScreens="true"
9+
android:normalScreens="true"
10+
android:largeScreens="true"
11+
android:xlargeScreens="true"/>
12+
13+
<uses-sdk
14+
android:minSdkVersion="17"
15+
android:targetSdkVersion="__APILEVEL__"/>
16+
17+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
18+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
19+
<uses-permission android:name="android.permission.INTERNET"/>
20+
21+
<application
22+
android:name="com.tns.NativeScriptApplication"
23+
android:allowBackup="true"
24+
android:icon="@drawable/icon"
25+
android:label="@string/app_name"
26+
android:theme="@style/AppTheme" >
27+
<activity
28+
android:name="com.tns.NativeScriptActivity"
29+
android:label="@string/title_activity_kimera"
30+
android:configChanges="keyboardHidden|orientation|screenSize">
31+
32+
<intent-filter>
33+
<action android:name="android.intent.action.MAIN" />
34+
35+
<category android:name="android.intent.category.LAUNCHER" />
36+
</intent-filter>
37+
</activity>
38+
<activity android:name="com.tns.ErrorReportActivity"/>
39+
</application>
40+
</manifest>

0 commit comments

Comments
 (0)