Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NewParkAPP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YONG-LIN SU
NewParkAPP
Commits
041d8677
Commit
041d8677
authored
Jan 12, 2024
by
YONG-LIN SU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正權限錯誤
parent
6b1dd5e3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
ConvertBindingAdapter.java
...com/android/newparkapp/adapter/ConvertBindingAdapter.java
+3
-0
T02StartActivity.java
...n/java/ecom/android/newparkapp/view/T02StartActivity.java
+2
-1
BlueToothPortViewModel.java
.../android/newparkapp/viewModel/BlueToothPortViewModel.java
+5
-0
No files found.
app/src/main/java/ecom/android/newparkapp/adapter/ConvertBindingAdapter.java
View file @
041d8677
...
@@ -30,6 +30,9 @@ public class ConvertBindingAdapter {
...
@@ -30,6 +30,9 @@ public class ConvertBindingAdapter {
public
static
void
BlueToothStatus2String
(
TextView
textView
,
BlueToothViewModel
.
BlueToothStatus
blueToothStatus
){
public
static
void
BlueToothStatus2String
(
TextView
textView
,
BlueToothViewModel
.
BlueToothStatus
blueToothStatus
){
String
message
=
""
;
String
message
=
""
;
int
colorCode
=
Color
.
BLACK
;
int
colorCode
=
Color
.
BLACK
;
if
(
blueToothStatus
==
null
){
blueToothStatus
=
BlueToothViewModel
.
BlueToothStatus
.
INIT
;
}
switch
(
blueToothStatus
){
switch
(
blueToothStatus
){
case
INIT:
case
INIT:
message
=
"尚未連接"
;
message
=
"尚未連接"
;
...
...
app/src/main/java/ecom/android/newparkapp/view/T02StartActivity.java
View file @
041d8677
package
ecom
.
android
.
newparkapp
.
view
;
package
ecom
.
android
.
newparkapp
.
view
;
import
static
android
.
Manifest
.
permission
.
BLUETOOTH_ADVERTISE
;
import
static
android
.
Manifest
.
permission
.
BLUETOOTH_CONNECT
;
import
static
android
.
Manifest
.
permission
.
BLUETOOTH_CONNECT
;
import
static
android
.
Manifest
.
permission
.
BLUETOOTH_SCAN
;
import
static
android
.
Manifest
.
permission
.
BLUETOOTH_SCAN
;
...
@@ -79,7 +80,7 @@ public class T02StartActivity extends AppCompatActivity {
...
@@ -79,7 +80,7 @@ public class T02StartActivity extends AppCompatActivity {
private
ArrayAdapter
<
String
>
deviceNameArrayAdapter
;
private
ArrayAdapter
<
String
>
deviceNameArrayAdapter
;
private
MutableLiveData
<
Boolean
>
hasPermissions
=
new
MutableLiveData
<>();
private
MutableLiveData
<
Boolean
>
hasPermissions
=
new
MutableLiveData
<>();
private
String
[]
bluetoothPermissions
=
new
String
[]{
BLUETOOTH_
CONNECT
,
BLUETOOTH_SCAN
};
private
String
[]
bluetoothPermissions
=
new
String
[]{
BLUETOOTH_
SCAN
,
BLUETOOTH_CONNECT
,
BLUETOOTH_ADVERTISE
};
private
ActivityResultLauncher
vehicleTypeResultLauncher
;
private
ActivityResultLauncher
vehicleTypeResultLauncher
;
private
ActivityResultLauncher
spaceResultLauncher
;
private
ActivityResultLauncher
spaceResultLauncher
;
...
...
app/src/main/java/ecom/android/newparkapp/viewModel/BlueToothPortViewModel.java
View file @
041d8677
package
ecom
.
android
.
newparkapp
.
viewModel
;
package
ecom
.
android
.
newparkapp
.
viewModel
;
import
static
android
.
Manifest
.
permission
.
BLUETOOTH_ADVERTISE
;
import
static
android
.
Manifest
.
permission
.
BLUETOOTH_CONNECT
;
import
static
android
.
Manifest
.
permission
.
BLUETOOTH_SCAN
;
import
android.app.Activity
;
import
android.app.Application
;
import
android.app.Application
;
import
android.bluetooth.BluetoothAdapter
;
import
android.bluetooth.BluetoothAdapter
;
import
android.bluetooth.BluetoothDevice
;
import
android.bluetooth.BluetoothDevice
;
...
...
Write
Preview
Markdown
is supported
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