Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28384] Android: rightImage property for tableviewrow does not work for res images in "/images/" folder

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-05-18T18:06:05.000+0000
Affected Version/sRelease 9.3.0, Release 9.3.1, Release 9.3.2
Fix Version/sRelease 10.0.0, Release 9.3.3
ComponentsAndroid
Labelsregression
ReporterLokesh Choudhary
AssigneeGary Mathews
Created2021-03-11T20:43:38.000+0000
Updated2021-05-18T18:06:09.000+0000

Description

Steps to reproduce:

1. Use the code below in your app.js:
const win = Ti.UI.createWindow({
	backgroundColor : 'white'
});
var rowItems = [];
for (var i = 0; i < 10; i++) {
	var row = Ti.UI.createTableViewRow({
		title : 'Apples',
		borderColor : 'red',
		borderWidth : 2,
                rightImage : '/images/icon_s_arrow_right.png'
	});
	row.add(Ti.UI.createLabel({
		color : 'black',
		text : i,
		touchEnabled : false,
		left : 0,
		width : Ti.UI.FILL
	}));
	rowItems.push(row);
}

var table = Ti.UI.createTableView({
	data : rowItems,
	minRowHeight : 100
});

win.add(table);
win.open();
2. Build for android device.

Actual result:

1. Exception is thrown:
[ERROR] :  TiFileHelper: (main) [31,1024] /images/icon_s_arrow_right.png not found.
[ERROR] :  TiFileHelper: java.io.FileNotFoundException: Resources/images/icon_s_arrow_right.png
[ERROR] :  TiFileHelper: 	at android.content.res.AssetManager.nativeOpenAsset(Native Method)
[ERROR] :  TiFileHelper: 	at android.content.res.AssetManager.open(AssetManager.java:824)
[ERROR] :  TiFileHelper: 	at android.content.res.AssetManager.open(AssetManager.java:801)
[ERROR] :  TiFileHelper: 	at org.appcelerator.titanium.util.TiFileHelper.openInputStream(TiFileHelper.java:204)
[ERROR] :  TiFileHelper: 	at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:294)
[ERROR] :  TiFileHelper: 	at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:243)
[ERROR] :  TiFileHelper: 	at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:238)
[ERROR] :  TiFileHelper: 	at ti.modules.titanium.ui.widget.tableview.TableViewHolder.bind(TableViewHolder.java:221)
[ERROR] :  TiFileHelper: 	at ti.modules.titanium.ui.widget.tableview.TableViewAdapter.onBindViewHolder(TableViewAdapter.java:115)
[ERROR] :  TiFileHelper: 	at ti.modules.titanium.ui.widget.tableview.TableViewAdapter.onBindViewHolder(TableViewAdapter.java:26)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
[ERROR] :  TiFileHelper: 	at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:689)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:955)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:955)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
[ERROR] :  TiFileHelper: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at androidx.appcompat.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:530)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
[ERROR] :  TiFileHelper: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
[ERROR] :  TiFileHelper: 	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
[ERROR] :  TiFileHelper: 	at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
[ERROR] :  TiFileHelper: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
[ERROR] :  TiFileHelper: 	at com.android.internal.policy.DecorView.onLayout(DecorView.java:779)
[ERROR] :  TiFileHelper: 	at android.view.View.layout(View.java:21927)
[ERROR] :  TiFileHelper: 	at android.view.ViewGroup.layout(ViewGroup.java:6260)
[ERROR] :  TiFileHelper: 	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3080)
[ERROR] :  TiFileHelper: 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2590)
[ERROR] :  TiFileHelper: 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
[ERROR] :  TiFileHelper: 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7598)
[ERROR] :  TiFileHelper: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
[ERROR] :  TiFileHelper: 	at android.view.Choreographer.doCallbacks(Choreographer.java:790)
[ERROR] :  TiFileHelper: 	at android.view.Choreographer.doFrame(Choreographer.java:725)
[ERROR] :  TiFileHelper: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
[ERROR] :  TiFileHelper: 	at android.os.Handler.handleCallback(Handler.java:883)
[ERROR] :  TiFileHelper: 	at android.os.Handler.dispatchMessage(Handler.java:100)
[ERROR] :  TiFileHelper: 	at android.os.Looper.loop(Looper.java:214)
[ERROR] :  TiFileHelper: 	at android.app.ActivityThread.main(ActivityThread.java:7356)
[ERROR] :  TiFileHelper: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiFileHelper: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
[ERROR] :  TiFileHelper: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Expected result:

1. No exception is thrown & images are displayed.

Comments

  1. Gary Mathews 2021-03-12

    master: https://github.com/appcelerator/titanium_mobile/pull/12558
  2. Lokesh Choudhary 2021-03-15

    FR Passed.
  3. Christopher Williams 2021-03-16

    merged to master; 10_0_X for 10.0.0 target; and 9_3_X branch.

JSON Source