Giter Club home page Giter Club logo

android-stepper's People

Contributors

acefalobi avatar mspnr avatar skyfaced 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

android-stepper's Issues

Error: java.lang.NoSuchMethodError: No virtual method set TextAppearence

I am trying to use your library in my project, but I have the following error.

Screenshot

Layout code:

<?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"
android:orientation="vertical"
    tools:context=".views.ui.planner.NewPlannerActivity">

<com.google.android.material.appbar.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay"
    app:elevation="0dp"
    app:layout_constraintTop_toTopOf="parent">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:layout_weight="1"
        tools:title="Step 1" />

</com.google.android.material.appbar.AppBarLayout>

<View
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:background="@color/inspectionColorPrimary"
    app:layout_constraintBottom_toTopOf="@id/guideline_stepper_middle"
    app:layout_constraintTop_toBottomOf="@id/appbar" />

<androidx.cardview.widget.CardView
    android:id="@+id/card_stepper"
    style="@style/Stepper.CardView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="32dp"
    app:layout_constraintTop_toBottomOf="@id/appbar"
    tools:layout_editor_absoluteX="32dp">

    <com.aceinteract.android.stepper.StepperNavigationView
        android:id="@+id/stepper"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="16dp"
        android:paddingTop="20dp"
        android:paddingEnd="16dp"
        android:paddingBottom="20dp"
        app:stepperIconSize="20dp"
        app:stepperItems="@menu/menu_new_planner_stepper"
        app:stepperTextColor="@android:color/black"
        app:stepperTextSize="12sp"
        app:stepperTextAppearance="@style/Stepper.Label"
        app:stepperType="@string/stepper_type_tab"
        app:stepperWidgetColor="@color/inspectionColorAccent" />

</androidx.cardview.widget.CardView>

<androidx.fragment.app.FragmentContainerView
    android:id="@+id/frame_stepper"
    android:name="androidx.navigation.fragment.NavHostFragment"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintTop_toBottomOf="@id/guideline_stepper_middle"
    app:navGraph="@navigation/nav_planner_stepper" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
    android:id="@+id/button_next"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/fab_margin"
    android:contentDescription="@string/lbl_next_step"
    android:src="@drawable/ic_visibility_off_black_24dp"
    app:backgroundTint="@color/inspectionColorAccent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:tint="@android:color/white" />

<View
    android:id="@+id/guideline_stepper_middle"
    android:layout_width="match_parent"
    android:layout_height="1dp"
    app:layout_constraintBottom_toBottomOf="@id/card_stepper"
    app:layout_constraintTop_toTopOf="@id/card_stepper" />

</androidx.constraintlayout.widget.ConstraintLayout>

Remove idea directory from the repository

Here is a friendly suggestion:

I did not get why to include .idea directory to repository. On every workstation I import the project can be a different setup for formatting, java versions etc. So then I have to track (or be distracted by) unnecessary local changes. There are multiple suggestions on the web, which files should be excluded, most contain multiple files. I find that adding just .idea/ to .gitignore if simple enough and keep the repository clean.

Please tell me what is the reason of including .idea to the repository?

Support RTL

Library not support Arabic direction it's layout destroyed like attached photo
Screenshot_٢٠٢١-٠٢-٠١-١٣-٥١-٤٥-٣٠١_com aceinteract android stepper 1

Java support

The following code seems to be only supported by Kotlin:

Captura de pantalla 2020-12-04 a las 12 26 33

as the setupWithNavController call in java asks for a second parameter, which must be an AnimBuilder. But AnimBuilder seems not to be available for Java:

Captura de pantalla 2020-12-04 a las 12 29 05

Is there any workaround in order to make it work with Java as well?

Thanks a lot in advance!

How to run the library locally?

I just stumbled on this problem. If I want to change a thing or two in the library and can attach to my app project it directly using the file system like this:

Add to settings.gradle

include ':android-stepper'
project(':android-stepper').projectDir = new File('../android-stepper/stepper')

Add to app/build.dependencies

dependencies {
  implementation project(':android-stepper')

With your library it does not work. Currently I am able to run it from maven version only.

Can you please describe how to a attach Android Stepper to an app project locally?

APIs lower than 28

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:

  • Doesn't work
    • API 26 (8.0), Huawei P10 lite
  • Work perfectly
    • API 29 (10.0), Galaxy A70
    • API 29 (10.0), ZUK Z2

Tested on emulators:

  • Doesn't work
    • API 24
    • API 27
  • Work perfectly
    • API 28
    • API 29
    • API 30

Steps to reproduce

  1. Download sample app
  2. Run debug version

Error inflating stepper on API level 21 (Android 5.0)

The stepper is working fine while testing on API 32, but on API 21 it gives the following error:

android.view.InflateException: Binary XML file line #7: Error inflating class com.aceinteract.android.stepper.StepperNavigationView
...
...
Caused by: java.lang.reflect.InvocationTargetException
...
...
Caused by: java.lang.NoSuchMethodError: No virtual method setTextAppearance(I)V in class Landroid/widget/TextView; or its super classes (declaration of 'android.widget.TextView' appears in /system/framework/framework.jar:classes2.dex)

Could not find com.github.acefalobi:android-stepper:0.3.0

I have this problem. sync gradle finished good, but compile with this exception.
Does anyone have such a problem? Or is it mine alone?

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.acefalobi:android-stepper:0.3.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/acefalobi/android-stepper/0.3.0/android-stepper-0.3.0.pom
- https://jcenter.bintray.com/com/github/acefalobi/android-stepper/0.3.0/android-stepper-0.3.0.pom
- https://jitpack.io/com/github/acefalobi/android-stepper/0.3.0/android-stepper-0.3.0.pom
Required by:
project :app

Sorry, problems with my android studios

Stepper doesn't go to previous step on back button press

I'm using SafeArgs plugin to navigate and pass arguments between fragments. I also have nested fragments in my app.
First layer fragment shows the stepper and a FragmentContainerView which also has the setup code for the stepper:

val localNavHost = childFragmentManager.findFragmentById(R.id.order_host_view) as NavHostFragment
localController = localNavHost.navController
binding.stepper.setupWithNavController(localController)
}

When I navigate to a fragment using SafeArgs the stepper automatically updates and highlights the second step, but when I press the back button, it navigates back to the first step but the stepper is still highlighting the second one. Is this a bug with the stepper or am I doing something wrong?

PS: Both of my FragmentContainerView's have their app:defaultNavHost attribute set to true, one with the main nav_graph and one for the nested fragments and the stepper.

Not working with binding extension

Does not work when using the binding
only works with directly setting up the layout on setContentView.

Getting this error while using binding :-

java.lang.ArrayIndexOutOfBoundsException: length=4; index=4

onStepChanged dispatched too early

On event onStepChanged I can't get a correct reference to fragment being presented, would be good to wait animation finish and then dispatch the event.

How to browse stepper from inside a fragment

Here is a question regarding your example of using the stepper.

In your example with numbered tabs stepper, the only way to go to next step is by clicking the button in the activity itself:

I would like to build some buttons for going back and forth in the fragment itself (because some processing logic is related to the steps).

What would be your advice to trigger jump between steps from inside the fragment?

Menu listener

Hi, great library!

Is there any way to know when a menu item has been clicked?
It would be nice to navigate when the user clicks on a stepper item.

Fragments Not Showing

Thanks for starting this cool project, although I'm having trouble getting it to work correctly.

I've created a sample project that follows your guide here: Project Link

For some reason the individual fragment steps don't show, only the stepper view.

image

In the sample project each step has a single text view, that shows one, two and three respectively for each step. As you can see those are not visible.

Failed to resolve

Got a Failed to resolve: com.github.acefalobi:android-stepper:0.3.0 on a new android project. So I thought something was wrong on my end. But looking at jitpack, I can only see up to version 0.2.2 there.

Please let meknow if there's something I'm missing.

Different Color for stages of steps

Hello,

I just want different colors for all stages, like for inprogress (Yellow), not completed(red) and completed (green).
Is there is any way to do it.

Crash on TextView.setTextAppearance (was added in API23)

Problem

If running the test app on a device with API lower than 23, the following crash appears:
Caused by: java.lang.NoSuchMethodError: No virtual method setTextAppearance(I)V in class Landroid/widget/TextView; or its super classes (declaration of 'android.widget.TextView' appears in /system/framework/framework.jar:classes2.dex)

Cause

The error is caused by one of these lines:

The problem is, that the used method setTextAppearance appeared only in API23:
https://developer.android.com/reference/android/widget/TextView#setTextAppearance(int)

Solution

To resolve the error minimum SDK should be rasied to 23:

Or setTextAppearance should be wrapped into the following check:

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
  setTextAppearance(context, textAppearance)
else
  setTextAppearance(textAppearance)

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.