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
d365a966
Commit
d365a966
authored
Sep 02, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Plain Diff
fix merge
parents
b26227e7
0499afd4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
385 additions
and
49 deletions
+385
-49
misc.xml
.idea/misc.xml
+1
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-0
BottomSheets.java
app/src/main/java/com/yono/messeripos/BottomSheets.java
+4
-4
LoginActivity.java
app/src/main/java/com/yono/messeripos/LoginActivity.java
+95
-7
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+0
-2
PaymentActivity.java
app/src/main/java/com/yono/messeripos/PaymentActivity.java
+8
-8
RegisterActivity.java
app/src/main/java/com/yono/messeripos/RegisterActivity.java
+14
-0
ic_close.xml
app/src/main/res/drawable/ic_close.xml
+10
-0
activity_login_m.xml
app/src/main/res/layout/activity_login_m.xml
+10
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+5
-13
activity_register.xml
app/src/main/res/layout/activity_register.xml
+9
-0
appbar_dashboard.xml
app/src/main/res/layout/appbar_dashboard.xml
+1
-0
dashboard_login.xml
app/src/main/res/layout/dashboard_login.xml
+2
-2
item_category.xml
app/src/main/res/layout/item_category.xml
+12
-10
login_form.xml
app/src/main/res/layout/login_form.xml
+1
-2
register_form.xml
app/src/main/res/layout/register_form.xml
+211
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
.idea/misc.xml
View file @
d365a966
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"
1.8
"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"
JDK
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
</component>
<component
name=
"ProjectType"
>
<component
name=
"ProjectType"
>
...
...
app/src/main/AndroidManifest.xml
View file @
d365a966
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
android:roundIcon=
"@mipmap/ic_launcher_new_icon"
android:roundIcon=
"@mipmap/ic_launcher_new_icon"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme.appbar"
>
android:theme=
"@style/AppTheme.appbar"
>
<activity
android:name=
".RegisterActivity"
></activity>
<activity
<activity
android:name=
".BottomSheets"
android:name=
".BottomSheets"
tools:ignore=
"Instantiatable"
/>
tools:ignore=
"Instantiatable"
/>
...
...
app/src/main/java/com/yono/messeripos/BottomSheets.java
View file @
d365a966
app/src/main/java/com/yono/messeripos/LoginActivity.java
View file @
d365a966
...
@@ -39,9 +39,9 @@ public class LoginActivity extends AppCompatActivity {
...
@@ -39,9 +39,9 @@ public class LoginActivity extends AppCompatActivity {
Utils
utils
=
new
Utils
();
Utils
utils
=
new
Utils
();
LoginState
loginState
;
LoginState
loginState
;
MaterialButton
btnSign
i
n
;
MaterialButton
btnSign
up
,
btnSignI
n
;
ConstraintLayout
loginSheetLayout
;
ConstraintLayout
loginSheetLayout
,
registerSheetLayout
;
BottomSheetBehavior
sheetBehavior
;
BottomSheetBehavior
sheetBehavior
,
sheetBehavior2
;
int
height
,
width
;
int
height
,
width
;
ImageButton
closeBtn
;
ImageButton
closeBtn
;
...
@@ -58,15 +58,103 @@ public class LoginActivity extends AppCompatActivity {
...
@@ -58,15 +58,103 @@ public class LoginActivity extends AppCompatActivity {
}
}
mainViewModels
=
ViewModelProviders
.
of
(
this
).
get
(
MainViewModels
.
class
);
mainViewModels
=
ViewModelProviders
.
of
(
this
).
get
(
MainViewModels
.
class
);
// bindUI
// bindUI
btnSignin
=
findViewById
(
R
.
id
.
signInButtonDashboardLogin
);
// get window height
DisplayMetrics
displayMetrics
=
new
DisplayMetrics
();
getWindowManager
().
getDefaultDisplay
().
getMetrics
(
displayMetrics
);
height
=
displayMetrics
.
heightPixels
;
width
=
displayMetrics
.
widthPixels
;
// get bottom sheets
sheetBehavior
=
BottomSheetBehavior
.
from
(
loginSheetLayout
);
sheetBehavior2
=
BottomSheetBehavior
.
from
(
registerSheetLayout
);
// button on click to form login
btnSignIn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
if
(
sheetBehavior
.
getState
()
!=
BottomSheetBehavior
.
STATE_EXPANDED
)
{
sheetBehavior
.
setState
(
BottomSheetBehavior
.
STATE_EXPANDED
);
loginSheetLayout
.
setMaxHeight
(
height
-
100
);
}
else
{
sheetBehavior
.
setState
(
BottomSheetBehavior
.
STATE_COLLAPSED
);
}
}
});
//button on click to form register
btnSignup
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
if
(
sheetBehavior2
.
getState
()
!=
BottomSheetBehavior
.
STATE_EXPANDED
)
{
sheetBehavior2
.
setState
(
BottomSheetBehavior
.
STATE_EXPANDED
);
registerSheetLayout
.
setMaxHeight
(
height
-
100
);
}
else
{
sheetBehavior2
.
setState
(
BottomSheetBehavior
.
STATE_COLLAPSED
);
}
}
});
/*
* LOGIN LOGIKA DIBAWAH INI
* */
//<<<<<<< HEAD
// public void onClick(View v) {
// Snackbar snackbar = Snackbar.make(v, "Oppss! Wrong Username Or Password!", Snackbar.LENGTH_LONG);
//
// if (TextUtils.isEmpty(username.getText().toString()) &&
// TextUtils.isEmpty(password.getText().toString())){
// username.setError("This field can't empty");
// password.setError("This field can't empty");
// }else if (TextUtils.isEmpty(username.getText().toString())){
// username.setError("This field can't empty");
// }else if (TextUtils.isEmpty(password.getText().toString())){
// password.setError("This field can't empty");
// }else{
// progressBar.setVisibility(View.VISIBLE);
// username.setEnabled(false);
// password.setEnabled(false);
// btnLogin.setEnabled(false);
//
// mainViewModels.checkLogin(new UsersModels(username.getText().toString(),
// password.getText().toString())).observe(LoginActivity.this, new Observer<DataResponse<UsersModels>>() {
// @Override
// public void onChanged(DataResponse<UsersModels> usersModelsDataResponse) {
// Log.d("Status", usersModelsDataResponse.getMessageData());
//
// if (usersModelsDataResponse != null){
// if (usersModelsDataResponse.getStatusData()){
// SharedPreferences.Editor editor = sharedPreferences.edit();
// editor.putBoolean(SplashScreen.SESSION, true);
// editor.commit();
//
// startActivity(new Intent(LoginActivity.this, MainActivity.class));
//
// progressBar.setVisibility(View.GONE);
// username.setEnabled(true);
// password.setEnabled(true);
// btnLogin.setEnabled(true);
// }else {
// utils.snackBar(v,"Oppss! Wrong Username Or Password!").show();
// progressBar.setVisibility(View.GONE);
// username.setEnabled(true);
// password.setEnabled(true);
// btnLogin.setEnabled(true);
// }
// }else{
// utils.snackBar(v, "Oppss! ログイン中にエラーが発生しました。しばらくしてからもう一度お試しください").show();
// }
//
// }
// });
//=======
// session login
// session login
sharedPreferences
=
getSharedPreferences
(
SplashScreen
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
sharedPreferences
=
getSharedPreferences
(
SplashScreen
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
// button login on click
// button login on click
btnSign
i
n
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
btnSign
I
n
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
loginState
=
new
LoginState
(
LoginActivity
.
this
,
mainViewModels
);
loginState
=
new
LoginState
(
LoginActivity
.
this
,
mainViewModels
);
...
...
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
d365a966
...
@@ -101,7 +101,6 @@ public class MainActivity extends AppCompatActivity {
...
@@ -101,7 +101,6 @@ public class MainActivity extends AppCompatActivity {
showLoading
(
true
);
showLoading
(
true
);
btnAddCart
=
findViewById
(
R
.
id
.
materialBtnAddCart
);
btnAddCart
=
findViewById
(
R
.
id
.
materialBtnAddCart
);
binding
.
tvCategory
.
setVisibility
(
View
.
GONE
);
binding
.
tvProduct
.
setVisibility
(
View
.
GONE
);
binding
.
tvProduct
.
setVisibility
(
View
.
GONE
);
formCategory
=
new
FormCategory
();
formCategory
=
new
FormCategory
();
...
@@ -200,7 +199,6 @@ public class MainActivity extends AppCompatActivity {
...
@@ -200,7 +199,6 @@ public class MainActivity extends AppCompatActivity {
categoryModels
.
add
(
0
,
caModels
);
categoryModels
.
add
(
0
,
caModels
);
categoryModelsArrayList
.
addAll
(
categoryModels
);
categoryModelsArrayList
.
addAll
(
categoryModels
);
binding
.
tvCategory
.
setVisibility
(
View
.
VISIBLE
);
binding
.
tvProduct
.
setVisibility
(
View
.
VISIBLE
);
binding
.
tvProduct
.
setVisibility
(
View
.
VISIBLE
);
categoryAdapter
.
setCategoriAdapter
(
MainActivity
.
this
,
categoryModelsArrayList
);
categoryAdapter
.
setCategoriAdapter
(
MainActivity
.
this
,
categoryModelsArrayList
);
binding
.
rvCategory
.
setLayoutManager
(
new
LinearLayoutManager
(
binding
.
rvCategory
.
setLayoutManager
(
new
LinearLayoutManager
(
...
...
app/src/main/java/com/yono/messeripos/PaymentActivity.java
View file @
d365a966
app/src/main/java/com/yono/messeripos/RegisterActivity.java
0 → 100644
View file @
d365a966
package
com
.
yono
.
messeripos
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.os.Bundle
;
public
class
RegisterActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_register
);
}
}
\ No newline at end of file
app/src/main/res/drawable/ic_close.xml
0 → 100644
View file @
d365a966
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
android:tint=
"?attr/colorControlNormal"
>
<path
android:fillColor=
"@color/colorPrimary"
android:pathData=
"M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"
/>
</vector>
app/src/main/res/layout/activity_login_m.xml
View file @
d365a966
...
@@ -122,6 +122,16 @@
...
@@ -122,6 +122,16 @@
app:layout_constraintVertical_bias=
"0.01999998"
/>
app:layout_constraintVertical_bias=
"0.01999998"
/>
<com.google.android.material.textview.MaterialTextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"forgot your password ?"
android:layout_marginLeft=
"100sp"
android:textColor=
"@color/colorWhite"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/btnLogin"
/>
<ProgressBar
<ProgressBar
android:id=
"@+id/progressBar"
android:id=
"@+id/progressBar"
style=
"?android:attr/progressBarStyle"
style=
"?android:attr/progressBarStyle"
...
...
app/src/main/res/layout/activity_main.xml
View file @
d365a966
...
@@ -50,22 +50,15 @@
...
@@ -50,22 +50,15 @@
</com.google.android.material.appbar.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<TextView
android:id=
"@+id/tvCategory"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/topBar"
android:textColor=
"@android:color/black"
android:textSize=
"18sp"
android:textAllCaps=
"true"
android:layout_margin=
"5dp"
android:text=
"Category"
/>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvCategory"
android:id=
"@+id/rvCategory"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tvCategory"
/>
android:layout_below=
"@+id/topBar"
android:layout_alignParentEnd=
"true"
android:paddingTop=
"10dp"
android:layout_marginEnd=
"0dp"
/>
<ImageView
<ImageView
android:id=
"@+id/imgEmpty"
android:id=
"@+id/imgEmpty"
...
@@ -95,8 +88,7 @@
...
@@ -95,8 +88,7 @@
android:textColor=
"@android:color/black"
android:textColor=
"@android:color/black"
android:textSize=
"18sp"
android:textSize=
"18sp"
android:textAllCaps=
"true"
android:textAllCaps=
"true"
android:layout_margin=
"5dp"
android:layout_margin=
"5dp"
/>
android:text=
"Product"
/>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvProduct"
android:id=
"@+id/rvProduct"
...
...
app/src/main/res/layout/activity_register.xml
0 → 100644
View file @
d365a966
<?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:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".RegisterActivity"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/appbar_dashboard.xml
View file @
d365a966
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawableStart=
"@drawable/ic_baseline_search_24"
android:drawableStart=
"@drawable/ic_baseline_search_24"
android:hint=
"Search"
android:hint=
"Search"
android:textStyle=
"normal"
android:outlineSpotShadowColor=
"#fff"
android:outlineSpotShadowColor=
"#fff"
android:paddingStart=
"10dp"
android:paddingStart=
"10dp"
android:textColor=
"#fff"
android:textColor=
"#fff"
...
...
app/src/main/res/layout/dashboard_login.xml
View file @
d365a966
...
@@ -46,11 +46,12 @@
...
@@ -46,11 +46,12 @@
app:strokeColor=
"#fff"
app:strokeColor=
"#fff"
android:text=
"sign up"
android:text=
"sign up"
android:textStyle=
"bold"
android:textStyle=
"bold"
android:textColor=
"
#fff
"
android:textColor=
"
@color/colorWhite
"
app:strokeWidth=
"2dp"
app:strokeWidth=
"2dp"
app:rippleColor=
"@color/colorWhite"
app:rippleColor=
"@color/colorWhite"
android:padding=
"20dp"
android:padding=
"20dp"
app:cornerRadius=
"5dp"
app:cornerRadius=
"5dp"
android:background=
"@color/colorPrimaryCenter"
android:layout_above=
"@id/signInButtonDashboardLogin"
android:layout_above=
"@id/signInButtonDashboardLogin"
android:layout_marginBottom=
"10dp"
/>
android:layout_marginBottom=
"10dp"
/>
...
@@ -70,4 +71,3 @@
...
@@ -70,4 +71,3 @@
</layout>
</layout>
<!--</androidx.coordinatorlayout.widget.CoordinatorLayout>-->
\ No newline at end of file
app/src/main/res/layout/item_category.xml
View file @
d365a966
...
@@ -59,26 +59,28 @@
...
@@ -59,26 +59,28 @@
<com.google.android.material.button.MaterialButton
<com.google.android.material.button.MaterialButton
android:id=
"@+id/categoryDelete"
android:id=
"@+id/categoryDelete"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"40dp"
android:backgroundTint=
"@android:color/holo_red_dark"
android:text=
"DELETE"
android:text=
"DELETE"
android:textSize=
"10sp"
android:textAlignment=
"textStart"
android:textAlignment=
"textStart"
app:layout_constraintTop_toBottomOf=
"@id/cvCategory"
android:textSize=
"10sp"
android:backgroundTint=
"@android:color/holo_red_dark"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/cvCategory"
app:layout_constraintVertical_bias=
"0.0"
/>
<com.google.android.material.button.MaterialButton
<com.google.android.material.button.MaterialButton
android:id=
"@+id/categoryUpdate"
android:id=
"@+id/categoryUpdate"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"40dp"
android:backgroundTint=
"@color/colorGreen"
android:text=
"UPDATE"
android:text=
"UPDATE"
android:textSize=
"10sp"
android:textAlignment=
"textEnd"
android:textAlignment=
"textEnd"
app:layout_constraintTop_toBottomOf=
"@id/cvCategory"
android:textSize=
"10sp"
android:backgroundTint=
"@color/colorGreen"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/cvCategory"
app:layout_constraintVertical_bias=
"0.0"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</layout>
...
...
app/src/main/res/layout/login_form.xml
View file @
d365a966
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<androidx.coordinatorlayout.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
...
@@ -120,5 +121,3 @@
...
@@ -120,5 +121,3 @@
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
</layout>
<!--</androidx.constraintlayout.widget.ConstraintLayout>-->
\ No newline at end of file
app/src/main/res/layout/register_form.xml
0 → 100644
View file @
d365a966
This diff is collapsed.
Click to expand it.
app/src/main/res/values/strings.xml
View file @
d365a966
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
<string
name=
"title_next"
>
next
</string>
<string
name=
"title_next"
>
next
</string>
<string
name=
"open_cart"
>
Open Cart
</string>
<string
name=
"open_cart"
>
Open Cart
</string>
<string
name=
"text_new_category"
>
Add New Category
</string>
<string
name=
"text_new_category"
>
Add New Category
</string>
<string
name=
"email"
>
Email
</string>
<string-array
name=
"planets_array"
>
<string-array
name=
"planets_array"
>
<item>
Mercury
</item>
<item>
Mercury
</item>
...
...
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