This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const val CACHE_TTL_SECONDS: Short = 30 * 60 | |
private const val INET_BROADCAST_INTERVAL_SECONDS: Short = 30 * 60 | |
class Dscp( | |
private val inetServer: InetServer, | |
private val addressProvider: AddressProvider, | |
private val bleAdvertiser: BleAdvertiser, | |
private val bleScanner: BleScanner, | |
private val inetBroadcaster: InetBroadcaster, | |
private val timer: Timer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" > | |
<org.opencv.android.JavaCameraView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:id="@+id/color_blob_detection_activity_surface_view" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mobymagic.opencvproject; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import org.opencv.core.Core; | |
import org.opencv.core.CvType; | |
import org.opencv.core.Mat; | |
import org.opencv.core.MatOfPoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mobymagic.opencvproject; | |
import java.util.List; | |
import org.opencv.android.BaseLoaderCallback; | |
import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame; | |
import org.opencv.android.LoaderCallbackInterface; | |
import org.opencv.android.OpenCVLoader; | |
import org.opencv.core.Core; | |
import org.opencv.core.CvType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.CAMERA"/> | |
<uses-feature android:name="android.hardware.camera" android:required="false"/> | |
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> | |
<uses-feature android:name="android.hardware.camera.front" android:required="false"/> | |
<uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Container _getListItemWidget(Map currency, MaterialColor color) { | |
// Returns a container widget that has a card child and a top margin of 5.0 | |
return new Container( | |
margin: const EdgeInsets.only(top: 5.0), | |
child: new Card( | |
child: _getListTile(currency, color), | |
), | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListTile _getListTile(Map currency, MaterialColor color) { | |
return new ListTile( | |
leading: _getLeadingWidget(currency['name'], color), | |
title: _getTitleWidget(currency['name']), | |
subtitle: _getSubtitleWidget( | |
currency['price_usd'], currency['percent_change_1h']), | |
isThreeLine: true, | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text _getTitleWidget(String currencyName) { | |
return new Text( | |
currencyName, | |
style: new TextStyle(fontWeight: FontWeight.bold), | |
); | |
} | |
Text _getSubtitleWidget(String priceUsd, String percentChange1h) { | |
return new Text('\$$priceUsd\n1 hour: $percentChange1h%'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Bitcoin", | |
"price_usd": "11525.7", | |
"percent_change_1h": "-0.18", | |
... | |
}, | |
... | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CircleAvatar _getLeadingWidget(String currencyName, MaterialColor color) { | |
return new CircleAvatar( | |
backgroundColor: color, | |
child: new Text(currencyName[0]), | |
); | |
} |