-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backup all files - Forgot what changes I made
- Loading branch information
Showing
6 changed files
with
103 additions
and
54 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
68 changes: 34 additions & 34 deletions
68
android/app/src/main/java/com/example/proxyauth/MainActivity.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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
package com.example.proxyauth | ||
|
||
import android.os.Bundle | ||
import com.google.android.material.bottomnavigation.BottomNavigationView | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.navigation.findNavController | ||
import androidx.navigation.ui.AppBarConfiguration | ||
import androidx.navigation.ui.setupActionBarWithNavController | ||
import androidx.navigation.ui.setupWithNavController | ||
import com.example.proxyauth.databinding.ActivityMainBinding | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
private lateinit var binding: ActivityMainBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
binding = ActivityMainBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
val navView: BottomNavigationView = binding.navView | ||
|
||
val navController = findNavController(R.id.nav_host_fragment_activity_main) | ||
// Passing each menu ID as a set of Ids because each | ||
// menu should be considered as top level destinations. | ||
val appBarConfiguration = AppBarConfiguration( | ||
setOf( | ||
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications | ||
) | ||
) | ||
setupActionBarWithNavController(navController, appBarConfiguration) | ||
navView.setupWithNavController(navController) | ||
} | ||
package com.example.proxyauth | ||
|
||
import android.os.Bundle | ||
import com.google.android.material.bottomnavigation.BottomNavigationView | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.navigation.findNavController | ||
import androidx.navigation.ui.AppBarConfiguration | ||
import androidx.navigation.ui.setupActionBarWithNavController | ||
import androidx.navigation.ui.setupWithNavController | ||
import com.example.proxyauth.databinding.ActivityMainBinding | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
private lateinit var binding: ActivityMainBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
binding = ActivityMainBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
val navView: BottomNavigationView = binding.navView | ||
|
||
val navController = findNavController(R.id.nav_host_fragment_activity_main) | ||
// Passing each menu ID as a set of Ids because each | ||
// menu should be considered as top level destinations. | ||
val appBarConfiguration = AppBarConfiguration( | ||
setOf( | ||
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications | ||
) | ||
) | ||
setupActionBarWithNavController(navController, appBarConfiguration) | ||
navView.setupWithNavController(navController) | ||
} | ||
} |
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
17 changes: 7 additions & 10 deletions
17
android/app/src/main/java/com/example/proxyauth/ui/home/HomeViewModel.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 |
---|---|---|
@@ -1,23 +1,20 @@ | ||
package com.example.proxyauth.ui.home | ||
|
||
import android.bluetooth.BluetoothAdapter | ||
import android.bluetooth.BluetoothDevice | ||
import android.util.Log | ||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
|
||
|
||
class HomeViewModel : ViewModel() { | ||
|
||
private val _text = MutableLiveData<String>().apply { | ||
value = "This is home Fragment" | ||
} | ||
private val trustedDevices : ArrayList<String> = ArrayList () | ||
/* | ||
* Fetch all the devices that are trusted and connected | ||
*/ | ||
fun fetchDeviceList() : ArrayList<String> { | ||
trustedDevices.add("device 1") | ||
trustedDevices.add("device 2") | ||
Log.i("test", trustedDevices.toString()) | ||
return trustedDevices | ||
fun fetchDeviceList(bluetoothAdapter: BluetoothAdapter?) : ArrayList<BluetoothDevice> { | ||
var list: ArrayList<BluetoothDevice> = ArrayList<BluetoothDevice>() | ||
list.addAll(bluetoothAdapter?.bondedDevices as Set<BluetoothDevice>) | ||
return list | ||
} | ||
} |
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