-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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-25556] Android: Add gravity to drawerLockMode #9627
Conversation
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.
see below
@@ -16,6 +16,18 @@ since: "6.2.0" | |||
platforms: [android] | |||
|
|||
properties: | |||
- name: GRAVITY_LEFT |
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.
Also document GRAVITY_BOTH
?
layout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED); | ||
if (param instanceof HashMap) { | ||
HashMap<String, Object> drawerParams = (HashMap<String, Object>) param; | ||
if (TiConvert.toInt(drawerParams.get(TiC.PROPERTY_GRAVITY)) == 1) { |
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.
Use the constant GRAVITY_BOTH
instead of 1
NOTE: you could also use a KrollDict
and use getInt(TiC.PROPERTY_GRAVITY)
instead of needing to use TiConvert
Tests:
Generated by 🚫 dangerJS |
@m1ga Bootstrap for the unit-test: ti.ui.android.drawerlayout.addontest.js/*
* Appcelerator Titanium Mobile
* Copyright (c) 2017 by Axway, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/* eslint-env mocha */
/* global Titanium */
/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions');
describe.android('Titanium.UI.Android.DrawerLayout', function () {
// Add required tests here
}); |
Shall I keep the syntax like it is ( |
Tests:
|
I have problem testing the file locally. Is this enough:
|
Tests:
|
JIRA: https://jira.appcelerator.org/browse/TIMOB-25556
Allow to set gravity (left, right) to lock drawer views separately. The current implementation only locks both side at the same time.
Example