This repository has been archived by the owner on Jun 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Android] Support rotateX and rotateY, optimize animation as well.
* [Use LayoutParamsProperty instead of DimensionUpdateListener to achieve height/width animation.](http://dotwe.org/vue/c7a70462a136b61e11ab37f384862003) * [Support rotateX and rotateY.](http://dotwe.org/vue/e712dd2ad4df470bab940d8e0e6d052d). * Stop remove transform and transform-origin from WXStyle in UpdateStyleAction. * Stop execute animation callback if corresponding WXInstance is destroyed when animation finished.
- Loading branch information
Showing
8 changed files
with
213 additions
and
138 deletions.
There are no files selected for viewing
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
88 changes: 0 additions & 88 deletions
88
android/sdk/src/main/java/com/taobao/weex/ui/animation/DimensionUpdateListener.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
android/sdk/src/main/java/com/taobao/weex/ui/animation/HeightProperty.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,35 @@ | ||
/** | ||
* 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. | ||
*/ | ||
package com.taobao.weex.ui.animation; | ||
|
||
|
||
import android.view.ViewGroup.LayoutParams; | ||
|
||
public class HeightProperty extends LayoutParamsProperty { | ||
|
||
@Override | ||
protected Integer getProperty(LayoutParams layoutParams) { | ||
return layoutParams.height; | ||
} | ||
|
||
@Override | ||
protected void setProperty(LayoutParams layoutParams, Integer expected) { | ||
layoutParams.height = expected; | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
android/sdk/src/main/java/com/taobao/weex/ui/animation/LayoutParamsProperty.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,64 @@ | ||
/** | ||
* 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. | ||
*/ | ||
package com.taobao.weex.ui.animation; | ||
|
||
|
||
import android.util.Property; | ||
import android.view.View; | ||
import android.view.ViewGroup.LayoutParams; | ||
import com.taobao.weex.ui.component.WXComponent; | ||
import com.taobao.weex.ui.view.IRenderResult; | ||
|
||
/** | ||
* android.util.IntProperty<T> cannot be applied here, as it is only added at API 24. | ||
*/ | ||
abstract class LayoutParamsProperty extends Property<View, Integer> { | ||
|
||
LayoutParamsProperty() { | ||
super(Integer.class, "layoutParams"); | ||
} | ||
|
||
@Override | ||
public Integer get(View object) { | ||
LayoutParams layoutParams; | ||
if (object != null && (layoutParams = object.getLayoutParams()) != null) { | ||
return getProperty(layoutParams); | ||
} | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void set(View object, Integer value) { | ||
LayoutParams layoutParams; | ||
if (object != null && (layoutParams = object.getLayoutParams()) != null) { | ||
setProperty(layoutParams, value); | ||
if (object instanceof IRenderResult) { | ||
WXComponent component = ((IRenderResult) object).getComponent(); | ||
if (component != null) { | ||
component.notifyNativeSizeChanged(layoutParams.width, layoutParams.height); | ||
} | ||
} | ||
object.requestLayout(); | ||
} | ||
} | ||
|
||
protected abstract Integer getProperty(LayoutParams layoutParams); | ||
|
||
protected abstract void setProperty(LayoutParams layoutParams, Integer expected); | ||
} |
Oops, something went wrong.