Skip to content

Commit

Permalink
Generify connecting to Bluup GATT device
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Aug 17, 2023
1 parent c996ee3 commit 55479f7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
applicationId 'com.hiddenramblings.tagmo'
minSdkVersion 16
targetSdkVersion 34
versionName "4.0.1"
versionName "4.0.2"
versionCode = versionName.replace(".","").toInteger() * 10

vectorDrawables {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,19 +606,7 @@ open class GattSlotFragment : Fragment(), GattSlotAdapter.OnAmiiboClickListener,
item.findViewById<TextView>(R.id.device_address).text =
requireActivity().getString(R.string.device_address, device.address)

item.findViewById<View>(R.id.connect_flask).run {
setOnClickListener {
deviceDialog.dismiss()
deviceProfile = device.name
deviceAddress = device.address
deviceType = detectedType
dismissGattDiscovery()
showConnectionNotice()
startBluupService()
}
}

item.findViewById<View>(R.id.connect_slide).run {
item.findViewById<View>(R.id.connect_bluup).run {
setOnClickListener {
deviceDialog.dismiss()
deviceProfile = device.name
Expand Down
19 changes: 2 additions & 17 deletions app/src/main/res/layout/device_bluetooth.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,12 @@
android:layout_marginTop="2dp">

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/connect_flask"
android:id="@+id/connect_bluup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="14sp"
android:text="@string/device_flask" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/connect_slide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="14sp"
android:text="@string/device_slide" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="2dp">
android:text="@string/device_bluup" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/connect_pixl"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<string name="elite_amiiqo" translatable="false">N2 Elite / Amiiqo</string>
<string name="gatt_title" translatable="false">Bluetooth</string>

<string name="device_bluup" translatable="false">Bluup</string>
<string name="device_flask" translatable="false">Flask</string>
<string name="device_slide" translatable="false">Slide</string>
<string name="device_puck" translatable="false">Puck.js</string>
Expand Down

0 comments on commit 55479f7

Please sign in to comment.