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
[TIMOB-18040] - Android: expose gravity constants and add documentation #6435
Conversation
manumaticx
commented
Dec 5, 2014
- exposed gravity constants (TIMOB-18040)
- documented gravity (TIDOC-1988)
Hi @manumaticx, can you update this branch to work with the latest master? Would be great to have it in for 6.0.0! /cc @ashcoding |
# Conflicts: # android/modules/ui/src/java/ti/modules/titanium/ui/android/AndroidModule.java
@hansemannn All's well. |
Great! I also forgot to say, that you might change the docs version from "3.6.0" to "6.0.0" as part of the upcoming release. |
@hansemannn sry, I missed that. Updated as well |
Code review looks good. Will have a look at functionally testing this soon. |
summary: Raw bit controlling whether the right/bottom edge is clipped to its container, based on the gravity direction being applied. | ||
type: Number | ||
permission: read-only | ||
since: "6.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "since" is for the Ti-version, not the Android version. Can you correct all constants based on your current knowledge? You could make a "description" param that says something like "Only available on Android 6 and later". If some are available earlier / later, go ahead adjust it.
@manumaticx Left some additional comments. Can you attach a simple test case that can be thrown in an app.js? |
Okay, PR updated. Here is code for testing this: function gravityTest(){
var gravityConstants = [
"GRAVITY_AXIS_CLIP",
"GRAVITY_AXIS_PULL_AFTER",
"GRAVITY_AXIS_PULL_BEFORE",
"GRAVITY_AXIS_SPECIFIED",
"GRAVITY_AXIS_X_SHIFT",
"GRAVITY_AXIS_Y_SHIFT",
"GRAVITY_BOTTOM",
"GRAVITY_CENTER",
"GRAVITY_CENTER_HORIZONTAL",
"GRAVITY_CENTER_VERTICAL",
"GRAVITY_CLIP_HORIZONTAL",
"GRAVITY_CLIP_VERTICAL",
"GRAVITY_DISPLAY_CLIP_HORIZONTAL",
"GRAVITY_DISPLAY_CLIP_VERTICAL",
"GRAVITY_END",
"GRAVITY_FILL",
"GRAVITY_FILL_HORIZONTAL",
"GRAVITY_FILL_VERTICAL",
"GRAVITY_HORIZONTAL_GRAVITY_MASK",
"GRAVITY_LEFT",
"GRAVITY_NO_GRAVITY",
"GRAVITY_RELATIVE_HORIZONTAL_GRAVITY_MASK",
"GRAVITY_RELATIVE_LAYOUT_DIRECTION",
"GRAVITY_RIGHT",
"GRAVITY_START",
"GRAVITY_TOP",
"GRAVITY_VERTICAL_GRAVITY_MASK"
];
gravityConstants.forEach(function(gravity){
Ti.UI.createNotification({
message: gravity,
duration: Ti.UI.NOTIFICATION_DURATION_SHORT,
gravity: Ti.UI.Android[gravity]
}).show();
});
} |
Thanks, will test today! One thing I forgot: Can you add |
@hansemannn is this necessary? |
@manumaticx: Not necessary, just nice to have for advanced API-clarification. It's fine to skip it for now and we'll add in a future docs updates. The reason is, that the constants are clearly Android, but the "gravity" property is part of the |
Ah, the gravity proprerty itself. That's right, let me add this quickly. I forgot that (back when I submitted this PR |
I guess I have to squash these commits now!? 😊 |
You can create an additional commit to fix the line-breaks, thats fine. EDIT: Wrong PR, but yeah you can leave it like it is. Will merge as soon as travis finishes. |
summary: Determines the location at which the notification should appear on the screen. | ||
type: Number | ||
constants: Titanium.UI.Android.GRAVITY_* | ||
platforms: [android] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @manumaticx, forgot to finish the review here. Please add the since: "5.4.0"
here as well and we can merge today. Thank you! 🚀
Approved! |