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
e24b80e9
Commit
e24b80e9
authored
Aug 27, 2020
by
iman Fauzi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix layout main
parent
108224e5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
62 deletions
+40
-62
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+7
-6
logo.png
app/src/main/res/drawable/logo.png
+0
-0
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 @
e24b80e9
...
...
@@ -62,11 +62,12 @@ public class MainActivity extends AppCompatActivity {
@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
);
binding
.
appBarUpdate
.
setVisibility
(
View
.
GONE
);
//
binding.appBarUpdate.setVisibility(View.GONE);
Log
.
i
(
"Status Checkout main activity"
,
"onCreate: "
+
SplashScreen
.
checkout
);
showLoading
(
true
);
...
...
@@ -96,13 +97,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
)
{
...
...
@@ -279,7 +280,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 @
e24b80e9
1.46 KB
app/src/main/res/layout/activity_main.xml
View file @
e24b80e9
...
...
@@ -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"
>
...
...
@@ -66,11 +54,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"
...
...
@@ -78,20 +65,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"
...
...
@@ -100,11 +85,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 @
e24b80e9
...
...
@@ -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