MaterialFavoriteButton | Animated favorite/star/like button | User Interface library

 by   IvBaranov Java Version: 0.1.5 License: Apache-2.0

kandi X-RAY | MaterialFavoriteButton Summary

kandi X-RAY | MaterialFavoriteButton Summary

MaterialFavoriteButton is a Java library typically used in User Interface, React applications. MaterialFavoriteButton has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

Material spinning favorite/star/like button.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              MaterialFavoriteButton has a low active ecosystem.
              It has 587 star(s) with 96 fork(s). There are 18 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 2 open issues and 20 have been closed. On average issues are closed in 74 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of MaterialFavoriteButton is 0.1.5

            kandi-Quality Quality

              MaterialFavoriteButton has 0 bugs and 0 code smells.

            kandi-Security Security

              MaterialFavoriteButton has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              MaterialFavoriteButton code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              MaterialFavoriteButton is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              MaterialFavoriteButton releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              It has 754 lines of code, 52 functions and 17 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed MaterialFavoriteButton and discovered the below as its top functions. This is intended to give you an instant insight into MaterialFavoriteButton implemented functionality, and help decide if they suit your requirements.
            • Initialize the default values
            • Toggle the favorite state of this button
            • Convert Dp value to Pixel
            • Sets the right padding
            • Set the favorite state of this button
            • Obtains the typed array from an attribute set
            • Initialize attributes
            • Sets the favorite state of the button
            • Set the favorite button
            • Animates the button
            • Initializes the activity
            • Set the listener for the favorite state
            • Set the listener which should be called when the favorites animation is changed
            • Set the color of the preference
            • Set the favorite theme
            • Set the type of the preference
            • Override to handle menu item selection
            • Changes the favorite state of this button
            • Set the size of the button
            Get all kandi verified functions for this library.

            MaterialFavoriteButton Key Features

            No Key Features are available at this moment for MaterialFavoriteButton.

            MaterialFavoriteButton Examples and Code Snippets

            No Code Snippets are available at this moment for MaterialFavoriteButton.

            Community Discussions

            QUESTION

            Could not find multidex.jar (com.android.support:multidex:1.0.2)
            Asked 2020-May-21 at 11:15

            Could not find multidex.jar (com.android.support:multidex:1.0.2). Searched in the following locations: https://jcenter.bintray.com/com/android/support/multidex/1.0.2/multidex

            I have just installed latest version of Android Studio 3.1.3 When i tried to sync my project it shows failed to resolve : multidex

            Also i tried https://jcenter.bintray.com/com/android/support/multidex/1.0.2/multidex this link which shows 404 error. Please help

            Project Level :

            ...

            ANSWER

            Answered 2018-Jun-11 at 07:07

            Since you are developing using Android Studio 3.1.3, try to update your build.gradle dependencies and plugin as well to their latest version.

            And move your repository google() to the buildscript.

            You can try this:

            Top-level build.gradle

            Source https://stackoverflow.com/questions/50781608

            QUESTION

            Material Favorite Button vs Image Button
            Asked 2019-Feb-24 at 16:26

            What is the difference between MaterialFavoriteButton and image button? As both are buttons are same why image button can't be used as Favorite button?

            ...

            ANSWER

            Answered 2019-Feb-24 at 16:26

            You are welcome to use ImageView or ImageButton for a favorite button. MaterialFavoriteButton has additional features that some developers may like:

            • The ability to provide the favorite and not-favorite images as simple drawable resources, or opt into built-in star or heart images if they fit your needs

            • Integrated animations for transitioning between those images

            • Simple event handlers for finding out when the user toggles the state and when the animations end

            If you do not want those features, or you do not want to use open source libraries, you do not need to use MaterialFavoriteButton.

            Source https://stackoverflow.com/questions/54843116

            QUESTION

            when i scroll the custom list in my android app then the favorite icon which is part of the custom adapter changes on its own
            Asked 2017-Oct-20 at 14:31

            I have created a custom list, the adapter of which contains three components song title, song number and favorite icon. The favorite icon is meant to mark or unmark the favorite item in the list. Please have a look to the attached video to understand what is the problem.

            Video

            When I click on the star, the icon gets selected/unselected and fires the setOnFavoriteChangeListener event. In the event I check the isFavorite status and update the database accordingly. Here is the full code of adapter:

            ...

            ANSWER

            Answered 2017-Oct-20 at 14:31

            I think I figured out your problem. It has to do with the fact your are recycling your ListView's items. During the initial load everything works fine and nothing is selected and the call dataModel.getFav() returns false so when your call viewHolder.favorite.setFavorite() the MaterialFavoriteButton doesn't fire it's set OnFavoriteChangeListener. The reason for this is, because internally it checks to see if the new favorite state is different from the last as an optimization to prevent unnecessary work (I checked the source code). But, once you make a selection your onFavoriteChanged will be fired because the new state is different and you then store the values inside of your Database. Your problem arises when you start to scroll, since your view are recycled, the MaterialFavoriteButton's favorite state will set but when you call dataModel.getFav() it will return false to and change the MaterialFavoriteButton's favorite state back to false. Thus causing your the MaterialFavoriteButton's old OnFavoriteChangeListener to fire once again (thus why the button isn't favorited). It is also updating your Database with it's previous dataModel (NOTE: this is a closure issue) that is why you see it use the text from a view that was scrolled of screen. The reason the old OnFavoriteChangeListener is being called because the view is being recycled and still has the instance you passed to it during the initial load. So once all view are populated to fill the entire screen, if you scroll the first one to go off the top screen will be passed in to getView() as convertView.You should move the call viewHolder.favorite.setOnFavoriteChangeListener to before the setFavorite() call. If you place a debug statement in the code and step through the call to viewHolder.favorite.setFavorite() you should see what I am talking about. I hope this all makes since to you. If not, comment and I try and give you more assistance. My recommended solution would be to hold off on the database writes until a save button is pressed or the Activity/Fragment is paused or stopped and just store the favorite state inside of an ArrayList that gets accessed using the getView(...) position argument. This is much more efficient because you won't have to constantly access the Database anytime the ListView is scrolled.

            Source https://stackoverflow.com/questions/46848914

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install MaterialFavoriteButton

            You can download it from GitHub.
            You can use MaterialFavoriteButton like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the MaterialFavoriteButton component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/IvBaranov/MaterialFavoriteButton.git

          • CLI

            gh repo clone IvBaranov/MaterialFavoriteButton

          • sshUrl

            git@github.com:IvBaranov/MaterialFavoriteButton.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link