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

feat: add Ti.UI.OptionBar #12510

Merged
merged 3 commits into from Mar 9, 2021
Merged

Conversation

jquick-axway
Copy link
Contributor

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

Summary:

  • On iOS, this shows a segmented control.
  • On Android, this shows a material toggle button group.
    • The layout property can be set to "horiztonal" (the default) or "vertical".

Examples:
OptionBar-iOS OptionBar-Android-Horizontal OptionBar-Android-Vertical


Test:

  1. Create a Classic Titanium project. (Use the template that creates a TabGroup.)
  2. Use the OptionBarTest.js as your app.js from TIMOB-28317.
  3. Add the below element to the "tiapp.xml" file.
  4. Build and run on Android.
  5. Verify the app looks like the above screenshot.
  6. Tap on the 2nd button of each bar and verify the following gets logged.
    @@@ button click index: 1
  7. Repeat steps 5-6 on iOS.
  8. Uncomment the // layout: "vertical", lines in all 3 spots of the code.
  9. Repeat steps 5-6 on Android and verify it looks like the above vertical buttons.
<ti:app>
	<android xmlns:android="http://schemas.android.com/apk/res/android">
		<manifest>
			<application android:theme="@style/Theme.MaterialComponents.Light.DarkActionBar"/>
		</manifest>
	</android>
</ti:app>

Fixes TIMOB-28317
@jquick-axway jquick-axway added ios android feature docs parity 👯‍♀️ test PR that updates our test cases backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge labels Mar 2, 2021
@jquick-axway jquick-axway added this to the 10.0.0 milestone Mar 2, 2021
@build build requested review from a team March 2, 2021 06:50
@build
Copy link
Contributor

build commented Mar 2, 2021

Fails
🚫 Tests have failed, see below for more information.
🚫

Test suite crashed on iOS simulator. Please see the crash log for more details.

Warnings
⚠️ This PR has milestone set to 10.0.0, but the version defined in package.json is 10.1.0 Please either: - Update the milestone on the PR - Update the version in package.json - Hold the PR to be merged later after a release and version bump on this branch
⚠️

iphone/cli/commands/_build.js#L6230 - iphone/cli/commands/build.js line 6230 – 'reject' is defined but never used. Allowed unused args must match /^.+/u. (no-unused-vars)

Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 2 tests have failed There are 2 tests failing and 683 skipped out of 12513 total tests.

Tests:

ClassnameNameTimeError
android.emulator.Titanium.Geolocation.methods#reverseGeocoder() works via Promise return value (5.0.2)2.006
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)
android.emulator.Titanium.UI.TabGroup.closed/focused.focused (5.0.2)11.042
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)

Generated by 🚫 dangerJS against 59da973

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

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

CR: PASS

NOTE: Maybe we could add snapshot tests for this?

@jquick-axway
Copy link
Contributor Author

Maybe we could add snapshot tests for this?

I'm worried that the layout will be slightly different based on system font and DPI.
However, I am planning on updating "kitchensink-v2" to show option bar on both Android and iOS.

@lokeshchdhry
Copy link
Contributor

FR Passed.
Looks good on both Android & IOS.

@sgtcoolguy sgtcoolguy merged commit 17e7896 into tidev:master Mar 9, 2021
@build
Copy link
Contributor

build commented Mar 9, 2021

The backport to 10_0_X failed:

The process 'git' failed with exit code 128

Check the run for full details
To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Check out the target branch
git checkout 10_0_X
# Make sure it's up to date
git pull
# Check out your branch
git checkout -b backport-12510-to-10_0_X
# Apply the commits from the PR
curl -s https://github.com/appcelerator/titanium_mobile/commit/9e9ab37a368848be475007b02f5fb6358b464d6e.patch | git am -3 --ignore-whitespace
# Push it to GitHub
git push --set-upstream origin backport-12510-to-10_0_X

Then, create a pull request where the base branch is 10_0_X and the compare/head branch is backport-12510-to-10_0_X.

sgtcoolguy pushed a commit that referenced this pull request Mar 9, 2021
@ewanharris ewanharris removed 10_0_X backport failed backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge labels Mar 16, 2021
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

6 participants