Commit 2f40a98a authored by iman Fauzi's avatar iman Fauzi

Merge branch 'dev' of https://git.mdd.co.id:44195/muhammadsuryono/meser into dev

parents 5cb7044d ea484f56
......@@ -20,6 +20,15 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
......
......@@ -13,13 +13,16 @@
android:theme="@style/AppTheme">
<activity android:name=".PaymentActivity"></activity>
<activity android:name=".CartActivity" />
<activity android:name=".MainActivity">
<activity android:name=".SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
</activity>
<meta-data
android:name="preloaded_fonts"
......
package com.yono.messeripos;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.MaterialToolbar;
public class MainActivity extends AppCompatActivity {
......@@ -28,6 +27,9 @@ public class MainActivity extends AppCompatActivity {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
w.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
w.setStatusBarColor(ContextCompat.getColor(MainActivity.this, R.color.colorWhite));
}
toolbar = findViewById(R.id.topAppBar);
......@@ -37,7 +39,7 @@ public class MainActivity extends AppCompatActivity {
int id = item.getItemId();
if (id == R.id.menu_cart){
Toast.makeText(MainActivity.this, "Pesan cart", Toast.LENGTH_LONG).show();
startActivity(new Intent(MainActivity.this, CartActivity.class));
}
return true;
}
......
......@@ -13,10 +13,12 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.yono.messeripos.databinding.PaymentListBinding;
import java.util.ArrayList;
......@@ -34,24 +36,32 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.payment_list, parent, false);
PaymentListBinding paymentListBinding = DataBindingUtil.inflate(
LayoutInflater.from(parent.getContext()),
R.layout.payment_list,
parent,
false
);
return new ViewHolder(view);
// View view = LayoutInflater.from(parent.getContext())
// .inflate(R.layout.payment_list, parent, false);
return new ViewHolder(paymentListBinding);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.cardView.setTag(position);
holder.radioButton.setChecked(position == getPosition);
final PaymentModel paymentModel = paymentModels.get(position);
ImageView imageView = holder.logoComp;
Glide.with(context)
.load(paymentModel.getUrl())
.apply(new RequestOptions().placeholder(R.drawable.skeleton))
.into(imageView);
holder.binData(paymentModels.get(position));
// holder.cardView.setTag(position);
// holder.radioButton.setChecked(position == getPosition);
// final PaymentModel paymentModel = paymentModels.get(position);
//
// ImageView imageView = holder.logoComp;
//
// Glide.with(context)
// .load(paymentModel.getUrl())
// .apply(new RequestOptions().placeholder(R.drawable.skeleton))
// .into(imageView);
}
@Override
......@@ -60,33 +70,17 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
}
public class ViewHolder extends RecyclerView.ViewHolder {
PaymentListBinding binding;
public ViewHolder(@NonNull PaymentListBinding view) {
super(view.getRoot());
this.binding = view;
}
public CardView cardView;
public ImageView logoComp;
public RadioButton radioButton;
public TextView textView;
public Button btnPay;
public ViewHolder(@NonNull View itemView) {
super(itemView);
cardView = itemView.findViewById(R.id.cvPayment);
logoComp = itemView.findViewById(R.id.ivLogo);
radioButton = itemView.findViewById(R.id.rbPayment);
textView = itemView.findViewById(R.id.tvPayment);
btnPay = itemView.findViewById(R.id.btnPay);
public void binData(PaymentModel paymentModel){
binding.setPayment(paymentModel);
}
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getPosition = getAdapterPosition();
notifyDataSetChanged();
if (getPosition == Integer.parseInt(cardView.getTag().toString())) radioButton.setChecked(true); else radioButton.setChecked(false);
}
});
}
}
}
package com.yono.messeripos;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import androidx.appcompat.app.AppCompatActivity;
public class SplashScreen extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
}
}
package com.yono.messeripos.api;
public class ApiHelper {
}
package com.yono.messeripos.models;
import com.google.gson.annotations.SerializedName;
public class ProductModels {
@SerializedName("id_product")
private int idProduct;
@SerializedName("product_name")
private String productName;
@SerializedName("price")
private int priceProduct;
@SerializedName("stock")
private int stockProduct;
}
package com.yono.messeripos.response;
import com.google.gson.annotations.SerializedName;
public class DataResponse<T> {
@SerializedName("status")
private Boolean statusData;
@SerializedName("messages")
private String messageData;
@SerializedName("data")
private T data;
public Boolean getStatusData() {
return statusData;
}
public void setStatusData(Boolean statusData) {
this.statusData = statusData;
}
public String getMessageData() {
return messageData;
}
public void setMessageData(String messageData) {
this.messageData = messageData;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
......@@ -22,7 +22,7 @@
app:menu="@menu/home"
android:elevation="0dp"
app:navigationIcon="@drawable/ic_meser"
android:layout_marginTop="20dp"
android:layout_marginTop="30dp"
style="@style/Widget.MaterialComponents.Toolbar.Primary"
>
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorPrimaryDark">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/ic_meser_icon"
app:layout_constraintTop_toTopOf="parent"
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
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="payment"
type="com.yono.messeripos.PaymentModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginVertical="2dp">
......@@ -66,3 +73,4 @@
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
......@@ -3,4 +3,5 @@
<color name="colorPrimary">#3498DB</color>
<color name="colorPrimaryDark">#3498DB</color>
<color name="colorAccent">#0f4c75</color>
<color name="colorWhite">#fff</color>
</resources>
\ No newline at end of file
......@@ -6,13 +6,10 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:fontFamily">@font/roboto</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">true</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:actionBarStyle">@style/ThemeActionBar</item>
<item name="android:windowActionBarOverlay">false</item>
<item name="android:windowTranslucentStatus">true</item>
<!-- <item name="android:windowTranslucentNavigation">false</item>-->
<!-- <item name="windowActionBar">true</item>-->
<!-- <item name="windowNoTitle">true</item>-->
<item name="windowActionBarOverlay">true</item>
<item name="actionBarStyle">@style/ThemeActionBar</item>
</style>
......
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