Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
meser
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Muhammad Suryono
meser
Commits
b0435b7d
Commit
b0435b7d
authored
Sep 01, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
8d183400
041fcb0e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
412 additions
and
82 deletions
+412
-82
FormProductActivity.java
...rc/main/java/com/yono/messeripos/FormProductActivity.java
+16
-21
LoginActivity.java
app/src/main/java/com/yono/messeripos/LoginActivity.java
+178
-57
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+6
-3
gradient.xml
app/src/main/res/drawable/gradient.xml
+1
-1
ic_messer_primary.xml
app/src/main/res/drawable/ic_messer_primary.xml
+18
-0
ic_messer_white.xml
app/src/main/res/drawable/ic_messer_white.xml
+18
-0
dashboard_login.xml
app/src/main/res/layout/dashboard_login.xml
+69
-0
login_form.xml
app/src/main/res/layout/login_form.xml
+105
-0
colors.xml
app/src/main/res/values/colors.xml
+1
-0
No files found.
app/src/main/java/com/yono/messeripos/FormProductActivity.java
View file @
b0435b7d
...
...
@@ -181,37 +181,32 @@ public class FormProductActivity extends AppCompatActivity {
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
N
)
private
void
setSpinner
(
String
s
)
{
progressDialog
.
show
();
HashSet
<
String
>
set
=
new
HashSet
<>();
List
<
String
>
str
=
new
ArrayList
<>();
categoryModels
=
new
ArrayList
<>();
categoryModels
.
add
(
"SELECT CATEGORY"
);
str
.
add
(
"SELECT CATEGORY"
);
mainViewModels
.
getCategory
().
observe
(
this
,
listDataResponse
->
{
List
<
CategoryModels
>
cate
=
listDataResponse
.
getData
();
for
(
CategoryModels
cd:
cate
){
Log
.
i
(
"SPINNER"
,
"setSpinner: "
+
utils
.
convertGson
(
cd
.
getNameCategory
()));
progressDialog
.
dismiss
();
for
(
CategoryModels
cd:
listDataResponse
.
getData
()){
categoryModels
.
add
(
cd
.
getNameCategory
());
}
List
<
String
>
collect
=
categoryModels
.
stream
().
map
(
v
->
{
// Log.i("Spinner data", "onCreate: "+utils.convertGson(categoryModels));
});
List
<
HashSet
<
String
>>
collect
=
categoryModels
.
stream
().
map
(
v
->
{
if
(
set
.
add
(
v
)
==
true
)
{
set
.
add
(
v
);
str
.
add
(
v
);
}
return
set
;
return
v
;
}).
collect
(
Collectors
.
toList
());
Log
.
i
(
"SPINNER"
,
"setSpinner: "
+
utils
.
convertGson
(
collect
));
Log
.
i
(
"SPINNER"
,
"setSpinner: "
+
utils
.
convertGson
(
str
));
@SuppressLint
(
"ResourceType"
)
ArrayAdapter
<
String
>
dataAdapter
=
new
ArrayAdapter
<
String
>(
FormProductActivity
.
this
,
R
.
id
.
listCategory
,
categoryModels
);
R
.
id
.
listCategory
,
str
);
binding
.
listCategory
.
setAdapter
(
dataAdapter
);
progressDialog
.
dismiss
(
);
}
);
}
private
void
saveProduct
(){
...
...
app/src/main/java/com/yono/messeripos/LoginActivity.java
View file @
b0435b7d
This diff is collapsed.
Click to expand it.
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
b0435b7d
...
...
@@ -390,7 +390,6 @@ public class MainActivity extends AppCompatActivity {
categoryAdapter
.
setListener
(
new
CategoryAdapter
.
CategoryListener
()
{
@Override
public
void
onGetProduct
(
CategoryModels
categoryModels
)
{
progressDialog
.
show
();
Log
.
i
(
"diluar if"
,
"onGetProduct: "
+
selectCategory
);
if
(!
selectCategory
){
binding
.
rvProduct
.
setVisibility
(
View
.
GONE
);
...
...
@@ -400,14 +399,16 @@ public class MainActivity extends AppCompatActivity {
Log
.
i
(
"setelah if"
,
"onGetProduct: "
+
selectCategory
);
if
(
categoryModels
.
getIdCategory
()
==
0
){
progressDialog
.
show
();
if
(
mainViewModels
.
getProduct
().
getValue
().
getData
().
size
()
!=
0
){
selectCategory
=
false
;
mainViewModels
.
getProduct
().
observe
(
MainActivity
.
this
,
new
Observer
<
DataResponse
<
List
<
ProductModels
<
CategoryModels
>>>>()
{
@Override
public
void
onChanged
(
DataResponse
<
List
<
ProductModels
<
CategoryModels
>>>
listDataResponse
)
{
progressDialog
.
dismiss
();
productModelsArrayList
.
clear
();
productModelsArrayList
.
addAll
(
listDataResponse
.
getData
());
progressDialog
.
dismiss
();
binding
.
rvProduct
.
setVisibility
(
View
.
VISIBLE
);
binding
.
imgEmpty
.
setVisibility
(
View
.
GONE
);
productAdapter
.
setProduct
(
MainActivity
.
this
,
productModelsArrayList
);
...
...
@@ -422,14 +423,16 @@ public class MainActivity extends AppCompatActivity {
// binding.imgEmpty.bringToFront();
}
}
else
{
progressDialog
.
show
();
selectCategory
=
false
;
mainViewModels
.
getProductByCategory
(
categoryModels
.
getIdCategory
()).
observe
(
MainActivity
.
this
,
new
Observer
<
DataResponse
<
List
<
ProductModels
>>>()
{
@Override
public
void
onChanged
(
DataResponse
<
List
<
ProductModels
>>
listDataResponse
)
{
progressDialog
.
dismiss
();
if
(
listDataResponse
!=
null
)
{
productModelsArrayList
.
clear
();
productModelsArrayList
.
addAll
(
listDataResponse
.
getData
());
progressDialog
.
dismiss
();
showLoading
(
false
);
if
(
productModelsArrayList
.
isEmpty
())
{
binding
.
rvProduct
.
setVisibility
(
View
.
GONE
);
...
...
app/src/main/res/drawable/gradient.xml
View file @
b0435b7d
...
...
@@ -2,7 +2,7 @@
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item>
<shape>
<gradient
android:startColor=
"@color/colorPrimary"
android:
endColor=
"@color/colorPrimaryDark"
android:angle=
"90
"
/>
<gradient
android:startColor=
"@color/colorPrimary"
android:
centerColor=
"@color/colorPrimaryCenter"
android:endColor=
"@color/colorPrimaryDark"
android:angle=
"-90"
android:centerY=
"0.7
"
/>
</shape>
</item>
</selector>
\ No newline at end of file
app/src/main/res/drawable/ic_messer_primary.xml
0 → 100644
View file @
b0435b7d
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"64dp"
android:height=
"43dp"
android:viewportWidth=
"64"
android:viewportHeight=
"43"
>
<path
android:pathData=
"M8.5,36.682C13.1944,36.682 17,32.8764 17,28.182C17,23.4876 13.1944,19.682 8.5,19.682C3.8056,19.682 0,23.4876 0,28.182C0,32.8764 3.8056,36.682 8.5,36.682Z"
android:fillColor=
"@color/colorPrimary"
android:fillAlpha=
"0.87"
/>
<path
android:pathData=
"M59.6642,27.3332L40.9464,5.0349C38.6122,2.2542 34.4658,1.8922 31.6851,4.2264C28.9044,6.5606 28.5424,10.7071 30.8766,13.4878L49.5943,35.7861C51.9285,38.5668 56.075,38.9287 58.8557,36.5945C61.6364,34.2603 61.9984,30.1139 59.6642,27.3332Z"
android:fillColor=
"@color/colorPrimary"
android:fillAlpha=
"0.87"
/>
<path
android:pathData=
"M40.2832,29.2722L21.5654,6.9739C19.2312,4.1932 15.0848,3.8312 12.3041,6.1654C9.5234,8.4996 9.1614,12.6461 11.4956,15.4268L30.2133,37.7251C32.5475,40.5058 36.694,40.8677 39.4747,38.5335C42.2554,36.1993 42.6174,32.0529 40.2832,29.2722Z"
android:fillColor=
"@color/colorPrimary"
android:fillAlpha=
"0.87"
/>
</vector>
app/src/main/res/drawable/ic_messer_white.xml
0 → 100644
View file @
b0435b7d
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"64dp"
android:height=
"43dp"
android:viewportWidth=
"64"
android:viewportHeight=
"43"
>
<path
android:pathData=
"M8.5,36.682C13.1944,36.682 17,32.8764 17,28.182C17,23.4876 13.1944,19.682 8.5,19.682C3.8056,19.682 0,23.4876 0,28.182C0,32.8764 3.8056,36.682 8.5,36.682Z"
android:fillColor=
"#fff"
android:fillAlpha=
"0.87"
/>
<path
android:pathData=
"M59.6642,27.3332L40.9464,5.0349C38.6122,2.2542 34.4658,1.8922 31.6851,4.2264C28.9044,6.5606 28.5424,10.7071 30.8766,13.4878L49.5943,35.7861C51.9285,38.5668 56.075,38.9287 58.8557,36.5945C61.6364,34.2603 61.9984,30.1139 59.6642,27.3332Z"
android:fillColor=
"#fff"
android:fillAlpha=
"0.87"
/>
<path
android:pathData=
"M40.2832,29.2722L21.5654,6.9739C19.2312,4.1932 15.0848,3.8312 12.3041,6.1654C9.5234,8.4996 9.1614,12.6461 11.4956,15.4268L30.2133,37.7251C32.5475,40.5058 36.694,40.8677 39.4747,38.5335C42.2554,36.1993 42.6174,32.0529 40.2832,29.2722Z"
android:fillColor=
"#fff"
android:fillAlpha=
"0.87"
/>
</vector>
app/src/main/res/layout/dashboard_login.xml
0 → 100644
View file @
b0435b7d
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:background=
"@drawable/gradient"
xmlns:android=
"http://schemas.android.com/apk/res/android"
tools:context=
".LoginActivity"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingHorizontal=
"20dp"
android:paddingVertical=
"25dp"
>
<ImageView
android:id=
"@+id/messerLogoDashboardLogin"
android:layout_width=
"215dp"
android:layout_height=
"215dp"
android:src=
"@drawable/ic_messer_white"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"50dp"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"messer"
android:textSize=
"30dp"
android:fontFamily=
"@font/poppins_bold"
android:textStyle=
"bold"
android:textColor=
"@color/colorWhite"
android:layout_below=
"@id/messerLogoDashboardLogin"
android:layout_centerHorizontal=
"true"
/>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/signUpButtonDashboardLogin"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
style=
"?attr/materialButtonOutlinedStyle"
app:strokeColor=
"#fff"
android:text=
"sign up"
android:textStyle=
"bold"
android:textColor=
"#fff"
app:strokeWidth=
"2dp"
app:rippleColor=
"@color/colorWhite"
android:padding=
"20dp"
app:cornerRadius=
"5dp"
android:layout_above=
"@id/signInButtonDashboardLogin"
android:layout_marginBottom=
"10dp"
/>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/signInButtonDashboardLogin"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:backgroundTint=
"@color/colorWhite"
android:layout_alignParentBottom=
"true"
android:padding=
"20dp"
android:text=
"sign in"
android:textStyle=
"bold"
app:rippleColor=
"#A8A8A8"
app:cornerRadius=
"5dp"
android:textColor=
"@color/colorPrimary"
/>
</RelativeLayout>
<include
layout=
"@layout/login_form"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
app/src/main/res/layout/login_form.xml
0 → 100644
View file @
b0435b7d
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/ConstraintLoginLayout"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:orientation=
"vertical"
android:layout_gravity=
"bottom"
app:behavior_hideable=
"false"
android:padding=
"20dp"
style=
"@style/Widget.Rounded.BottomSheet"
app:behavior_peekHeight=
"0dp"
android:background=
"@color/colorWhite"
app:layout_behavior=
"com.google.android.material.bottomsheet.BottomSheetBehavior"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageButton
android:id=
"@+id/closeBtnLogin"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:src=
"@drawable/ic_baseline_plus_24"
android:scaleType=
"centerInside"
android:adjustViewBounds=
"true"
android:padding=
"50dp"
android:backgroundTint=
"@android:color/transparent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
<ImageView
android:id=
"@+id/messerLogoInLogin"
android:layout_width=
"215dp"
android:layout_height=
"215dp"
android:src=
"@drawable/ic_messer_primary"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/closeBtnLogin"
/>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/formUsernameLogin"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/username"
app:layout_constraintTop_toBottomOf=
"@id/messerLogoInLogin"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/FormPasswordLogin"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/password"
app:layout_constraintTop_toBottomOf=
"@id/formUsernameLogin"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</com.google.android.material.textfield.TextInputLayout>
<CheckBox
android:id=
"@+id/CBRememberMe"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Remember Me"
android:textColor=
"@color/colorPrimary"
app:layout_constraintTop_toBottomOf=
"@id/FormPasswordLogin"
app:layout_constraintStart_toStartOf=
"parent"
app:useMaterialThemeColors=
"true"
/>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/SignInButtonInLogin"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/CBRememberMe"
android:text=
"Sign In"
android:padding=
"20dp"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Forgot Password?"
app:layout_constraintTop_toBottomOf=
"@id/SignInButtonInLogin"
app:layout_constraintEnd_toEndOf=
"parent"
android:layout_marginTop=
"10dp"
android:textColor=
"@color/colorPrimary"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
b0435b7d
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"colorPrimary"
>
#4d089a
</color>
<color
name=
"colorPrimaryCenter"
>
#4021B9
</color>
<color
name=
"colorPrimaryDark"
>
#323edd
</color>
<color
name=
"colorAccent"
>
#dc2ade
</color>
<color
name=
"colorAccentDark"
>
#e8f044
</color>
...
...
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