GithubHelp home page GithubHelp logo

skydoves / androidveil Goto Github PK

View Code? Open in Web Editor NEW
1.4K 16.0 100.0 4.82 MB

:performing_arts: An easy, flexible way to implement loading skeletons and shimmering effect for Android.

License: Apache License 2.0

Kotlin 100.00%
android android-library androidveil skeleton shimmer recyclerview android-ui skydoves

androidveil's Introduction

AndroidVeil


An easy, flexible way to implement veil skeletons and shimmering effect for Android.


License API Build Status Android Weekly Medium Android Weekly


Download

Maven Central

Gradle

Add the codes below to your root build.gradle file (not your module build.gradle file):

allprojects {
    repositories {
        mavenCentral()
    }
}

And add the dependency below to your module's build.gradle file:

dependencies {
    implementation "com.github.skydoves:androidveil:1.1.3"
}

Usage

First, add following XML namespace inside your XML layout file:

xmlns:app="http://schemas.android.com/apk/res-auto"

VeilLayout in layout

<com.skydoves.androidveil.VeilLayout
      android:id="@+id/veilLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:veilLayout_veiled="true" // shows veils initially
      app:veilLayout_shimmerEnable="true" // sets shimmer enable
      app:veilLayout_baseColor="@android:color/holo_green_dark" // sets shimmer base color
      app:veilLayout_highlightColor="@android:color/holo_green_light" // sets shimmer highlight color
      app:veilLayout_baseAlpha="0.6" // sets shimmer base alpha value
      app:veilLayout_highlightAlpha="1.0" // sets shimmer highlight alpha value
      app:veilLayout_dropOff="0.5"// sets how quickly the shimmer`s gradient drops-off
      app:veilLayout_radius="6dp" // sets a corner radius of the whole veiled items >

      <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:text="And now here is my secret, a very simple secret"
         android:textColor="@android:color/white"
         android:textSize="22sp"/>

      <!-- Skip -->    

</com.skydoves.androidveil.VeilLayout>

Veil and UnVeil

We can implement veiled skeletons using below methods.

veilLayout.veil()
veilLayout.unVeil()

Implement veils using layout resource

We can implement veiled skeletons using the layout resource.

veilLayout.layout = R.layout.layout_item_test

VeilRecyclerFrameView

VeilRecyclerFrameView implements veiled skeletons for RecyclerView with the shimmer effect.

VeilRecyclerFrameView in layout

<com.skydoves.androidveil.VeilRecyclerFrameView
        android:id="@+id/veilRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:veilFrame_layout="@layout/item_profile" // sets to make veiling target layout
        app:veilFrame_veiled="true" // shows veils initially
        app:veilFrame_shimmerEnable="true" // sets shimmer enable
        app:veilFrame_baseColor="@android:color/holo_green_dark" // sets shimmer base color
        app:veilFrame_highlightColor="@android:color/holo_green_light" // sets shimmer highlight color
        app:veilFrame_baseAlpha="0.6" // sets shimmer base alpha value
        app:veilFrame_highlightAlpha="1.0" // sets shimmer highlight alpha value
        app:veilFrame_radius="8dp" // sets a corner radius of the whole veiled items 
        app:veilFrame_isItemWrapContentHeight="true"  // sets height of list item wrap_content
        app:veilFrame_isItemWrapContentWidth="true"   // sets width of list item wrap_content />

And we should attach our own adapter and LayoutManager.

veilRecyclerView.setAdapter(adapter) // sets your own adapter
veilRecyclerView.setLayoutManager(LinearLayoutManager(this)) // sets LayoutManager
veilRecyclerView.addVeiledItems(15) // add veiled 15 items

VeilRecyclerFrameView with a horizontal carousel

Automatically masking a horizontal layout is not supported yet. Horizontal (carousel) layouts can be used if you specify their shimmer layout yourself in advance (and tell the view to use this prepared layout by setting isPrepared = true). See CarouselActivity for an example

veilRecyclerView.setVeilLayout(
  layout = R.layout.item_prepared_shimmer_carousel,
  isPrepared = true
)
veilRecyclerView.setAdapter(adapter)
veilRecyclerView.setLayoutManager(LinearLayoutManager(this, RecyclerView.HORIZONTAL, false))
addVeiledItems(15)

Veil and UnVeil

We can implement veiled skeletons using below methods.

veilRecyclerView.veil() // shows veil skeletons
veilRecyclerView.unVeil() // disappear veils and shows your own recyclerView

RecyclerView

We can access our Recyclerview and veiledRecyclerView using the below methods.

veilRecyclerView.getRecyclerView() // veilRecyclerView.getRecyclerView().setHasFixedSize(true)
veilRecyclerView.getVeiledRecyclerView()

Shimmer

This library using shimmer-android by Facebook.
Here are the detail shimmer-instruction about shimmer or you can reference below examples.

create using Builder

This is how to create Shimmer's instance using Shimmer.Builder class.

val shimmer = Shimmer.ColorHighlightBuilder()
      .setBaseColor(ContextCompat.getColor(context, R.color.shimmerBase0))
      .setHighlightColor(ContextCompat.getColor(context, R.color.shimmerHighlight0))
      .setBaseAlpha(1f)
      .setHighlightAlpha(1f)
      .build()

veilLayout.shimmer = shimmer // sets shimmer to VeilLayout
veilRecyclerView.shimmer = shimmer // sets shimmer to VeilRecyclerView

create using kotlin dsl

This is how to create Shimmer's instance using kotlin dsl.

val shimmer_alpha = alphaShimmer {
      setBaseAlpha(1.0f)
      setHighlightAlpha(0.5f)
}
val shimmer_color = colorShimmer {
      setBaseAlpha(1.0f)
      setHighlightAlpha(0.5f)
      setBaseColor(ContextCompat.getColor(context, R.color.colorPrimary))
      setHighlightColor(ContextCompat.getColor(context, R.color.colorPrimaryDark))
}

AndroidVeil Attributes

Attributes Type Default Description
veiled Boolean false shows veils initially.
layout Int -1 implement veils using the layout resource.
radius dimension 8dp sets corner radius to the veil items.
drawable Drawable null sets background drawable to the veil items.
shimmerEnable Boolean true sets shimmer enable.
baseColor ColorInt Color.LTGRAY sets shimmer base color.
highlightColor ColorInt Color.DKGRAY sets shimmer highlight color.
baseAlpha Float 1.0f sets shimmer base alpha value.
highlightAlpha Float 1.0f sets shimmer highlight alpha value.
dropOff Float 0.5f sets how quickly the shimmer's gradient drops-off.
defaultChildVisible Boolean false sets the child view's visibility when called veil and unveil.
isItemWrapContentHeight Boolean false sets height of veiled list item wrap_content
isItemWrapContentWidth Boolean false sets width of veiled list item wrap_content

Find this repository useful? ❤️

Support it by joining stargazers for this repository. ⭐
Also follow me for my next creations! 🤩

License

Copyright 2018 skydoves

Licensed 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.

androidveil's People

Contributors

ahmedmed7t avatar alexquinlivan avatar radiopatrick avatar skydoves avatar wooooooak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidveil's Issues

Implementing veil skeletons in a RecyclerView with multiple view types (layouts)

Is your feature request related to a problem?

How to implement veil skeletons in a RecyclerView with multiple view types? Currently VeilRecyclerFrameView accepts only one VeilLayout. How to add one VeilLayout for each view types ?
For example I use 7 different layouts in my RecyclerView as below:

    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

        if (viewType == 0) {
            View view = inflater.inflate(R.layout.item_content_settings, parent, false);
            return new MyViewHolder(view);
        } else if (viewType == 1) {
            View view = inflater.inflate(R.layout.item_edit_delete_settings, parent, false);
            return new EditDeleteItemHolder(view);
        } else if (viewType == 2) {
            View view = inflater.inflate(R.layout.item_addnew_settings, parent, false);
            return new AddItemHolder(view);
        } else if (viewType == 3) {
            View view = inflater.inflate(R.layout.item_content_none_settings, parent, false);
            return new NoneHolder(view);
        } else if (viewType == 4) {
            View view = inflater.inflate(R.layout.item_email_id_settings, parent, false);
            return new EmailHolder(view);
        } else if (viewType == 5) {
            View view = inflater.inflate(R.layout.item_delete_data, parent, false);
            return new DeleteDataHolder(view);
        } else {
            View view = inflater.inflate(R.layout.button_save_settings, parent, false);
            return new SaveButtonHolder(view);
        }
    }

Thanks.

Test coverage

Is your feature request related to a problem?

I had an issue to cover UI screen with shimmer by espresso integration test

Describe the solution you'd like:

            onView(allOf(withClassName(endsWith("RecyclerView")), isDisplayed()))
                .check(matches(CustomMatchers().recyclerViewSizeMatch(count)))
                                                                or
            onView(CustomMatchers().isThisRequiredListInShimmer(tagToMatch))
    fun isThisRequiredListInShimmer(tagToMatch: String): BoundedMatcher<View, RecyclerView> {
        return object : BoundedMatcher<View, RecyclerView>(RecyclerView::class.java) {

            override fun describeTo(description: Description) {
                description.appendText("RecyclerView in shimmer component should have defined tag $tagToMatch")
            }

            override fun matchesSafely(item: RecyclerView): Boolean {
                return item.tag != null && item.tag.equals(tagToMatch)
            }
        }
    }

Describe alternatives you've considered:

This a solution I implemented for my use case, but it would be good to have more elegant way to do this.

VeilLayout doesn't work as expected in RecyclerView

조건은 RecyclerView 와 DiffUtil 를 사용하고 있고요.
안에 ViewHolder 안에 VeilLayout 사용하고 있습니다.
대충 구조는
RecyclerView
-> ViewHolder
-> VeilLayout

한번 veil 호출하고 몇초뒤 unveil 호출 했습니다. (정상 동작 O)
이후 veil 재호출하면 제대로 동작이 안될때 있고 될때가 있습니다...

왜 안되는지 알수 있을까요??

Not working on Textview

  • Library Version -> 1.1.1
  • Affected Device(s) -> Xiaomi Note 8 Android 10
  • Bug Desc

**Veil not working in TextView but work when TextTiew inside layout:

<com.skydoves.androidveil.VeilLayout
android:id="@+id/balance_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/large"
app:veilLayout_shimmerEnable="true"
app:layout_constraintEnd_toEndOf="@id/card_action"
app:layout_constraintStart_toStartOf="@id/card_action"
app:layout_constraintBottom_toTopOf="@id/card_action">

                <TextView
                    android:id="@+id/balance"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/zero_balance"
                    android:textColor="?attr/colorOnSecondary"
                    android:textSize="@dimen/large_title"
                    android:textStyle="bold"/>

            </com.skydoves.androidveil.VeilLayout>`

Veillayout cannot be used properly when the visual state is gone

Please complete the following information:

  • Library Version 1.1.3
  • Affected Device(s) Xiaomi10 Android12

Describe the Bug:

When activity is loaded, the veillayout visual state is gone, and then click to expand, veillayout is set to visible, but will not show the skeleton loading effect, all in vain. Would you please help to locate the problem? Determine if this is a bug

Expected Behavior:

When the veillayout visual state is gone, switch to visual state, and call the veil () method to display the effect correctly.

Video_20220919_090205_878.gif

Video_20220919_085349_642.gif

Implementing veil using the view reference.

Hi there,
Would it be possible to add a way to implement veil on a layout by referencing it's view? For example:

View mLayout = layout.getView();
veilLayout.layout = mLayout;

Currently, the only way to set a layout programmatically is by using layout resources, and due to some reasons I can't use it. It'd be great if you could introduce me with some way to use it with view reference. :)

Delay in showing the shimmer effect

  • Library Version 1.0.6
  • Affected Device(s) All

I just started using this dependency but I have encountered a serious problem. Why do I have this great delay to show the shimmer effect in the recyclerview? It takes a long time for the effect to appear.

I attach screen with the problem (I'm sorry for the poor quality, just so I could convert the video to gif).
Screenrecorder-2019-10-31-10-55-57-356_0_

Any way to solve this? Just in case it is necessary to know, I do the unVeil() only when I get all the data of my api on the internet.

Not working in MotionLayout

Please complete the following information:

  • Library Version - 1.1.1
  • Affected Device(s) - Oneplus 6T , Android 10

Describe the Bug:

Added Simple VeilLayout inside Motionlayout, it just takes up the space, but that space is empty, no shimmer or anything but works fine in ConstraintLayout

Expected Behavior:

it should work

VeilRecyclerFrameView need scroll to show the skeleton shimmering effect

I used VeilRecyclerFrameView the default is veil() but the shimmering efect need scroll bottom before showing the skeleton

` binding.veilLayoutExplore.setVeilLayout(R.layout.shimmer_tour_explore,4)
binding.veilLayoutExplore.getVeiledRecyclerView().addItemDecoration(VerticalItemDecoration(requireContext().resources.getDimensionPixelOffset(R.dimen.divider)))
binding.veilLayoutExplore.veil()

    binding.veilLayoutExplore.setLayoutManager(LinearLayoutManager(requireContext()))
    binding.veilLayoutExplore.getRecyclerView().addItemDecoration(VerticalItemDecoration(requireContext().resources.getDimensionPixelOffset(R.dimen.divider)))
    binding.veilLayoutExplore.setAdapter(adapter)`

how to LinearLayoutManager is LinearLayoutManager.HORIZONTAL

Is your feature request related to a problem?
I changed LinearLayoutManager.HORIZONTAL but it didn't work

Describe the solution you'd like:
holder.binding.recyclerViewContent.run {
setVeilLayout(R.layout.item_home_feature_shimmer)
setAdapter(featureHorizontalAdapter)
setLayoutManager(LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false))
addVeiledItems(2)
}

thanks admin

Doesn't work with recycler view horizontal layout and having some shimmer visual bugs

Please complete the following information:

  • Library Version [e.g. v1.0.4]
  • Affected Device(s) [e.g. Pixel 4 with Android 10.0]

Describe the Bug:

  • Doesn't work with LinearLayoutManager.HORIZONTAL
  • For some reason when the veiled is under effect, it cuts the view in half and I am not sure why, I tried experimenting around but no luck

image

Once everything is loaded:
image

VeilRecyclerFrameView doesn't display element with MaterialCardView correctly

  • Library Version v1.1.3
  • Affected Device - Realme 8 Pro with Android 13

Describe the Bug:

I have a problem displaying MaterialCardView in VeilRecyclerFrameView. The library displays content inside the MaterialCardView, but doesn't display the MaterialCardView border.

Example of how it is displayed now

Expected Behavior:

I expect to see a border and shadow for the MaterialCardView.
I'll add an example of how it should be.

Example as would like

journey_list

VeilLayout inside CardView doesn't show up

I noticed that no shimmering/unveiling animation happens once the VeilLayout is inside a CardView. Have a look at my XML:

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".features.lookup.MainActivity">

    <Button
        android:id="@+id/lookup_btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Lookup BIN"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/bin" />

    <EditText
        android:id="@+id/bin"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="16dp"
        android:textAlignment="textStart"
        android:textColor="@android:color/black"
        android:textSize="20sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:text="451643" />

    <TextView
        android:id="@+id/error_text"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:textAlignment="center"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:text="Error"/>

    <androidx.cardview.widget.CardView
        android:id="@+id/results_view"
        style="@style/CardViewStyle"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/lookup_btn">

        <com.skydoves.androidveil.VeilLayout
            android:id="@+id/veil_layout"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:veilLayout_radius="6dp"
            app:veilLayout_shimmerEnable="true"
            app:veilLayout_veiled="false"
            app:veilLayout_baseColor="@color/shimmerBase0"
            app:veilLayout_highlightColor="@color/shimmerHighlight0"
            app:veilLayout_baseAlpha="0.6"
            app:veilLayout_highlightAlpha="1.0"
            app:veilLayout_dropOff="0.5"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/lookup_btn"
            android:visibility="invisible">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/label_scheme"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentStart="true"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="8dp"
                        android:text="Scheme/Network"/>

                    <TextView
                        android:id="@+id/scheme"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        android:layout_marginEnd="8dp"
                        android:textSize="24sp"
                        tools:text="VISA" />

                </RelativeLayout>

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/label_type"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentStart="true"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="8dp"
                        android:text="Type" />

                    <TextView
                        android:id="@+id/type"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        android:layout_marginEnd="8dp"
                        android:textSize="24sp"
                        tools:text="Debit" />
                </RelativeLayout>

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/label_brand"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentStart="true"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="8dp"
                        android:text="Brand" />

                    <TextView
                        android:id="@+id/brand"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        android:layout_marginEnd="8dp"
                        android:textSize="24sp"
                        tools:text="Visa/Dankort" />
                </RelativeLayout>

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/label_country"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentStart="true"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="8dp"
                        android:text="Country" />

                    <TextView
                        android:id="@+id/country"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        android:layout_marginEnd="8dp"
                        android:textSize="24sp"
                        tools:text="Denmark" />
                </RelativeLayout>

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/label_bank"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentStart="true"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="8dp"
                        android:text="Bank" />

                    <TextView
                        android:id="@+id/bank"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        android:layout_marginEnd="8dp"
                        android:textSize="24sp"
                        tools:text="Jyske Bank" />
                </RelativeLayout>

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/label_length"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentStart="true"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="8dp"
                        android:text="Length" />

                    <TextView
                        android:id="@+id/length"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        android:layout_marginEnd="8dp"
                        android:textSize="24sp"
                        tools:text="16" />
                </RelativeLayout>
            </LinearLayout>
        </com.skydoves.androidveil.VeilLayout>
    </androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>

Firstly, the VeilLayout is invisible. Then it will be set to visible and veil() will be called once the lookup button is pressed and a request is sent. As soon as a response is received successfully, unVeil() will be called.

It might be a bit difficult to visualize but you can see this behavior by checking out the cardview branch from this app that I'm developing: https://github.com/alvindizon/bin-lookup/tree/cardview. In contrast, VeilLayout works nicely if it's not inside CardView, as can be seen in the master branch of my app.

Hope you can spot something or enlighten me as to what is happening. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.