Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1103] <headerview formFactor="handheld"> not working and throwing an error

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-08-08T07:27:28.000+0000
Affected Version/sAlloy 1.4.0, Alloy 1.3.1
Fix Version/sAlloy 1.5.0
ComponentsXML
Labelsqe-manualtest
ReporterFederico Casali
AssigneeFeon Sua Xin Miao
Created2014-07-31T17:49:15.000+0000
Updated2014-08-22T23:05:21.000+0000

Description

Problem description

formFactor='handheld' is not correctly applied if applied to object. Depending on the target, could either be not visible or crashing the app.

Steps to reproduce

Use the following sample code:

index.xml

<Alloy>
    <Window>    
        <TableView height="80%">
            <HeaderView formFactor="handheld">
                <View>
                    <Label>HeaderView Handheld</Label>
                </View>
            </HeaderView>
        </TableView>
         <View formFactor="handheld">
            	<Label>View Handheld</Label>
            </View>
    </Window>
</Alloy>

index.tss

"Window":{
	backgroundColor:'white',
	layout:'vertical'
}

"Label":{
	font:{
		fontSize:'20dp',
		color:'black'
	}
}
1. Build and run on Android Tablet (tested with Google Nexus 7 4.3) Expected result: App runs. Both Headerview and View are not visible. Result: App crashes with the following error log:
E/AndroidRuntime( 3251): FATAL EXCEPTION: main
		E/AndroidRuntime( 3251): Process: com.appcelerator.AlloyHarness, PID: 3251
		E/AndroidRuntime( 3251): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.AlloyHarness/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException
		E/AndroidRuntime( 3251): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
		E/AndroidRuntime( 3251): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
		E/AndroidRuntime( 3251): 	at android.app.ActivityThread.access$800(ActivityThread.java:135)
		E/AndroidRuntime( 3251): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
		E/AndroidRuntime( 3251): 	at android.os.Handler.dispatchMessage(Handler.java:102)
		E/AndroidRuntime( 3251): 	at android.os.Looper.loop(Looper.java:136)
		E/AndroidRuntime( 3251): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
		E/AndroidRuntime( 3251): 	at java.lang.reflect.Method.invokeNative(Native Method)
		E/AndroidRuntime( 3251): 	at java.lang.reflect.Method.invoke(Method.java:515)
		E/AndroidRuntime( 3251): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
		E/AndroidRuntime( 3251): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
		E/AndroidRuntime( 3251): 	at dalvik.system.NativeStart.main(Native Method)
		E/AndroidRuntime( 3251): Caused by: java.lang.NullPointerException
		E/AndroidRuntime( 3251): 	at ti.modules.titanium.ui.widget.tableview.TiTableView.layoutHeaderOrFooter(TiTableView.java:505)
		E/AndroidRuntime( 3251): 	at ti.modules.titanium.ui.widget.tableview.TiTableView.<init>(TiTableView.java:347)
		E/AndroidRuntime( 3251): 	at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:106)
		E/AndroidRuntime( 3251): 	at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1185)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:500)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:670)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:564)
		E/AndroidRuntime( 3251): 	at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:233)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:442)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:524)
		E/AndroidRuntime( 3251): 	at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18)
		E/AndroidRuntime( 3251): 	at android.app.Activity.performCreate(Activity.java:5231)
		E/AndroidRuntime( 3251): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
		E/AndroidRuntime( 3251): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
		E/AndroidRuntime( 3251): 	... 11 more
		W/ActivityManager(  550):   Force finishing activity com.appcelerator.AlloyHarness/org.appcelerator.titanium.TiActivity
		W/ActivityManager(  550):   Force finishing activity com.appcelerator.AlloyHarness/.HarnessActivity
		W/ActivityManager(  550): Activity pause timeout for ActivityRecord{528b362c u0 com.appcelerator.AlloyHarness/org.appcelerator.titanium.TiActivity t16 f}
		W/EGL_genymotion( 1017): eglSurfaceAttrib not implemented
		I/Process ( 3251): Sending signal. PID: 3251 SIG: 9
		W/InputDispatcher(  550): channel '528c7ea0 com.appcelerator.AlloyHarness/com.appcelerator.AlloyHarness.HarnessActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
		E/InputDispatcher(  550): channel '528c7ea0 com.appcelerator.AlloyHarness/com.appcelerator.AlloyHarness.HarnessActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
		W/audio_hw_primary(  114): out_write() limiting sleep time 69659 to 23219
		I/ActivityManager(  550): Process com.appcelerator.AlloyHarness (pid 3251) has died.
		W/InputDispatcher(  550): Attempted to unregister already unregistered input channel '528c7ea0 com.appcelerator.AlloyHarness/com.appcelerator.AlloyHarness.HarnessActivity (server)'
		W/InputMethodManagerService(  550): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@52bd1b38 attribute=null, token = android.os.BinderProxy@52bca104
		I/WindowState(  550): WIN DEATH: Window{528c7ea0 u0 com.appcelerator.AlloyHarness/com.appcelerator.AlloyHarness.HarnessActivity}
		W/audio_hw_primary(  114): out_write() limiting sleep time 46439 to 23219
		W/audio_hw_primary(  114): out_write() limiting sleep time 34828 to 23219
2. Build run on iOS tablet Result: app runs. and are not visible as expected 3. Build run on Android and iOS handheld Result: app runs. however is not displayed, while is correctly displayed as expected. Expected result: should be displayed.

Attachments

FileDateSize
galaxy_note10.png2014-08-07T08:14:14.000+000051496
galaxy_s3.png2014-08-07T08:14:14.000+000055911
ipad.png2014-08-07T08:14:14.000+000036336
iphone.png2014-08-07T08:14:14.000+000041241

Comments

  1. Feon Sua Xin Miao 2014-08-07

    PR: https://github.com/appcelerator/alloy/pull/502 Test app: https://github.com/feons/alloy/tree/ALOY-1103/test/apps/testing/ALOY-1103 Functional Test: 1. Run the test app, the app shouldn't crash 2. The UI should look like the attached screenshots for each platform.
  2. Praveen Innamuri 2014-08-08

    Merged PR to Alloy#master (1.5.0)
  3. Ewan Harris 2014-08-22

    Verified fix on: Mac OSX 10.9.4 Appcelerator Studio, build: 3.4.0.201408210941 Titanium SDK build: 3.4.0.v20140821144114 Titanium CLI, build: 3.4.0-dev Alloy: 1.5.0-dev Android Device Galaxy Tab 3 (4.2.2) Android Device S3 (4.0.4) iPad Simulator 7.1 iPhone Simulator 7.1 The UI on the devices matches the attached screenshots. Closing ticket.

JSON Source