nothing_glyph_interface

Last updated:

0 purchases

nothing_glyph_interface Image
nothing_glyph_interface Images
Add to Cart

Description:

nothing glyph interface

Nothing Glyph Interface #



Flutter implementation of the Glyph Developer Kit from Nothing.
Legal Notice #
I don't stand in any connection with Nothing and own any rights to their physical and digital products.
The included jar file is the property of Nothing.
Note #
For this plugin to work properly on physical Nothing devices, the glyph debugging must be enabled first:
adb shell settings put global nt_glyph_interface_debug_enable 1
copied to clipboard
The debugging mode will be automatically disabled after 48 hours to prevent misuse of the SDK.
For later publication, reach out to Nothing for a proper API key and add it to your AndroidManifest.xml.
<!-- This tag should be added in application tag -->
<meta-data android:name="NothingKey" android:value="{Your APIKey}" />
copied to clipboard
Usage #
In general, this plugin is implemented in the same way as the Glyph Developer Kit.
General #
Create a NothingGlyphInterface instance:
NothingGlyphInterface _nothingGlyphInterface = NothingGlyphInterface();
copied to clipboard
Check if the Android device is a Nothing Phone 1 or Phone 2:
bool isPhone1 = await _nothingGlyphInterface.is20111();
bool isPhone2 = await _nothingGlyphInterface.is22111();
bool isPhone2a = await _nothingGlyphInterface.is23111();
copied to clipboard
Listen to the Glyph connection stream.
The plugin should automatically try to connect to the Glyph interface during the app start and close its connection when the app ends.
_nothingGlyphInterface.onServiceConnection.listen((bool connected) {
print("connected: $connected");
});
copied to clipboard
Get the current state of the glyph interface:
int? period = await _glyphInterfacePlugin.getPeriod();
int? cycles = await _glyphInterfacePlugin.getCycles();
int? interval = await _glyphInterfacePlugin.getInterval();
List<int>? channel = await _glyphInterfacePlugin.getChannel();
copied to clipboard
Trigger the Glyph Interface #
Please use the provided GlyphFrameBuilder to create Glyph frames:
// basic example
await _glyphInterfacePlugin.buildGlyphFrame(GlyphFrameBuilder()
.buildChannelA()
.build()
);

// more complex example
await _glyphInterfacePlugin.buildGlyphFrame(GlyphFrameBuilder()
.buildChannelA()
.buildChannel(NothingPhone2.c3)
.buildPeriod(2000)
.buildCycles(3)
.buildInterval(1000)
.build()
);
copied to clipboard
After building a Glyph frame it must be triggered for the interface to light up:
// used to enable/disable the channels set in the GlyphFrame.
await _glyphInterfacePlugin.toggle();

// used for animating a breathing animation using the parameters of channels, period, and interval set in the GlyphFrame.
await _glyphInterfacePlugin.animate();

// used to display a progress value on C1 / D1.
await _glyphInterfacePlugin.displayProgress();

// used to simultaneously toggle all Glyphs except C1 / D1 and display the progress value on C1 / D1.
await _glyphInterfacePlugin.displayProgressAndToggle();
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.