Giter Site home page Giter Site logo

milosmns / silly-android Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 3.0 528 KB

Android plugins for Java, making core Android APIs easy to use

License: Apache License 2.0

Java 100.00%
android api appcompat boilerplate change cleanup cursor dialog dialogs drawables easy fix framework frameworks online permission plugin sdk silly

silly-android's People

Contributors

milosmns 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

silly-android's Issues

Easy RecyclerView

Add a pre-configured RecyclerView Adapter. Ideas and layers:

  1. DataProvider (stores data, provides data access to adapter)
  2. DataItem superclass for DataProviders
  3. Clickable and Long-Clickable ViewHolder, superclass
  4. Adapter that uses the DataProvider and is parametrized using DataItem and ViewHolder types

Add showKeyboard and hideKeyboard methods

protected void showKeyboard() {

        InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
        if (activity.getCurrentFocus() == null) {
            inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
        } else {
            View view = activity.getCurrentFocus();
            inputMethodManager.showSoftInput(view,InputMethodManager.SHOW_FORCED);
        }
    }

    /**
     * Hide keyboard.
     */
    protected void hideKeyboard() {

        InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
        View view = activity.getCurrentFocus();
        if (view == null) {
            if (inputMethodManager.isAcceptingText())
                inputMethodManager.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0);
        } else {
            if (view instanceof EditText)
                ((EditText) view).setText(((EditText) view).getText().toString()); // reset edit text bug on some keyboards bug
            inputMethodManager.hideSoftInputFromInputMethod(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
        }          
    }

Managed dialogs

TL;DR We need dialog management for each fragment and activity, a mechanism to support rotation, state saving and restoring and automatic recreation.

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.