Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Animation is not working in the dark mode #117

Open
julia-black opened this issue Jun 17, 2021 · 5 comments
Open

Animation is not working in the dark mode #117

julia-black opened this issue Jun 17, 2021 · 5 comments

Comments

@julia-black
Copy link

Hi! Animation is working in light mode, but isn't working in dark mode, for example, simplest layout:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.facebook.shimmer.ShimmerFrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintTop_toTopOf="parent">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="Hello World!" />
    </com.facebook.shimmer.ShimmerFrameLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
@edwinjzph
Copy link

edwinjzph commented Jun 29, 2021

I solved this issue by
<com.facebook.shimmer.ShimmerFrameLayout
android:forceDarkAllowed="false" >
</com.facebook.shimmer.ShimmerFrameLayout>

@julia-black
Copy link
Author

I solved this issue by
<com.facebook.shimmer.ShimmerFrameLayout
android:forceDarkAllowed="false" >
</com.facebook.shimmer.ShimmerFrameLayout>

But this also applies to internal elements.

@shreelakshmijoshi
Copy link

Hi @julia-black !
I am a new open source contributor and would like to solve this issue, could you help me understand the issue better by providing some extra references ?
Is this is issue open to contribute ?

@dev-rajuhalder
Copy link

dev-rajuhalder commented Oct 1, 2021

@edwinjzph Thanks it's working for me.

Here is my code

<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.recyclerview.widget.RecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/gray_5"
    android:layoutAnimation="@anim/layout_anim_2"
    android:visibility="gone" />

<com.facebook.shimmer.ShimmerFrameLayout
    android:id="@+id/shimmer"
    android:forceDarkAllowed="false"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:shimmer_auto_start="true"
    tools:targetApi="q">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <include layout="@layout/layout_shimmer_placeholder" />
        <include layout="@layout/layout_shimmer_placeholder" />
        <include layout="@layout/layout_shimmer_placeholder" />
        <include layout="@layout/layout_shimmer_placeholder" />
        <include layout="@layout/layout_shimmer_placeholder" />
    </LinearLayout>

</com.facebook.shimmer.ShimmerFrameLayout>

<com.google.android.material.textview.MaterialTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:layout_gravity="center"
    android:fontFamily="@font/roboto_thin"
    android:text="@string/label_not_found"
    android:textSize="24sp"
    android:visibility="gone"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
    android:id="@+id/fabAdd"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/activity_horizontal_margin"
    android:contentDescription="@string/app_name"
    android:src="@drawable/ic_baseline_add_24"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

@dyj0816
Copy link

dyj0816 commented Dec 2, 2021

我通过 <com.facebook.shimmer.ShimmerFrameLayout android:forceDarkAllowed="false" > </com.facebook.shimmer.ShimmerFrameLayout>解决了这个问题

hero

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants