Skip to content

Commit 58913bd

Browse files
committed
fix(image): make imageRotation work in ListView
1 parent 33aa9b9 commit 58913bd

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

packages/image/platforms/android/java/com/nativescript/image/ScalingUtils.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public abstract void getTransformImpl(
173173
float scaleY);
174174
}
175175

176-
private static class ScaleTypeFitXY extends AbstractScaleType {
176+
public static class ScaleTypeFitXY extends AbstractScaleType {
177177

178178
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeFitXY();
179179

@@ -199,7 +199,7 @@ public String toString() {
199199
}
200200
}
201201

202-
private static class ScaleTypeFitStart extends AbstractScaleType {
202+
public static class ScaleTypeFitStart extends AbstractScaleType {
203203

204204
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeFitStart();
205205

@@ -226,7 +226,7 @@ public String toString() {
226226
}
227227
}
228228

229-
private static class ScaleTypeFitBottomStart extends AbstractScaleType {
229+
public static class ScaleTypeFitBottomStart extends AbstractScaleType {
230230

231231
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeFitBottomStart();
232232

@@ -253,7 +253,7 @@ public String toString() {
253253
}
254254
}
255255

256-
private static class ScaleTypeFitCenter extends AbstractScaleType {
256+
public static class ScaleTypeFitCenter extends AbstractScaleType {
257257

258258
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeFitCenter();
259259

@@ -280,7 +280,7 @@ public String toString() {
280280
}
281281
}
282282

283-
private static class ScaleTypeFitEnd extends AbstractScaleType {
283+
public static class ScaleTypeFitEnd extends AbstractScaleType {
284284

285285
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeFitEnd();
286286

@@ -307,7 +307,7 @@ public String toString() {
307307
}
308308
}
309309

310-
private static class ScaleTypeCenter extends AbstractScaleType {
310+
public static class ScaleTypeCenter extends AbstractScaleType {
311311

312312
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeCenter();
313313

@@ -332,7 +332,7 @@ public String toString() {
332332
}
333333
}
334334

335-
private static class ScaleTypeCenterInside extends AbstractScaleType {
335+
public static class ScaleTypeCenterInside extends AbstractScaleType {
336336

337337
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeCenterInside();
338338

@@ -359,7 +359,7 @@ public String toString() {
359359
}
360360
}
361361

362-
private static class ScaleTypeCenterCrop extends AbstractScaleType {
362+
public static class ScaleTypeCenterCrop extends AbstractScaleType {
363363

364364
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeCenterCrop();
365365

@@ -393,7 +393,7 @@ public String toString() {
393393
}
394394
}
395395

396-
private static class ScaleTypeFocusCrop extends AbstractScaleType {
396+
public static class ScaleTypeFocusCrop extends AbstractScaleType {
397397

398398
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeFocusCrop();
399399

@@ -429,7 +429,7 @@ public String toString() {
429429
}
430430
}
431431

432-
private static class ScaleTypeFitX extends AbstractScaleType {
432+
public static class ScaleTypeFitX extends AbstractScaleType {
433433

434434
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeFitX();
435435

@@ -457,7 +457,7 @@ public String toString() {
457457
}
458458
}
459459

460-
private static class ScaleTypeFitY extends AbstractScaleType {
460+
public static class ScaleTypeFitY extends AbstractScaleType {
461461

462462
public static final com.facebook.drawee.drawable.ScalingUtils.ScaleType INSTANCE = new ScaleTypeFitY();
463463

src/image/index.android.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -973,31 +973,31 @@ function getScaleType(scaleType: ScaleType) {
973973
switch (scaleType) {
974974
case ScaleType.Center:
975975
//@ts-ignore
976-
return com.nativescript.image.ScalingUtils.ScaleType.CENTER;
976+
return new com.nativescript.image.ScalingUtils.ScaleTypeCenter();
977977
case ScaleType.AspectFill:
978978
case ScaleType.CenterCrop:
979979
//@ts-ignore
980-
return com.nativescript.image.ScalingUtils.ScaleType.CENTER_CROP;
980+
return new com.nativescript.image.ScalingUtils.ScaleTypeCenterCrop();
981981
case ScaleType.CenterInside:
982982
//@ts-ignore
983-
return com.nativescript.image.ScalingUtils.ScaleType.CENTER_INSIDE;
983+
return new com.nativescript.image.ScalingUtils.ScaleTypeCenterInside();
984984
case ScaleType.FitCenter:
985985
case ScaleType.AspectFit:
986986
//@ts-ignore
987-
return com.nativescript.image.ScalingUtils.ScaleType.FIT_CENTER;
987+
return new com.nativescript.image.ScalingUtils.ScaleTypeFitCenter();
988988
case ScaleType.FitEnd:
989989
//@ts-ignore
990-
return com.nativescript.image.ScalingUtils.ScaleType.FIT_END;
990+
return new com.nativescript.image.ScalingUtils.ScaleTypeFitEnd();
991991
case ScaleType.FitStart:
992992
//@ts-ignore
993-
return com.nativescript.image.ScalingUtils.ScaleType.FIT_START;
993+
return new com.nativescript.image.ScalingUtils.ScaleTypeFitStart();
994994
case ScaleType.Fill:
995995
case ScaleType.FitXY:
996996
//@ts-ignore
997-
return com.nativescript.image.ScalingUtils.ScaleType.FIT_XY;
997+
return new com.nativescript.image.ScalingUtils.ScaleTypeFitXY();
998998
case ScaleType.FocusCrop:
999999
//@ts-ignore
1000-
return com.nativescript.image.ScalingUtils.ScaleType.FOCUS_CROP;
1000+
return new com.nativescript.image.ScalingUtils.ScaleTypeFocusCrop();
10011001
default:
10021002
break;
10031003
}

0 commit comments

Comments
 (0)