Git Product home page Git Product logo

thatfiredev / firextensions Goto Github PK

View Code? Open in Web Editor NEW
29.0 2.0 7.0 349 KB

[DEPRECATED] ๐Ÿ”ฅ Unofficial Kotlin Extensions for the Firebase Android SDK.

Home Page: https://firebaseopensource.com/projects/rosariopfernandes/firextensions/

License: MIT License

Kotlin 100.00%
android android-library kotlin-android-extensions kotlin firebase firebase-database firestore firebase-firestore hacktoberfest

firextensions's Introduction

FirebaseOpensource.com

fireXtensions [DEPRECATED]

THIS LIBRARY IS NOW DEPRECATED IN FAVOR OF THE OFFICIAL FIREBASE KTX LIBRARIES.

PLEASE NOTE THAT NOT ALL THE FIREXTENSIONS ARE PRESENT IN THE OFFICIAL KTX, THAT'S BECAUSE SOME FIREXTENSIONS WOULD CAUSE MEMORY LEAKS WHILE OTHERS SIMPLY DID NOT ADD MUCH VALUE TO THE SDK. IF YOU FIND A FIREXTENSION WITH NO CORRESPONDING KTX, YOU'LL HAVE TO STICK TO THE OFFICIAL KOTLIN USAGE DEMONSTRATED IN THE FIREBASE DOCS.

THANKS FOR EVERYONE WHO CONTRIBUTED, SUPPORTED OR USED FIREXTENSIONS!

Introduction

fireXtensions are a set of Kotlin extension functions that aim to simplify the way you use the Firebase SDK for Android.

Available modules

Contributing

Anyone and everyone is welcome to contribute. Please take a moment to review the contributing guidelines.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgment

Inspired by Firebase KTX

firextensions's People

Contributors

edngulele avatar thatfiredev 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

Watchers

 avatar  avatar

firextensions's Issues

[Proposal] Remove unused resources

It's very important to keep projects (such as libraries) as light as possible. This will improve the performance and increase the download time.

This is a great library, i suggest removing the unused resources such as the test examples to keep the library even lighter.

Initialize FirebaseApp using a DSL style

Currently, initializing an app with FirebaseOptions in Kotlin looks like this:

val options = FirebaseOptions.Builder()
            .setApplicationId("1:27992087142:android:ce3b6448250083d1") // Required for Analytics.
            .setApiKey("AIzaSyADUe90ULnQDuGShD9W23RDP0xmeDc6Mvw") // Required for Auth.
            .setDatabaseUrl("https://myproject.firebaseio.com") // Required for RTDB.
            .build()
FirebaseApp.initializeApp(this /* required */, options /* optional */, "secondary" /* optional */)

I propose initializing it like:

FirebaseApp.initializeApp {
    context = this // required
    name = "secondary" // optional
    options { // optional
        applicationdId = "1:27992087142:android:ce3b6448250083d1"
        apiKey = "AIzaSyADUe90ULnQDuGShD9W23RDP0xmeDc6Mvw"
        databaseUrl = "https://myproject.firebaseio.com"

        // Below are optional parameters not mentioned above
        gaTrackingId = "someId"
        gcmSenderId = "someId"
        storageBucket = "bucketUrl"
        projectId = "someId"
    }
}

Create FirebaseUI extensions

FirebaseUI is very helpful when developing Android apps. It already handles lots of boilerplate code, but with Kotlin it might be able to handle more. The FirebaseRecyclerViewAdapter for the realtime database is an example:

Database

See how it's currently written here. Here's my proposal:

val options = FirebaseRecyclerOptions.fromQuery<Chat>(query)

val adapter = FirebaseRecyclerAdapter.with<ChatHolder>(options)
  .viewHolder { _, parent ->
    val view = layoutInflater.inflate(R.layout.list_item, parent, false)
    ChatHolder(view)
  }
  .bind { position, model ->
    // Bind the Chat object to the views from the ChatHolder
  }
  .build()

Create Reference Docs

The classes and methods in this library are not yet documented. We should create reference docs to help users of the library understand what each class and method is for.

Maybe use Dokka?

Write Unit Tests

Testing is an integral part of the software development process. This library should be no exception.

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.