Coder Social home page Coder Social logo

darkionavey / achievementunlocked-library Goto Github PK

View Code? Open in Web Editor NEW
124.0 16.0 29.0 8.87 MB

[Android] AchievementUnlocked is an open-source Android library that creates "XBOX Achievement Unlocked"-like alerts.

Home Page: http://goo.gl/ZNAmsI

Java 100.00%

achievementunlocked-library's Introduction

AchievementUnlocked app demo

AchievementUnlocked

Animated pop-ups inspired by XBOX.

Download APK (for Android KitKat+)

License

GPL (for the companion App)

Library (MIT)

How to add to my app

Copy AchievementUnlocked.Java class to your app. That's it!


How to show popups

  1. Initialize achievementUnlocked object
    AchievementUnlocked achievementUnlocked = new AchievementUnlocked(getApplicationContext());
  2. Customize appearance
      achievementUnlocked.setRounded(rounded).setLarge(large).setTopAligned(top).setDismissible(dismiss)
  3. Supply the aforementioned object with (array of) AcheievementData
    AchievementData data0 = new AchievementData();
    data0.setTitle(title); 
    data0.setSubTitle(title);
    data0.setIcon(iconFinal);  
    data0.setTextColor(textColor);
    data0.setIconBackgroundColor(iconBG);
    data0.setBackgroundColor(bg);
    data0.setPopUpOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                     
                    }
                });
  4. Pop your data!
    achievementUnlocked.show(data0, data1, data2, data3);

Phones with large status bars and/or Android Oreo+

achievementUnlocked.setNotchMode(Integer statusBarHeight)

Use the above method to vertically shift top-aligned popups. 'statusBarHeight' will be the vertical shift of the popup. If you supply a null value, 'status_bar_height' dimen from 'android' package will be used instead. You don't need to use the ViewCompat.setOnApplyWindowInsetsListener to get the statusbar height since the popup will be drawn over all apps and using the hardcoded status bar height is sufficient. This is the default behaviour on devices running Android Oreo+ since it prevents apps from drawing over the status bar.

New: control subtitle scrolling speed

In the latest version, new method to control scrolling speed has been added. To set speed rate, use the code below:
achievementUnlocked.setScrollingPxPerSeconds(float);

Higher values will result in faster scrolling. This method should be used alongside setReadingDelay method to assign rates that best fit your application nature

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.