Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
Your Cashier
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
Ahmad Abi Mulya
Your Cashier
Commits
a42f40f5
Commit
a42f40f5
authored
Aug 24, 2020
by
Trio Saputra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new updated
parent
6ac0ec6a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
+37
-7
ProductActivity.java
...ain/java/com/example/yourcashiertest/ProductActivity.java
+27
-1
activity_product.xml
app/src/main/res/layout/activity_product.xml
+10
-6
No files found.
app/src/main/java/com/example/yourcashiertest/ProductActivity.java
View file @
a42f40f5
...
...
@@ -2,13 +2,39 @@ package com.example.yourcashiertest;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.annotation.SuppressLint
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.AdapterView
;
import
android.widget.ArrayAdapter
;
import
android.widget.AutoCompleteTextView
;
import
android.widget.Spinner
;
public
class
ProductActivity
extends
AppCompatActivity
{
public
class
ProductActivity
extends
AppCompatActivity
implements
AdapterView
.
OnItemSelectedListener
{
AutoCompleteTextView
spCategory
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_product
);
spCategory
=
findViewById
(
R
.
id
.
spCategory
);
spCategory
.
setOnItemSelectedListener
(
this
);
ArrayAdapter
<
CharSequence
>
arrayAdapter
=
ArrayAdapter
.
createFromResource
(
this
,
R
.
array
.
category
,
android
.
R
.
layout
.
simple_spinner_item
);
arrayAdapter
.
setDropDownViewResource
(
android
.
R
.
layout
.
simple_spinner_dropdown_item
);
spCategory
.
setAdapter
(
arrayAdapter
);
}
@Override
public
void
onItemSelected
(
AdapterView
<?>
adapterView
,
View
view
,
int
i
,
long
l
)
{
}
@Override
public
void
onNothingSelected
(
AdapterView
<?>
adapterView
)
{
}
}
\ No newline at end of file
app/src/main/res/layout/activity_product.xml
View file @
a42f40f5
...
...
@@ -92,23 +92,27 @@
android:textSize=
"@dimen/text_default"
/>
</com.google.android.material.textfield.TextInputLayout>
<Spinner
android:id=
"@+id/spCategory"
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilCategory"
style=
"@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:listitem=
"@layout/support_simple_spinner_dropdown_item"
android:layout_below=
"@+id/tilPrice"
android:layout_marginStart=
"@dimen/space_default"
android:layout_marginBottom=
"@dimen/space_default"
android:layout_marginEnd=
"@dimen/space_default"
tools:ignore=
"NotSibling"
/>
android:layout_marginEnd=
"@dimen/space_default"
>
<AutoCompleteTextView
android:id=
"@+id/spCategory"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilDescription"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/
sp
Category"
android:layout_below=
"@id/
til
Category"
android:layout_marginStart=
"@dimen/space_default"
android:layout_marginEnd=
"@dimen/space_default"
>
...
...
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