我目前正在使用此代码,但背景没有改变。它仍然显示强调色作为背景。
<com.google.android.material.button.MaterialButton
android:id="@+id/materialButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello"
app:cornerRadius="32dp"
android:background="@drawable/gradiant_blue"/>
Run Code Online (Sandbox Code Playgroud)
gradiant_blue.xml
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="-45"
android:startColor="#2979FF"
android:endColor="#7C4DFF"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
我目前正在使用
材料组件版本:1.0.0-rc02
android android-button android-drawable material-components-android
这是当前的示例结构
Posts(Collection)
- post1Id : {
viewCount : 100,
likes : 45,
points : 190,
title : "Title",
postType : image/video
url : FileUrl,
createdOn : Timestamp,
createdBy : user20Id,
userName : name,
profilePic: url
}
Users(Collection)
- user1Id(Document):{
postsCount : 10,
userName : name,
profilePic : url
}
viewed(Collection)
- post1Id(Document):{
viewedTime : ""
}
- user2Id(Document)
Run Code Online (Sandbox Code Playgroud)
最终目标是
可能的最佳解决方案是什么(例如改变结构、云功能、客户端多次查询)?