GithubHelp home page GithubHelp logo

cwbudde / cordova-plugin-android-window-tools Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 44 KB

This Plugin contains code to access certain window properties (sizes, insets, etc.)

License: MIT License

HTML 25.59% Java 52.00% JavaScript 13.57% Python 7.86% Batchfile 0.98%
cordova-plugin cordova-android notch statusbar navigation-bar

cordova-plugin-android-window-tools's Introduction

Android Window Tools for Cordova

Plugin for Cordova 8.0+ to perform some basic window operations like setting certain flags or changing the statusbar color. Also getting various sizes and insets.

Released under MIT license; see LICENSE for details.

How does it work?

A loose collection of various tools that perform simple tasks on the Android side.

Installation

Cordova

cordova plugin add cordova-plugin-android-window-tools

Code example

Here are some examples on how you can use this plugin

AndroidWindowTools.getSoftwareKeys(successSoftKeysFunction, errorFunction);

AndroidWindowTools.getDisplayCutout(successFunction, errorFunction);

AndroidWindowTools.getRealSize(successRealSizeFunction, errorFunction);

// See https://developer.android.com/reference/android/view/Window#setNavigationBarColor(int)
AndroidWindowTools.setNavigationBarColor('#f00', successFunction, errorFunction);

// See https://developer.android.com/reference/android/view/Window#setStatusBarColor(int)
AndroidWindowTools.setStatusBarColor('#0f0', successFunction, errorFunction);

// See https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
AndroidWindowTools.setSystemUiVisibility(AndroidWindowTools.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | AndroidWindowTools.SYSTEM_UI_FLAG_LAYOUT_STABLE | AndroidWindowTools.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, successFunction, errorFunction);

// See https://developer.android.com/reference/android/view/WindowManager.LayoutParams
AndroidWindowTools.addWindowFlag(AndroidWindowTools.FLAG_FULLSCREEN, successFunction, errorFunction);
AndroidWindowTools.clearWindowFlag(AndroidWindowTools.FLAG_FORCE_NOT_FULLSCREEN, successFunction, errorFunction);

cordova-plugin-android-window-tools's People

Contributors

cwbudde avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

fasinc skf

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.