Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Merge rc20 #1880

Merged
merged 24 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3436364
[build] Updated the Apache release scripts. (#1741)
jondong Nov 13, 2018
3b67c87
[Release] Roll version number to 0.20.0
jondong Nov 13, 2018
7139ca2
[Release] Added the missing Apache license (#1753)
jondong Nov 14, 2018
d8fb665
Update LICENSE (#1765)
miomin Nov 15, 2018
03e203d
[iOS] fix scrollEnd can not get offset (#1729)
doumafang Nov 9, 2018
fef4326
[iOS] Remove specific animation by key instead of removing all. If we…
wqyfavor Nov 10, 2018
fabc9ae
[iOS] Fix deadlock if WXSDKInstance is release in thread safe diction…
wqyfavor Nov 14, 2018
6ef7d46
[iOS] Trigger vsync on iOS in every batch. (#1759)
wqyfavor Nov 14, 2018
94049e9
[iOS] Add completion callback for registerService (#1776)
wqyfavor Nov 19, 2018
b56ce0a
[iOS] Forbid adjustment of safeArea by system for cycle slider compon…
wqyfavor Nov 20, 2018
aa88ab0
[iOS] Add methods to retrieve css style values from weexcore c++ object.
Nov 21, 2018
f060ad8
Merge pull request #1786 from wqyfavor/fix-rc-0.20
jondong Nov 21, 2018
b79bb7c
Revert "Fix rc 0.20"
jondong Nov 21, 2018
0b6cfec
Merge pull request #1787 from apache/revert-1786-fix-rc-0.20
jondong Nov 21, 2018
c4847bb
[iOS] fix scrollEnd can not get offset (#1729)
doumafang Nov 9, 2018
ca545a5
[iOS] Remove specific animation by key instead of removing all. If we…
wqyfavor Nov 10, 2018
ac18368
[iOS] Fix deadlock if WXSDKInstance is release in thread safe diction…
wqyfavor Nov 14, 2018
6b9cbe0
[iOS] Trigger vsync on iOS in every batch. (#1759)
wqyfavor Nov 14, 2018
fd4b750
[iOS] Add completion callback for registerService (#1776)
wqyfavor Nov 19, 2018
8cf3513
[iOS] Forbid adjustment of safeArea by system for cycle slider compon…
wqyfavor Nov 20, 2018
942f0c5
[iOS] Add methods to retrieve css style values from weexcore c++ object.
Nov 21, 2018
5702b65
[Android] Fix mistype.
Nov 21, 2018
97eda0b
Merge pull request #1789 from wqyfavor/fix-rc-20
jondong Nov 22, 2018
cb9f751
Merge remote-tracking branch 'apache/rc-0.20.0'
Dec 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ This product bundles chromium v66.0.3344.2, which is available under a "BSD-styl
weex_core/Source/android/jniprebuild/jniheader/NativeRenderObjectUtils_jni.h
weex_core/Source/android/jniprebuild/jniheader/SystemMessageHandler_jni.h
weex_core/Source/android/jniprebuild/jniheader/WXBridge_jni.h
weex_core/Source/android/jniprebuild/jniheader/WXJsFunctions_jni.h
weex_core/Source/android/jniprebuild/jniheader/WXDebugJsBridge_jni.h
weex_core/Source/android/jniprebuild/jniheader/WXParams_jni.h
weex_core/Source/android/jniprebuild/jni_generator.py

This product bundles Android Open Source Project vandroid-4.2.2_r1, which is available under a "BSD" license. For details, see https://android.googlesource.com/platform/bionic/+/android-4.2.2_r1/libc/README and following files:
Expand Down
2 changes: 1 addition & 1 deletion android/playground/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
minSdkVersion project.minSdkVersion
targetSdkVersion project.targetSdkVersion
versionCode 20
versionName "0.19.1"
versionName "0.20.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
ndk{
Expand Down
21 changes: 20 additions & 1 deletion android/sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
Expand Down Expand Up @@ -36,7 +55,7 @@ checkstyle {
}


version = "0.19.0.4"
version = "0.20.0"

android {

Expand Down
19 changes: 19 additions & 0 deletions android/sdk/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.


# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
Expand Down
21 changes: 20 additions & 1 deletion android/sdk/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.


# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/ouy/Library/AndroidStudio/sdk/tools/proguard/proguard-android.txt
Expand All @@ -19,4 +38,4 @@
-keep class com.taobao.weex.layout.** { *; }
-keep class com.taobao.weex.WXSDKEngine { *; }
-keep class com.taobao.weex.base.SystemMessageHandler { *; }
-dontwarn com.taobao.weex.bridge.**
-dontwarn com.taobao.weex.bridge.**
21 changes: 20 additions & 1 deletion android/sdk/publish.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
#!/usr/bin/env bash
./gradlew clean assemble publish

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

./gradlew clean assemble publish
79 changes: 78 additions & 1 deletion ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,35 @@
#ifdef __cplusplus
#include "layout.h"

typedef WeexCore::WXCoreFlexDirection WXCoreFlexDirection;
typedef WeexCore::WXCoreFlexWrap WXCoreFlexWrap;
typedef WeexCore::WXCoreJustifyContent WXCoreJustifyContent;
typedef WeexCore::WXCoreAlignItems WXCoreAlignItems;
typedef WeexCore::WXCoreAlignSelf WXCoreAlignSelf;
typedef WeexCore::WXCorePositionType WXCorePositionType;
typedef WeexCore::WXCoreDirection WXCoreDirection;

extern "C" {
#endif
bool flexIsUndefined(float value);
#ifdef __cplusplus
}
#endif

#ifndef __cplusplus
// Ensure that .m files can use css style enum definitions.
#include "flex_enum.h"

typedef enum WXCoreFlexDirection WXCoreFlexDirection;
typedef enum WXCoreFlexWrap WXCoreFlexWrap;
typedef enum WXCoreJustifyContent WXCoreJustifyContent;
typedef enum WXCoreAlignItems WXCoreAlignItems;
typedef enum WXCoreAlignSelf WXCoreAlignSelf;
typedef enum WXCorePositionType WXCorePositionType;
typedef enum WXCoreDirection WXCoreDirection;

#endif

@interface WXComponent ()
{
@package
Expand All @@ -53,9 +75,64 @@ extern "C" {
* @warning Subclasses must not override this.
*/
#ifdef __cplusplus
@property(nonatomic, readonly, assign) WeexCore::WXCoreLayoutNode *flexCssNode;
@property (nonatomic, readonly, assign) WeexCore::WXCoreLayoutNode *flexCssNode;
#endif

/**
* @abstract Get css style value for key. The key should be of CSS standard form.
* This method is for convenience use in C/ObjC environment. And if you want to
* retrieve all style values or in C++, you could use flexCssNode directly.
*
* Thread usage:
* This method should be invoked in component thread by WXPerformBlockOnComponentThread.
* Note that all initWithRef methods of WXComponent and its subclasses are performed in
* component thread by default. Therefore you can call this method directly in initWithRef.
*
* Supported keys:
* width, height, min-width, min-height, max-width, max-height,
* margin-(left/right/top/bottom)
* padding-(left/right/top/bottom)
* border-(left/right/top/bottom)-width
* left, right, top, bottom
* flex-grow
*/
- (float)getCssStyleValueForKey:(NSString *)key;

/**
* @abstract Get css style flex-direction. Thread usage the same as getCssStyleValueForKey.
*/
- (WXCoreFlexDirection)getCssStyleFlexDirection;

/**
* @abstract Get css style flex-wrap. Thread usage the same as getCssStyleValueForKey.
*/
- (WXCoreFlexWrap)getCssStyleFlexWrap;

/**
* @abstract Get css style justify-content. Thread usage the same as getCssStyleValueForKey.
*/
- (WXCoreJustifyContent)getCssStyleJustifyContent;

/**
* @abstract Get css style align-items. Thread usage the same as getCssStyleValueForKey.
*/
- (WXCoreAlignItems)getCssStyleAlignItems;

/**
* @abstract Get css style align-self. Thread usage the same as getCssStyleValueForKey.
*/
- (WXCoreAlignSelf)getCssStyleAlignSelf;

/**
* @abstract Get css style position. Thread usage the same as getCssStyleValueForKey.
*/
- (WXCorePositionType)getCssStylePositionType;

/**
* @abstract Get css layout direction. Thread usage the same as getCssStyleValueForKey.
*/
- (WXCoreDirection)getCssDirection;

/**
* @abstract Convert layout dimension value like 'left', 'width' to style value in js considering viewport and scale.
*/
Expand Down
86 changes: 86 additions & 0 deletions ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,92 @@ - (CGFloat)judgePropValuePropValue:(id)propValue defaultValue:(CGFloat)defaultVa
return defaultValue;
}

- (float)getCssStyleValueForKey:(NSString *)key
{
/*
* width, height, min-width, min-height, max-width, max-height,
* margin-(left/right/top/bottom)
* padding-(left/right/top/bottom)
* border-(left/right/top/bottom)-width
* left, right, top, bottom
* flex-grow
*/
WXAssert(_flexCssNode != nullptr, @"Css node is null.");
if (_flexCssNode == nullptr) {
return NAN;
}

std::string ckey = [key UTF8String];
if (ckey == "width") return _flexCssNode->getStyleWidth();
if (ckey == "height") return _flexCssNode->getStyleHeight();
if (ckey == "min-width") return _flexCssNode->getMinWidth();
if (ckey == "min-height") return _flexCssNode->getMinHeight();
if (ckey == "max-width") return _flexCssNode->getMaxWidth();
if (ckey == "max-height") return _flexCssNode->getMaxHeight();
if (ckey == "margin-left") return _flexCssNode->getMarginLeft();
if (ckey == "margin-right") return _flexCssNode->getMarginRight();
if (ckey == "margin-top") return _flexCssNode->getMarginTop();
if (ckey == "margin-bottom") return _flexCssNode->getMarginBottom();
if (ckey == "padding-left") return _flexCssNode->getPaddingLeft();
if (ckey == "padding-right") return _flexCssNode->getPaddingRight();
if (ckey == "padding-top") return _flexCssNode->getPaddingTop();
if (ckey == "padding-bottom") return _flexCssNode->getPaddingBottom();
if (ckey == "border-left-width") return _flexCssNode->getBorderWidthLeft();
if (ckey == "border-right-width") return _flexCssNode->getBorderWidthRight();
if (ckey == "border-top-width") return _flexCssNode->getBorderWidthTop();
if (ckey == "border-bottom-width") return _flexCssNode->getBorderWidthBottom();
if (ckey == "left") return _flexCssNode->getStylePositionLeft();
if (ckey == "right") return _flexCssNode->getStylePositionRight();
if (ckey == "top") return _flexCssNode->getStylePositionTop();
if (ckey == "bottom") return _flexCssNode->getStylePositionBottom();
if (ckey == "flex-grow") return _flexCssNode->getFlex();

WXAssert(NO, @"Invalid css style key %@", key);
return NAN;
}

- (WXCoreFlexDirection)getCssStyleFlexDirection
{
WXAssert(_flexCssNode != nullptr, @"Css node is null.");
return _flexCssNode ? _flexCssNode->getFlexDirection() : kFlexDirectionColumn;
}

- (WXCoreFlexWrap)getCssStyleFlexWrap
{
WXAssert(_flexCssNode != nullptr, @"Css node is null.");
return _flexCssNode ? _flexCssNode->getFlexWrap() : kNoWrap;
}

- (WXCoreJustifyContent)getCssStyleJustifyContent
{
WXAssert(_flexCssNode != nullptr, @"Css node is null.");
return _flexCssNode ? _flexCssNode->getJustifyContent() : kJustifyFlexStart;
}

- (WXCoreAlignItems)getCssStyleAlignItems
{
WXAssert(_flexCssNode != nullptr, @"Css node is null.");
return _flexCssNode ? _flexCssNode->getAlignItems() : kAlignItemsStretch;
}

- (WXCoreAlignSelf)getCssStyleAlignSelf
{
WXAssert(_flexCssNode != nullptr, @"Css node is null.");
return _flexCssNode ? _flexCssNode->getAlignSelf() : kAlignSelfAuto;
}

- (WXCorePositionType)getCssStylePositionType
{
WXAssert(_flexCssNode != nullptr, @"Css node is null.");
return _flexCssNode ? _flexCssNode->getStylePositionType() : kRelative;
}

- (WXCoreDirection)getCssDirection
{
WXAssert(_flexCssNode != nullptr, @"Css node is null.");
return _flexCssNode ? _flexCssNode->getDirection() : WEEXCORE_CSS_DEFAULT_DIRECTION;
}

- (NSString*)convertLayoutValueToStyleValue:(NSString*)valueName
{
if (_flexCssNode == nullptr) {
Expand Down
10 changes: 5 additions & 5 deletions ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -20,7 +20,7 @@
#ifndef __WX_DEFINE_H__
#define __WX_DEFINE_H__

#define WX_SDK_VERSION @"0.19.0"
#define WX_SDK_VERSION @"0.20.0"

#if defined(__cplusplus)
#define WX_EXTERN extern "C" __attribute__((visibility("default")))
Expand Down Expand Up @@ -125,8 +125,8 @@ parts = [parts subarrayWithRange:(NSRange){0, parts.count - 1}];\
#endif

/**
* @abstract Compared with system version of current device
*
* @abstract Compared with system version of current device
*
* @return YES if greater than or equal to the system verison, otherwise, NO.
*
*/
Expand Down
4 changes: 2 additions & 2 deletions ios/sdk/WeexSDK/Sources/Utility/WXVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#import "WXVersion.h"
#import "WXDefine.h"

static const char* WeexSDKBuildTime = "2018-11-06 06:35:19 UTC";
static const unsigned long WeexSDKBuildTimestamp = 1541486119;
static const char* WeexSDKBuildTime = "2018-12-10 09:36:44 UTC";
static const unsigned long WeexSDKBuildTimestamp = 1544434604;

NSString* GetWeexSDKVersion(void)
{
Expand Down
Loading