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
7686d289
Commit
7686d289
authored
Aug 24, 2020
by
Alfansyah Fadlian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard design
parent
354072de
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
129 deletions
+40
-129
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+0
-9
ProductAdapter.java
...main/java/com/yono/messeripos/adapter/ProductAdapter.java
+0
-74
activity_main.xml
app/src/main/res/layout/activity_main.xml
+10
-45
appbar_dashboard.xml
app/src/main/res/layout/appbar_dashboard.xml
+29
-0
item_category.xml
app/src/main/res/layout/item_category.xml
+1
-1
No files found.
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
7686d289
...
...
@@ -7,24 +7,17 @@ import android.view.MenuItem;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.Toast
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.core.content.ContextCompat
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.google.android.material.appbar.MaterialToolbar
;
import
com.yono.messeripos.adapter.PaymentAdapter
;
import
com.yono.messeripos.adapter.ProductAdapter
;
import
com.yono.messeripos.models.ProductModels
;
import
com.yono.messeripos.response.PaymentResponse
;
import
java.util.ArrayList
;
public
class
MainActivity
extends
AppCompatActivity
{
private
ArrayList
<
ProductModels
>
productModels
=
new
ArrayList
<>();
MaterialToolbar
toolbar
;
...
...
@@ -34,8 +27,6 @@ public class MainActivity extends AppCompatActivity {
setContentView
(
R
.
layout
.
activity_main
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
w
=
getWindow
();
w
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
,
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
);
...
...
app/src/main/java/com/yono/messeripos/adapter/ProductAdapter.java
deleted
100644 → 0
View file @
354072de
package
com
.
yono
.
messeripos
.
adapter
;
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
.
ViewHolder
>
{
private
List
<
ProductModels
>
products
=
new
ArrayList
<>();
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
>
products
)
{
this
.
products
=
products
;
notifyDataSetChanged
();
}
@NonNull
@Override
public
ProductAdapter
.
ViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
return
new
ViewHolder
(
DataBindingUtil
.
inflate
(
LayoutInflater
.
from
(
parent
.
getContext
()),
R
.
layout
.
item_list
,
parent
,
false
)
);
}
@Override
public
void
onBindViewHolder
(
@NonNull
ProductAdapter
.
ViewHolder
holder
,
int
position
)
{
holder
.
bindData
(
products
.
get
(
position
),
listener
);
}
@Override
public
int
getItemCount
()
{
return
0
;
}
public
static
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
private
ItemListBinding
binding
;
public
ViewHolder
(
@NonNull
ItemListBinding
binding
)
{
super
(
binding
.
getRoot
());
this
.
binding
=
binding
;
}
public
void
bindData
(
ProductModels
productModels
,
ProductListener
listener
)
{
}
}
}
app/src/main/res/layout/activity_main.xml
View file @
7686d289
...
...
@@ -6,51 +6,19 @@
android:layout_height=
"match_parent"
tools:context=
".MainActivity"
>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<com.google.android.material.appbar.AppBarLayout
android:id=
"@+id/AppBar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingStart=
"15dp"
>
<com.google.android.material.appbar.MaterialToolbar
<include
android:id=
"@+id/topAppBar"
style=
"@style/Widget.MaterialComponents.Toolbar.Primary"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"30dp"
android:elevation=
"0dp"
app:menu=
"@menu/home"
app:navigationIcon=
"@drawable/ic_meser"
>
layout=
"@layout/appbar_dashboard"
>
</include>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilSearch"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<include
android:id=
"@+id/category"
<com.google.android.material.textfield.TextInputEditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:drawableStart=
"@drawable/ic_baseline_search_24"
android:hint=
"Search"
android:imeOptions=
"actionSearch"
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.AppBarLayout>
<include
android:id=
"@+id/category"
app:layout_constraintTop_toBottomOf=
"@id/tilSearch"
app:layout_constraintTop_toBottomOf=
"@+id/topAppBar"
layout=
"@layout/item_category"
/>
...
...
@@ -58,18 +26,15 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvProduct"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@+id/tvNew"
android:layout_below=
"@id/topAppBar"
android:layout_height=
"wrap_content"
android:overScrollMode=
"never"
android:padding=
"12sp"
app:layoutManager=
"androidx.recyclerview.widget.GridLayoutManager"
app:spanCount=
"2"
app:layout_constraintTop_toBottomOf=
"@id/category"
tools:listitem=
"@layout/item_list"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/appbar_dashboard.xml
0 → 100644
View file @
7686d289
<?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"
app:menu=
"@menu/home"
app:navigationIcon=
"@drawable/ic_meser"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilSearch"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:drawableStart=
"@drawable/ic_baseline_search_24"
android:hint=
"Search"
android:imeOptions=
"actionSearch"
android:textColor=
"#fff"
android:textColorHighlight=
"#fff"
android:textColorHint=
"#fff"
/>
</com.google.android.material.textfield.TextInputLayout>
</com.google.android.material.appbar.MaterialToolbar>
app/src/main/res/layout/item_category.xml
View file @
7686d289
...
...
@@ -43,7 +43,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:fontFamily=
"@font/roboto"
android:text=
"
Phones
"
android:text=
"
Food
"
android:textStyle=
"bold"
android:textSize=
"20sp"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
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