| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,13 @@ | |||
| 1 | + Button.even, Button.odd { | ||
| 2 | + border-radius: 5; | ||
| 3 | + color: white; | ||
| 4 | + margin: 0 5 5 0; | ||
| 5 | + } | ||
| 6 | + | ||
| 7 | + Button.even { | ||
| 8 | + background-color: #0000cc; | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + Button.odd { | ||
| 12 | + background-color: #33cc33; | ||
| 13 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + @import './main-page-common.css'; | ||
| 2 | + | ||
| 3 | + Button.even, Button.odd { | ||
| 4 | + height: 25; | ||
| 5 | + font-size: 10; | ||
| 6 | + padding: 0; | ||
| 7 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + @import './main-page-common.css'; | ||
| 2 | + | ||
| 3 | + Button.even, Button.odd { | ||
| 4 | + padding: 5; | ||
| 5 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + <Page loaded="pageLoaded"> | ||
| 2 | + <GridLayout rows="auto, *"> | ||
| 3 | + <Label text="{{ name }}" id="label" style="text-align:center;" /> | ||
| 4 | + <WrapLayout row="1"> | ||
| 5 | + <Button class="even" text="action" tap="{{ actionName }}" /> | ||
| 6 | + <Button class="odd" text="alert" tap="{{ alertName }}" /> | ||
| 7 | + <Button class="even" text="confirm" tap="{{ confirmName }}" /> | ||
| 8 | + <Button class="odd" text="login" tap="{{ loginName }}" /> | ||
| 9 | + <Button class="even" text="promptText" tap="{{ promptText }}" /> | ||
| 10 | + <Button class="odd" text="promptPass" tap="{{ promptPass }}" /> | ||
| 11 | + <Button class="even" text="promptEmail" tap="{{ promptEmail }}" /> | ||
| 12 | + <Button class="odd" text="promptNumber" tap="{{ promptNumber }}" /> | ||
| 13 | + <Button class="even" text="promptDecimal" tap="{{ promptDecimal }}" /> | ||
| 14 | + <Button class="odd" text="promptPhone" tap="{{ promptPhone }}" /> | ||
| 15 | + <Button class="even" text="promptCapitalizationNone" tap="{{ promptCapitalizationNone }}" /> | ||
| 16 | + <Button class="odd" text="promptCapitalizationAll" tap="{{ promptCapitalizationAll }}" /> | ||
| 17 | + <Button class="even" text="promptCapitalizationSentences" tap="{{ promptCapitalizationSentences }}" /> | ||
| 18 | + <Button class="odd" text="promptCapitalizationWords" tap="{{ promptCapitalizationWords }}" /> | ||
| 19 | + </WrapLayout> | ||
| 20 | + </GridLayout> | ||
| 21 | + </Page> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,11 +121,11 @@ export class SettingsViewModel extends observable.Observable { | |||
| 121 | 121 | public promptEmail(args: observable.EventData) { | |
| 122 | 122 | dialogs.prompt({ | |
| 123 | 123 | title: "Name", | |
| 124 | - message: "Enter name:", | ||
| 124 | + message: "Enter email:", | ||
| 125 | 125 | cancelButtonText: "Cancel", | |
| 126 | 126 | neutralButtonText: "Ignore", | |
| 127 | 127 | okButtonText: "OK", | |
| 128 | - defaultText: "John Reese", | ||
| 128 | + defaultText: "john.reese@nativescript.org", | ||
| 129 | 129 | inputType: dialogs.inputType.email | |
| 130 | 130 | }).then((promptResult) => { | |
| 131 | 131 | console.log("### Result: " + promptResult.result + ", Text: " + promptResult.text); | |
@@ -158,6 +158,26 @@ export class SettingsViewModel extends observable.Observable { | |||
| 158 | 158 | }); | |
| 159 | 159 | } | |
| 160 | 160 | ||
| 161 | + public promptDecimal(args: observable.EventData) { | ||
| 162 | + dialogs.prompt({ | ||
| 163 | + title: "Name", | ||
| 164 | + message: "Enter a decimal number:", | ||
| 165 | + cancelButtonText: "Cancel", | ||
| 166 | + neutralButtonText: "Ignore", | ||
| 167 | + okButtonText: "OK", | ||
| 168 | + defaultText: "13.50", | ||
| 169 | + inputType: dialogs.inputType.decimal | ||
| 170 | + }).then((promptResult) => { | ||
| 171 | + console.log("### Result: " + promptResult.result + ", Text: " + promptResult.text); | ||
| 172 | + if (promptResult.result) { | ||
| 173 | + this.set("name", promptResult.text); | ||
| 174 | + } | ||
| 175 | + else { | ||
| 176 | + this.set("name", "13.50"); | ||
| 177 | + } | ||
| 178 | + }); | ||
| 179 | + } | ||
| 180 | + | ||
| 161 | 181 | public promptPhone(args: observable.EventData) { | |
| 162 | 182 | dialogs.prompt({ | |
| 163 | 183 | title: "Name", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ export function pageLoaded(args: EventData) { | |||
| 12 | 12 | examples.set("bindings", "bindings/main-page"); | |
| 13 | 13 | examples.set("button", "button/main-page"); | |
| 14 | 14 | examples.set("css", "css/main-page"); | |
| 15 | - examples.set("dialogs", "dialogs/dialogs"); | ||
| 15 | + examples.set("dialogs", "dialogs/main-page"); | ||
| 16 | 16 | examples.set("events", "events/main-page"); | |
| 17 | 17 | examples.set("fonts", "font/main-page"); | |
| 18 | 18 | examples.set("flexbox", "flexbox/flexbox-main-page"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,6 +39,11 @@ export module inputType { | |||
| 39 | 39 | */ | |
| 40 | 40 | export const number: string = "number"; | |
| 41 | 41 | ||
| 42 | + /** | ||
| 43 | + * Decimal input type | ||
| 44 | + */ | ||
| 45 | + export const decimal: string = "decimal"; | ||
| 46 | + | ||
| 42 | 47 | /** | |
| 43 | 48 | * Phone input type | |
| 44 | 49 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -185,7 +185,9 @@ export function prompt(arg: any): Promise<PromptResult> { | |||
| 185 | 185 | } else if (options.inputType === inputType.email) { | |
| 186 | 186 | input.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); | |
| 187 | 187 | } else if (options.inputType === inputType.number) { | |
| 188 | - input.setInputType(android.text.InputType.TYPE_CLASS_NUMBER); | ||
| 188 | + input.setInputType(android.text.InputType.TYPE_CLASS_NUMBER); | ||
| 189 | + } else if (options.inputType === inputType.decimal) { | ||
| 190 | + input.setInputType(android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL); | ||
| 189 | 191 | } else if (options.inputType === inputType.phone) { | |
| 190 | 192 | input.setInputType(android.text.InputType.TYPE_CLASS_PHONE); | |
| 191 | 193 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments