Coder Social home page Coder Social logo

flashbar's People

Contributors

apan1000 avatar aritraroy avatar elek90 avatar skadyrov 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  avatar  avatar  avatar  avatar  avatar  avatar

flashbar's Issues

Cannot immediately dismiss Flashbar instance

Consider this code:

class MainActivity : AppCompatActivity() {

    var flashbar : Flashbar? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        setupFlashbar()
    }

    override fun onStart() {
        super.onStart()

        flashbar?.show()
        flashbar?.dismiss()
    }

    fun setupFlashbar() {
        flashbar = Flashbar.Builder(this)
                .message("Test")
                .gravity(Flashbar.Gravity.BOTTOM)
                .build()
    }
}

If you run it, you'll see that flashbar is still shown, regardless of flashbar?.dismiss() being called.
I'm not sure if this is a bug, since method isShowing() is provided so case like that was considered. If so, please add something like onFlashbarShown interface so it's possible to make sure that flashbar is dismissed.

Thanks for reading this. The library is great ♥

Enhacement

hi, how are you guys, thanks for this fantastic library.

just want to know if there is a chance to add a feature so that the user will see the flashbar after some opportunities like after 3 launches of the app or 3 days, and once he clicked the positive button the FlashBar will never been shown again.

otherwise. your app is greeeeeat

Input dialog

Add an EditText to the Flashbar dialog for taking input from users.

Allow this EditText to be customizable to accept both plain text(one-line and multiline) and passwords.

This dialog can be used as an input dialog box.

Duration issues.

The duration seems to get confused when dismissing the flash bar and opening one up again right afterwards.

Button on screen that fires the flash bar .show();

Showing flash bar with duration 5000 and positive button "dismiss"

Tapping on dismiss then quickly pressing the button to show another one

The flash bar closes before 5 seconds has elapsed. Presumably using the time from the first flash bar. Ideally this timer would get reset when the flash bar is dismissed.

Top and Bottom Margin

Hello,

Is there a way to add a top or bottom margin to the Flashbar view? It always stick to top or bottom, I tried changing fb_bottom_compensation_margin to a negative value, it works but the content does't go up with the view.

Thanks.

You cannot download the library with its correction CommonUtils.kt

internal fun Activity.getStatusBarHeightInPx(): Int {
val rectangle = Rect()

window.decorView.getWindowVisibleDisplayFrame(rectangle)

val statusBarHeight = rectangle.top
val contentViewTop = window.findViewById<View>(Window.ID_ANDROID_CONTENT).top
return if (contentViewTop == 0) { //Actionbar is not present
    statusBarHeight
} else {
    contentViewTop - statusBarHeight
}

}

Not working on Oreo

it crashes upon showing the first message

this is the code in a default method in an interface (implemented by Activities) :

default void showToast(String title, String details){
new Flashbar.Builder((Activity)this)
.enableSwipeToDismiss()
.dismissOnTapOutside()
.duration(3000)
.gravity(Flashbar.Gravity.TOP)
.title(title)
.message(details)
.build()
.show();
}

this is the stack trace :

W/StaticLayout: maxLineHeight should not be -1. maxLines:1 lineCount:1
2019-06-25 03:54:13.941 W/System.err: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.lang.AbstractMethodError: abstract method "void com.cuboh.mobile.presentation.core.behaviors.CustomToasts.showToast(java.lang.Throwable)"
2019-06-25 03:54:13.942 W/System.err: at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
2019-06-25 03:54:13.942 W/System.err: at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:126)
2019-06-25 03:54:13.942 W/System.err: at android.os.Handler.handleCallback(Handler.java:793)
2019-06-25 03:54:13.942 W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98)
2019-06-25 03:54:13.942 W/System.err: at android.os.Looper.loop(Looper.java:176)
2019-06-25 03:54:13.943 W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6701)
2019-06-25 03:54:13.943 W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2019-06-25 03:54:13.943 W/System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:249)
2019-06-25 03:54:13.943 W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
2019-06-25 03:54:13.943 W/System.err: Caused by: java.lang.AbstractMethodError: abstract method "void com.cuboh.mobile.presentation.core.behaviors.CustomToasts.showToast(java.lang.Throwable)"
2019-06-25 03:54:13.943 W/System.err: at com.cuboh.mobile.presentation.features.main.-$$Lambda$NO1rDPnH-993Pc6JvEqcyiJesow.accept(Unknown Source:4)
2019-06-25 03:54:13.944 W/System.err: at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
2019-06-25 03:54:13.944 W/System.err: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
2019-06-25 03:54:13.944 W/System.err: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
2019-06-25 03:54:13.944 W/System.err: at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
2019-06-25 03:54:13.944 W/System.err: ... 7 more

Overlay Animation?

Using the overlay feature is cool, but the abrupt-ness of its appearance/disappearance doesn't match well with the rest of my UI. Is it possible to add fade-in/fade-out animations to the overlay's appearance/disappearance?

The action button gets hidden under navigation bar on Tablet Devices using `Flashbar.Gravity.BOTTOM`

Summary

The action button gets hidden under the navigation bar when used in tablets, making them untapable.

  • Library Version Tested: 1.0.1 and 1.0.2
  • OS Version: 6.0.1, 7.1.1 (Used emulator)

Screencast

screencapture-1526087965459

Code Used

flashbar = Flashbar.Builder(this)
        .gravity(Flashbar.Gravity.BOTTOM)
        .title("Title")
        .message("Message")
        .backgroundColorRes(R.color.colorPrimaryDark)
        .positiveActionText(R.string.btn_cta_preceed)
        .negativeActionText(R.string.btn_cta_okay)
        .positiveActionTextColorRes(R.color.colorAccent)
        .negativeActionTextColorRes(R.color.colorAccent)
        .positiveActionTapListener(object : Flashbar.OnActionTapListener {
            override fun onActionTapped(bar: Flashbar) {
                bar.dismiss()
            }
        })
        .negativeActionTapListener(object : Flashbar.OnActionTapListener {
            override fun onActionTapped(bar: Flashbar) {
                bar.dismiss()
            }
        })
        .build()

New message will override old one if send together

Case: If I send 2 or more message in just one seconds and time to display one individual message is 2 seconds. Than the new one will override the previous one. Any way that new message will appear after old one is gone.

Suggestion isShowing misleading name

Hi. First of all, I love Flashbar. You did a great job there.

I would like to make one suggestion. I think Flashbar.isShowing() is a bit misleading. You use it as an opposition to Flashbar.isDismissing().
Consider using the name Flashbar.isAppearing() or Flashbar.isEmerging() instead. It represents its functionality in a better way.
Flashbar.isShowing() should substitute Flashbar.isShown() in my opinion.

Hope you take it into consideration.
Cheers.

Problem with NoActionBar bar activity

Hi, I tried to use this in my new app and it's working fine but when I used this with a no NoActionBar activity it's not showing properly on Flashbar.Gravity.TOP

This is my code which I am writing

Flashbar.Builder builder = new Flashbar.Builder(activity) .gravity(gravity) .title(title) .message(body) .enableSwipeToDismiss() .backgroundColorRes(R.color.colorPrimarylight) .enterAnimation(FlashAnim.with(activity) .animateBar() .duration(Flashbar.DURATION_SHORT) .alpha() .overshoot()); _flashBar=builder.build();

This is the preview of the problem

untitled

What should I do ?

crash in android P

use simple example but have this error :
E/TypefaceCompatApi21Impl: java.lang.NoSuchMethodException java.lang.NoSuchMethodException: addFontWeightStyle [class java.lang.String, int, boolean]

i think you use hide method and this not allow in android P
this is my example:

    Flashbar flashbar = new Flashbar.Builder(this)
            .message(R.string.str_start_sync)
            .gravity(Flashbar.Gravity.BOTTOM)
            .showProgress(Flashbar.ProgressPosition.LEFT)
            .build();
    flashbar.show();

Legacy support to AndroidX migration

Cheers! For the great library @aritraroy

It seems library still needs legacy support libraries, Do you have any plans for the androidX migration as such also seen that it is not available on maven?

Can we expect updates in future ? Or library is dead and no more updates can be expected in future.....

Looking forward to hear from you!

Unwanted Bottom Margin on Oneplus Devices

There's an unwanted bottom margin added to the flashbar on Oneplus Devices.

I tested it out on emulator running on Pie and it works fine.

But on Oneplus 6 running on Pie it adds an unwanted bottom margin as you can see in this picture.

Screenshot of Unwanted Bottom Margin to Flashbar

Shows under dialog fragment

when i use flash bar in a dialogFragment the flashbar displays under the dialog fragment. i pass the dialogFragment's activity to flash bar.

Failed to resolve

when i try to add it to gradle
this message appear
Failed to resolve: com.andrognito.flashbar:flashbar:1.0.1

Initialization for a style guide

Would recommend having a way of initializing the library once by passing a config object and then the same Flashbar object be used. When you pass the config object, it creates an immutable version of a Flashbar which gets cloned every time you try to customize it further.

This basically allows someone to initialize the Flashbar once based on their own style guide and then keep reusing that configuration.

Varun

Flutter version of Flashbar

Hi @aritraroy. I passing by to let you know that I liked the idea so much that I'm developing a Flutter version of Flashbar: Flushbar.
It is still in early stages though. I hope I can make something as good as Flashbar. If you want to check it out, Flushbar.

Cheers!

Position issue?

Hello,

Great work guys!

Is there ia issue with the TOP positioning or is just me?

image

Add buttons for samples in sample app

It would be nice to have a list of all the various types of customisations available as a list of buttons for hiding/showing, similar to this

Bonus: publish the sample to the play store so that we don't need to clone/build the project :)

One Bar at a time

Is there a way to make sure i only have one bar showing at any given moment ?

Text Position

Hello, Great library guys thank you.
am having a problem with text position inside the Flashbar,
I've tried to set the .titleAppearance() and .messageAppearance() to center or right it did not work.
is there any solution to this?

Unable to use DURATION_INDEFINITE

I'm unable to set indefinite duration for the flashbar message by using Flashbar.DURATION_INDEFINITE.

I get the following error:

Duration cannot be negative or zero

Please make changes in the code regarding this and allow an exception for Flashbar.DURATION_INDEFINITE

Using Flashbar in java-only projects requires kotlin-stdlib dependency

Not sure if this is by design, but using Flashbar in my non-kotlin enabled Android project resulted in an immediate crash on application run with a ClassNotFoundException. I had to add the kotlin-stdlib dependency to my app gradle in order to get it working.

Would be nice if there was a way around that.

Icons on android 5.0

When I add icons as drawables to flashbar i can see only white shapes of icons.

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.