From d07d46c8673a75bc6ae80f7bcabf41b3e24232bb Mon Sep 17 00:00:00 2001 From: eko Date: Fri, 19 Aug 2022 13:39:54 +0700 Subject: [PATCH] detail barang 2 edit hapus button --- .idea/misc.xml | 2 + app/src/main/AndroidManifest.xml | 11 ++- .../activity/DashboardActivity.java | 47 ++++++++++++ .../adapter/AdapterDashboardTop.java | 70 ++++++++++++++++++ .../inventaris/model/ModelDashboardTop.java | 27 +++++++ app/src/main/res/drawable/ic_edit.xml | 5 ++ app/src/main/res/drawable/ic_hapus.xml | 5 ++ app/src/main/res/drawable/sibanuputih.png | Bin 0 -> 6584 bytes .../main/res/layout/activity_dashboard.xml | 53 +++++++++++++ .../res/layout/activity_detail_barang.xml | 48 ++++++++++-- .../main/res/layout/recycle_dahsboard_top.xml | 42 +++++++++++ app/src/main/res/values/colors.xml | 5 +- app/src/main/res/values/themes.xml | 4 +- 13 files changed, 304 insertions(+), 15 deletions(-) create mode 100644 app/src/main/java/com/unej/inventaris/activity/DashboardActivity.java create mode 100644 app/src/main/java/com/unej/inventaris/adapter/AdapterDashboardTop.java create mode 100644 app/src/main/java/com/unej/inventaris/model/ModelDashboardTop.java create mode 100644 app/src/main/res/drawable/ic_edit.xml create mode 100644 app/src/main/res/drawable/ic_hapus.xml create mode 100644 app/src/main/res/drawable/sibanuputih.png create mode 100644 app/src/main/res/layout/activity_dashboard.xml create mode 100644 app/src/main/res/layout/recycle_dahsboard_top.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index 94f7cb5..de9a258 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -17,10 +17,12 @@ + + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 461adbc..9cd66af 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,11 +12,16 @@ android:supportsRtl="true" android:theme="@style/Theme.Inventaris" android:usesCleartextTraffic="true"> + + + + android:parentActivityName=".activity.BarangActivity" /> @@ -28,7 +33,7 @@ + android:exported="true" /> \ No newline at end of file diff --git a/app/src/main/java/com/unej/inventaris/activity/DashboardActivity.java b/app/src/main/java/com/unej/inventaris/activity/DashboardActivity.java new file mode 100644 index 0000000..7c5a659 --- /dev/null +++ b/app/src/main/java/com/unej/inventaris/activity/DashboardActivity.java @@ -0,0 +1,47 @@ +package com.unej.inventaris.activity; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import android.os.Bundle; + +import com.unej.inventaris.R; +import com.unej.inventaris.adapter.AdapterDashboardTop; +import com.unej.inventaris.model.ModelDashboardTop; + +import java.util.ArrayList; +import java.util.List; + +public class DashboardActivity extends AppCompatActivity { + + private List list_01; + private AdapterDashboardTop adapterDashboardTop; + private RecyclerView rctop; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_dashboard); + getSupportActionBar().hide(); + rctop = findViewById(R.id.rctop); + + list_01 = getTop(); + adapterDashboardTop = new AdapterDashboardTop(list_01, this); + rctop.setAdapter(adapterDashboardTop); + rctop.setHasFixedSize(true); + rctop.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true)); + + } + + + private List getTop() { + List allItems = new ArrayList(); + allItems.add(new ModelDashboardTop("JUMLAH TOTAL BARANG","126")); + allItems.add(new ModelDashboardTop("TOTAL PENGGUNA","2")); + allItems.add(new ModelDashboardTop("TOTAL BARANG KELUAR","14")); + allItems.add(new ModelDashboardTop("TOTAL DIVISI","4")); + return allItems; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/unej/inventaris/adapter/AdapterDashboardTop.java b/app/src/main/java/com/unej/inventaris/adapter/AdapterDashboardTop.java new file mode 100644 index 0000000..3932161 --- /dev/null +++ b/app/src/main/java/com/unej/inventaris/adapter/AdapterDashboardTop.java @@ -0,0 +1,70 @@ +package com.unej.inventaris.adapter; + +import android.content.Context; +import android.content.Intent; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + + +import com.unej.inventaris.R; +import com.unej.inventaris.model.ModelDashboardTop; + +import java.util.List; + +public class AdapterDashboardTop extends RecyclerView.Adapter { + private List list_one; + private Context context; + + public AdapterDashboardTop(List list_one, Context context) { + this.list_one = list_one; + this.context = context; + } + + @NonNull + @Override + public MoreMenuHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { + View view = LayoutInflater.from(context).inflate(R.layout.recycle_dahsboard_top, viewGroup, false); + MoreMenuHolder menuHolder = new MoreMenuHolder(view); + view.setTag(menuHolder); + return menuHolder; + } + + @Override + public void onBindViewHolder(@NonNull MoreMenuHolder holder, int position) { + holder.init(list_one.get(position)); + } + + @Override + public int getItemCount() { + return list_one.size(); + } + + public class MoreMenuHolder extends RecyclerView.ViewHolder implements View.OnClickListener { + private TextView tvketerangan, tvjumlah; + private int position; + + public MoreMenuHolder(@NonNull View itemView) { + super(itemView); + + tvketerangan = (TextView) itemView.findViewById(R.id.tvKeterangan); + tvjumlah = (TextView) itemView.findViewById(R.id.tvJumlah); + } + + public void init(ModelDashboardTop moreListModel) { + tvketerangan.setText(moreListModel.getKeterangan()); + tvjumlah.setText(moreListModel.getJumlah()); + + } + + @Override + public void onClick(View view) { + + } + } +} diff --git a/app/src/main/java/com/unej/inventaris/model/ModelDashboardTop.java b/app/src/main/java/com/unej/inventaris/model/ModelDashboardTop.java new file mode 100644 index 0000000..27bf4b6 --- /dev/null +++ b/app/src/main/java/com/unej/inventaris/model/ModelDashboardTop.java @@ -0,0 +1,27 @@ +package com.unej.inventaris.model; + +public class ModelDashboardTop { + String Keterangan; + String Jumlah; + + public ModelDashboardTop(String keterangan, String jumlah) { + Keterangan = keterangan; + Jumlah = jumlah; + } + + public String getKeterangan() { + return Keterangan; + } + + public void setKeterangan(String keterangan) { + Keterangan = keterangan; + } + + public String getJumlah() { + return Jumlah; + } + + public void setJumlah(String jumlah) { + Jumlah = jumlah; + } +} diff --git a/app/src/main/res/drawable/ic_edit.xml b/app/src/main/res/drawable/ic_edit.xml new file mode 100644 index 0000000..faddfce --- /dev/null +++ b/app/src/main/res/drawable/ic_edit.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_hapus.xml b/app/src/main/res/drawable/ic_hapus.xml new file mode 100644 index 0000000..282594c --- /dev/null +++ b/app/src/main/res/drawable/ic_hapus.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/sibanuputih.png b/app/src/main/res/drawable/sibanuputih.png new file mode 100644 index 0000000000000000000000000000000000000000..472d393304c714fb2217f1d9e2ca786cc551b8d5 GIT binary patch literal 6584 zcmcIp2UJtpx+XLM1*C}-Aq1qTfh2?k0+C(?X(A}7gd~s%At9lIG)1Hr!9i4{DF{-O zA_yXiKFaGbg2-8=WLx7N#AXPWGg^+pr$vk#C&lOjjfqK7djA6WKGO7NVq(8TJZI-=XJ(4Rl1Yjf z9N7u4=u4t7&`eAkn!Xea))nswbi%t3-O-?>>enD35r+oZs+d8{D7tt8(a4{QxAs4K z4(soVRl|WaPXjf4Q49hS-V+1#CAqoNP`+r;4_*|bzyDeZ1pEQ`UY=+WL+bB7kSKrBy3>Bfi4id+UkpVFstDQl=?|cp*48N1UwG45Eru^t-45T!^Y;!sc(2o4WdgMkqcXH_s33WtK7AP5{73Qm%pSUMQDzh~W7g<~*c5Ka(fWdszAMdF>oNEJ8+tOixVg4LW= zRqz-D1g@;ih}Pfi>XO~aR5LP;5nW{v5QjxMlc^*Oqkf1aj0;|g;_k9v%?x&i7e+)H zBXxd1*M~LU<7dx}2>elWC=7PL*3lsBevYCJB&tl z_VmF}@!BqoNdL#;Qu=q|X&CRnmX1|}V39ZsBg8Pc6WB==4hO5^Au3=eWjqpz#USB` z{lx!2O8?1?C1BiL@Qj^P3G{z==D(}rf9K3Ut*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MzRdO?b^$Ude5qhVyIA zji&}&J3+l>)V9v^rd;jK2H%^F9P7Y^&I#>3+Zbp(`)e|^@le_7B~ga}#Aa=woMes*Dy1>CQ-3v3p|aw&jdvCFQ^WX1QDf>x%%rE6$;&I!alp)H zgD#f5E6RP*hMW%)()fD}*)_9kMZGUuEWKc!J2BbTU;ll{)o5cyFe>Z$73!M(;jb?v zGP*H#7Be%2ff!!ZqjR{My@9iN=+$tp8rP?;exu=e{3R^qCiTlZ#`GXp$!P&e?vwtg z=UP1NhV0occbxrch@Sa2p4z2Y!LWG!RT=bH99+z+h^L769Urogk4@%VlZfZzMj?8R zhDqLy=ii}2pxAP4uEuWp*+GLzvrcn^Fb}RY=k7fM9h>QPfiFQ>NbrSiWcHHX%JN{4)LRR}c7@WKtWn`sy{)DB z`ssFFkmBcU=bV&1d_u6lX?im~Y!flPF3f+`V<*Gw*MK);&XNTqLJiyg9Cvdij|`Kg z%VlAg!u*@Ew>F#WqHzJjZ#BAwJ1x}1ZZNNU;hs=9U^Z9A^Q!Z9&!y)}4 z*BvKBIac?4HGDO|aWU>3=3czE(k>7E>7>EM9==z}w8Y|8Be>U`M6dhxBioqiI~VA$ zd`YH5B%SCn%4cD3@d~_$Dw{fAY(Cn!0$!v8LCH)HaC(Ufbd{nw%x()1^#B*5vXu8& z(HT>g7L|GJ79R=**}aZ+v2fRWoE8goGsxbvEZs%KBUZ{8N^3IDXVI3u0;>ga-dLytU#Y0^YqR(w`(ESPZH(O71IfKwTY_ngU=>$>F& z;jinM4NWI~w7=C4yw}zLRgB&jptvk{a;d&d@T~$JQ!DLtct{)<#3K&{)InSqbDSIszp%1Rp&;<8k8Rw44EYr7=n({<^_^CqIox6KwCM fJjVaBSr)Du9sQ2FQFUSezZGNsvwB53j$!`;1nGz) literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout/activity_dashboard.xml b/app/src/main/res/layout/activity_dashboard.xml new file mode 100644 index 0000000..754605a --- /dev/null +++ b/app/src/main/res/layout/activity_dashboard.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_detail_barang.xml b/app/src/main/res/layout/activity_detail_barang.xml index 86d0e37..dea5ec1 100644 --- a/app/src/main/res/layout/activity_detail_barang.xml +++ b/app/src/main/res/layout/activity_detail_barang.xml @@ -25,10 +25,11 @@ android:layout_width="0dp" android:layout_height="40dp" android:layout_marginEnd="16dp" - android:ems="10" - android:padding="5dp" android:background="@drawable/rounded_grey" + android:ems="10" + android:enabled="false" android:inputType="textPersonName" + android:padding="5dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="@+id/textView2" @@ -51,10 +52,11 @@ android:id="@+id/editTextSerialNumber" android:layout_width="0dp" android:layout_height="40dp" + android:background="@drawable/rounded_grey" android:ems="10" + android:enabled="false" android:inputType="textPersonName" android:padding="5dp" - android:background="@drawable/rounded_grey" app:layout_constraintEnd_toEndOf="@+id/editTextNamaBarang" app:layout_constraintStart_toStartOf="@+id/textView3" app:layout_constraintTop_toBottomOf="@+id/textView3" /> @@ -76,10 +78,11 @@ android:id="@+id/editTextJumlahBarang" android:layout_width="0dp" android:layout_height="40dp" + android:background="@drawable/rounded_grey" android:ems="10" + android:enabled="false" android:inputType="textPersonName" android:padding="5dp" - android:background="@drawable/rounded_grey" app:layout_constraintEnd_toEndOf="@+id/editTextSerialNumber" app:layout_constraintStart_toStartOf="@+id/textView4" app:layout_constraintTop_toBottomOf="@+id/textView4" /> @@ -101,10 +104,11 @@ android:id="@+id/editTextLokasi" android:layout_width="0dp" android:layout_height="40dp" - android:padding="5dp" android:background="@drawable/rounded_grey" android:ems="10" + android:enabled="false" android:inputType="textPersonName" + android:padding="5dp" app:layout_constraintEnd_toEndOf="@+id/editTextJumlahBarang" app:layout_constraintStart_toStartOf="@+id/editTextJumlahBarang" app:layout_constraintTop_toBottomOf="@+id/textView5" /> @@ -126,10 +130,11 @@ android:id="@+id/editTextKeterangan" android:layout_width="0dp" android:layout_height="40dp" - android:padding="5dp" android:background="@drawable/rounded_grey" android:ems="10" + android:enabled="false" android:inputType="textPersonName" + android:padding="5dp" app:layout_constraintEnd_toEndOf="@+id/editTextLokasi" app:layout_constraintStart_toStartOf="@+id/editTextLokasi" app:layout_constraintTop_toBottomOf="@+id/textView6" /> @@ -151,10 +156,11 @@ android:id="@+id/editTextTanggalMasuk" android:layout_width="0dp" android:layout_height="40dp" - android:padding="5dp" android:background="@drawable/rounded_grey" android:ems="10" + android:enabled="false" android:inputType="textPersonName" + android:padding="5dp" app:layout_constraintEnd_toEndOf="@+id/editTextKeterangan" app:layout_constraintStart_toStartOf="@+id/editTextKeterangan" app:layout_constraintTop_toBottomOf="@+id/textView7" /> @@ -176,11 +182,37 @@ android:id="@+id/editTextWaktuInput" android:layout_width="0dp" android:layout_height="40dp" - android:padding="5dp" android:background="@drawable/rounded_grey" android:ems="10" + android:enabled="false" android:inputType="textPersonName" + android:padding="5dp" app:layout_constraintEnd_toEndOf="@+id/editTextTanggalMasuk" app:layout_constraintStart_toStartOf="@+id/textView8" app:layout_constraintTop_toBottomOf="@+id/textView8" /> + +