-
Notifications
You must be signed in to change notification settings - Fork 0
/
HallMain.kt
41 lines (31 loc) · 1.15 KB
/
HallMain.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.example.iot_assignment
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView
import androidx.cardview.widget.CardView
class HallMain : AppCompatActivity() {
lateinit var module1: CardView
lateinit var module2: CardView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_hall_main)
val toolbar: TextView = findViewById(R.id.toolbar_title)
toolbar.setText("Smart Hall Module")
val back: ImageView = findViewById(R.id.arrow_back_icon)
back.setOnClickListener {
onBackPressed()
}
module1 = findViewById(R.id.module1)
module2 = findViewById(R.id.module2)
module1.setOnClickListener{
val intent = Intent(this, SmartLight::class.java)
startActivity(intent)
}
module2.setOnClickListener {
val intent = Intent(this, RoomLogin::class.java)
startActivity(intent)
}
}
}