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
27ba5480
Commit
27ba5480
authored
Aug 24, 2020
by
Alfansyah Fadlian
Browse files
Options
Browse Files
Download
Plain Diff
activity
parents
fd0a033f
82fc4bab
Show whitespace changes
Inline
Side-by-side
Showing
59 changed files
with
902 additions
and
312 deletions
+902
-312
build.gradle
app/build.gradle
+9
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+9
-6
ic_launcher_new_icon-playstore.png
app/src/main/ic_launcher_new_icon-playstore.png
+0
-0
CartActivity.java
app/src/main/java/com/yono/messeripos/CartActivity.java
+24
-7
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+19
-5
PaymentActivity.java
app/src/main/java/com/yono/messeripos/PaymentActivity.java
+11
-0
ProductActivity.java
app/src/main/java/com/yono/messeripos/ProductActivity.java
+14
-0
SplashScreen.java
app/src/main/java/com/yono/messeripos/SplashScreen.java
+8
-0
ToolbarApp.java
app/src/main/java/com/yono/messeripos/ToolbarApp.java
+19
-0
CartAdapter.java
...rc/main/java/com/yono/messeripos/adapter/CartAdapter.java
+31
-0
CategoryAdapter.java
...ain/java/com/yono/messeripos/adapter/CategoryAdapter.java
+31
-0
PaymentAdapter.java
...main/java/com/yono/messeripos/adapter/PaymentAdapter.java
+20
-4
ProductAdapter.java
...main/java/com/yono/messeripos/adapter/ProductAdapter.java
+78
-0
ApiHelper.java
app/src/main/java/com/yono/messeripos/api/ApiHelper.java
+14
-0
Client.java
app/src/main/java/com/yono/messeripos/api/client/Client.java
+9
-0
CategoryServise.java
...java/com/yono/messeripos/api/service/CategoryServise.java
+15
-0
ProductService.java
.../java/com/yono/messeripos/api/service/ProductService.java
+17
-0
CartDaos.java
app/src/main/java/com/yono/messeripos/daos/CartDaos.java
+8
-0
LocalDatabase.java
...main/java/com/yono/messeripos/database/LocalDatabase.java
+17
-0
CartModels.java
app/src/main/java/com/yono/messeripos/models/CartModels.java
+27
-0
CategoryModels.java
.../main/java/com/yono/messeripos/models/CategoryModels.java
+27
-0
MainViewModels.java
.../main/java/com/yono/messeripos/models/MainViewModels.java
+73
-0
ProductCartModels.java
...in/java/com/yono/messeripos/models/ProductCartModels.java
+139
-0
ProductModels.java
...c/main/java/com/yono/messeripos/models/ProductModels.java
+46
-3
UsersModels.java
...src/main/java/com/yono/messeripos/models/UsersModels.java
+27
-0
DataResponse.java
.../main/java/com/yono/messeripos/response/DataResponse.java
+3
-2
PaymentResponse.java
...in/java/com/yono/messeripos/response/PaymentResponse.java
+22
-0
zoom_in.xml
app/src/main/res/anim/zoom_in.xml
+13
-0
ic_launcher_foreground.xml
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
+0
-30
ic_launcher_background.xml
app/src/main/res/drawable/ic_launcher_background.xml
+0
-170
ic_launcher_new_icon_foreground.xml
...src/main/res/drawable/ic_launcher_new_icon_foreground.xml
+4
-4
activity_cart.xml
app/src/main/res/layout/activity_cart.xml
+25
-3
activity_login.xml
app/src/main/res/layout/activity_login.xml
+10
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+26
-29
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+11
-3
activity_product.xml
app/src/main/res/layout/activity_product.xml
+9
-0
activity_splash.xml
app/src/main/res/layout/activity_splash.xml
+1
-0
app_bar.xml
app/src/main/res/layout/app_bar.xml
+11
-0
appbar_dashboard.xml
app/src/main/res/layout/appbar_dashboard.xml
+17
-15
item_category.xml
app/src/main/res/layout/item_category.xml
+30
-28
item_list.xml
app/src/main/res/layout/item_list.xml
+1
-1
payment_list.xml
app/src/main/res/layout/payment_list.xml
+5
-0
ic_launcher.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+1
-1
ic_launcher.xml~
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml~
+0
-0
ic_launcher_new_icon.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher_new_icon.xml
+5
-0
ic_launcher_new_icon_round.xml
...main/res/mipmap-anydpi-v26/ic_launcher_new_icon_round.xml
+5
-0
ic_launcher_round.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+1
-1
ic_launcher_new_icon.png
app/src/main/res/mipmap-hdpi/ic_launcher_new_icon.png
+0
-0
ic_launcher_new_icon_round.png
app/src/main/res/mipmap-hdpi/ic_launcher_new_icon_round.png
+0
-0
ic_launcher_new_icon.png
app/src/main/res/mipmap-mdpi/ic_launcher_new_icon.png
+0
-0
ic_launcher_new_icon_round.png
app/src/main/res/mipmap-mdpi/ic_launcher_new_icon_round.png
+0
-0
ic_launcher_new_icon.png
app/src/main/res/mipmap-xhdpi/ic_launcher_new_icon.png
+0
-0
ic_launcher_new_icon_round.png
app/src/main/res/mipmap-xhdpi/ic_launcher_new_icon_round.png
+0
-0
ic_launcher_new_icon.png
app/src/main/res/mipmap-xxhdpi/ic_launcher_new_icon.png
+0
-0
ic_launcher_new_icon_round.png
...src/main/res/mipmap-xxhdpi/ic_launcher_new_icon_round.png
+0
-0
ic_launcher_new_icon.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher_new_icon.png
+0
-0
ic_launcher_new_icon_round.png
...rc/main/res/mipmap-xxxhdpi/ic_launcher_new_icon_round.png
+0
-0
ic_launcher_new_icon_background.xml
app/src/main/res/values/ic_launcher_new_icon_background.xml
+4
-0
styles.xml
app/src/main/res/values/styles.xml
+6
-0
No files found.
app/build.gradle
View file @
27ba5480
...
...
@@ -25,6 +25,10 @@ android {
enabled
=
true
}
viewBinding
{
enabled
=
true
}
compileOptions
{
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
...
...
@@ -41,6 +45,11 @@ dependencies {
implementation
'com.squareup.retrofit2:converter-gson:2.9.0'
implementation
'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation
'com.github.bumptech.glide:glide:4.3.1'
def
room_version
=
"2.2.5"
implementation
"androidx.room:room-runtime:$room_version"
annotationProcessor
"androidx.room:room-compiler:$room_version"
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test.ext:junit:1.1.1'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
...
...
app/src/main/AndroidManifest.xml
View file @
27ba5480
...
...
@@ -2,7 +2,7 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.yono.messeripos"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<application
android:allowBackup=
"true"
...
...
@@ -10,8 +10,11 @@
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".PaymentActivity"
></activity>
android:theme=
"@style/AppTheme.appbar"
>
<activity
android:name=
".ProductActivity"
></activity>
<activity
android:name=
".PaymentActivity"
android:theme=
"@style/AppTheme.appbar"
/>
<activity
android:name=
".CartActivity"
/>
<activity
android:name=
".SplashScreen"
>
<intent-filter>
...
...
@@ -20,9 +23,9 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".MainActivity"
>
</activity>
<activity
android:name=
".MainActivity"
android:theme=
"@style/AppTheme.appbar"
>
</activity>
<meta-data
android:name=
"preloaded_fonts"
...
...
app/src/main/ic_launcher_new_icon-playstore.png
0 → 100644
View file @
27ba5480
14.1 KB
app/src/main/java/com/yono/messeripos/CartActivity.java
View file @
27ba5480
...
...
@@ -2,11 +2,13 @@ package com.yono.messeripos;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.annotation.SuppressLint
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.ImageButton
;
import
android.widget.TextView
;
import
com.google.android.material.appbar.MaterialToolbar
;
import
com.google.android.material.textfield.TextInputEditText
;
import
java.text.NumberFormat
;
...
...
@@ -18,13 +20,20 @@ public class CartActivity extends AppCompatActivity {
TextInputEditText
tiQty
;
TextView
tvQtyView
,
tvPrice
,
tvTotal
;
p
rivate
int
counter
;
p
ublic
int
counter
,
prices
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_cart
);
MaterialToolbar
toolbars
=
findViewById
(
R
.
id
.
cAppBar
);
setSupportActionBar
(
toolbars
);
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
getSupportActionBar
().
setDisplayShowHomeEnabled
(
true
);
getSupportActionBar
().
setTitle
(
"Checkout"
);
toolbars
.
setNavigationOnClickListener
(
view
->
onBackPressed
());
btMinus
=
findViewById
(
R
.
id
.
btMinus
);
btPlus
=
findViewById
(
R
.
id
.
btPlus
);
btDelete
=
findViewById
(
R
.
id
.
btDelete
);
...
...
@@ -35,8 +44,12 @@ public class CartActivity extends AppCompatActivity {
tvTotal
=
findViewById
(
R
.
id
.
tvTotal
);
counter
=
Integer
.
parseInt
(
tvQtyView
.
getText
().
toString
());
prices
=
Integer
.
parseInt
(
tvPrice
.
getText
().
toString
());
tvTotal
.
setText
(
setToRp
().
format
((
double
)
Integer
.
parseInt
(
tvTotal
.
getText
().
toString
())));
btMinus
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@SuppressLint
(
"SetTextI18n"
)
@Override
public
void
onClick
(
View
view
)
{
if
(
counter
>
1
){
...
...
@@ -46,11 +59,11 @@ public class CartActivity extends AppCompatActivity {
countTotal
();
}
}
});
btPlus
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@SuppressLint
(
"SetTextI18n"
)
@Override
public
void
onClick
(
View
view
)
{
counter
++;
...
...
@@ -63,10 +76,10 @@ public class CartActivity extends AppCompatActivity {
}
private
void
countTotal
()
{
int
price
=
Integer
.
parseInt
(
tvPrice
.
getText
().
toString
())
;
int
price
=
prices
;
int
qtyView
=
Integer
.
parseInt
(
tvQtyView
.
getText
().
toString
());
int
count
=
price
*
qtyView
;
String
result
=
Integer
.
toString
(
price
*
qtyView
);
//
String result = Integer.toString(price*qtyView);
// set to view
tvTotal
.
setText
(
setToRp
().
format
((
double
)
count
));
...
...
@@ -75,7 +88,11 @@ public class CartActivity extends AppCompatActivity {
private
NumberFormat
setToRp
()
{
Locale
ID
=
new
Locale
(
"in"
,
"ID"
);
NumberFormat
formatRp
=
NumberFormat
.
getCurrencyInstance
(
ID
);
return
formatRp
;
return
NumberFormat
.
getCurrencyInstance
(
ID
);
}
}
/**
* Harga belum bisa di beri String (Rp)
*/
\ No newline at end of file
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
27ba5480
...
...
@@ -11,20 +11,28 @@ import android.view.WindowManager;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.core.content.ContextCompat
;
import
androidx.databinding.DataBindingUtil
;
import
androidx.lifecycle.ViewModelProvider
;
import
androidx.lifecycle.ViewModelProviders
;
import
com.google.android.material.appbar.MaterialToolbar
;
import
com.yono.messeripos.adapter.ProductAdapter
;
import
com.yono.messeripos.databinding.ActivityMainBinding
;
import
com.yono.messeripos.models.MainViewModels
;
import
com.yono.messeripos.models.ProductModels
;
import
java.util.ArrayList
;
public
class
MainActivity
extends
AppCompatActivity
{
MaterialToolbar
toolbar
;
private
ActivityMainBinding
binding
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
ProductAdapter
adapter
=
new
ProductAdapter
();
binding
=
DataBindingUtil
.
setContentView
(
this
,
R
.
layout
.
activity_main
);
binding
.
rvProduct
.
setAdapter
(
adapter
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
...
...
@@ -40,13 +48,19 @@ public class MainActivity extends AppCompatActivity {
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
int
id
=
item
.
getItemId
();
if
(
id
==
R
.
id
.
menu_cart
)
{
startActivity
(
new
Intent
(
MainActivity
.
this
,
CartActivity
.
class
));
startActivity
(
new
Intent
(
getApplicationContext
()
,
CartActivity
.
class
));
}
return
true
;
}
});
MainViewModels
mainViewModels
=
ViewModelProviders
.
of
(
this
).
get
(
MainViewModels
.
class
);
// ProductModels productModels = new ViewModelProvider(this).get(ProductModels)
mainViewModels
.
getProduct
().
observe
(
this
,
mainViewModels:
:
getProduct
);
//code product
mainViewModels
.
getCategory
();
}
}
\ No newline at end of file
app/src/main/java/com/yono/messeripos/PaymentActivity.java
View file @
27ba5480
...
...
@@ -5,7 +5,9 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.os.Bundle
;
import
android.widget.Toolbar
;
import
com.google.android.material.appbar.MaterialToolbar
;
import
com.yono.messeripos.adapter.PaymentAdapter
;
import
com.yono.messeripos.response.PaymentResponse
;
...
...
@@ -14,12 +16,21 @@ import java.util.ArrayList;
public
class
PaymentActivity
extends
AppCompatActivity
{
private
ArrayList
<
PaymentResponse
>
paymentResponses
=
new
ArrayList
<>();
MaterialToolbar
toolbars
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_payment
);
MaterialToolbar
toolbars
=
findViewById
(
R
.
id
.
appbar
);
setSupportActionBar
(
toolbars
);
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
getSupportActionBar
().
setDisplayShowHomeEnabled
(
true
);
getSupportActionBar
().
setTitle
(
"Payment"
);
toolbars
.
setNavigationOnClickListener
(
view
->
onBackPressed
());
RecyclerView
rvPayment
=
findViewById
(
R
.
id
.
rvPayment
);
LinearLayoutManager
llm
=
new
LinearLayoutManager
(
this
);
...
...
app/src/main/java/com/yono/messeripos/ProductActivity.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.os.Bundle
;
public
class
ProductActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_product
);
}
}
\ No newline at end of file
app/src/main/java/com/yono/messeripos/SplashScreen.java
View file @
27ba5480
...
...
@@ -4,14 +4,22 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.view.animation.Animation
;
import
android.view.animation.AnimationUtils
;
import
android.widget.ImageView
;
import
androidx.appcompat.app.AppCompatActivity
;
public
class
SplashScreen
extends
AppCompatActivity
{
ImageView
img
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_splash
);
img
=
findViewById
(
R
.
id
.
image_splash
);
Animation
animation
=
AnimationUtils
.
loadAnimation
(
getApplicationContext
(),
R
.
anim
.
zoom_in
);
img
.
startAnimation
(
animation
);
new
Handler
(
Looper
.
getMainLooper
()).
postDelayed
(()->{
startActivity
(
new
Intent
(
SplashScreen
.
this
,
MainActivity
.
class
));
...
...
app/src/main/java/com/yono/messeripos/ToolbarApp.java
0 → 100644
View file @
27ba5480
//package com.yono.messeripos;
//
//import android.content.Context;
//
//import androidx.appcompat.app.AppCompatActivity;
//
//import com.google.android.material.appbar.MaterialToolbar;
//
//public class ToolbarApp {
//
// public ToolbarApp(Context context, int toolbar, String title) {
//
// MaterialToolbar toolbars = findViewById(toolbar);
// setSupportActionBar(toolbars);
// getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// getSupportActionBar().setDisplayShowHomeEnabled(true);
// getSupportActionBar().setTitle(title);
// }
//}
app/src/main/java/com/yono/messeripos/adapter/CartAdapter.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
adapter
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
public
class
CartAdapter
extends
RecyclerView
.
Adapter
<
CartAdapter
.
MyViewHolder
>
{
@NonNull
@Override
public
CartAdapter
.
MyViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
return
null
;
}
@Override
public
void
onBindViewHolder
(
@NonNull
CartAdapter
.
MyViewHolder
holder
,
int
position
)
{
}
@Override
public
int
getItemCount
()
{
return
0
;
}
public
class
MyViewHolder
extends
RecyclerView
.
ViewHolder
{
public
MyViewHolder
(
@NonNull
View
itemView
)
{
super
(
itemView
);
}
}
}
app/src/main/java/com/yono/messeripos/adapter/CategoryAdapter.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
adapter
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
public
class
CategoryAdapter
extends
RecyclerView
.
Adapter
<
CategoryAdapter
.
MyViewHolder
>
{
@NonNull
@Override
public
CategoryAdapter
.
MyViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
return
null
;
}
@Override
public
void
onBindViewHolder
(
@NonNull
CategoryAdapter
.
MyViewHolder
holder
,
int
position
)
{
}
@Override
public
int
getItemCount
()
{
return
0
;
}
public
class
MyViewHolder
extends
RecyclerView
.
ViewHolder
{
public
MyViewHolder
(
@NonNull
View
itemView
)
{
super
(
itemView
);
}
}
}
app/src/main/java/com/yono/messeripos/adapter/PaymentAdapter.java
View file @
27ba5480
package
com
.
yono
.
messeripos
.
adapter
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.annotation.NonNull
;
import
androidx.cardview.widget.CardView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.google.android.material.button.MaterialButton
;
import
androidx.databinding.DataBindingUtil
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.google.android.material.card.MaterialCardView
;
import
com.yono.messeripos.PaymentActivity
;
import
com.yono.messeripos.response.PaymentResponse
;
import
com.yono.messeripos.R
;
...
...
@@ -29,6 +36,11 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
@NonNull
@Override
public
ViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
// View view = LayoutInflater.from(parent.getContext())
// .inflate(R.layout.payment_list, parent, false);
//
// return new ViewHolder(view);
PaymentListBinding
paymentListBinding
=
DataBindingUtil
.
inflate
(
LayoutInflater
.
from
(
parent
.
getContext
()),
R
.
layout
.
payment_list
,
...
...
@@ -45,7 +57,6 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
@Override
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
holder
.
binData
(
paymentResponses
.
get
(
position
));
// holder.cardView.setTag(position);
// holder.radioButton.setChecked(position == getPosition);
// final PaymentModel paymentModel = paymentModels.get(position);
//
...
...
@@ -57,23 +68,28 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
// .into(imageView);
}
@Override
public
int
getItemCount
()
{
return
paymentResponses
.
size
();
}
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
MaterialCardView
cardView
;
PaymentListBinding
binding
;
public
ViewHolder
(
@NonNull
PaymentListBinding
view
)
{
super
(
view
.
getRoot
());
this
.
binding
=
view
;
getPosition
=
getAdapterPosition
();
Log
.
d
(
"ViewHolder: "
,
String
.
valueOf
(
cardView
));
}
@SuppressLint
(
"ResourceAsColor"
)
public
void
binData
(
PaymentResponse
paymentResponse
){
binding
.
setPayment
(
paymentResponse
);
}
binding
.
setLogo
(
paymentResponse
.
getUrl
());
}
}
}
app/src/main/java/com/yono/messeripos/adapter/ProductAdapter.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
adapter
;
import
android.content.Context
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.annotation.NonNull
;
import
androidx.databinding.DataBindingUtil
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.yono.messeripos.R
;
import
com.yono.messeripos.databinding.ItemListBinding
;
import
com.yono.messeripos.models.ProductModels
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
ProductAdapter
extends
RecyclerView
.
Adapter
<
ProductAdapter
.
MyViewHolder
>
{
private
List
<
ProductModels
>
productModels
;
Context
context
;
public
interface
ProductListener
{
void
onUpdate
(
ProductModels
product
);
void
onDelete
(
ProductModels
product
);
}
private
ProductListener
listener
;
public
void
setListener
(
ProductListener
listener
)
{
this
.
listener
=
listener
;
}
public
void
setProducts
(
List
<
ProductModels
>
product
)
{
this
.
productModels
=
product
;
notifyDataSetChanged
();
}
@NonNull
@Override
public
ProductAdapter
.
MyViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
return
new
MyViewHolder
(
DataBindingUtil
.
inflate
(
LayoutInflater
.
from
(
parent
.
getContext
()),
R
.
layout
.
item_list
,
parent
,
false
)
);
}
@Override
public
void
onBindViewHolder
(
@NonNull
ProductAdapter
.
MyViewHolder
holder
,
int
position
)
{
holder
.
bindData
(
productModels
.
get
(
position
),
listener
);
}
@Override
public
int
getItemCount
()
{
return
productModels
.
size
();
}
public
class
MyViewHolder
extends
RecyclerView
.
ViewHolder
{
private
ItemListBinding
binding
;
public
MyViewHolder
(
@NonNull
ItemListBinding
binding
)
{
super
(
binding
.
getRoot
());
this
.
binding
=
binding
;
}
public
void
bindData
(
ProductModels
productModels
,
ProductListener
listener
)
{
binding
.
setProduct
(
productModels
);
}
}
}
app/src/main/java/com/yono/messeripos/api/ApiHelper.java
View file @
27ba5480
package
com
.
yono
.
messeripos
.
api
;
import
retrofit2.Retrofit
;
import
retrofit2.converter.gson.GsonConverterFactory
;
public
class
ApiHelper
{
public
static
final
String
BASE_URL
=
"https://rest-api-meser.herokuapp.com/"
;
public
static
final
String
VERSI_API_1
=
"api/v1/"
;
public
static
Retrofit
request
(
String
baseUrl
){
Retrofit
retrofit
=
new
Retrofit
.
Builder
()
.
baseUrl
(
baseUrl
)
.
addConverterFactory
(
GsonConverterFactory
.
create
())
.
build
();
return
retrofit
;
}
}
app/src/main/java/com/yono/messeripos/api/client/Client.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
api
.
client
;
import
com.yono.messeripos.api.ApiHelper
;
public
class
Client
{
public
<
T
>
T
Client
(
Class
<
T
>
service
){
return
ApiHelper
.
request
(
ApiHelper
.
BASE_URL
).
create
(
service
);
}
}
app/src/main/java/com/yono/messeripos/api/service/CategoryServise.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
api
.
service
;
import
com.yono.messeripos.api.ApiHelper
;
import
com.yono.messeripos.models.CategoryModels
;
import
com.yono.messeripos.response.DataResponse
;
import
java.util.List
;
import
retrofit2.Call
;
import
retrofit2.http.GET
;
public
interface
CategoryServise
{
@GET
(
ApiHelper
.
VERSI_API_1
+
"categories"
)
Call
<
DataResponse
<
List
<
CategoryModels
>>>
getCategory
();
}
app/src/main/java/com/yono/messeripos/api/service/ProductService.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
api
.
service
;
import
com.yono.messeripos.api.ApiHelper
;
import
com.yono.messeripos.models.CategoryModels
;
import
com.yono.messeripos.models.ProductModels
;
import
com.yono.messeripos.response.DataResponse
;
import
java.util.List
;
import
retrofit2.Call
;
import
retrofit2.http.GET
;
public
interface
ProductService
{
@GET
(
ApiHelper
.
VERSI_API_1
+
"products-join"
)
Call
<
DataResponse
<
List
<
ProductModels
<
CategoryModels
>>>>
getProducts
();
}
app/src/main/java/com/yono/messeripos/daos/CartDaos.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
daos
;
import
androidx.room.Dao
;
@Dao
public
interface
CartDaos
{
}
app/src/main/java/com/yono/messeripos/database/LocalDatabase.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
database
;
import
androidx.room.Database
;
import
androidx.room.RoomDatabase
;
import
com.yono.messeripos.daos.CartDaos
;
import
com.yono.messeripos.models.ProductCartModels
;
@Database
(
entities
=
{
ProductCartModels
.
class
},
version
=
1
,
exportSchema
=
false
)
public
abstract
class
LocalDatabase
extends
RoomDatabase
{
public
abstract
CartDaos
cartDaos
();
private
static
volatile
LocalDatabase
INSTANCE
;
private
static
final
int
NUMBER_OF_THREADS
=
407
;
}
app/src/main/java/com/yono/messeripos/models/CartModels.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
models
;
import
com.google.gson.annotations.SerializedName
;
public
class
CartModels
<
T
>
{
@SerializedName
(
"id"
)
private
String
idOrders
;
@SerializedName
(
"products"
)
private
T
dataOrders
;
public
String
getIdOrders
()
{
return
idOrders
;
}
public
void
setIdOrders
(
String
idOrders
)
{
this
.
idOrders
=
idOrders
;
}
public
T
getDataOrders
()
{
return
dataOrders
;
}
public
void
setDataOrders
(
T
dataOrders
)
{
this
.
dataOrders
=
dataOrders
;
}
}
app/src/main/java/com/yono/messeripos/models/CategoryModels.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
models
;
import
com.google.gson.annotations.SerializedName
;
public
class
CategoryModels
{
@SerializedName
(
"id"
)
private
int
idCategory
;
@SerializedName
(
"name"
)
private
String
nameCategory
;
public
int
getIdCategory
()
{
return
idCategory
;
}
public
void
setIdCategory
(
int
idCategory
)
{
this
.
idCategory
=
idCategory
;
}
public
String
getNameCategory
()
{
return
nameCategory
;
}
public
void
setNameCategory
(
String
nameCategory
)
{
this
.
nameCategory
=
nameCategory
;
}
}
app/src/main/java/com/yono/messeripos/models/MainViewModels.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
models
;
import
android.util.Log
;
import
androidx.lifecycle.MutableLiveData
;
import
androidx.lifecycle.ViewModel
;
import
com.google.gson.Gson
;
import
com.yono.messeripos.api.client.Client
;
import
com.yono.messeripos.api.service.CategoryServise
;
import
com.yono.messeripos.api.service.ProductService
;
import
com.yono.messeripos.response.DataResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
import
retrofit2.Response
;
public
class
MainViewModels
extends
ViewModel
{
MutableLiveData
<
DataResponse
<
List
<
ProductModels
<
List
<
CategoryModels
>>>>>
productList
;
MutableLiveData
<
DataResponse
<
List
<
CategoryModels
>>>
categoryList
;
Client
client
=
new
Client
();
public
MainViewModels
(){
productList
=
new
MutableLiveData
<>();}
public
MutableLiveData
<
DataResponse
<
List
<
ProductModels
<
List
<
CategoryModels
>>>>>
getProduct
(){
getProductList
();
return
productList
;
}
public
MutableLiveData
<
DataResponse
<
List
<
CategoryModels
>>>
getCategory
(){
getCategoryList
();
return
categoryList
;
}
private
void
getProductList
()
{
ProductService
productService
=
client
.
Client
(
ProductService
.
class
);
productService
.
getProducts
().
enqueue
(
new
Callback
<
DataResponse
<
List
<
ProductModels
<
CategoryModels
>>>>()
{
@Override
public
void
onResponse
(
Call
<
DataResponse
<
List
<
ProductModels
<
CategoryModels
>>>>
call
,
Response
<
DataResponse
<
List
<
ProductModels
<
CategoryModels
>>>>
response
)
{
String
js
=
new
Gson
().
toJson
(
response
.
body
());
Log
.
d
(
"Get Data"
,
"Response "
+
js
);
}
@Override
public
void
onFailure
(
Call
<
DataResponse
<
List
<
ProductModels
<
CategoryModels
>>>>
call
,
Throwable
t
)
{
Log
.
e
(
"Error get product"
,
"Response "
+
t
.
getMessage
());
}
});
}
private
void
getCategoryList
(){
CategoryServise
categoryServise
=
client
.
Client
(
CategoryServise
.
class
);
categoryServise
.
getCategory
().
enqueue
(
new
Callback
<
DataResponse
<
List
<
CategoryModels
>>>()
{
@Override
public
void
onResponse
(
Call
<
DataResponse
<
List
<
CategoryModels
>>>
call
,
Response
<
DataResponse
<
List
<
CategoryModels
>>>
response
)
{
String
js
=
new
Gson
().
toJson
(
response
.
body
());
Log
.
d
(
"Get Data Category"
,
"Response "
+
js
);
}
@Override
public
void
onFailure
(
Call
<
DataResponse
<
List
<
CategoryModels
>>>
call
,
Throwable
t
)
{
Log
.
e
(
"Error get product"
,
"Response "
+
t
.
getMessage
());
}
});
}
}
app/src/main/java/com/yono/messeripos/models/ProductCartModels.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
models
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
androidx.room.Entity
;
import
androidx.room.PrimaryKey
;
import
com.google.gson.annotations.SerializedName
;
@Entity
(
tableName
=
"carts"
)
public
class
ProductCartModels
implements
Parcelable
{
@PrimaryKey
(
autoGenerate
=
true
)
@SerializedName
(
"id"
)
private
long
id
;
@SerializedName
(
"id_orders"
)
private
int
id_orders
;
@SerializedName
(
"quantity"
)
private
long
quantity_orders
;
@SerializedName
(
"product_id"
)
private
int
id_product_orders
;
@SerializedName
(
"product_name"
)
private
String
product_name_orders
;
@SerializedName
(
"price"
)
private
long
price_orders
;
@SerializedName
(
"grand_total"
)
private
int
grand_total_orders
;
public
ProductCartModels
(
long
id
,
int
id_orders
,
long
quantity_orders
,
int
id_product_orders
,
String
product_name_orders
,
long
price_orders
,
int
grand_total_orders
)
{
this
.
id
=
id
;
this
.
id_orders
=
id_orders
;
this
.
quantity_orders
=
quantity_orders
;
this
.
id_product_orders
=
id_product_orders
;
this
.
product_name_orders
=
product_name_orders
;
this
.
price_orders
=
price_orders
;
this
.
grand_total_orders
=
grand_total_orders
;
}
protected
ProductCartModels
(
Parcel
in
)
{
id
=
in
.
readLong
();
id_orders
=
in
.
readInt
();
quantity_orders
=
in
.
readLong
();
id_product_orders
=
in
.
readInt
();
product_name_orders
=
in
.
readString
();
price_orders
=
in
.
readLong
();
grand_total_orders
=
in
.
readInt
();
}
public
static
final
Creator
<
ProductCartModels
>
CREATOR
=
new
Creator
<
ProductCartModels
>()
{
@Override
public
ProductCartModels
createFromParcel
(
Parcel
in
)
{
return
new
ProductCartModels
(
in
);
}
@Override
public
ProductCartModels
[]
newArray
(
int
size
)
{
return
new
ProductCartModels
[
size
];
}
};
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
parcel
,
int
i
)
{
parcel
.
writeLong
(
id
);
parcel
.
writeInt
(
id_orders
);
parcel
.
writeLong
(
quantity_orders
);
parcel
.
writeLong
(
price_orders
);
parcel
.
writeString
(
product_name_orders
);
parcel
.
writeInt
(
grand_total_orders
);
}
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
int
getId_orders
()
{
return
id_orders
;
}
public
void
setId_orders
(
int
id_orders
)
{
this
.
id_orders
=
id_orders
;
}
public
long
getQuantity_orders
()
{
return
quantity_orders
;
}
public
void
setQuantity_orders
(
long
quantity_orders
)
{
this
.
quantity_orders
=
quantity_orders
;
}
public
int
getId_product_orders
()
{
return
id_product_orders
;
}
public
void
setId_product_orders
(
int
id_product_orders
)
{
this
.
id_product_orders
=
id_product_orders
;
}
public
String
getProduct_name_orders
()
{
return
product_name_orders
;
}
public
void
setProduct_name_orders
(
String
product_name_orders
)
{
this
.
product_name_orders
=
product_name_orders
;
}
public
long
getPrice_orders
()
{
return
price_orders
;
}
public
void
setPrice_orders
(
long
price_orders
)
{
this
.
price_orders
=
price_orders
;
}
public
int
getGrand_total_orders
()
{
return
grand_total_orders
;
}
public
void
setGrand_total_orders
(
int
grand_total_orders
)
{
this
.
grand_total_orders
=
grand_total_orders
;
}
}
app/src/main/java/com/yono/messeripos/models/ProductModels.java
View file @
27ba5480
...
...
@@ -2,11 +2,11 @@ package com.yono.messeripos.models;
import
com.google.gson.annotations.SerializedName
;
public
class
ProductModels
{
@SerializedName
(
"id
_product
"
)
public
class
ProductModels
<
T
>
{
@SerializedName
(
"id"
)
private
int
idProduct
;
@SerializedName
(
"
product_
name"
)
@SerializedName
(
"name"
)
private
String
productName
;
@SerializedName
(
"price"
)
...
...
@@ -14,4 +14,47 @@ public class ProductModels {
@SerializedName
(
"stock"
)
private
int
stockProduct
;
@SerializedName
(
"category"
)
private
T
categoryProduct
;
public
int
getIdProduct
()
{
return
idProduct
;
}
public
void
setIdProduct
(
int
idProduct
)
{
this
.
idProduct
=
idProduct
;
}
public
String
getProductName
()
{
return
productName
;
}
public
void
setProductName
(
String
productName
)
{
this
.
productName
=
productName
;
}
public
int
getPriceProduct
()
{
return
priceProduct
;
}
public
void
setPriceProduct
(
int
priceProduct
)
{
this
.
priceProduct
=
priceProduct
;
}
public
int
getStockProduct
()
{
return
stockProduct
;
}
public
void
setStockProduct
(
int
stockProduct
)
{
this
.
stockProduct
=
stockProduct
;
}
public
T
getCategoryProduct
()
{
return
categoryProduct
;
}
public
void
setCategoryProduct
(
T
categoryProduct
)
{
this
.
categoryProduct
=
categoryProduct
;
}
}
app/src/main/java/com/yono/messeripos/models/UsersModels.java
0 → 100644
View file @
27ba5480
package
com
.
yono
.
messeripos
.
models
;
import
com.google.gson.annotations.SerializedName
;
public
class
UsersModels
{
@SerializedName
(
"username"
)
private
String
usernameUsers
;
@SerializedName
(
"password"
)
private
String
passwordUsers
;
public
String
getUsernameUsers
()
{
return
usernameUsers
;
}
public
void
setUsernameUsers
(
String
usernameUsers
)
{
this
.
usernameUsers
=
usernameUsers
;
}
public
String
getPasswordUsers
()
{
return
passwordUsers
;
}
public
void
setPasswordUsers
(
String
passwordUsers
)
{
this
.
passwordUsers
=
passwordUsers
;
}
}
app/src/main/java/com/yono/messeripos/response/DataResponse.java
View file @
27ba5480
package
com
.
yono
.
messeripos
.
response
;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.google.gson.annotations.SerializedName
;
public
class
DataResponse
<
T
>
{
...
...
@@ -7,13 +9,12 @@ public class DataResponse<T> {
@SerializedName
(
"status"
)
private
Boolean
statusData
;
@SerializedName
(
"message
s
"
)
@SerializedName
(
"message"
)
private
String
messageData
;
@SerializedName
(
"data"
)
private
T
data
;
public
Boolean
getStatusData
()
{
return
statusData
;
}
...
...
app/src/main/java/com/yono/messeripos/response/PaymentResponse.java
View file @
27ba5480
package
com
.
yono
.
messeripos
.
response
;
import
android.widget.ImageView
;
import
androidx.databinding.BindingAdapter
;
import
com.bumptech.glide.Glide
;
public
class
PaymentResponse
{
private
String
url
;
private
String
bank
;
private
boolean
isSelected
;
public
boolean
isSelected
()
{
return
isSelected
;
}
public
void
setSelected
(
boolean
selected
)
{
isSelected
=
selected
;
}
public
PaymentResponse
(
String
url
,
String
bank
)
{
this
.
url
=
url
;
...
...
@@ -25,4 +40,11 @@ public class PaymentResponse {
public
void
setBank
(
String
bank
)
{
this
.
bank
=
bank
;
}
@BindingAdapter
(
"logo_bank"
)
public
static
void
loadImage
(
ImageView
view
,
String
url
)
{
Glide
.
with
(
view
.
getContext
())
.
load
(
url
)
.
into
(
view
);
}
}
\ No newline at end of file
app/src/main/res/anim/zoom_in.xml
0 → 100644
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<scale
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:duration=
"1000"
android:fromXScale=
"2"
android:fromYScale=
"2"
android:pivotX=
"50%"
android:pivotY=
"50%"
android:toXScale=
"4"
android:toYScale=
"4"
>
</scale>
</set>
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
deleted
100644 → 0
View file @
fd0a033f
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:aapt=
"http://schemas.android.com/aapt"
android:width=
"108dp"
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<path
android:pathData=
"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"
>
<aapt:attr
name=
"android:fillColor"
>
<gradient
android:endX=
"85.84757"
android:endY=
"92.4963"
android:startX=
"42.9492"
android:startY=
"49.59793"
android:type=
"linear"
>
<item
android:color=
"#44000000"
android:offset=
"0.0"
/>
<item
android:color=
"#00000000"
android:offset=
"1.0"
/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor=
"#FFFFFF"
android:fillType=
"nonZero"
android:pathData=
"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth=
"1"
android:strokeColor=
"#00000000"
/>
</vector>
\ No newline at end of file
app/src/main/res/drawable/ic_launcher_background.xml
deleted
100644 → 0
View file @
fd0a033f
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"108dp"
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<path
android:fillColor=
"#3DDC84"
android:pathData=
"M0,0h108v108h-108z"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M9,0L9,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,0L19,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M29,0L29,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M39,0L39,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M49,0L49,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M59,0L59,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M69,0L69,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M79,0L79,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M89,0L89,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M99,0L99,108"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,9L108,9"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,19L108,19"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,29L108,29"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,39L108,39"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,49L108,49"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,59L108,59"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,69L108,69"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,79L108,79"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,89L108,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M0,99L108,99"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,29L89,29"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,39L89,39"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,49L89,49"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,59L89,59"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,69L89,69"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M19,79L89,79"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M29,19L29,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M39,19L39,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M49,19L49,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M59,19L59,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M69,19L69,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
<path
android:fillColor=
"#00000000"
android:pathData=
"M79,19L79,89"
android:strokeWidth=
"0.8"
android:strokeColor=
"#33FFFFFF"
/>
</vector>
app/src/main/res/drawable/ic_launcher_foreground.xml
→
app/src/main/res/drawable/ic_launcher_
new_icon_
foreground.xml
View file @
27ba5480
...
...
@@ -3,10 +3,10 @@
android:height=
"108dp"
android:viewportWidth=
"108"
android:viewportHeight=
"108"
>
<group
android:scaleX=
"0.
8991456
6"
android:scaleY=
"0.
8991456
6"
android:translateX=
"2
6.61
"
android:translateY=
"3
5.04218
7"
>
<group
android:scaleX=
"0.
9226867
6"
android:scaleY=
"0.
9226867
6"
android:translateX=
"2
5.62
"
android:translateY=
"3
4.27295
7"
>
<path
android:pathData=
"M8.5,28.182m-8.5,0a8.5,8.5 0,1 1,17 0a8.5,8.5 0,1 1,-17 0"
android:fillColor=
"#fff"
/>
...
...
app/src/main/res/layout/activity_cart.xml
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
xmlns:tools=
"http://schemas.android.com/tools"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_height=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
<include
android:id=
"@+id/cAppBar"
layout=
"@layout/app_bar"
/>
<com.google.android.material.card.MaterialCardView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/cAppBar"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
...
...
@@ -118,3 +129,14 @@
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/btCheckout"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/title_checkout"
android:layout_margin=
"10dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_login.xml
0 → 100644
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/colorPrimaryDark"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
27ba5480
...
...
@@ -7,19 +7,18 @@
tools:context=
".MainActivity"
>
<include
android:id=
"@+id/topAppBar"
android:id=
"@+id/topBar"
layout=
"@layout/appbar_dashboard"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
layout=
"@layout/appbar_dashboard"
>
</include>
android:layout_height=
"wrap_content"
></include>
<include
android:id=
"@+id/category"
layout=
"@layout/item_category"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@+id/topAppBar
"
layout=
"@layout/item_category"
/>
android:layout_marginTop=
"10dp
"
app:layout_constraintTop_toBottomOf=
"@+id/topBar"
/>
<!-- Scrollable content -->
...
...
@@ -30,11 +29,9 @@
android:overScrollMode=
"never"
android:padding=
"12sp"
app:layoutManager=
"androidx.recyclerview.widget.GridLayoutManager"
app:spanCount=
"2"
app:layout_constraintTop_toBottomOf=
"@id/category"
app:spanCount=
"2"
tools:listitem=
"@layout/item_list"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_payment.xml
View file @
27ba5480
...
...
@@ -4,14 +4,22 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:padding=
"10dp"
tools:context=
".PaymentActivity"
>
<include
android:id=
"@+id/appbar"
layout=
"@layout/app_bar"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvPayment"
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
app:layout_constraintTop_to
TopOf=
"parent"
/>
android:layout_height=
"
wrap_cont
ent"
app:layout_constraintTop_to
BottomOf=
"@id/appbar"
/>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/btnPay"
...
...
app/src/main/res/layout/activity_product.xml
0 → 100644
View file @
27ba5480
<?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=
".ProductActivity"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_splash.xml
View file @
27ba5480
...
...
@@ -6,6 +6,7 @@
android:background=
"@color/colorPrimaryDark"
>
<ImageView
android:id=
"@+id/image_splash"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:src=
"@drawable/ic_meser_icon"
...
...
app/src/main/res/layout/app_bar.xml
0 → 100644
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
android:id=
"@+id/topAppBar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:elevation=
"0dp"
style=
"@style/Widget.MaterialComponents.Toolbar.Primary"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
</com.google.android.material.appbar.MaterialToolbar>
app/src/main/res/layout/appbar_dashboard.xml
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
android:id=
"@+id/topAppBar"
<com.google.android.material.appbar.AppBarLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:elevation=
"0dp"
style=
"@style/Widget.MaterialComponents.Toolbar.Primary"
xmlns:android=
"http://schemas.android.com/apk/res/android"
app:menu=
"@menu/home"
app:navigationIcon=
"@drawable/ic_meser"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
android:paddingStart=
"15dp"
>
<com.google.android.material.
textfield.TextInputLayout
android:id=
"@+id/t
ilSearch
"
style=
"@style/Widget.MaterialComponents.T
extInputLayout.OutlinedBox.Dense
"
<com.google.android.material.
appbar.MaterialToolbar
android:id=
"@+id/t
opAppBar
"
style=
"@style/Widget.MaterialComponents.T
oolbar.Primary
"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:layout_marginTop=
"30dp"
android:elevation=
"0dp"
app:menu=
"@menu/home"
app:navigationIcon=
"@drawable/ic_meser"
>
<
com.google.android.material.textfield.TextInput
EditText
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:drawableStart=
"@drawable/ic_baseline_search_24"
android:hint=
"Search"
android:imeOptions=
"actionSearch"
android:outlineSpotShadowColor=
"#fff"
android:paddingStart=
"10dp"
android:textColor=
"#fff"
android:textColorHighlight=
"#fff"
android:textColorHint=
"#fff"
/>
</com.google.android.material.textfield.TextInputLayout>
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.MaterialToolbar>
</com.google.android.material.appbar.AppBarLayout>
app/src/main/res/layout/item_category.xml
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<HorizontalScrollView
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_height=
"40dp"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:scrollbars=
"none"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
android:paddingStart=
"10dp"
android:paddingTop=
"5dp"
android:paddingEnd=
"10dp"
android:orientation=
"horizontal"
>
android:paddingEnd=
"10dp"
>
<com.google.android.material.card.MaterialCardView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:backgroundTint=
"@color/ic_launcher_background"
app:cardCornerRadius=
"20dp"
>
app:cardCornerRadius=
"15dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
...
...
@@ -27,10 +27,10 @@
<ImageView
android:id=
"@+id/image_cat"
android:layout_width=
"20dp"
android:layout_height=
"30dp"
android:src=
"@drawable/ic_meser"
android:layout_width=
"30dp"
android:layout_height=
"50dp"
android:layout_marginStart=
"10dp"
android:src=
"@drawable/ic_meser"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.06"
...
...
@@ -42,16 +42,16 @@
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"40dp"
android:fontFamily=
"@font/roboto"
android:text=
"Food"
android:textStyle=
"bold"
android:textSize=
"20sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/image_cat"
app:layout_constraintTop_toTopOf=
"parent"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"40dp"
tools:ignore=
"MissingConstraints"
/>
...
...
@@ -61,9 +61,9 @@
<com.google.android.material.card.MaterialCardView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:backgroundTint=
"@color/ic_launcher_background"
android:layout_marginStart=
"20dp"
app:cardCornerRadius=
"20dp"
>
android:backgroundTint=
"@color/ic_launcher_background"
app:cardCornerRadius=
"15dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
...
...
@@ -71,10 +71,10 @@
<ImageView
android:id=
"@+id/image_cat1"
android:layout_width=
"20dp"
android:layout_height=
"30dp"
android:src=
"@drawable/ic_meser"
android:layout_width=
"30dp"
android:layout_height=
"50dp"
android:layout_marginStart=
"10dp"
android:src=
"@drawable/ic_meser"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.06"
...
...
@@ -86,16 +86,16 @@
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"40dp"
android:fontFamily=
"@font/roboto"
android:text=
"Food"
android:textStyle=
"bold"
android:textSize=
"20sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/image_cat1"
app:layout_constraintTop_toTopOf=
"parent"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"40dp"
tools:ignore=
"MissingConstraints"
/>
...
...
@@ -105,9 +105,11 @@
<com.google.android.material.card.MaterialCardView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:backgroundTint=
"@color/ic_launcher_background"
android:layout_marginStart=
"20dp"
app:cardCornerRadius=
"20dp"
>
android:backgroundTint=
"@color/ic_launcher_background"
app:cardCornerRadius=
"15dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
...
...
@@ -115,10 +117,10 @@
<ImageView
android:id=
"@+id/image_cat2"
android:layout_width=
"20dp"
android:layout_height=
"30dp"
android:src=
"@drawable/ic_meser"
android:layout_width=
"30dp"
android:layout_height=
"50dp"
android:layout_marginStart=
"10dp"
android:src=
"@drawable/ic_meser"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.06"
...
...
@@ -130,16 +132,16 @@
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"40dp"
android:fontFamily=
"@font/roboto"
android:text=
"Food"
android:textStyle=
"bold"
android:textSize=
"20sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/image_cat2"
app:layout_constraintTop_toTopOf=
"parent"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"40dp"
tools:ignore=
"MissingConstraints"
/>
...
...
app/src/main/res/layout/item_list.xml
View file @
27ba5480
...
...
@@ -64,7 +64,7 @@
android:gravity=
"end"
android:paddingStart=
"@dimen/material_emphasis_medium"
android:paddingEnd=
"@dimen/material_emphasis_disabled"
android:textColor=
"@
drawable/ic_launcher_background
"
android:textColor=
"@
color/colorPrimary
"
android:textSize=
"12sp"
/>
<com.google.android.material.textview.MaterialTextView
...
...
app/src/main/res/layout/payment_list.xml
View file @
27ba5480
...
...
@@ -8,6 +8,10 @@
<variable
name=
"payment"
type=
"com.yono.messeripos.response.PaymentResponse"
/>
<variable
name=
"logo"
type=
"String"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
...
...
@@ -45,6 +49,7 @@
android:layout_width=
"131dp"
android:layout_height=
"39dp"
android:src=
"@drawable/ic_bni_logo"
app:logo_bank=
"@{logo}"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
View file @
27ba5480
...
...
@@ -2,5 +2,5 @@
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<background
android:drawable=
"@color/ic_launcher_background"
/>
<foreground
android:drawable=
"@drawable/ic_
meser
"
/>
<foreground
android:drawable=
"@drawable/ic_
launcher_new_icon_foreground
"
/>
</adaptive-icon>
\ No newline at end of file
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml~
0 → 100644
View file @
27ba5480
app/src/main/res/mipmap-anydpi-v26/ic_launcher_new_icon.xml
0 → 100644
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<background
android:drawable=
"@color/ic_launcher_background"
/>
<foreground
android:drawable=
"@drawable/ic_launcher_new_icon_foreground"
/>
</adaptive-icon>
\ No newline at end of file
app/src/main/res/mipmap-anydpi-v26/ic_launcher_new_icon_round.xml
0 → 100644
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<background
android:drawable=
"@color/ic_launcher_background"
/>
<foreground
android:drawable=
"@drawable/ic_launcher_new_icon_foreground"
/>
</adaptive-icon>
\ No newline at end of file
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<background
android:drawable=
"@color/ic_launcher_background"
/>
<foreground
android:drawable=
"@drawable/ic_
meser
"
/>
<foreground
android:drawable=
"@drawable/ic_
launcher_new_icon_foreground
"
/>
</adaptive-icon>
\ No newline at end of file
app/src/main/res/mipmap-hdpi/ic_launcher_new_icon.png
0 → 100644
View file @
27ba5480
1.64 KB
app/src/main/res/mipmap-hdpi/ic_launcher_new_icon_round.png
0 → 100644
View file @
27ba5480
3.54 KB
app/src/main/res/mipmap-mdpi/ic_launcher_new_icon.png
0 → 100644
View file @
27ba5480
1.15 KB
app/src/main/res/mipmap-mdpi/ic_launcher_new_icon_round.png
0 → 100644
View file @
27ba5480
2.23 KB
app/src/main/res/mipmap-xhdpi/ic_launcher_new_icon.png
0 → 100644
View file @
27ba5480
2.28 KB
app/src/main/res/mipmap-xhdpi/ic_launcher_new_icon_round.png
0 → 100644
View file @
27ba5480
5.04 KB
app/src/main/res/mipmap-xxhdpi/ic_launcher_new_icon.png
0 → 100644
View file @
27ba5480
3.49 KB
app/src/main/res/mipmap-xxhdpi/ic_launcher_new_icon_round.png
0 → 100644
View file @
27ba5480
7.77 KB
app/src/main/res/mipmap-xxxhdpi/ic_launcher_new_icon.png
0 → 100644
View file @
27ba5480
4.83 KB
app/src/main/res/mipmap-xxxhdpi/ic_launcher_new_icon_round.png
0 → 100644
View file @
27ba5480
11.2 KB
app/src/main/res/values/ic_launcher_new_icon_background.xml
0 → 100644
View file @
27ba5480
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"ic_launcher_new_icon_background"
>
#5B4CFF
</color>
</resources>
\ No newline at end of file
app/src/main/res/values/styles.xml
View file @
27ba5480
...
...
@@ -14,6 +14,12 @@
<item
name=
"actionBarStyle"
>
@style/ThemeActionBar
</item>
</style>
<style
name=
"AppTheme.appbar"
parent=
"Theme.MaterialComponents.Light.NoActionBar"
>
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
</style>
<style
name=
"ThemeActionBar"
parent=
"Widget.MaterialComponents.Light.ActionBar.Solid"
>
<item
name=
"android:background"
>
@null
</item>
<!-- Support library compatibility -->
...
...
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