Closed 15189611 closed 3 years ago
@15189611 thanks, I appreciate your feedback.
If you use textView.loadSkeleton()
function, please make sure that you are setting android:text="@string/your_label"
in your xml. I'm working in a better solution for that.
Please let me know if the still issue persists.
if i use textView doesn't setting android:text="@string/your_label" ,the skeleton doesn't working
because android:text="" from Remote data!
The skeleton framework can be support?
Hi @15189611 👋,
I found some issues related with TextView's skeletons and added a new extension function for textviews. It is not necessary to set text in your xml. You just have to set length for skeleton to work well.
textView?.loadSkeleton(length = 20)
Please try out 0.8.5
version.
if is other view or viewGroup doesn't setting data maybe couldn't support ?
@15189611 There is no support for LinearLayouts and RelativeLayout. I'm working on that.
The others Views and ViewGroups should work well.
![Uploading image.png…]() i can't setting android:layout_height="120dp" , the ImageView doesn't working~
I need to use your framework now because all my elemental data comes from the remote
@15189611 I've tried to reproduce your problem but everything works fine.
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivMap"
android:layout_width="0dp"
android:layout_height="120dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/ShapeAppearance.RoundedCornerImageView"
tools:srcCompat="@drawable/map_one" />
clHeader?.loadSkeleton()
ivMap?.loadSkeleton()
Can you please provide more information about your problem?
i mean you don't setting android:layout_height="120dp"
like this <com.google.android.material.imageview.ShapeableImageView android:id="@+id/ivMap" android:layout_width="0dp" android:layout_height="0dp" android:scaleType="centerCrop" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:shapeAppearanceOverlay="@style/ShapeAppearance.RoundedCornerImageView" tools:srcCompat="@drawable/map_one" />
@15189611 In this case your ShapeableImageView is not visible because bottom constraint is missing.
You can actually set width and height to
0dp
and set either top and bottom or left and right constraints to "parent".
There are two options:
Add missing constraint:
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivMap"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="@id/guideline"
app:shapeAppearanceOverlay="@style/ShapeAppearance.RoundedCornerImageView"
tools:srcCompat="@drawable/map_one" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintGuide_percent="0.4"
android:orientation="horizontal"/>
Set android:layout_height="wrap_content"
and app:srcCompat="@drawable/map_one"
and set the new image when you have data from network
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivMap"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/ShapeAppearance.RoundedCornerImageView"
app:srcCompat="@drawable/map_one" />
Have a nice day 👋
I have a situation where my view doesn't set up data in advance, I need to request data set up after the network, and the skeleton screen doesn't appear at this time