| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bcadcbe commit 398c9b3
48 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ export function getNativeText(button: buttonModule.Button): string { | |||
| 8 | 8 | } | |
| 9 | 9 | ||
| 10 | 10 | export function getNativeTextWrap(button: buttonModule.Button): boolean { | |
| 11 | - return (<android.widget.Button>button.android).isSingleLine(); | ||
| 11 | + return ((<android.widget.Button>button.android).getLineCount() === 1); | ||
| 12 | 12 | } | |
| 13 | 13 | ||
| 14 | 14 | export function getNativeFontSize(button: buttonModule.Button): number { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,14 +14,14 @@ class NativeButton extends android.widget.Button { | |||
| 14 | 14 | return global.__native(this); | |
| 15 | 15 | } | |
| 16 | 16 | ||
| 17 | - protected onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void { | ||
| 17 | + public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void { | ||
| 18 | 18 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |
| 19 | 19 | this.owner.widthMeasureSpec = widthMeasureSpec; | |
| 20 | 20 | this.owner.heightMeasureSpec = heightMeasureSpec; | |
| 21 | 21 | this.owner.measureCount++; | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | - protected onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void { | ||
| 24 | + public onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void { | ||
| 25 | 25 | super.onLayout(changed, left, top, right, bottom); | |
| 26 | 26 | this.owner.arrangeCount++; | |
| 27 | 27 | } | |
@@ -33,14 +33,14 @@ class NativeStackLayout extends org.nativescript.widgets.StackLayout { | |||
| 33 | 33 | return global.__native(this); | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | - protected onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void { | ||
| 36 | + public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void { | ||
| 37 | 37 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |
| 38 | 38 | this.owner.widthMeasureSpec = widthMeasureSpec; | |
| 39 | 39 | this.owner.heightMeasureSpec = heightMeasureSpec; | |
| 40 | 40 | this.owner.measureCount++; | |
| 41 | 41 | } | |
| 42 | 42 | ||
| 43 | - protected onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void { | ||
| 43 | + public onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void { | ||
| 44 | 44 | super.onLayout(changed, left, top, right, bottom); | |
| 45 | 45 | this.owner.arrangeCount++; | |
| 46 | 46 | } | |
@@ -52,14 +52,14 @@ class NativeGridLayout extends org.nativescript.widgets.GridLayout { | |||
| 52 | 52 | return global.__native(this); | |
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | - protected onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void { | ||
| 55 | + public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void { | ||
| 56 | 56 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |
| 57 | 57 | this.owner.widthMeasureSpec = widthMeasureSpec; | |
| 58 | 58 | this.owner.heightMeasureSpec = heightMeasureSpec; | |
| 59 | 59 | this.owner.measureCount++; | |
| 60 | 60 | } | |
| 61 | 61 | ||
| 62 | - protected onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void { | ||
| 62 | + public onLayout(changed: boolean, left: number, top: number, right: number, bottom: number): void { | ||
| 63 | 63 | super.onLayout(changed, left, top, right, bottom); | |
| 64 | 64 | this.owner.arrangeCount++; | |
| 65 | 65 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | import * as common from "./application-settings-common"; | |
| 2 | 2 | import { getNativeApplication } from "../application"; | |
| 3 | 3 | ||
| 4 | - var sharedPreferences: android.content.ISharedPreferences; | ||
| 4 | + var sharedPreferences: android.content.SharedPreferences; | ||
| 5 | 5 | function ensureSharedPreferences() { | |
| 6 | 6 | if (!sharedPreferences) { | |
| 7 | 7 | sharedPreferences = (<android.app.Application>getNativeApplication()).getApplicationContext().getSharedPreferences("prefs.db", 0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ function initializeMenuItemClickListener(): void { | |||
| 38 | 38 | return global.__native(this); | |
| 39 | 39 | } | |
| 40 | 40 | ||
| 41 | - onMenuItemClick(item: android.view.IMenuItem): boolean { | ||
| 41 | + onMenuItemClick(item: android.view.MenuItem): boolean { | ||
| 42 | 42 | let itemId = item.getItemId(); | |
| 43 | 43 | return this.owner._onAndroidItemSelected(itemId); | |
| 44 | 44 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -145,9 +145,9 @@ function initializeDialogFragment() { | |||
| 145 | 145 | ||
| 146 | 146 | const dialog = new DialogImpl(this, this.getActivity(), this.getTheme()); | |
| 147 | 147 | ||
| 148 | - // do not override alignment unless fullscreen modal will be shown; | ||
| 148 | + // do not override alignment unless fullscreen modal will be shown; | ||
| 149 | 149 | // otherwise we might break component-level layout: | |
| 150 | - // https://github.com/NativeScript/NativeScript/issues/5392 | ||
| 150 | + // https://github.com/NativeScript/NativeScript/issues/5392 | ||
| 151 | 151 | if (!this._fullscreen && !this._stretched) { | |
| 152 | 152 | this.owner.horizontalAlignment = "center"; | |
| 153 | 153 | this.owner.verticalAlignment = "middle"; | |
@@ -185,7 +185,7 @@ function initializeDialogFragment() { | |||
| 185 | 185 | this._shownCallback(); | |
| 186 | 186 | } | |
| 187 | 187 | ||
| 188 | - public onDismiss(dialog: android.content.IDialogInterface): void { | ||
| 188 | + public onDismiss(dialog: android.content.DialogInterface): void { | ||
| 189 | 189 | super.onDismiss(dialog); | |
| 190 | 190 | const manager = this.getFragmentManager(); | |
| 191 | 191 | if (manager) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,7 +71,7 @@ function initializeEditTextListeners(): void { | |||
| 71 | 71 | // owner.android.setSelection(selectionStart); | |
| 72 | 72 | } | |
| 73 | 73 | ||
| 74 | - public afterTextChanged(editable: android.text.IEditable): void { | ||
| 74 | + public afterTextChanged(editable: android.text.Editable): void { | ||
| 75 | 75 | const owner = this.owner; | |
| 76 | 76 | if (!owner || owner._changeFromCode) { | |
| 77 | 77 | return; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,9 +16,9 @@ class NativeScriptActivity extends android.app.Activity { | |||
| 16 | 16 | return global.__native(this); | |
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | - protected onCreate(savedInstanceState: android.os.Bundle): void { | ||
| 19 | + public onCreate(savedInstanceState: android.os.Bundle): void { | ||
| 20 | 20 | appModule.android.init(this.getApplication()); | |
| 21 | - | ||
| 21 | + | ||
| 22 | 22 | // Set isNativeScriptActivity in onCreate. | |
| 23 | 23 | // The JS constructor might not be called because the activity is created from Android. | |
| 24 | 24 | this.isNativeScriptActivity = true; | |
@@ -29,24 +29,24 @@ class NativeScriptActivity extends android.app.Activity { | |||
| 29 | 29 | this._callbacks.onCreate(this, savedInstanceState, super.onCreate); | |
| 30 | 30 | } | |
| 31 | 31 | ||
| 32 | - protected onNewIntent(intent: android.content.Intent): void { | ||
| 32 | + public onNewIntent(intent: android.content.Intent): void { | ||
| 33 | 33 | super.onNewIntent(intent); | |
| 34 | 34 | super.setIntent(intent); | |
| 35 | 35 | } | |
| 36 | 36 | ||
| 37 | - protected onSaveInstanceState(outState: android.os.Bundle): void { | ||
| 37 | + public onSaveInstanceState(outState: android.os.Bundle): void { | ||
| 38 | 38 | this._callbacks.onSaveInstanceState(this, outState, super.onSaveInstanceState); | |
| 39 | 39 | } | |
| 40 | 40 | ||
| 41 | - protected onStart(): void { | ||
| 41 | + public onStart(): void { | ||
| 42 | 42 | this._callbacks.onStart(this, super.onStart); | |
| 43 | 43 | } | |
| 44 | 44 | ||
| 45 | - protected onStop(): void { | ||
| 45 | + public onStop(): void { | ||
| 46 | 46 | this._callbacks.onStop(this, super.onStop); | |
| 47 | 47 | } | |
| 48 | 48 | ||
| 49 | - protected onDestroy(): void { | ||
| 49 | + public onDestroy(): void { | ||
| 50 | 50 | this._callbacks.onDestroy(this, super.onDestroy); | |
| 51 | 51 | } | |
| 52 | 52 | ||
@@ -58,7 +58,7 @@ class NativeScriptActivity extends android.app.Activity { | |||
| 58 | 58 | this._callbacks.onRequestPermissionsResult(this, requestCode, permissions, grantResults, undefined /*TODO: Enable if needed*/); | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | - protected onActivityResult(requestCode: number, resultCode: number, data: android.content.Intent): void { | ||
| 61 | + public onActivityResult(requestCode: number, resultCode: number, data: android.content.Intent): void { | ||
| 62 | 62 | this._callbacks.onActivityResult(this, requestCode, resultCode, data, super.onActivityResult); | |
| 63 | 63 | } | |
| 64 | 64 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,5 @@ | |||
| 1 | + /// <reference path="transition-definitions.android.d.ts"/> | ||
| 2 | + | ||
| 1 | 3 | // Definitions. | |
| 2 | 4 | import { NavigationTransition, BackstackEntry } from "../frame"; | |
| 3 | 5 | import { AnimationType } from "./fragment.transitions"; | |
@@ -332,7 +334,7 @@ function getTransitionListener(entry: ExpandedEntry, transition: android.transit | |||
| 332 | 334 | return new TransitionListener(entry, transition); | |
| 333 | 335 | } | |
| 334 | 336 | ||
| 335 | - function getAnimationListener(): android.animation.Animator.IAnimatorListener { | ||
| 337 | + function getAnimationListener(): android.animation.Animator.AnimatorListener { | ||
| 336 | 338 | if (!AnimationListener) { | |
| 337 | 339 | @Interfaces([android.animation.Animator.AnimatorListener]) | |
| 338 | 340 | class AnimationListnerImpl extends java.lang.Object implements android.animation.Animator.AnimatorListener { | |
@@ -375,7 +377,7 @@ function getAnimationListener(): android.animation.Animator.IAnimatorListener { | |||
| 375 | 377 | ||
| 376 | 378 | return AnimationListener; | |
| 377 | 379 | } | |
| 378 | - | ||
| 380 | + | ||
| 379 | 381 | function addToWaitingQueue(entry: ExpandedEntry): void { | |
| 380 | 382 | const frameId = entry.frameId; | |
| 381 | 383 | let entries = waitingQueue.get(frameId); | |
@@ -387,7 +389,7 @@ function addToWaitingQueue(entry: ExpandedEntry): void { | |||
| 387 | 389 | entries.add(entry); | |
| 388 | 390 | } | |
| 389 | 391 | ||
| 390 | - function clearAnimationListener(animator: ExpandedAnimator, listener: android.animation.Animator.IAnimatorListener): void { | ||
| 392 | + function clearAnimationListener(animator: ExpandedAnimator, listener: android.animation.Animator.AnimatorListener): void { | ||
| 391 | 393 | if (!animator) { | |
| 392 | 394 | return; | |
| 393 | 395 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,58 @@ | |||
| 1 | + /** | ||
| 2 | + * @private | ||
| 3 | + */ /** */ | ||
| 4 | + | ||
| 5 | + // Definitions for Android API lvl 21 transitions | ||
| 6 | + declare module android { | ||
| 7 | + export module transition { | ||
| 8 | + export abstract class Transition extends java.lang.Object { | ||
| 9 | + addListener(transition: Transition.TransitionListener): Transition; | ||
| 10 | + removeListener(transition: Transition.TransitionListener): Transition; | ||
| 11 | + setDuration(duration: number): Transition; | ||
| 12 | + setInterpolator(interpolator: android.animation.TimeInterpolator): Transition; | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + export abstract class Visibility extends android.transition.Transition { | ||
| 16 | + constructor(); | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + export class Slide extends Visibility { | ||
| 20 | + constructor(slideEdge: number); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + export class Fade extends Visibility { | ||
| 24 | + constructor(fadingMode: number); | ||
| 25 | + static IN: number; | ||
| 26 | + static OUT: number; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + export class Explode extends Visibility { | ||
| 30 | + constructor(); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + export module Transition { | ||
| 34 | + export interface TransitionListener { | ||
| 35 | + onTransitionStart(transition: android.transition.Transition): void; | ||
| 36 | + onTransitionEnd(transition: android.transition.Transition): void; | ||
| 37 | + onTransitionResume(transition: android.transition.Transition): void; | ||
| 38 | + onTransitionPause(transition: android.transition.Transition): void; | ||
| 39 | + onTransitionCancel(transition: android.transition.Transition): void; | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + export module app { | ||
| 45 | + export interface Fragment { | ||
| 46 | + getEnterTransition(): android.transition.Transition; | ||
| 47 | + getExitTransition(): android.transition.Transition; | ||
| 48 | + getReenterTransition(): android.transition.Transition; | ||
| 49 | + getReturnTransition(): android.transition.Transition; | ||
| 50 | + setEnterTransition(transition: android.transition.Transition): void; | ||
| 51 | + setExitTransition(transition: android.transition.Transition): void; | ||
| 52 | + setReenterTransition(transition: android.transition.Transition): void; | ||
| 53 | + setReturnTransition(transition: android.transition.Transition): void; | ||
| 54 | + setAllowEnterTransitionOverlap(allow: boolean): void; | ||
| 55 | + setAllowReturnTransitionOverlap(allow: boolean): void; | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ function ensureLruBitmapCacheClass() { | |||
| 12 | 12 | return global.__native(this); | |
| 13 | 13 | } | |
| 14 | 14 | ||
| 15 | - protected sizeOf(key: string, bitmap: android.graphics.Bitmap): number { | ||
| 15 | + public sizeOf(key: string, bitmap: android.graphics.Bitmap): number { | ||
| 16 | 16 | // The cache size will be measured in kilobytes rather than | |
| 17 | 17 | // number of items. | |
| 18 | 18 | var result = Math.round(bitmap.getByteCount() / 1024); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments