acefalobi / android-stepper

A library for creating a wizard-like step-through user interface that uses navigation components and menus for displaying steps with advanced customization.
Apache License 2.0
325 stars 38 forks source link

APIs lower than 28 #8

Closed SkyfaceD closed 3 years ago

SkyfaceD commented 3 years ago

Currently library draws steps correctly only on 28, 29 and 30 APIs. This is bug or library doesn't provide support for lower APIs?

Screenshots from real devices:

Tab Stepper on Huawei P10 lite Huawei P10 lite

Tab Stepper on ZUK Z2 ZUK Z2

Tested on real device:

Tested on emulators:

Steps to reproduce

  1. Download sample app
  2. Run debug version
acefalobi commented 3 years ago

@SkyfaceD it must be a bug. i'll look into it.

acefalobi commented 3 years ago

@SkyfaceD does this bug only occur with the tab stepper type?

SkyfaceD commented 3 years ago

@acefalobi nope, for all stepper types.

Screens from Huawei P10 lite Tab stepper: image

Numbered tab stepper: image

Progress stepper: image

Fleets stepper: image

acefalobi commented 3 years ago

@SkyfaceD if you can, please send me the screenshot of the other types

SkyfaceD commented 3 years ago

@SkyfaceD if you can, please send me the screenshot of the other types

Check editted comment.

arthurndossi commented 3 years ago

@SkyfaceD it must be a bug. i'll look into it.

Hi, did you look into this?

arthurndossi commented 3 years ago

I solved this issue by creating a refs.xml in res -> values with content

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
    <item name="stepper_progress" type="layout" tools:override="true">@layout/new_stepper_progress</item>
</resources>

... and created a new layout file new_stepper_progress same as stepper_progress except for one addition in cardview app:cardElevation="0dp"

like this...

<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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:elevation="0dp"
    android:layout_width="0dp"
    tools:layout_width="match_parent"
    android:layout_height="3dp"
    app:cardElevation="0dp"
    app:cardCornerRadius="100dp">

    <ProgressBar
        android:id="@+id/progress_stepper"
        style="@style/Widget.AppCompat.ProgressBar.Horizontal"
        android:layout_width="match_parent"
        android:layout_height="3dp"
        android:layout_gravity="center"
        android:indeterminate="false"
        android:max="100"
        tools:progress="50"
        tools:progressTint="@color/color_stepper_default" />

</androidx.cardview.widget.CardView>
acefalobi commented 3 years ago

Thanks for this @arthurndossi.

I'll create an alternate layout for API <28 removing the elevation till I figure out how to fix this.

arthurndossi commented 3 years ago

Just add this line

app:cardElevation="0dp"

for CardView in each layout in android-stepper/stepper/src/main/res/layout/. No need to create another layout.

acefalobi commented 3 years ago

the card elevation is what gives it the nice subtle shadow.

acefalobi commented 3 years ago

@SkyfaceD and @arthurndossi can you try with the feature/stepper-type branch and see if it works for you.

arthurndossi commented 3 years ago

Alright👍

On Tue, Apr 13, 2021, 1:36 PM Ace Falobi @.***> wrote:

@SkyfaceD https://github.com/SkyfaceD and @arthurndossi https://github.com/arthurndossi can you try with the feature/stepper-type https://github.com/acefalobi/android-stepper/tree/feature/stepper-type branch and see if it works for you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/acefalobi/android-stepper/issues/8#issuecomment-818634311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG7DPBF3R3LJ5OC6NV2QXQ3TIQNDPANCNFSM4UL5OSFQ .

ashotterekyanlmc commented 3 years ago

@acefalobi Hello. Numbers are not displayed on android 6 and 7. the problem remains :(

mspnr commented 3 years ago

Missing numbers can be fixed by changing cardCornerRadius to 10dp here:

https://github.com/acefalobi/android-stepper/blob/b7c39b496ef673fbd2765f8a70ba99327c578f5d/stepper/src/main/res/layout/stepper_tab_item_number_icon.xml#L9

acefalobi commented 3 years ago

closing this cos it seems to have been fixed