Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shunchaki
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shohboz Qoraboev
shunchaki
Commits
a7cfcb82
Commit
a7cfcb82
authored
Dec 07, 2021
by
shohboz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPD]
MUS-123
Feature, pin screen updated
parent
ae72f928
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
291 additions
and
67 deletions
+291
-67
PinAdapter.kt
app/src/main/java/uz/ssd/mobiuz/ui/auth/pin/PinAdapter.kt
+99
-0
PinFragment.kt
app/src/main/java/uz/ssd/mobiuz/ui/auth/pin/PinFragment.kt
+99
-0
fragment_pin.xml
app/src/main/res/layout/fragment_pin.xml
+47
-37
fragment_pin_dialog.xml
app/src/main/res/layout/fragment_pin_dialog.xml
+46
-30
No files found.
app/src/main/java/uz/ssd/mobiuz/ui/auth/PinAdapter.kt
→
app/src/main/java/uz/ssd/mobiuz/ui/auth/
pin/
PinAdapter.kt
View file @
a7cfcb82
package
uz.ssd.mobiuz.ui.auth
package
uz.ssd.mobiuz.ui.auth
.pin
import
android.view.LayoutInflater
import
android.view.ViewGroup
...
...
app/src/main/java/uz/ssd/mobiuz/ui/auth/PinFragment.kt
→
app/src/main/java/uz/ssd/mobiuz/ui/auth/
pin/
PinFragment.kt
View file @
a7cfcb82
package
uz.ssd.mobiuz.ui.auth
package
uz.ssd.mobiuz.ui.auth
.pin
import
android.os.Bundle
import
android.view.View
...
...
@@ -16,6 +16,7 @@ import uz.ssd.mobiuz.R
import
uz.ssd.mobiuz.databinding.FragmentPinBinding
import
uz.ssd.mobiuz.model.PinData
import
uz.ssd.mobiuz.model.SharedPref
import
uz.ssd.mobiuz.ui.auth.AuthViewModel
import
uz.ssd.mobiuz.ui.base.BaseFragment
import
uz.ssd.mobiuz.utils.Utils
import
javax.inject.Inject
...
...
@@ -31,7 +32,6 @@ class PinFragment : BaseFragment(R.layout.fragment_pin) {
private
val
data
=
ArrayList
<
PinData
>()
private
val
pinAdapter
=
PinAdapter
()
private
val
viewModel
:
AuthViewModel
by
viewModels
()
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
...
...
@@ -45,6 +45,9 @@ class PinFragment : BaseFragment(R.layout.fragment_pin) {
override
fun
setUpUI
()
{
bn
.
apply
{
loadData
()
toolbar
.
setNavigationOnClickListener
{
navController
.
navigateUp
()
}
rvPin
.
layoutManager
=
LinearLayoutManager
(
requireContext
(),
LinearLayoutManager
.
HORIZONTAL
,
false
)
rvPin
.
setHasFixedSize
(
true
)
...
...
app/src/main/res/layout/fragment_pin.xml
View file @
a7cfcb82
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
>
<com.google.android.material.appbar.MaterialToolbar
...
...
@@ -31,58 +31,60 @@
android:gravity=
"center"
>
<TextView
android:layout_width=
"wrap_content"
android:text=
"@string/pin_not_same"
android:id=
"@+id/txt_not_pin"
android:
visibility=
"gone
"
android:
textSize=
"@dimen/_10sdp
"
android:
layout_width=
"wrap_content
"
android:
layout_height=
"wrap_content
"
android:layout_gravity=
"top|center"
android:layout_marginTop=
"@dimen/_20sdp"
android:textStyle=
"bold"
android:layout_marginBottom=
"@dimen/_20sdp"
android:text=
"@string/pin_not_same"
android:textColor=
"@color/red"
android:layout_height=
"wrap_content"
/>
android:textSize=
"@dimen/_10sdp"
android:textStyle=
"bold"
android:visibility=
"gone"
/>
<com.google.android.material.card.MaterialCardView
android:layout_width=
"wrap_content"
android:id=
"@+id/card_pin"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
>
<androidx.recyclerview.widget.RecyclerView
android:layout_width=
"wrap_content
"
android:id=
"@+id/rv_pin
"
android:paddingVertical=
"@dimen/_8sdp
"
android:paddingHorizontal=
"@dimen/_6sdp
"
tools:listitem=
"@layout/item_pin
"
android:orientation=
"horizontal
"
tools:itemCount=
"4
"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager
"
android:layout_height=
"wrap_content"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_pin
"
android:layout_width=
"wrap_content
"
android:layout_height=
"wrap_content
"
android:orientation=
"horizontal
"
android:paddingHorizontal=
"@dimen/_6sdp
"
android:paddingVertical=
"@dimen/_8sdp
"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager
"
tools:itemCount=
"4
"
tools:listitem=
"@layout/item_pin"
/>
</com.google.android.material.card.MaterialCardView>
</FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/btn_view_group"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:id=
"@+id/btn_view_group"
android:layout_weight=
"3"
android:paddingHorizontal=
"@dimen/_48sdp"
>
<TextView
android:id=
"@+id/btn_1"
style=
"@style/BtnStyle"
android:text=
"@string/_1"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_1"
app:layout_constraintEnd_toStartOf=
"@id/btn_2"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/btn_2"
style=
"@style/BtnStyle"
android:
text=
"@string/_2
"
android:
layout_marginHorizontal=
"@dimen/_10sdp
"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_2"
app:layout_constraintEnd_toStartOf=
"@id/btn_3"
app:layout_constraintStart_toEndOf=
"@id/btn_1"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
@@ -90,61 +92,68 @@
<TextView
android:id=
"@+id/btn_3"
style=
"@style/BtnStyle"
android:text=
"@string/_3"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_3"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/btn_2"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/btn_4"
style=
"@style/BtnStyle"
android:layout_marginTop=
"@dimen/_16sdp"
android:text=
"@string/_4"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_4"
app:layout_constraintEnd_toStartOf=
"@id/btn_5"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/btn_1"
/>
<TextView
android:id=
"@+id/btn_5"
style=
"@style/BtnStyle"
android:
text=
"@string/_5
"
android:
layout_marginHorizontal=
"@dimen/_10sdp
"
android:background=
"@drawable/bgn_pin_btn"
app:layout_constraintEnd_toStartOf=
"@id/btn_3"
app:layout_constraintStart_toEndOf=
"@id/btn_1"
android:text=
"@string/_5"
app:layout_constraintEnd_toStartOf=
"@id/btn_6"
app:layout_constraintStart_toEndOf=
"@id/btn_4"
app:layout_constraintTop_toTopOf=
"@id/btn_4"
/>
<TextView
android:id=
"@+id/btn_6"
style=
"@style/BtnStyle"
android:text=
"@string/_6"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_6"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/btn_5"
app:layout_constraintTop_toTopOf=
"@id/btn_4"
/>
<TextView
android:id=
"@+id/btn_7"
style=
"@style/BtnStyle"
android:layout_marginTop=
"@dimen/_16sdp"
android:text=
"@string/_7"
android:background=
"@drawable/bgn_pin_btn"
app:layout_constraintStart_toStartOf=
"parent"
android:text=
"@string/_7"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/btn_8"
app:layout_constraintTop_toBottomOf=
"@id/btn_4"
/>
<TextView
android:id=
"@+id/btn_8"
style=
"@style/BtnStyle"
android:
text=
"@string/_8
"
android:
layout_marginHorizontal=
"@dimen/_10sdp
"
android:background=
"@drawable/bgn_pin_btn"
app:layout_constraintEnd_toStartOf=
"@id/btn_3"
app:layout_constraintStart_toEndOf=
"@id/btn_1"
android:text=
"@string/_8"
app:layout_constraintStart_toEndOf=
"@id/btn_7"
app:layout_constraintEnd_toStartOf=
"@id/btn_9"
app:layout_constraintTop_toTopOf=
"@id/btn_7"
/>
<TextView
android:id=
"@+id/btn_9"
style=
"@style/BtnStyle"
android:text=
"@string/_9"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_9"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/btn_8"
app:layout_constraintTop_toTopOf=
"@id/btn_7"
/>
...
...
@@ -152,8 +161,9 @@
android:id=
"@+id/btn_0"
style=
"@style/BtnStyle"
android:layout_marginTop=
"@dimen/_16sdp"
android:text=
"@string/_0"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_0"
app:layout_constraintEnd_toEndOf=
"@id/btn_8"
app:layout_constraintStart_toStartOf=
"@id/btn_8"
app:layout_constraintTop_toBottomOf=
"@id/btn_7"
/>
...
...
@@ -162,12 +172,12 @@
android:id=
"@+id/btn_remove"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:
padding=
"@dimen/_12sdp
"
android:
background=
"?selectableItemBackgroundBorderless
"
android:contentDescription=
"@string/remove"
android:padding=
"@dimen/_4sdp"
android:src=
"@drawable/ic_vector_remove"
android:background=
"?selectableItemBackgroundBorderless"
app:layout_constraintBottom_toBottomOf=
"@id/btn_0"
app:layout_constraintEnd_toEndOf=
"
parent
"
app:layout_constraintEnd_toEndOf=
"
@id/btn_9
"
app:layout_constraintStart_toStartOf=
"@id/btn_9"
app:layout_constraintTop_toTopOf=
"@id/btn_0"
/>
...
...
app/src/main/res/layout/fragment_pin_dialog.xml
View file @
a7cfcb82
...
...
@@ -40,19 +40,19 @@
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/card_pin"
android:layout_width=
"wrap_content"
android:minWidth=
"@dimen/_80sdp"
android:minHeight=
"@dimen/_25sdp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
>
android:layout_gravity=
"center"
android:minWidth=
"@dimen/_80sdp"
android:minHeight=
"@dimen/_25sdp"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_pin"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
android:layout_gravity=
"center"
android:paddingHorizontal=
"18dp"
android:layout_marginTop=
"2dp"
android:orientation=
"horizontal"
android:paddingHorizontal=
"18dp"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount=
"4"
tools:listitem=
"@layout/item_pin"
/>
...
...
@@ -68,22 +68,22 @@
<TextView
android:id=
"@+id/btn_1"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_1"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/btn_2"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/btn_2"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_2"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintEnd_toStartOf=
"@id/btn_3"
app:layout_constraintStart_toEndOf=
"@id/btn_1"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
@@ -91,22 +91,22 @@
<TextView
android:id=
"@+id/btn_3"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_3"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintStart_toEndOf=
"@id/btn_2"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/btn_2"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/btn_4"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:layout_marginTop=
"@dimen/_16sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_4"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintEnd_toStartOf=
"@id/btn_5"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/btn_1"
/>
...
...
@@ -114,10 +114,10 @@
<TextView
android:id=
"@+id/btn_5"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_5"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintEnd_toStartOf=
"@id/btn_3"
app:layout_constraintStart_toEndOf=
"@id/btn_1"
app:layout_constraintTop_toTopOf=
"@id/btn_4"
/>
...
...
@@ -125,22 +125,22 @@
<TextView
android:id=
"@+id/btn_6"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_6"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintStart_toEndOf=
"@id/btn_5"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/btn_5"
app:layout_constraintTop_toTopOf=
"@id/btn_4"
/>
<TextView
android:id=
"@+id/btn_7"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:layout_marginTop=
"@dimen/_16sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_7"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintEnd_toStartOf=
"@id/btn_8"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/btn_4"
/>
...
...
@@ -148,10 +148,10 @@
<TextView
android:id=
"@+id/btn_8"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_8"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintEnd_toStartOf=
"@id/btn_3"
app:layout_constraintStart_toEndOf=
"@id/btn_1"
app:layout_constraintTop_toTopOf=
"@id/btn_7"
/>
...
...
@@ -159,25 +159,25 @@
<TextView
android:id=
"@+id/btn_9"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_9"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintStart_toEndOf=
"@id/btn_8"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/btn_8"
app:layout_constraintTop_toTopOf=
"@id/btn_7"
/>
<TextView
android:id=
"@+id/btn_0"
style=
"@style/BtnStyle"
android:layout_width=
"@dimen/_48sdp"
android:layout_height=
"@dimen/_44sdp"
android:layout_marginTop=
"@dimen/_16sdp"
android:background=
"@drawable/bgn_pin_btn"
android:text=
"@string/_0"
android:layout_height=
"@dimen/_44sdp"
android:layout_width=
"@dimen/_48sdp"
app:layout_constraintStart_toStartOf=
"@id/btn_8"
app:layout_constraintTop_toBottomOf=
"@id/btn_
7
"
/>
app:layout_constraintTop_toBottomOf=
"@id/btn_
8
"
/>
<ImageView
...
...
@@ -193,6 +193,22 @@
app:layout_constraintStart_toEndOf=
"@id/btn_0"
app:layout_constraintTop_toTopOf=
"@id/btn_0"
/>
<TextView
android:id=
"@+id/with_password"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/_30sdp"
android:background=
"?android:selectableItemBackground"
android:text=
"Войти по паролю"
android:textColor=
"@color/red"
android:textSize=
"@dimen/_12sdp"
android:textStyle=
"bold"
android:paddingHorizontal=
"@dimen/_20sdp"
android:paddingVertical=
"@dimen/_10sdp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/btn_0"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment