qr-basic-admin-scrollview(luche), no mne ploho
This commit is contained in:
parent
cc1628c733
commit
0c722d75cf
@ -7,4 +7,6 @@ data class PersonInfoDto(
|
||||
val photo: String,
|
||||
val position: String,
|
||||
val lastVisit: String,
|
||||
val role: String,
|
||||
val isBanned: Boolean
|
||||
)
|
||||
|
@ -108,6 +108,12 @@ class MainFragment: Fragment(R.layout.fragment_main) {
|
||||
if (state.photo.isNotEmpty()) {
|
||||
picasso.load(state.photo).into(binding.photo)
|
||||
}
|
||||
if (state.isBanned){
|
||||
binding.scan.visibility = View.VISIBLE
|
||||
}
|
||||
if (state.role == "ADMIN"){
|
||||
binding.admin.visibility = View.VISIBLE
|
||||
}
|
||||
binding.fullname.text = state.fullName
|
||||
binding.position.text = state.position
|
||||
binding.lastEntry.text = state.lastVisit
|
||||
|
@ -5,5 +5,7 @@ data class MainState(
|
||||
val photo: String = "",
|
||||
val position: String = "",
|
||||
val lastVisit: String = "",
|
||||
val role: String = "",
|
||||
val isBanned: Boolean = false,
|
||||
val error: String? = null
|
||||
)
|
||||
|
@ -52,6 +52,8 @@ class MainViewModel @Inject constructor(
|
||||
photo = personInfo.photo,
|
||||
position = personInfo.position,
|
||||
lastVisit = dfo.format(dfi.parse(personInfo.lastVisit)!!),
|
||||
role = personInfo.role,
|
||||
isBanned = personInfo.isBanned,
|
||||
error = null
|
||||
)
|
||||
}
|
||||
|
17
app/src/main/res/drawable/button.xml
Normal file
17
app/src/main/res/drawable/button.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/purple_500"/>
|
||||
<!-- <stroke android:width="1dip" android:color="@color/purple_700"/>-->
|
||||
<corners
|
||||
android:radius="15dp"
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:bottomRightRadius="15dp"
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp"
|
||||
/>
|
||||
|
||||
<padding android:bottom="10dip"
|
||||
android:left="10dip"
|
||||
android:right="10dip"
|
||||
android:top="10dip"/>
|
||||
</shape>
|
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/purple_500"/>
|
||||
<!-- <stroke android:width="1dip" android:color="@color/purple_700"/>-->
|
||||
<solid android:color="@color/app_background"/>
|
||||
<!-- <stroke android:width="1dip" android:color="@color/purple_700"/>-->
|
||||
<corners
|
||||
android:radius="15dp"
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:bottomRightRadius="15dp"
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp"
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp"
|
||||
android:topLeftRadius="40dp"
|
||||
android:topRightRadius="40dp"
|
||||
/>
|
||||
|
||||
<padding android:bottom="10dip"
|
||||
|
@ -23,7 +23,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="10sp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/entry"
|
||||
android:background="@drawable/button"
|
||||
android:text="Refresh"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.503"
|
||||
@ -35,15 +35,16 @@
|
||||
android:layout_width="256dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="10sp"
|
||||
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_weight="10"
|
||||
android:background="@drawable/entry"
|
||||
android:background="@drawable/button"
|
||||
android:text="Scan QR"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.503"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/refresh" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/refresh"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/position"
|
||||
@ -66,7 +67,7 @@
|
||||
|
||||
android:layout_margin="10sp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/entry"
|
||||
android:background="@drawable/button"
|
||||
android:text="LOGOUT"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.503"
|
||||
@ -91,9 +92,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10sp"
|
||||
android:background="@drawable/entry"
|
||||
android:background="@drawable/button"
|
||||
android:text="admin"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/photo"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.603"
|
||||
@ -121,7 +122,7 @@
|
||||
android:layout_width="251dp"
|
||||
android:layout_height="58dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:background="@drawable/entry"
|
||||
android:background="@drawable/button"
|
||||
android:paddingTop="15sp"
|
||||
android:paddingBottom="15sp"
|
||||
android:text="Ваши проходы"
|
||||
@ -141,7 +142,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10sp"
|
||||
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.501"
|
||||
@ -153,7 +153,7 @@
|
||||
android:layout_width="0sp"
|
||||
android:layout_height="0sp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@color/app_background"
|
||||
android:background="@drawable/entry"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@ -171,7 +171,8 @@
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="185dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/entry"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/button"
|
||||
android:paddingTop="15sp"
|
||||
android:paddingBottom="15sp"
|
||||
android:text="Ваши проходы"
|
||||
|
Loading…
x
Reference in New Issue
Block a user