Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andy B-S
Companion App Android
Commits
a5a016e2
Commit
a5a016e2
authored
Aug 23, 2019
by
Stefan Zabka
Browse files
ble: personal status fixing all of the bugs
parent
abfee43a
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/de/ccc/events/badge/card10/mood/MoodFragment.kt
View file @
a5a016e2
...
@@ -41,19 +41,19 @@ class MoodFragment : Fragment() {
...
@@ -41,19 +41,19 @@ class MoodFragment : Fragment() {
}
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
mood_c
ongres
s
.
setOnClickListener
{
mood_c
hao
s
.
setOnClickListener
{
card10Service
?.
setPersonalState
(
PersonalState
.
CHAOS
)
card10Service
?.
setPersonalState
(
PersonalState
.
CHAOS
)
}
}
mood_c
haos
.
setOnClickListener
{
mood_c
ommunication
.
setOnClickListener
{
card10Service
?.
setPersonalState
(
PersonalState
.
COMMUNICATION
)
card10Service
?.
setPersonalState
(
PersonalState
.
COMMUNICATION
)
}
}
mood_c
ongress
.
setOnClickListener
{
mood_c
amp
.
setOnClickListener
{
card10Service
?.
setPersonalState
(
PersonalState
.
CAMP
)
card10Service
?.
setPersonalState
(
PersonalState
.
CAMP
)
}
}
no_contact
.
setOnClickListener
{
no_contact
.
setOnClickListener
{
card10Service
?.
setPersonalState
(
PersonalState
.
NO_CONTACT
)
card10Service
?.
setPersonalState
(
PersonalState
.
NO_CONTACT
)
}
}
no_
contact
.
setOnClickListener
{
no_
state
.
setOnClickListener
{
card10Service
?.
setPersonalState
(
PersonalState
.
NONE
)
card10Service
?.
setPersonalState
(
PersonalState
.
NONE
)
}
}
}
}
...
...
app/src/main/java/de/ccc/events/badge/card10/time/Card10Service.kt
View file @
a5a016e2
...
@@ -63,8 +63,8 @@ class Card10Service(
...
@@ -63,8 +63,8 @@ class Card10Service(
fun
setPersonalState
(
value
:
PersonalState
)
{
fun
setPersonalState
(
value
:
PersonalState
)
{
personalStateCharacteristic
.
value
=
ByteArray
(
2
)
personalStateCharacteristic
.
value
=
ByteArray
(
2
)
personalStateCharacteristic
.
value
[
0
]
=
value
.
v
.
toByte
()
personalStateCharacteristic
.
value
[
1
]
=
value
.
v
.
toByte
()
personalStateCharacteristic
.
value
[
1
]
=
(
value
.
v
shr
8
).
toByte
()
personalStateCharacteristic
.
value
[
0
]
=
(
value
.
v
shr
8
).
toByte
()
println
(
"=== Writing personal State array : ${personalStateCharacteristic.value[0]},${personalStateCharacteristic.value[1]} "
)
println
(
"=== Writing personal State array : ${personalStateCharacteristic.value[0]},${personalStateCharacteristic.value[1]} "
)
ConnectionService
.
writeCharacteristic
(
personalStateCharacteristic
)
ConnectionService
.
writeCharacteristic
(
personalStateCharacteristic
)
}
}
...
...
app/src/main/res/layout/mood_fragment.xml
View file @
a5a016e2
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
android:text=
"@string/chaos"
/>
android:text=
"@string/chaos"
/>
<Button
android:id=
"@+id/mood_communication"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
<Button
android:id=
"@+id/mood_communication"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/communication"
/>
android:text=
"@string/communication"
/>
<Button
android:id=
"@+id/mood_c
ongress
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
<Button
android:id=
"@+id/mood_c
amp
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/c
ongress
"
/>
android:text=
"@string/c
amp
"
/>
<Button
android:id=
"@+id/no_contact"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
<Button
android:id=
"@+id/no_contact"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/no_contact"
/>
android:text=
"@string/no_contact"
/>
<Button
android:id=
"@+id/no_state"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
<Button
android:id=
"@+id/no_state"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/values/strings.xml
View file @
a5a016e2
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<string
name=
"personal_state"
>
Personal State
</string>
<string
name=
"personal_state"
>
Personal State
</string>
<string
name=
"chaos"
>
Chaos
</string>
<string
name=
"chaos"
>
Chaos
</string>
<string
name=
"communication"
>
Communication
</string>
<string
name=
"communication"
>
Communication
</string>
<string
name=
"c
ongress"
>
Congress
</string>
<string
name=
"c
amp"
>
Camp
</string>
<string
name=
"no_contact"
>
No Contact
</string>
<string
name=
"no_contact"
>
No Contact
</string>
<string
name=
"off"
>
Off
</string>
<string
name=
"off"
>
Off
</string>
</resources>
</resources>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment