-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow users to use other badges
- Loading branch information
1 parent
64350b0
commit 3ed2caa
Showing
16 changed files
with
153 additions
and
56 deletions.
There are no files selected for viewing
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
8 changes: 0 additions & 8 deletions
8
android/src/main/java/org/fossasia/badgemagic/core/bluetooth/Constants.kt
This file was deleted.
Oops, something went wrong.
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
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
14 changes: 14 additions & 0 deletions
14
android/src/main/java/org/fossasia/badgemagic/data/badge/Badges.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.fossasia.badgemagic.data.badge | ||
|
||
import java.util.UUID | ||
|
||
enum class Badges(val device: DeviceID) { | ||
LSLED(DeviceID( | ||
UUID.fromString("0000fee0-0000-1000-8000-00805f9b34fb"), | ||
UUID.fromString("0000fee1-0000-1000-8000-00805f9b34fb") | ||
)), | ||
VBLAB(DeviceID( | ||
UUID.fromString("0000fff0-0000-1000-8000-00805f9b34fb"), | ||
UUID.fromString("0000fff1-0000-1000-8000-00805f9b34fb") | ||
)); | ||
} |
5 changes: 5 additions & 0 deletions
5
android/src/main/java/org/fossasia/badgemagic/data/badge/DeviceID.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.fossasia.badgemagic.data.badge | ||
|
||
import java.util.UUID | ||
|
||
data class DeviceID(val serviceID: UUID, val characteristicsID: UUID) |
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
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
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
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
13 changes: 13 additions & 0 deletions
13
android/src/main/java/org/fossasia/badgemagic/util/BadgeUtils.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.fossasia.badgemagic.util | ||
|
||
import org.fossasia.badgemagic.data.badge.Badges | ||
import org.fossasia.badgemagic.data.badge.DeviceID | ||
import org.koin.core.KoinComponent | ||
import org.koin.core.inject | ||
|
||
class BadgeUtils : KoinComponent { | ||
private val prefUtils: PreferenceUtils by inject() | ||
|
||
val currentDevice: DeviceID | ||
get() = Badges.valueOf(prefUtils.selectedBadge).device | ||
} |
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
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
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
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
Oops, something went wrong.