Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-24655] Android: Disable HW-acceleration when opacity is defined #9051

Merged
merged 1 commit into from Aug 29, 2017

Conversation

garymathews
Copy link
Contributor

  • Disable hardware-acceleration when opacity is defined on Android 5.1 or lower
TEST CASE
var win = Titanium.UI.createWindow({backgroundColor: 'white', layout: 'vertical'}),
    a = Ti.UI.createView({
        top: 10,
        backgroundColor: 'blue',
        width: 200, height: 200
    }),
    b = Ti.UI.createView({
        top: 10,
        backgroundColor: 'orange',
        width: 100, height: 100,
        borderWidth: 3,
        borderRadius: 50,
        borderColor: 'red'
    }),
    c = Ti.UI.createView({
        top: 10,
        backgroundColor: 'red',
        width: 100, height: 100,
        opacity: 0.5,
        borderRadius: 35
    });

a.add(require('ti.map').createView({
    height: Ti.UI.FILL,
    width: Ti.UI.FILL,
    borderRadius: 10
}));

win.add([a, b, c]);
win.open();
  • Test on Android versions 4.1, 4.2, 4.3, 5.0, 5.1 and 6.0

JIRA Ticket

@garymathews garymathews added this to the 6.2.0 milestone May 11, 2017
@garymathews garymathews requested a review from ypbnv May 11, 2017 14:43
Copy link
Contributor

@ypbnv ypbnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: Pass

@lokeshchdhry
Copy link
Contributor

@garymathews , I see the following error & a crash on android 5.1.X.

[ERROR] :  TiApplication: (main) [81,81] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.timob24655/org.appcelerator.titanium.TiActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class android.support.v7.widget.Toolbar; Titanium 6.2.0,2017/06/26 11:47,undefined
[ERROR] :  TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.timob24655/org.appcelerator.titanium.TiActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class android.support.v7.widget.Toolbar
[ERROR] :  TiApplication: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.access$800(ActivityThread.java:151)
[ERROR] :  TiApplication: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
[ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:135)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5254)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Method.java:372)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
[ERROR] :  TiApplication: Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class android.support.v7.widget.Toolbar
[ERROR] :  TiApplication: 	at android.view.LayoutInflater.createView(LayoutInflater.java:633)
[ERROR] :  TiApplication: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
[ERROR] :  TiApplication: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
[ERROR] :  TiApplication: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
[ERROR] :  TiApplication: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
[ERROR] :  TiApplication: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
[ERROR] :  TiApplication: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
[ERROR] :  TiApplication: 	at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:394)
[ERROR] :  TiApplication: 	at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:312)
[ERROR] :  TiApplication: 	at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:268)
[ERROR] :  TiApplication: 	at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:145)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiBaseActivity.setContentView(TiBaseActivity.java:570)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:694)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:21)
[ERROR] :  TiApplication: 	at android.app.Activity.performCreate(Activity.java:5990)
[ERROR] :  TiApplication: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
[ERROR] :  TiApplication: 	... 10 more
[ERROR] :  TiApplication: Caused by: java.lang.reflect.InvocationTargetException
[ERROR] :  TiApplication: 	at java.lang.reflect.Constructor.newInstance(Native Method)
[ERROR] :  TiApplication: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
[ERROR] :  TiApplication: 	at android.view.LayoutInflater.createView(LayoutInflater.java:607)
[ERROR] :  TiApplication: 	... 26 more
[ERROR] :  TiApplication: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/graphics/drawable/VectorDrawableCompat;
[ERROR] :  TiApplication: 	at android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:891)
[ERROR] :  TiApplication: 	at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:356)
[ERROR] :  TiApplication: 	at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)
[ERROR] :  TiApplication: 	at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:192)
[ERROR] :  TiApplication: 	at android.support.v7.widget.TintTypedArray.getDrawable(TintTypedArray.java:60)
[ERROR] :  TiApplication: 	at android.support.v7.widget.Toolbar.<init>(Toolbar.java:254)
[ERROR] :  TiApplication: 	at android.support.v7.widget.Toolbar.<init>(Toolbar.java:196)
[ERROR] :  TiApplication: 	... 29 more
[ERROR] :  TiApplication: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.graphics.drawable.VectorDrawableCompat" on path: DexPathList[[zip file "/data/app/com.app.timob24655-2/base.apk"],nativeLibraryDirectories=[/data/app/com.app.timob24655-2/lib/x86, /vendo

@lokeshchdhry
Copy link
Contributor

Verified with @garymathews that the above error is unrelated to this change.

@lokeshchdhry
Copy link
Contributor

FR Passed.

Views are displayed as expected with borderRadius & opacity in the same view.

Studio Ver: 4.9.0.201705302345
SDK Ver: 6.2.0.v20170712181511
OS Ver: 10.12.3
Xcode Ver: Xcode 8.3.3
Appc NPM: 4.2.9
Appc CLI: 6.2.2
Ti CLI Ver: 5.0.14
Alloy Ver: 1.9.11
Node Ver: 6.10.1
Java Ver: 1.8.0_101
Devices: ⇨ google Nexus 5 --- Android 6.0.1
Emulator: Android 4.4.4

@lokeshchdhry
Copy link
Contributor

@garymathews , Can you please resolve the conflict so that I can merge.

@hansemannn hansemannn modified the milestones: 7.0.0, 6.2.0 Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants