Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25600] Android : SDK 7.0.0.GA not applying custom theme attributes properly on TableViewRow, but SDK 5.5.1 or below works properly

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-03-01T00:24:58.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.1.0
ComponentsAndroid
Labelsn/a
ReporterPrashant Saini
AssigneeYordan Banev
Created2017-12-11T15:05:31.000+0000
Updated2018-03-06T23:16:54.000+0000

Description

When using custom theme to change the *touch-ripple* colour on *tableview rows*, *touch-ripple* colour is not applied using *SDK 7.0.0.GA*, however it works as expected while using *5.5.1.GA* or below. It makes impossible to change the ripple-effect colour using *7.0.0.GA* & even it's behaving odd if I use *touchFeedbackColor* on tableview rows. Here's a sample code to test this:
var win = Ti.UI.createWindow({
	backgroundColor : 'black',
	theme : 'GalleryTheme'
});

var table = Ti.UI.createTableView({
	width : Ti.UI.FILL,
	height : Ti.UI.FILL
});

table.appendRow(createRow("Camera Test"));
table.appendRow(createRow("Multi Image Picker"));
table.appendRow(createRow("Image Compression Test"));
table.appendRow(createRow("Get Current Location"));

win.add(table);

win.open();

function createRow(_text) {
	var label = Ti.UI.createLabel({
		color: 'white',
		text: _text,
		left : 20,
		width: Ti.UI.SIZE, height: Ti.UI.SIZE
	});

	var row = Ti.UI.createTableViewRow({
		height: 50,
	        width: Ti.UI.FILL
	});

	row.add(label);
	return row;
}

// theme used in this sample to change ripple effect
<style name="GalleryTheme" parent="Theme.AppCompat.Light">
        <item name="colorPrimary">#ffbc77</item>
        <item name="colorPrimaryDark">#cf9458</item>
        <item name="colorAccent">#4064ff</item>
	<item name="colorControlHighlight">#2eba4d</item>
</style>
As expected, *colorControlHighlight* colour should be used to show ripple-colour effect. Also find attached screenshot for both SDKs.

Attachments

FileDateSize
sdk6_3_0.png2017-12-11T15:03:50.000+000076491
sdk7_0_0.png2017-12-11T15:03:50.000+000071646

Comments

  1. Sharif AbuDarda 2017-12-11

    Hello, I tried to test the issue. But not quiet able to reproduce it. I hve created a sample app with custom theme.xml in platform/android/res/values/ and I used your theme code section above. Now I define the theme in tiapp.xml. also, use theme property in the window as your code. I see the orange action bar but The row selection color is not changing now even for 6.3.0.GA as you mentioned. So, there might be a problem. Can you compile a sample app for us and send it here. so we can testit. Are you testing on device?
  2. Prashant Saini 2017-12-12

    Hi Sharif, I just re-checked my SDK & it was 5.5.1 on which it's working fine. I had deleted 6.3.0 this Saturday when I installed 7.0.0. But I am sure that I was able to see that green ripple color earlier when I was using 6.3.0. Yes, I tested it on 4 different devices as I mentioned in Environments. Could you please recheck it with SDK 5.5.1 because I can clearly see green-ripple colour in 5.5.1 but not in 7.0.0?
  3. Prashant Saini 2017-12-20

    Hi Sharif, few more important things I found today about this bug are:

    Theme is not getting applied to very first window of the app, i.e., *index.xml*

    If we the same TableView in another window, theme works properly.

    Adding to above point, if we open another window right after index.xml window, it doesn't work.

    If we delay opening the another window with same TableView, theme works properly.

    In any case, theme is not applying only on TableView, however I can see it applied properly on Button.

    So from above points, it looks like that theme is somehow getting delayed in being applied to TableView only on first window.
  4. Yordan Banev 2018-01-08

    PR: https://github.com/appcelerator/titanium_mobile/pull/9701 7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9874
  5. Lokesh Choudhary 2018-02-23

    FR Passed for master & backport. Waiting for CR to merge.
  6. Lokesh Choudhary 2018-02-28

    Backport PR merged. Waiting for master merge to get enabled.
  7. Lokesh Choudhary 2018-03-01

    Master PR merged.
  8. Lokesh Choudhary 2018-03-06

    Verified the fix in SDK 7.2.0.v20180305152636 & 7.1.0.v20180306061214. Closing. Studio Ver: 5.0.0.201712081732 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.12 Appc CLI: 7.0.2 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.11.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 — Android 6.0.1 ⇨ google Nexus 6P — Android 8.0.0

JSON Source