-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
299 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
31 changes: 31 additions & 0 deletions
31
app/src/main/java/com/example/chiecnonkydieu/ui/admin/HomeAdminActivity.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.example.chiecnonkydieu.ui.admin | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.activity.enableEdgeToEdge | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.core.view.ViewCompat | ||
import androidx.core.view.WindowInsetsCompat | ||
import com.example.chiecnonkydieu.R | ||
import com.example.chiecnonkydieu.databinding.ActivityHomeAdminBinding | ||
|
||
class HomeAdminActivity : AppCompatActivity() { | ||
private lateinit var binding: ActivityHomeAdminBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
enableEdgeToEdge() | ||
binding = ActivityHomeAdminBinding.inflate(layoutInflater) | ||
val view = binding.root | ||
setContentView(view) | ||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.admin_main)) { v, insets -> | ||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) | ||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) | ||
insets | ||
} | ||
binding.btnThemCauHoi.setOnClickListener { | ||
val intent = Intent(this, AddQuestionActivity::class.java) | ||
startActivity(intent) | ||
} | ||
} | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
app/src/main/java/com/example/chiecnonkydieu/ui/admin/LoginActivity.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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.example.chiecnonkydieu.ui.admin | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.activity.enableEdgeToEdge | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.core.view.ViewCompat | ||
import androidx.core.view.WindowInsetsCompat | ||
import com.example.chiecnonkydieu.MainActivity | ||
import com.example.chiecnonkydieu.R | ||
import com.example.chiecnonkydieu.databinding.ActivityLoginBinding | ||
import com.example.chiecnonkydieu.databinding.ActivityPlayingRoomBinding | ||
import com.example.chiecnonkydieu.ui.wheel.WheelActivity | ||
|
||
class LoginActivity : AppCompatActivity() { | ||
|
||
private lateinit var binding: ActivityLoginBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
enableEdgeToEdge() | ||
binding = ActivityLoginBinding.inflate(layoutInflater) | ||
val view = binding.root | ||
setContentView(view) | ||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> | ||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) | ||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) | ||
insets | ||
} | ||
|
||
binding.btnDangNhap.setOnClickListener { | ||
if (binding.edtTaikhoan.text.toString() == "admin") { | ||
val intent: Intent = Intent(this, HomeAdminActivity::class.java) | ||
startActivity(intent) | ||
} | ||
else { | ||
val intent: Intent = Intent(this, MainActivity::class.java) | ||
startActivity(intent) | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/admin_main" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@drawable/purple_gradient" | ||
tools:context=".MainActivity"> | ||
|
||
<ImageView | ||
android:id="@+id/img_logo" | ||
android:layout_width="150dp" | ||
android:layout_height="150dp" | ||
android:layout_marginTop="30dp" | ||
android:contentDescription="@string/wheel_logo" | ||
android:src="@drawable/ic_wheel" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/tv_title" | ||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked" | ||
android:layout_marginTop="20dp" | ||
android:text="ADMIN" | ||
android:textSize="30sp" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/img_logo" /> | ||
|
||
|
||
<com.google.android.material.button.MaterialButton | ||
android:id="@+id/btn_taoPhong" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/tao_nft" | ||
android:backgroundTint="@color/orange" | ||
android:elevation="30dp" | ||
android:stateListAnimator="@null" | ||
android:textColor="@color/black" | ||
android:textSize="25sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/tv_title" /> | ||
|
||
|
||
<com.google.android.material.button.MaterialButton | ||
android:id="@+id/btn_themCauHoi" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/btn_taoCauHoi" | ||
android:backgroundTint="@color/orange" | ||
android:elevation="30dp" | ||
android:stateListAnimator="@null" | ||
android:textColor="@color/black" | ||
android:textSize="25sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/btn_taoPhong" /> | ||
|
||
<ImageView | ||
android:id="@+id/img_wheel" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="30dp" | ||
android:contentDescription="@string/wheel_logo" | ||
android:src="@drawable/ic_roulette" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/btn_taoPhong" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/main" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/blue_200" | ||
tools:context=".ui.admin.LoginActivity"> | ||
|
||
<ImageView | ||
android:id="@+id/img_logo" | ||
android:layout_width="150dp" | ||
android:layout_height="150dp" | ||
android:layout_marginTop="30dp" | ||
android:contentDescription="@string/wheel_logo" | ||
android:src="@drawable/ic_wheel" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_title" | ||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="20dp" | ||
android:text="@string/app_title" | ||
android:textSize="30sp" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/img_logo" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_taiKhoan" | ||
style="@style/TextAppearance.AppCompat.Large" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="10dp" | ||
android:text="@string/title_taikhoan" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/tv_title" /> | ||
|
||
<com.google.android.material.textfield.TextInputLayout | ||
android:id="@+id/til_taiKhoan" | ||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginEnd="20dp" | ||
android:hint="@string/title_taikhoan" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/tv_taiKhoan"> | ||
|
||
<com.google.android.material.textfield.TextInputEditText | ||
android:id="@+id/edt_taikhoan" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:inputType="textPersonName" | ||
android:maxLines="1" /> | ||
</com.google.android.material.textfield.TextInputLayout> | ||
|
||
<TextView | ||
android:id="@+id/tv_matKhau" | ||
style="@style/TextAppearance.AppCompat.Large" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="10dp" | ||
android:text="@string/title_matKhau" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/til_taiKhoan" /> | ||
|
||
<com.google.android.material.textfield.TextInputLayout | ||
android:id="@+id/til_matKhau" | ||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginEnd="20dp" | ||
android:hint="@string/title_matKhau" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/tv_matKhau"> | ||
|
||
<com.google.android.material.textfield.TextInputEditText | ||
android:id="@+id/edt_matKhau" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:inputType="textPersonName" | ||
android:maxLines="1" /> | ||
</com.google.android.material.textfield.TextInputLayout> | ||
|
||
<com.google.android.material.button.MaterialButton | ||
android:id="@+id/btn_dangNhap" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/btn_dangNhap" | ||
android:backgroundTint="@color/orange" | ||
android:elevation="30dp" | ||
android:stateListAnimator="@null" | ||
android:textColor="@color/black" | ||
android:textSize="25sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/til_matKhau" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
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