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
7c720a08
Commit
7c720a08
authored
Aug 31, 2020
by
iman Fauzi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
round bottom sheet
parent
b60ffb58
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
103 deletions
+77
-103
BottomSheets.java
app/src/main/java/com/yono/messeripos/BottomSheets.java
+30
-29
PaymentActivity.java
app/src/main/java/com/yono/messeripos/PaymentActivity.java
+29
-29
ToolbarApp.java
app/src/main/java/com/yono/messeripos/ToolbarApp.java
+0
-11
activity_bottom_sheets.xml
app/src/main/res/layout/activity_bottom_sheets.xml
+1
-2
activity_login.xml
app/src/main/res/layout/activity_login.xml
+0
-30
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+0
-1
styles.xml
app/src/main/res/values/styles.xml
+17
-1
No files found.
app/src/main/java/com/yono/messeripos/BottomSheets.java
View file @
7c720a08
...
@@ -76,41 +76,41 @@ public class BottomSheets extends BottomSheetDialogFragment {
...
@@ -76,41 +76,41 @@ public class BottomSheets extends BottomSheetDialogFragment {
btnCash
=
v
.
findViewById
(
R
.
id
.
btnCash
);
btnCash
=
v
.
findViewById
(
R
.
id
.
btnCash
);
totalHarga
=
v
.
findViewById
(
R
.
id
.
totalHarga
);
totalHarga
=
v
.
findViewById
(
R
.
id
.
totalHarga
);
utils
=
new
Utils
();
utils
=
new
Utils
();
bottomSheetBehavior
=
BottomSheetBehavior
.
from
(
layoutFormCash
);
//
bottomSheetBehavior = BottomSheetBehavior.from(layoutFormCash);
// sharedPreferences = getActivity().getSharedPreferences(MainActivity.ORDER_ID, Context.MODE_PRIVATE);
// sharedPreferences = getActivity().getSharedPreferences(MainActivity.ORDER_ID, Context.MODE_PRIVATE);
bottomSheetBehavior
.
setState
(
BottomSheetBehavior
.
STATE_COLLAPSED
);
//
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
long
ga
=
paymentsModels
.
getGrossAmount
();
long
ga
=
paymentsModels
.
getGrossAmount
();
String
setCurrency
=
utils
.
convertPrice
(
"Rp."
,
ga
);
String
setCurrency
=
utils
.
convertPrice
(
"Rp."
,
ga
);
totalHarga
.
setText
(
setCurrency
);
totalHarga
.
setText
(
setCurrency
);
hargaChange
.
setText
(
defaultText
);
hargaChange
.
setText
(
defaultText
);
bottomSheetBehavior
.
setBottomSheetCallback
(
new
BottomSheetBehavior
.
BottomSheetCallback
()
{
//
bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
//
@Override
public
void
onStateChanged
(
@NonNull
View
bottomSheet
,
int
newState
)
{
//
public void onStateChanged(@NonNull View bottomSheet, int newState) {
switch
(
newState
)
{
//
switch (newState) {
case
BottomSheetBehavior
.
STATE_HIDDEN
:
//
case BottomSheetBehavior.STATE_HIDDEN:
break
;
//
break;
case
BottomSheetBehavior
.
STATE_EXPANDED
:
//
case BottomSheetBehavior.STATE_EXPANDED:
break
;
//
break;
case
BottomSheetBehavior
.
STATE_COLLAPSED
:
//
case BottomSheetBehavior.STATE_COLLAPSED:
break
;
//
break;
case
BottomSheetBehavior
.
STATE_DRAGGING
:
//
case BottomSheetBehavior.STATE_DRAGGING:
break
;
//
break;
case
BottomSheetBehavior
.
STATE_SETTLING
:
//
case BottomSheetBehavior.STATE_SETTLING:
break
;
//
break;
}
//
}
}
//
}
@Override
//
@Override
public
void
onSlide
(
@NonNull
View
bottomSheet
,
float
slideOffset
)
{
//
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
if
(
bottomSheetBehavior
.
getState
()
!=
BottomSheetBehavior
.
STATE_EXPANDED
)
{
//
if (bottomSheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) {
bottomSheetBehavior
.
setState
(
BottomSheetBehavior
.
STATE_EXPANDED
);
//
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
else
{
//
} else {
bottomSheetBehavior
.
setState
(
BottomSheetBehavior
.
STATE_COLLAPSED
);
//
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
//
}
}
//
}
});
//
});
inputAmount
.
addTextChangedListener
(
new
TextWatcher
()
{
inputAmount
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
@Override
...
@@ -120,7 +120,7 @@ public class BottomSheets extends BottomSheetDialogFragment {
...
@@ -120,7 +120,7 @@ public class BottomSheets extends BottomSheetDialogFragment {
@Override
@Override
public
void
onTextChanged
(
CharSequence
charSequence
,
int
i
,
int
i1
,
int
i2
)
{
public
void
onTextChanged
(
CharSequence
charSequence
,
int
i
,
int
i1
,
int
i2
)
{
if
(
TextUtils
.
isEmpty
(
charSequence
))
inputAmount
.
setText
(
"
0
"
);
if
(
TextUtils
.
isEmpty
(
charSequence
))
inputAmount
.
setText
(
""
);
grossAmount
=
paymentsModels
.
getGrossAmount
();
grossAmount
=
paymentsModels
.
getGrossAmount
();
long
input
=
Long
.
parseLong
(
inputAmount
.
getText
().
toString
());
long
input
=
Long
.
parseLong
(
inputAmount
.
getText
().
toString
());
...
@@ -142,6 +142,7 @@ public class BottomSheets extends BottomSheetDialogFragment {
...
@@ -142,6 +142,7 @@ public class BottomSheets extends BottomSheetDialogFragment {
}
}
private
void
bayar
(
View
view
)
{
private
void
bayar
(
View
view
)
{
// String orderId, String paymentType, String bank, long grossAmount
// String orderId, String paymentType, String bank, long grossAmount
PaymentsModels
paymentsModels
=
new
PaymentsModels
(
PaymentsModels
paymentsModels
=
new
PaymentsModels
(
MainActivity
.
orderId
,
MainActivity
.
orderId
,
...
...
app/src/main/java/com/yono/messeripos/PaymentActivity.java
View file @
7c720a08
...
@@ -68,7 +68,7 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -68,7 +68,7 @@ public class PaymentActivity extends AppCompatActivity {
Button
cashBtn
;
Button
cashBtn
;
ProgressDialog
progressDialog
;
ProgressDialog
progressDialog
;
BottomSheetBehavior
bottomSheetBank
;
BottomSheetBehavior
bottomSheetBank
;
RelativeLayout
qrcodeLayoutBank
;
//
RelativeLayout qrcodeLayoutBank;
...
@@ -89,8 +89,8 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -89,8 +89,8 @@ public class PaymentActivity extends AppCompatActivity {
checkoutAdapter
=
new
CheckoutAdapter
();
checkoutAdapter
=
new
CheckoutAdapter
();
recyclerView
=
findViewById
(
R
.
id
.
rvItem
);
recyclerView
=
findViewById
(
R
.
id
.
rvItem
);
grandTotal
=
findViewById
(
R
.
id
.
grand_total
);
grandTotal
=
findViewById
(
R
.
id
.
grand_total
);
qrcodeLayoutBank
=
findViewById
(
R
.
id
.
qrCodeForm
);
//
qrcodeLayoutBank = findViewById(R.id.qrCodeForm);
bottomSheetBank
=
BottomSheetBehavior
.
from
(
qrcodeLayoutBank
);
//
bottomSheetBank = BottomSheetBehavior.from(qrcodeLayoutBank);
progressDialog
=
new
ProgressDialog
(
PaymentActivity
.
this
);
progressDialog
=
new
ProgressDialog
(
PaymentActivity
.
this
);
progressDialog
.
setMessage
(
"Loading..."
);
progressDialog
.
setMessage
(
"Loading..."
);
progressDialog
.
setCancelable
(
false
);
progressDialog
.
setCancelable
(
false
);
...
@@ -144,32 +144,32 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -144,32 +144,32 @@ public class PaymentActivity extends AppCompatActivity {
});
});
bottomSheetBank
.
setBottomSheetCallback
(
new
BottomSheetBehavior
.
BottomSheetCallback
()
{
//
bottomSheetBank.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
//
@Override
public
void
onStateChanged
(
@NonNull
View
bottomSheet
,
int
newState
)
{
//
public void onStateChanged(@NonNull View bottomSheet, int newState) {
switch
(
newState
)
{
//
switch (newState) {
case
BottomSheetBehavior
.
STATE_HIDDEN
:
//
case BottomSheetBehavior.STATE_HIDDEN:
break
;
//
break;
case
BottomSheetBehavior
.
STATE_EXPANDED
:
//
case BottomSheetBehavior.STATE_EXPANDED:
break
;
//
break;
case
BottomSheetBehavior
.
STATE_COLLAPSED
:
//
case BottomSheetBehavior.STATE_COLLAPSED:
break
;
//
break;
case
BottomSheetBehavior
.
STATE_DRAGGING
:
//
case BottomSheetBehavior.STATE_DRAGGING:
break
;
//
break;
case
BottomSheetBehavior
.
STATE_SETTLING
:
//
case BottomSheetBehavior.STATE_SETTLING:
break
;
//
break;
}
//
}
}
//
}
//
@Override
//
@Override
public
void
onSlide
(
@NonNull
View
bottomSheet
,
float
slideOffset
)
{
//
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
if
(
bottomSheetBank
.
getState
()
!=
BottomSheetBehavior
.
STATE_EXPANDED
)
{
//
if (bottomSheetBank.getState() != BottomSheetBehavior.STATE_EXPANDED) {
bottomSheetBank
.
setState
(
BottomSheetBehavior
.
STATE_EXPANDED
);
//
bottomSheetBank.setState(BottomSheetBehavior.STATE_EXPANDED);
}
else
{
//
} else {
bottomSheetBank
.
setState
(
BottomSheetBehavior
.
STATE_COLLAPSED
);
//
bottomSheetBank.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
//
}
}
//
}
});
//
});
btnPay
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
btnPay
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
app/src/main/java/com/yono/messeripos/ToolbarApp.java
deleted
100644 → 0
View file @
b60ffb58
package
com
.
yono
.
messeripos
;
import
android.content.Context
;
import
com.google.android.material.appbar.MaterialToolbar
;
public
class
ToolbarApp
{
}
app/src/main/res/layout/activity_bottom_sheets.xml
View file @
7c720a08
...
@@ -15,8 +15,7 @@
...
@@ -15,8 +15,7 @@
android:orientation=
"vertical"
android:orientation=
"vertical"
app:behavior_hideable=
"true"
app:behavior_hideable=
"true"
app:behavior_peekHeight=
"56dp"
app:behavior_peekHeight=
"56dp"
app:layout_behavior=
"com.google.android.material.bottomsheet.BottomSheetBehavior"
style=
"@style/Widget.Rounded.BottomSheet"
style=
"@style/AppModalStyle"
android:padding=
"16dp"
>
android:padding=
"16dp"
>
<TextView
<TextView
...
...
app/src/main/res/layout/activity_login.xml
deleted
100644 → 0
View file @
b60ffb58
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_height=
"match_parent"
android:layout_width=
"match_parent"
>
<FrameLayout
android:id=
"@+id/btSheet"
style=
"?attr/bottomSheetStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_behavior=
"com.google.android.material.bottomsheet.BottomSheetBehavior"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:text=
"hello"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:text=
"This is"
/>
</FrameLayout>
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
app/src/main/res/layout/activity_payment.xml
View file @
7c720a08
...
@@ -87,5 +87,4 @@
...
@@ -87,5 +87,4 @@
</RelativeLayout>
</RelativeLayout>
<include
layout=
"@layout/activity_q_r_code"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
app/src/main/res/values/styles.xml
View file @
7c720a08
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<item
name=
"windowActionBarOverlay"
>
true
</item>
<item
name=
"windowActionBarOverlay"
>
true
</item>
<item
name=
"android:fontFamily"
>
@font/roboto
</item>
<item
name=
"android:fontFamily"
>
@font/roboto
</item>
<item
name=
"actionBarStyle"
>
@style/ThemeActionBar
</item>
<item
name=
"actionBarStyle"
>
@style/ThemeActionBar
</item>
<item
name=
"bottomSheetDialogTheme"
>
@style/ThemeOverlay.
Me
.BottomSheetDialog
</item>
<item
name=
"bottomSheetDialogTheme"
>
@style/ThemeOverlay.
Rounded
.BottomSheetDialog
</item>
</style>
</style>
...
@@ -75,6 +75,22 @@
...
@@ -75,6 +75,22 @@
<item
name=
"android:hint"
>
Select kategori
</item>
<item
name=
"android:hint"
>
Select kategori
</item>
</style>
</style>
<style
name=
"ShapeAppearanceOverlay.Rounded.top"
parent=
""
>
<item
name=
"cornerSizeTopLeft"
>
30dp
</item>
<item
name=
"cornerSizeTopRight"
>
30dp
</item>
<item
name=
"cornerFamily"
>
rounded
</item>
</style>
<style
name=
"ThemeOverlay.Rounded.BottomSheetDialog"
parent=
"@style/ThemeOverlay.MaterialComponents.BottomSheetDialog"
>
<item
name=
"bottomSheetStyle"
>
@style/Widget.Rounded.BottomSheet
</item>
</style>
<style
name=
"Widget.Rounded.BottomSheet"
parent=
"Widget.MaterialComponents.BottomSheet"
>
<item
name=
"shapeAppearanceOverlay"
>
@style/ShapeAppearanceOverlay.Rounded.top
</item>
</style>
<style
name=
"AppModalStyle"
parent=
"Widget.Design.BottomSheet.Modal"
>
<style
name=
"AppModalStyle"
parent=
"Widget.Design.BottomSheet.Modal"
>
<item
name=
"android:background"
>
@drawable/round_corner_sheet
</item>
<item
name=
"android:background"
>
@drawable/round_corner_sheet
</item>
</style>
</style>
...
...
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