Skip to content

Commit e7ec9f2

Browse files
committed
feat(android): keepHardwareMode property in Ti.UI.View
1 parent 93b8e61 commit e7ec9f2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,9 @@ protected void setOnLongClickListener(View view)
22102210

22112211
protected void disableHWAcceleration()
22122212
{
2213-
if (this.borderView != null) {
2213+
if (this.borderView != null && !(proxy.hasProperty("keepHardwareMode")
2214+
&& TiConvert.toBoolean(proxy.getProperty("keepHardwareMode"), false))
2215+
) {
22142216
this.borderView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
22152217
}
22162218
}

apidoc/Titanium/UI/View.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,15 @@ properties:
15551555
Defaults to `undefined`.
15561556
type: [Number,String]
15571557

1558+
- name: keepHardwareMode
1559+
summary: A value indicating the render mode of the View
1560+
description: |
1561+
Set to true to keep hardware mode when using a border and transparent backgrounds.
1562+
type: Boolean
1563+
default: false
1564+
platforms: [android]
1565+
since: {android: "13.1.0"}
1566+
15581567
- name: layout
15591568
type: String
15601569
summary: |

0 commit comments

Comments
 (0)