Skip to content

Commit

Permalink
Merge pull request #9550 from jquick-axway/TIMOB-16257
Browse files Browse the repository at this point in the history
[TIMOB-16257] Android: Fixed crashed caused by setting ScrollView.scrollingEnabled on non-UI thread
  • Loading branch information
Lokesh Choudhary committed Oct 25, 2017
2 parents 15f1ee7 + 10c8bd3 commit 5f826a6
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package ti.modules.titanium.ui;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
Expand All @@ -30,7 +29,7 @@
})
public class ActivityIndicatorProxy extends TiViewProxy
{
private static final int MSG_FIRST_ID = KrollProxy.MSG_LAST_ID + 1;
private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1;
private static final int MSG_SHOW = MSG_FIRST_ID + 100;

boolean visible = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package ti.modules.titanium.ui;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
Expand Down Expand Up @@ -40,7 +39,7 @@
})
public class LabelProxy extends TiViewProxy
{
private static final int MSG_FIRST_ID = KrollProxy.MSG_LAST_ID + 1;
private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1;
protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999;

public LabelProxy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package ti.modules.titanium.ui;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.AsyncResult;
import org.appcelerator.kroll.common.TiMessenger;
Expand Down Expand Up @@ -36,7 +35,7 @@
public class ScrollViewProxy extends TiViewProxy
implements Handler.Callback
{
private static final int MSG_FIRST_ID = KrollProxy.MSG_LAST_ID + 1;
private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1;

private static final int MSG_SCROLL_TO = MSG_FIRST_ID + 100;
private static final int MSG_SCROLL_TO_BOTTOM = MSG_FIRST_ID + 101;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.appcelerator.titanium.TiDimension;
import org.appcelerator.titanium.TiTranslucentActivity;
import org.appcelerator.titanium.proxy.ActivityProxy;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.proxy.TiWindowProxy;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiRHelper;
Expand Down Expand Up @@ -64,7 +63,7 @@ public class WindowProxy extends TiWindowProxy implements TiActivityWindow
private static final String TAG = "WindowProxy";
private static final String PROPERTY_POST_WINDOW_CREATED = "postWindowCreated";

private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1;
private static final int MSG_FIRST_ID = TiWindowProxy.MSG_LAST_ID + 1;
private static final int MSG_SET_PIXEL_FORMAT = MSG_FIRST_ID + 100;
private static final int MSG_SET_TITLE = MSG_FIRST_ID + 101;
private static final int MSG_SET_WIDTH_HEIGHT = MSG_FIRST_ID + 102;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package ti.modules.titanium.ui.android;

import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
Expand All @@ -29,7 +28,7 @@
})
public class CardViewProxy extends TiViewProxy
{
private static final int MSG_FIRST_ID = KrollProxy.MSG_LAST_ID + 1;
private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1;
protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999;

public CardViewProxy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public abstract class TiWindowProxy extends TiViewProxy
private static final String TAG = "TiWindowProxy";
protected static final boolean LOLLIPOP_OR_GREATER = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP);

private static final int MSG_FIRST_ID = KrollProxy.MSG_LAST_ID + 1;
private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1;
private static final int MSG_OPEN = MSG_FIRST_ID + 100;
private static final int MSG_CLOSE = MSG_FIRST_ID + 101;
protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999;
Expand Down
2 changes: 2 additions & 0 deletions tests/Resources/ti.ui.scrollview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ describe('Titanium.UI.ScrollView', function () {
it('scrollingEnabled', function () {
var bar = Ti.UI.createScrollView({});
should(bar.scrollingEnabled).be.a.Boolean;
bar.scrollingEnabled = false;
should(bar.scrollingEnabled).be.eql(false);
});

// Android-only property
Expand Down

0 comments on commit 5f826a6

Please sign in to comment.