capacitor-plugin-toggle-fullscreen
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i capacitor-plugin-toggle-fullscreen

Weekly Downloads

1

Version

0.0.7

License

MIT

Unpacked Size

234 kB

Total Files

77

Last publish

Collaborators

  • phuhui