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
9946f70e
Commit
9946f70e
authored
Aug 27, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Plain Diff
Merge sama iman
parents
4443b63a
4206e979
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
78 deletions
+47
-78
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+6
-6
logo.png
app/src/main/res/drawable/logo.png
+0
-0
activity_cart.xml
app/src/main/res/layout/activity_cart.xml
+8
-16
activity_main.xml
app/src/main/res/layout/activity_main.xml
+15
-32
item_category.xml
app/src/main/res/layout/item_category.xml
+18
-24
No files found.
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
9946f70e
...
...
@@ -75,7 +75,7 @@ public class MainActivity extends AppCompatActivity {
ProductAdapter
adapter
=
new
ProductAdapter
();
binding
.
rvProduct
.
setAdapter
(
adapter
);
binding
.
appBarUpdate
.
setVisibility
(
View
.
GONE
);
//
binding.appBarUpdate.setVisibility(View.GONE);
showLoading
(
true
);
categoryAdapter
=
new
CategoryAdapter
();
...
...
@@ -123,13 +123,13 @@ public class MainActivity extends AppCompatActivity {
status_update
=
true
;
binding
.
topAppBar
.
setVisibility
(
View
.
GONE
);
binding
.
rvCategory
.
setVisibility
(
View
.
GONE
);
binding
.
appBarUpdate
.
setVisibility
(
View
.
VISIBLE
);
MaterialToolbar
toolbars
=
findViewById
(
R
.
id
.
appBarUpdate
);
setSupportActionBar
(
toolbars
);
//
binding.appBarUpdate.setVisibility(View.VISIBLE);
//
MaterialToolbar toolbars = findViewById(R.id.appBarUpdate);
//
setSupportActionBar(toolbars);
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
getSupportActionBar
().
setDisplayShowHomeEnabled
(
true
);
getSupportActionBar
().
setTitle
(
"Update Product"
);
toolbars
.
setNavigationOnClickListener
(
view
->
updateFinish
());
//
toolbars.setNavigationOnClickListener(view -> updateFinish());
productAdapter
.
notifyDataSetChanged
();
}
else
if
(
id
==
R
.
id
.
create
)
{
...
...
@@ -355,7 +355,7 @@ public class MainActivity extends AppCompatActivity {
status_update
=
false
;
binding
.
topAppBar
.
setVisibility
(
View
.
VISIBLE
);
binding
.
rvCategory
.
setVisibility
(
View
.
VISIBLE
);
binding
.
appBarUpdate
.
setVisibility
(
View
.
GONE
);
//
binding.appBarUpdate.setVisibility(View.GONE);
productAdapter
.
notifyDataSetChanged
();
}
...
...
app/src/main/res/drawable/logo.png
0 → 100644
View file @
9946f70e
1.46 KB
app/src/main/res/layout/activity_cart.xml
View file @
9946f70e
<?xml version="1.0" encoding="utf-8"?>
<
androidx.constraintlayout.widget.Constraint
Layout
<
Relative
Layout
android:layout_height=
"match_parent"
android:layout_width=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
...
...
@@ -11,31 +11,23 @@
android:id=
"@+id/cAppBar"
layout=
"@layout/app_bar"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvCart"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_above=
"@id/btCheckout"
android:layout_below=
"@id/cAppBar"
android:overScrollMode=
"never"
android:padding=
"1sp"
app:layoutManager=
"androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toTopOf=
"@id/btCheckout"
app:layout_constraintTop_toBottomOf=
"@id/cAppBar"
app:layout_constraintVertical_bias=
"0.0"
tools:layout_editor_absoluteX=
"0dp"
tools:listitem=
"@layout/item_cart"
/>
<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:padding=
"15dp"
android:textSize=
"16sp"
android:layout_alignParentBottom=
"true"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
android:background=
"@color/colorPrimary"
android:gravity=
"center"
android:text=
"@string/title_checkout"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
</RelativeLayout>
app/src/main/res/layout/activity_main.xml
View file @
9946f70e
...
...
@@ -9,7 +9,7 @@
type=
"com.yono.messeripos.models.MainViewModels"
/>
</data>
<
androidx.constraintlayout.widget.Constraint
Layout
<
Relative
Layout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".MainActivity"
>
...
...
@@ -23,28 +23,16 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:paddingTop=
"20dp"
tools:ignore=
"RtlSymmetry"
>
<com.google.android.material.appbar.MaterialToolbar
android:id=
"@+id/appBarUpdate"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:elevation=
"0dp"
android:paddingTop=
"0dp"
android:background=
"@drawable/gradient"
style=
"@style/Widget.MaterialComponents.Toolbar.Primary"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
</com.google.android.material.appbar.MaterialToolbar>
android:paddingTop=
"20dp"
>
<com.google.android.material.appbar.MaterialToolbar
android:id=
"@+id/topAppBar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/gradient"
app:menu=
"@menu/home"
android:elevation=
"0dp"
app:navigationIcon=
"@
mipmap/ic_meser_icon
"
app:navigationIcon=
"@
drawable/logo
"
style=
"@style/Widget.MaterialComponents.Toolbar.Primary"
>
...
...
@@ -67,11 +55,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvCategory"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:layout_marginStart=
"5dp"
app:layout_constraintTop_toBottomOf=
"@id/topBar"
android:layout_marginTop=
"10dp"
tools:listitem=
"@layout/item_category"
/>
android:layout_height=
"wrap_content"
tools:listitem=
"@layout/item_category"
android:layout_below=
"@id/topBar"
android:layout_above=
"@id/imgEmpty"
/>
<ImageView
android:id=
"@+id/imgEmpty"
...
...
@@ -79,20 +66,18 @@
android:layout_height=
"wrap_content"
android:visibility=
"gone"
android:src=
"@drawable/no"
app:layout_constraintTop_toBottomOf=
"@id/rvCategory"
/>
android:layout_below=
"@id/topBar"
android:foregroundGravity=
"center"
/>
<ProgressBar
android:id=
"@+id/pbLoading"
android:indeterminateTint=
"@color/colorAccent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:backgroundTint=
"@color/colorAccent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
android:indeterminateTint=
"@color/colorAccent"
android:layout_centerInParent=
"true"
/>
<!--
Scrollable content -->
<!--
Scrollable content -->
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvProduct"
android:layout_width=
"match_parent"
...
...
@@ -101,11 +86,9 @@
app:layoutManager=
"androidx.recyclerview.widget.GridLayoutManager"
app:spanCount=
"2"
android:layout_marginHorizontal=
"5dp"
app:layout_constraintTop_toBottomOf=
"@id/rvCategory"
tools:listitem=
"@layout/item_list"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
android:layout_below=
"@id/rvCategory"
/>
</
androidx.constraintlayout.widget.Constraint
Layout>
</
Relative
Layout>
</layout>
\ No newline at end of file
app/src/main/res/layout/item_category.xml
View file @
9946f70e
...
...
@@ -10,59 +10,53 @@
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_height=
"
40dp
"
android:layout_height=
"
wrap_content
"
android:layout_width=
"wrap_content"
android:layout_marginEnd=
"5dp"
>
android:paddingVertical=
"10dp"
android:layout_marginHorizontal=
"3dp"
>
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/cvCategory"
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
android:layout_height=
"
wrap_cont
ent"
android:backgroundTint=
"#2041B8"
android:clickable=
"true"
android:focusable=
"true"
android:checkable=
"true"
app:cardCornerRadius=
"40dp"
>
app:cardCornerRadius=
"50dp"
android:clipToPadding=
"true"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
>
<
androidx.constraintlayout.widget.Constraint
Layout
<
Relative
Layout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"wrap_content"
android:paddingHorizontal=
"20dp"
>
<ImageView
android:id=
"@+id/image_cat"
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"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.0"
tools:ignore=
"MissingConstraints"
/>
android:src=
"@drawable/ic_meser"
/>
<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=
"@{category.nameCategory}"
android:textStyle=
"bold"
android:textSize=
"20sp"
android:textColor=
"#fff"
tools:text=
"@tools:sample/full_names"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/image_cat"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"MissingConstraints"
/>
tools:text=
"elizabeth"
android:layout_toRightOf=
"@id/image_cat"
android:layout_centerInParent=
"true"
/>
</
androidx.constraintlayout.widget.Constraint
Layout>
</
Relative
Layout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
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