Coder Social home page Coder Social logo

jonsangar / cordova-plugin-transparent-navigationbar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rdcavanha/cordova-plugin-transparent-navigationbar

0.0 0.0 1.0 12 KB

Cordova plugin to make the navigation bar transparent on Android

License: Apache License 2.0

JavaScript 18.21% Java 81.79%

cordova-plugin-transparent-navigationbar's Introduction

cordova-plugin-transparent-navigationbar

This plugin allows you to make the navigation bar transparent and overlay the Cordova's webview. Works on Android only.

Installation

cordova plugin add cordova-plugin-transparent-navigationbar

Usage

You can use this plugin by either the preference tag in your config.xml file or by calling it programmatically during runtime.

Please note that when setting the navigation bar transparent, it will overlap Cordova's webview, which may cause your app to be displayed partly underneath the navigation bar.

To avoid any issues where UI elements are blocked by the navigation bar, it is recommended to set some padding to the bottom of your app.


Preferences

Add the following in your config.xml file

TransparentNavigationBar
Makes the navigation bar transparent
Boolean, default value: false

<preference name="TransparentNavigationBar" value="true" />

NavigationBarLight
Makes the navigation bar buttons either dark or light
String, either dark or light, default value: dark

<preference name="TransparentNavigationBarButtonsColor" value="dark" />

Programatically

When running in Cordova, this plugins exposes the global object TransparentNavigationBar in the window object

Please note that this object will only be available after the deviceready event has been fired

function handleDeviceReady() {
  console.log(window.NavigationBar);
}

document.addEventListener('deviceready', handleDeviceReady, false);

TransparentNavigationBar.setNavigationBarTransparent

Makes the navigation bar transparent

TransparentNavigationBar.setNavigationBarTransparent();

TransparentNavigationBar.setNavigationBarButtonsColor

Makes the navigation bar buttons either dark or light
Accepts either dark or light

TransparentNavigationBar.setNavigationBarButtonsColor('dark');

cordova-plugin-transparent-navigationbar's People

Contributors

jonsangarx avatar rdcavanha avatar

Forkers

seamlink-dev

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.