0.0.7 • Published 4 years ago

capacitor-plugin-toggle-fullscreen v0.0.7

Weekly downloads
13
License
MIT
Repository
github
Last release
4 years ago

capacitor-plugin-toggle-fullscreen

Install

Using npm:

npm install --save capacitor-plugin-toggle-fullscreen

or using yarn:

yarn add capacitor-plugin-toggle-fullscreen

Use

Register the plugin in your Activity:

// Other imports...
import com.lianlf.capacitoryfullscreen.ToggleFullScreen;

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initializes the Bridge
    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
      // Additional plugins you've installed go here
      // Ex: add(TotallyAwesomePlugin.class);
      add(ToggleFullScreen.class);
    }});
  }
}

In JS code:

<button
    onClick={() => ToggleFullScreen.toggle()}
>
    Toggle Screen
</button>
<button
    onClick={() => ToggleFullScreen.toggle({ orientation: 'LANDSCAPE' })}
>
    Set Landscape
</button>
<button
    onClick={() => ToggleFullScreen.toggle({ orientation: 'PORTRAIT' })}
>
    Set Portrait
</button>

Run

npx cap sync && npx cap open android
0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago