Skip to content

Commit

Permalink
fb status
Browse files Browse the repository at this point in the history
  • Loading branch information
4rius committed Apr 9, 2024
1 parent 09e1270 commit def0921
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class MainActivity : AppCompatActivity() {

// Interfaz de la bottom sheet
val textViewDetails = bottomSheetView.findViewById<TextView>(R.id.textViewDetails)
val textViewFirebaseStatus = bottomSheetView.findViewById<TextView>(R.id.textViewFirebaseStatus)
val buttonConnect = bottomSheetView.findViewById<Button>(R.id.buttonConnect)
val buttonDisconnect = bottomSheetView.findViewById<Button>(R.id.buttonDisconnect)
val buttonMyKeys = bottomSheetView.findViewById<Button>(R.id.buttonMyKeys)
Expand All @@ -157,6 +158,13 @@ class MainActivity : AppCompatActivity() {
append(NetworkService.getStatus())
}

// Configuración del estado de Firebase
if (LogService.instance?.authenticated == true) {
textViewFirebaseStatus.text = getString(R.string.firebase_authenticated)
} else {
textViewFirebaseStatus.text = getString(R.string.firebase_not_authenticated)
}

// Configuración de los botones
buttonConnect.setOnClickListener {
bottomSheetDialog.dismiss()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LogService: Service() {

lateinit var id: String
lateinit var realtimeDatabase: FirebaseDatabase
private var authenticated = false
var authenticated = false

override fun onCreate() {
super.onCreate()
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/bottom_sheet_options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
android:textSize="16sp"
android:textStyle="italic" />

<TextView
android:id="@+id/textViewFirebaseStatus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/details_string"
android:textColor="@color/black"
android:textAlignment="center"
android:textSize="16sp"
android:textStyle="italic" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,6 @@
<string name="actions_done">All tasks were finished</string>
<string name="all_tasks_string">No tasks pending</string>
<string name="tasks_done">Tasks done: %1$s Tasks pending: %2$s</string>
<string name="firebase_authenticated">Firebase authenticated - Logging data to the RTDB</string>
<string name="firebase_not_authenticated">Firebase not authenticated - No logs will be sent to the RTDB</string>
</resources>

0 comments on commit def0921

Please sign in to comment.