-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Parity for Ti.UI.ListViewScrollPosition.* / Ti.UI.TableViewScro…
…llPosition.* on iOS/Android (#13251) * feat(android): scrollToItem position top move constant clean up * feat(ios): add parity for „Ti.UI.ListViewScrollPosition.*“ constants Co-authored-by: Hans Knöchel <hansemannn@users.noreply.github.com>
- Loading branch information
1 parent
8dac17b
commit 8cea843
Showing
11 changed files
with
203 additions
and
21 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
android/modules/ui/src/java/ti/modules/titanium/ui/ListViewScrollPositionModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2020 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
package ti.modules.titanium.ui; | ||
|
||
import org.appcelerator.kroll.KrollModule; | ||
import org.appcelerator.kroll.annotations.Kroll; | ||
|
||
import ti.modules.titanium.ui.UIModule; | ||
|
||
@Kroll.module(parentModule = UIModule.class) | ||
public class ListViewScrollPositionModule extends KrollModule | ||
{ | ||
@Kroll.constant | ||
public static final int TOP = 1; | ||
@Kroll.constant | ||
public static final int BOTTOM = 2; | ||
@Kroll.constant | ||
public static final int MIDDLE = 3; | ||
@Kroll.constant | ||
public static final int NONE = 0; | ||
|
||
@Override | ||
public String getApiName() | ||
{ | ||
return "Ti.UI.ListViewScrollPosition"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
name: Titanium.UI.ListViewScrollPosition | ||
summary: | | ||
A set of constants for the position value that can be used for the `position` property of | ||
<ListViewAnimationProperties> when invoking the ListView's `scrollToItem`, `appendSection`, | ||
`deleteSectionAt`, `insertSectionAt` and `replaceSectionAt` methods. | ||
extends: Titanium.Proxy | ||
platforms: [android, iphone, ipad, macos] | ||
since: {android: "10.2.0", iphone: "5.4.0", ipad: "5.4.0", macos: "9.2.0"} | ||
excludes: | ||
properties: [bubbleParent] | ||
methods: [addEventListener, applyProperties, fireEvent, removeEventListener] | ||
createable: false | ||
properties: | ||
- name: BOTTOM | ||
summary: The list view scrolls the row of interest to the bottom of the visible list view. | ||
type: Number | ||
permission: read-only | ||
|
||
- name: MIDDLE | ||
summary: The list view scrolls the row of interest to the middle of the list table view. | ||
type: Number | ||
permission: read-only | ||
|
||
- name: NONE | ||
summary: | | ||
The table view scrolls the row of interest to be fully visible with a minimal movement. | ||
If the row is already fully visible, no scrolling occurs. For example, if the row is above the | ||
visible area, the behavior is identical to that specified by `TOP`. This is the default. | ||
type: Number | ||
permission: read-only | ||
|
||
- name: TOP | ||
summary: The list view scrolls the row of interest to the top of the visible list view. | ||
type: Number | ||
permission: read-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
#if defined(USE_TI_UITABLEVIEWSCROLLPOSITION) || defined(USE_TI_UILISTVIEWSCROLLPOSITION) | ||
|
||
#import <TitaniumKit/TiProxy.h> | ||
|
||
@interface TiUITableViewScrollPositionProxy : TiProxy { | ||
|
||
@private | ||
} | ||
|
||
@property (nonatomic, readonly) NSNumber *NONE; | ||
@property (nonatomic, readonly) NSNumber *TOP; | ||
@property (nonatomic, readonly) NSNumber *MIDDLE; | ||
@property (nonatomic, readonly) NSNumber *BOTTOM; | ||
|
||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
#if defined(USE_TI_UITABLEVIEWSCROLLPOSITION) || defined(USE_TI_UILISTVIEWSCROLLPOSITION) | ||
|
||
#import "TiUITableViewScrollPositionProxy.h" | ||
#import <TitaniumKit/TiBase.h> | ||
|
||
@implementation TiUITableViewScrollPositionProxy | ||
|
||
- (NSString *)apiName | ||
{ | ||
return @"Ti.UI.TableViewScrollPosition"; | ||
} | ||
|
||
MAKE_SYSTEM_PROP(NONE, UITableViewScrollPositionNone); | ||
MAKE_SYSTEM_PROP(TOP, UITableViewScrollPositionTop); | ||
MAKE_SYSTEM_PROP(MIDDLE, UITableViewScrollPositionMiddle); | ||
MAKE_SYSTEM_PROP(BOTTOM, UITableViewScrollPositionBottom); | ||
|
||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.