Commit 799b9512 authored by Muhammad Suryono's avatar Muhammad Suryono

Fix merge with dashboard fadli and iman daiman abadan

parents 6ea65ccb 38ca79bc
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
package="com.yono.messeripos"> package="com.yono.messeripos">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature <uses-feature
android:name="android.hardware.camera" android:name="android.hardware.camera"
...@@ -17,14 +17,19 @@ ...@@ -17,14 +17,19 @@
android:roundIcon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme.appbar"> android:theme="@style/AppTheme.appbar">
<activity android:name=".LoginActivity" android:theme="@style/AppTheme.appbar" /> <activity android:name=".InvoiceActivity"></activity>
<activity
android:name=".LoginActivity"
android:theme="@style/AppTheme.appbar" />
<activity <activity
android:name=".PaymentActivity" android:name=".PaymentActivity"
android:theme="@style/AppTheme.appbar" /> android:theme="@style/AppTheme.appbar" />
<activity <activity
android:name=".CartActivity" android:name=".CartActivity"
android:theme="@style/AppTheme.appbar" /> android:theme="@style/AppTheme.appbar" />
<activity android:name=".ProductActivity" android:theme="@style/AppTheme.appbar" /> <activity
android:name=".ProductActivity"
android:theme="@style/AppTheme.appbar" />
<activity android:name=".SplashScreen"> <activity android:name=".SplashScreen">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
...@@ -44,7 +49,7 @@ ...@@ -44,7 +49,7 @@
android:grantUriPermissions="true"> android:grantUriPermissions="true">
<meta-data <meta-data
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/path"/> android:resource="@xml/path" />
</provider> </provider>
<meta-data <meta-data
......
...@@ -102,7 +102,6 @@ public class CartActivity extends AppCompatActivity { ...@@ -102,7 +102,6 @@ public class CartActivity extends AppCompatActivity {
} }
}); });
btnCheckout.setOnClickListener(new View.OnClickListener() { btnCheckout.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
...@@ -128,6 +127,17 @@ public class CartActivity extends AppCompatActivity { ...@@ -128,6 +127,17 @@ public class CartActivity extends AppCompatActivity {
} }
}); });
btnCheckout = findViewById(R.id.btCheckout);
//
btnCheckout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(CartActivity.this, PaymentActivity.class));
finish();
}
});
} }
} }
......
...@@ -13,9 +13,12 @@ import android.os.PersistableBundle; ...@@ -13,9 +13,12 @@ import android.os.PersistableBundle;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.provider.Settings; import android.provider.Settings;
import android.util.Log; import android.util.Log;
import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView; import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
...@@ -33,6 +36,7 @@ import com.yono.messeripos.models.ProductModels; ...@@ -33,6 +36,7 @@ import com.yono.messeripos.models.ProductModels;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
public class FormProductActivity extends AppCompatActivity { public class FormProductActivity extends AppCompatActivity {
...@@ -42,6 +46,12 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -42,6 +46,12 @@ public class FormProductActivity extends AppCompatActivity {
private static final int REQUEST_IMAGE_CAPTURE = 1; private static final int REQUEST_IMAGE_CAPTURE = 1;
private static final int REQUEST_PERMISSIONS = 448; private static final int REQUEST_PERMISSIONS = 448;
private boolean isUpdate = false; private boolean isUpdate = false;
private Spinner splistCategory;
String kondisi_spin;
private String[] default_category = {
"--pilih category--",
};
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
...@@ -66,6 +76,23 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -66,6 +76,23 @@ public class FormProductActivity extends AppCompatActivity {
binding.cvProduct.setOnClickListener(view -> openFile()); binding.cvProduct.setOnClickListener(view -> openFile());
binding.btnAdd.setOnClickListener(view -> saveProduct()); 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) {
}
});
} }
...@@ -152,4 +179,5 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -152,4 +179,5 @@ public class FormProductActivity extends AppCompatActivity {
cursor.close(); cursor.close();
return result; return result;
} }
} }
package com.yono.messeripos;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class InvoiceActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_invoice);
}
}
\ No newline at end of file
...@@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity; ...@@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
...@@ -22,9 +23,8 @@ import java.util.ArrayList; ...@@ -22,9 +23,8 @@ import java.util.ArrayList;
public class PaymentActivity extends AppCompatActivity { public class PaymentActivity extends AppCompatActivity {
private ArrayList<PaymentResponse> paymentResponses = new ArrayList<>(); private ArrayList<PaymentResponse> paymentResponses = new ArrayList<>();
Button btnPay;
public static String methodPay=""; public static String methodPay="";
private Button btnPay;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -72,3 +72,4 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -72,3 +72,4 @@ public class PaymentActivity extends AppCompatActivity {
}); });
} }
} }
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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.textview.MaterialTextView
android:id="@+id/tvProductName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
android:text="Invoice"
android:textColor="@color/colorWhite"
app:layout_constraintTop_toTopOf="parent" />
</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>
<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_margin="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -12,15 +12,111 @@ ...@@ -12,15 +12,111 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
/>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cvInvoice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:layout_margin="16dp"
app:cardCornerRadius="20dp"
android:scrollbars="vertical"
app:layout_constraintTop_toBottomOf="@+id/appbar"
tools:ignore="MissingConstraints">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="300dp"
>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvBilling"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/roboto"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="@string/hint_billing" />
<ImageView
android:id="@+id/image_splash"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/bill"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvBilling"
/> />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvBillingProduct"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/roboto"
android:textAlignment="center"
android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@+id/image_splash"
tools:text="@string/hint_product_name" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvBillingPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/roboto"
android:textAlignment="center"
android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@+id/tvBillingProduct"
tools:text="@string/hint_price" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvBillingQuantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/roboto"
android:textAlignment="center"
android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@+id/tvBillingPrice"
tools:text="@string/hint_quantity" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvBillingCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/roboto"
android:textAlignment="center"
android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@+id/tvBillingQuantity"
tools:text="@string/hint_category" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvBillingDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/roboto"
android:textAlignment="center"
android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@+id/tvBillingCategory"
tools:text="@string/hint_description" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvPayment" android:id="@+id/rvPayment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/appbar" android:overScrollMode="never"
/> app:layout_constraintTop_toBottomOf="@id/cvInvoice"/>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btnPay" android:id="@+id/btnPay"
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="60dp"
android:padding="15dp"> android:padding="15dp">
<View <View
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
<ImageView <ImageView
android:id="@+id/ivLogo" android:id="@+id/ivLogo"
android:layout_width="131dp" android:layout_width="120dp"
android:layout_height="39dp" android:layout_height="40dp"
android:src="@drawable/ic_bni_logo" android:src="@drawable/ic_bni_logo"
app:logo_bank="@{logo}" app:logo_bank="@{logo}"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
......
...@@ -22,5 +22,6 @@ ...@@ -22,5 +22,6 @@
<string name="price">Price</string> <string name="price">Price</string>
<string name="stock">Stock</string> <string name="stock">Stock</string>
<string name="add">Add</string> <string name="add">Add</string>
<string name="hint_billing">Billing</string>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment