mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
Added typed information for lazily loaded android types.
This commit is contained in:
@ -256,7 +256,7 @@ export class AndroidApplication extends observable.Observable implements definit
|
||||
ensureBroadCastReceiverClass();
|
||||
var that = this;
|
||||
var registerFunc = function (context: android.content.Context) {
|
||||
var receiver = new BroadcastReceiverClass(onReceiveCallback);
|
||||
var receiver: android.content.BroadcastReceiver = new BroadcastReceiverClass(onReceiveCallback);
|
||||
context.registerReceiver(receiver, new android.content.IntentFilter(intentFilter));
|
||||
that._registeredReceivers[intentFilter] = receiver;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ function doFrame(currentTimeMillis: number) {
|
||||
}
|
||||
}
|
||||
|
||||
var native;
|
||||
var native: fpsNative.FPSCallback;
|
||||
function ensureNative() {
|
||||
if (!native) {
|
||||
native = new fpsNative.FPSCallback(doFrame);
|
||||
|
@ -12,7 +12,7 @@ import http = require("http");
|
||||
var requestIdCounter = 0;
|
||||
var pendingRequests = {};
|
||||
|
||||
var completeCallback;
|
||||
var completeCallback: com.tns.Async.CompleteCallback;
|
||||
function ensureCompleteCallback() {
|
||||
if (completeCallback) {
|
||||
return;
|
||||
|
@ -64,7 +64,7 @@ export class Span extends spanCommon.Span {
|
||||
(realFontAttributes & enums.FontAttributes.Italic) ? enums.FontStyle.italic : enums.FontStyle.normal,
|
||||
(realFontAttributes & enums.FontAttributes.Bold) ? enums.FontWeight.bold : enums.FontWeight.normal);
|
||||
ensureCustomTypefaceSpanClass();
|
||||
let typefaceSpan = new CustomTypefaceSpanClass(realFontFamily, font.getAndroidTypeface());
|
||||
let typefaceSpan: android.text.style.TypefaceSpan = new CustomTypefaceSpanClass(realFontFamily, font.getAndroidTypeface());
|
||||
this.spanModifiers.push(typefaceSpan);
|
||||
}
|
||||
var realFontSize = this.fontSize ||
|
||||
|
@ -15,7 +15,7 @@ function ensureFloatType() {
|
||||
}
|
||||
}
|
||||
|
||||
var argbEvaluator;
|
||||
var argbEvaluator: android.animation.ArgbEvaluator;
|
||||
function ensureArgbEvaluator() {
|
||||
if (!argbEvaluator) {
|
||||
argbEvaluator = new android.animation.ArgbEvaluator();
|
||||
|
@ -30,7 +30,7 @@ function ensureLruBitmapCacheClass() {
|
||||
|
||||
export class Cache extends common.Cache {
|
||||
private _callback: any;
|
||||
private _cache;
|
||||
private _cache: android.util.LruCache<string, android.graphics.Bitmap>;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
@ -38,7 +38,6 @@ export class Cache extends common.Cache {
|
||||
ensureLruBitmapCacheClass();
|
||||
var maxMemory = java.lang.Runtime.getRuntime().maxMemory() / 1024;
|
||||
var cacheSize = maxMemory / 8;
|
||||
//console.log("cacheSize: " + cacheSize);
|
||||
this._cache = new LruBitmapCacheClass(cacheSize);
|
||||
|
||||
var that = new WeakRef(this);
|
||||
|
@ -123,7 +123,7 @@ export class Page extends pageCommon.Page {
|
||||
}
|
||||
|
||||
/* tslint:disable */
|
||||
private _dialogFragment;
|
||||
private _dialogFragment: android.app.DialogFragment;
|
||||
/* tslint:enable */
|
||||
protected _showNativeModalView(parent: Page, context: any, closeCallback: Function, fullscreen?: boolean) {
|
||||
super._showNativeModalView(parent, context, closeCallback, fullscreen);
|
||||
|
@ -88,7 +88,7 @@ function onItemsPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
|
||||
var arr = java.lang.reflect.Array.newInstance(java.lang.Integer.class.getField("TYPE").get(null), 1);
|
||||
arr[0] = R_ATTR_STATE_SELECTED;
|
||||
var colorDrawable = new SegmentedBarColorDrawableClass(view.selectedBackgroundColor.android)
|
||||
var colorDrawable: android.graphics.drawable.ColorDrawable = new SegmentedBarColorDrawableClass(view.selectedBackgroundColor.android)
|
||||
stateDrawable.addState(arr, colorDrawable);
|
||||
stateDrawable.setBounds(0, 15, vg.getRight(), vg.getBottom());
|
||||
|
||||
@ -128,6 +128,8 @@ function ensureSegmentedBarColorDrawableClass() {
|
||||
canvas.drawRect(0, this.getBounds().height() - 15, this.getBounds().width(), this.getBounds().height(), p);
|
||||
}
|
||||
}
|
||||
|
||||
SegmentedBarColorDrawableClass = SegmentedBarColorDrawable;
|
||||
}
|
||||
|
||||
export class SegmentedBarItem extends common.SegmentedBarItem {
|
||||
@ -144,7 +146,7 @@ export class SegmentedBarItem extends common.SegmentedBarItem {
|
||||
}
|
||||
|
||||
export class SegmentedBar extends common.SegmentedBar {
|
||||
private _android;
|
||||
private _android: android.widget.TabHost;
|
||||
public _listener: android.widget.TabHost.OnTabChangeListener;
|
||||
|
||||
public _createUI() {
|
||||
|
@ -186,7 +186,7 @@ export class TabView extends common.TabView {
|
||||
private _pagerAdapter: android.support.v4.view.PagerAdapter;
|
||||
private _androidViewId: number;
|
||||
|
||||
private _pageChagedListener;
|
||||
private _pageChagedListener: android.support.v4.view.ViewPager.SimpleOnPageChangeListener;
|
||||
|
||||
get android(): android.view.View {
|
||||
return this._grid;
|
||||
|
@ -3,7 +3,7 @@ import { knownFolders } from "file-system"
|
||||
export var debug = true;
|
||||
|
||||
// TODO: Get this from the runtimes...
|
||||
var applicationRootPath;
|
||||
var applicationRootPath: string;
|
||||
function ensureAppRootPath() {
|
||||
if (!applicationRootPath) {
|
||||
applicationRootPath = knownFolders.currentApp().path;
|
||||
|
Reference in New Issue
Block a user