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
b0c11049
Commit
b0c11049
authored
Aug 26, 2020
by
Alfansyah Fadlian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spinner product
parent
d508483d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
1 deletion
+62
-1
FormProductActivity.java
...rc/main/java/com/yono/messeripos/FormProductActivity.java
+29
-0
activity_invoice.xml
app/src/main/res/layout/activity_invoice.xml
+33
-0
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+0
-1
No files found.
app/src/main/java/com/yono/messeripos/FormProductActivity.java
View file @
b0c11049
...
...
@@ -11,8 +11,12 @@ import android.os.PersistableBundle;
import
android.provider.MediaStore
;
import
android.provider.Settings
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.AdapterView
;
import
android.widget.ArrayAdapter
;
import
android.widget.Spinner
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
...
...
@@ -29,6 +33,7 @@ import com.yono.messeripos.models.ProductModels;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
public
class
FormProductActivity
extends
AppCompatActivity
{
...
...
@@ -38,6 +43,12 @@ public class FormProductActivity extends AppCompatActivity {
private
static
final
int
REQUEST_IMAGE_CAPTURE
=
1
;
private
static
final
int
REQUEST_PERMISSIONS
=
448
;
private
boolean
isUpdate
=
false
;
private
Spinner
splistCategory
;
String
kondisi_spin
;
private
String
[]
default_category
=
{
"--pilih category--"
,
};
@Override
public
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
...
...
@@ -62,6 +73,23 @@ public class FormProductActivity extends AppCompatActivity {
binding
.
cvProduct
.
setOnClickListener
(
view
->
openFile
());
binding
.
btnAdd
.
setOnClickListener
(
view
->
saveProduct
());
//spinner
final
ArrayAdapter
<
String
>
adapter
=
new
ArrayAdapter
<>(
this
,
android
.
R
.
layout
.
simple_spinner_item
,
default_category
);
splistCategory
=
findViewById
(
R
.
id
.
listCategory
);
splistCategory
.
setAdapter
(
adapter
);
splistCategory
.
setOnItemSelectedListener
(
new
AdapterView
.
OnItemSelectedListener
()
{
@Override
public
void
onItemSelected
(
AdapterView
<?>
adapterView
,
View
view
,
int
i
,
long
l
)
{
kondisi_spin
=
splistCategory
.
getSelectedItem
().
toString
();
}
@Override
public
void
onNothingSelected
(
AdapterView
<?>
adapterView
)
{
}
});
}
...
...
@@ -147,4 +175,5 @@ public class FormProductActivity extends AppCompatActivity {
cursor
.
close
();
return
result
;
}
}
app/src/main/res/layout/activity_invoice.xml
View file @
b0c11049
...
...
@@ -4,6 +4,39 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/ic_launcher_new_icon_background"
tools:context=
".InvoiceActivity"
>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilInvoice"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:ignore=
"MissingConstraints"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/hint_price"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/cvInvoice"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"12sp"
app:cardCornerRadius=
"20dp"
app:layout_constraintTop_toBottomOf=
"@+id/tilInvoice"
tools:ignore=
"MissingConstraints"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"600dp"
>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_payment.xml
View file @
b0c11049
...
...
@@ -12,7 +12,6 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<androidx.recyclerview.widget.RecyclerView
...
...
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