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

Android: Fixed picker spinner to size/position columns correctly on Android 5.0 and higher #9674

Merged
merged 7 commits into from May 11, 2018

Conversation

maggieaxway
Copy link
Contributor

@maggieaxway maggieaxway commented Dec 11, 2017

JIRA:
https://jira.appcelerator.org/browse/TIMOB-19822

Test:

  1. Build and run the SpinnerTest.js file attached to TIMOB-19822 on Android 5.0 or higher.
  2. Verify that all spinner columns have the same height.
  3. Verify that the item selected in each spinner column is correctly centered vertically.
  4. See SpinnerTest-good.png attached to TIMOB-19822 for an idea of what spinners should look like.
  5. Re-run the test on an Android 4.x device. (This is to verify that there are no regressions.)

@build
Copy link
Contributor

build commented Dec 11, 2017

Messages
📖

🎉 Another contribution from our awesome community member, maggieaxway! Thanks again for helping us make Titanium SDK better. 👍

📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@maggieaxway
Copy link
Contributor Author

Leading to different result on API 25 & 26.

if (Build.VERSION.SDK_INT < 21) {
translateY = -getItemOffset();
} else {
translateY = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maggie, this UI widget still has offset issues on API Levels > 21, right? I think we should by translating by the value returned by getTextSize() for the higher API Levels. This is because we offset it by text size here.

That is, it should look like this...

if (Build.VERSION.SDK_INT < 21) {
	translateY = -getItemOffset();
} else {
	translateY = getTextSize() / 2.0f;
}

Can you give the above a go please?

@maggieaxway
Copy link
Contributor Author

19822.zip

@jquick-axway This is my testing result comparing the translateY. Not sure if it is showing different result on your devices?

@jquick-axway jquick-axway changed the title Update WheelView.java Android: Fixed picker spinner to size/position columns correctly on Android 5.0 and higher May 9, 2018
@jquick-axway
Copy link
Contributor

Updated PR. Spinner sizing/positioning issues on Android 5.0 and higher is now fixed.

@jquick-axway jquick-axway added this to the 7.2.0 milestone May 9, 2018
@lokeshchdhry
Copy link
Contributor

FR Passed.

Picker spinner columns size/position as expected.

Studio Ver: 5.1.0.201804230827
SDK Ver: 7.2.0 local build
OS Ver: 10.13.4
Xcode Ver: Xcode 9.3
Appc NPM: 4.2.13
Appc CLI: 7.0.3
Daemon Ver: 1.1.1
Ti CLI Ver: 5.1.0
Alloy Ver: 1.12.0
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 10
Devices: ⇨ google Nexus 6P --- Android 8.1.0
⇨ google Nexus 5 --- Android 6.0.1
Emulator: ⇨ Android 4.1.2

@build build added the android label May 11, 2018
@lokeshchdhry lokeshchdhry merged commit 8642c55 into tidev:master May 11, 2018
@sgtcoolguy sgtcoolguy modified the milestones: 7.2.0, 7.3.0 May 16, 2018
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

5 participants