Skip to content

Commit 34a0315

Browse files
committed
test: demo app update
1 parent 20a27b0 commit 34a0315

File tree

7 files changed

+100
-101
lines changed

7 files changed

+100
-101
lines changed

demo-vue/references.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
2-
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
1+
/// <reference path="./node_modules/@nativescript/types-ios/lib/ios.d.ts" />
2+
/// <reference path="./node_modules/@nativescript/types-android/lib/android-26.d.ts" />
33
/// <reference path="../src/references.d.ts" />
44

55
// typings/custom.d.ts

demo/app/examples/appLogger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Label } from '@nativescript/core/ui/label';
44

55
export function writeToOutputLabel(imageView: Img, message: string) {
66
const gridLayout = imageView.parent as GridLayout;
7-
const label = gridLayout.getViewById('outputLabel');
7+
const label = gridLayout.getViewById('outputLabel') as Label;
88
console.log(message);
99
label.text += '\n' + message;
1010
}

demo/app/examples/cache-fragment.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { EventData } from '@nativescript/core/data/observable';
22
import { Button } from '@nativescript/core/ui/button';
33
import { GridLayout } from '@nativescript/core/ui/layouts/grid-layout';
44
import { Label } from '@nativescript/core/ui/label';
5-
import * as imageModel from '@nativescript-community/ui-image';
5+
import { Img, getImagePipeline } from '@nativescript-community/ui-image';
66
import { writeToOutputLabel } from './appLogger';
77

88
const src = 'https://raw.githubusercontent.com/nativescript-community/ui-image/master/examples-data/breakfast1.jpg';
99

1010
export function onCheckCache(args: EventData) {
1111
const button = args.object as Button;
1212
const gridLayout = button.parent as GridLayout;
13-
const imageView = gridLayout.getViewById('imageView');
14-
const imagePipeLine = imageModel.getImagePipeline();
13+
const imageView = gridLayout.getViewById('imageView') as Img;
14+
const imagePipeLine = getImagePipeline();
1515
const isInCache = imagePipeLine.isInBitmapMemoryCache(src);
1616
writeToOutputLabel(imageView, '>>>>> Image is in the Bitmap memory cache - ' + isInCache);
1717

@@ -25,8 +25,8 @@ export function onCheckCache(args: EventData) {
2525
export function onClearCache(args: EventData) {
2626
const button = args.object as Button;
2727
const gridLayout = button.parent as GridLayout;
28-
const imageView = gridLayout.getViewById('imageView');
29-
const imagePipeLine = imageModel.getImagePipeline();
28+
const imageView = gridLayout.getViewById('imageView') as Img;
29+
const imagePipeLine = getImagePipeline();
3030
writeToOutputLabel(imageView, '>>>>> Clearning cache');
3131

3232
imagePipeLine.clearCaches();
@@ -35,15 +35,15 @@ export function onClearCache(args: EventData) {
3535
export function onSetImage(args: EventData) {
3636
const button = args.object as Button;
3737
const gridLayout = button.parent as GridLayout;
38-
const imageView = gridLayout.getViewById('imageView');
38+
const imageView = gridLayout.getViewById('imageView') as Img;
3939
imageView.src = null;
4040
imageView.src = src;
4141
}
4242

4343
export function onResetImage(args: EventData) {
4444
const button = args.object as Button;
4545
const gridLayout = button.parent as GridLayout;
46-
const imageView = gridLayout.getViewById('imageView');
46+
const imageView = gridLayout.getViewById('imageView') as Img;
4747
writeToOutputLabel(imageView, ">>>>> Refreshing cache and 'src'");
4848

4949
imageView.updateImageUri();

demo/app/examples/nativecolorfilter-fragment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Img } from '@nativescript-community/ui-image';
22

33
export function onLoaded(args) {
44
const imageView = args.object as Img;
5-
if (imageView.android) {
5+
if (global.isAndroid) {
66
const matrix: android.graphics.ColorMatrix = new android.graphics.ColorMatrix();
77
matrix.setSaturation(0);
88
const filter: android.graphics.ColorMatrixColorFilter = new android.graphics.ColorMatrixColorFilter(

demo/app/examples/single-fragment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventData } from '@nativescript/core/ui/page';
1+
import { EventData } from '@nativescript/core';
22

33
export function onImageTap(args: EventData) {
44
console.log('onImageTap', args);

demo/references.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
/// <reference path="./node_modules/tns-platform-declarations/android-26.d.ts" />
2-
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
3-
/// <reference path="../src/references.d.ts" />
1+
/// <reference path="./node_modules/@nativescript/types-ios/lib/ios.d.ts" />
2+
/// <reference path="./node_modules/@nativescript/types-android/lib/android-26.d.ts" />

0 commit comments

Comments
 (0)