
回复
1.在项目根目录下的build.gradle文件中,
allprojects {
repositories {
maven {
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
}
}
2.在entry模块的build.gradle文件中,
dependencies {
implementation('com.gitee.chinasoft_ohos:MaterialShadows:1.0.0')
......
}
在sdk6,DevEco Studio 2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
<com.sdsmdg.harjot.materialshadows.MaterialShadowViewWrapper
ohos:id="$+id:shadow_wrapper"
ohos:height="match_content"
ohos:width="match_parent"
ohos:background_element="#FFFFFF"
ohos:padding="20vp"
app:animateShadow="true"
app:animationDuration="300"
app:calculateAsync="true"
app:shadowOffsetX="10"
app:shadowOffsetY="10"
app:showWhenAllReady="true"
>
<Image
ohos:id="$+id:image"
ohos:height="80vp"
ohos:width="80vp"
ohos:align_parent_left="true"
ohos:image_src="$media:google"
ohos:padding="10vp"
ohos:scale_mode="clip_center"/>
</com.sdsmdg.harjot.materialshadows.MaterialShadowViewWrapper>
XML attribute | Java set methods | Description | Default Value |
---|---|---|---|
shadowOffsetX | setOffsetX(...) | Set the X-offset of the shadow | 0.0f |
shadowOffsetY | setOffsetX(...) | Set the Y-offset of the shadow | 0.0f |
calculateAsync | setShouldCalculateAsync(...) | Set the flag for async shadow calculations. | true |
showWhenAllReady | setShowShadowsWhenAllReady(...) | Set the flag for showing all shadows after all calculations are over | true |
animateShadow | setShouldAnimateShadow(...) | Set the flag for shadow animation | true |
animationDuration | setAnimationDuration(...) | Set the value of shadow animation duration. | 300ms |
CodeCheck代码测试无异常
CloudTest代码测试无异常
病毒安全检测通过
当前版本demo功能与原组件基本无差异
MaterialShadows is licensed under `MIT license`. View license.