detail barang 2 edit hapus button

This commit is contained in:
eko 2022-08-19 13:39:54 +07:00
parent b692d733d1
commit d07d46c867
13 changed files with 304 additions and 15 deletions

View File

@ -17,10 +17,12 @@
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/drawable/rounded_white_kehadiran.xml" value="0.37864583333333335" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/drawable/stroke_bluesoft.xml" value="0.36302083333333335" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/activity_barang.xml" value="0.30104166666666665" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/activity_dashboard.xml" value="0.5" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/activity_detail_barang.xml" value="0.25" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/activity_login.xml" value="0.3078125" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/activity_main.xml" value="0.2911458333333333" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/recycle_barang.xml" value="0.2911458333333333" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/recycle_dahsboard_top.xml" value="0.28958333333333336" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/recycleview_barang.xml" value="0.75" />
<entry key="..\:/Users/eko/AndroidStudioProjects/inventaris/app/src/main/res/layout/tg.xml" value="0.3625" />
</map>

View File

@ -12,11 +12,16 @@
android:supportsRtl="true"
android:theme="@style/Theme.Inventaris"
android:usesCleartextTraffic="true">
<activity
android:name=".activity.DashboardActivity"
android:exported="true" >
</activity>
<activity
android:name=".activity.DetailBarangActivity"
android:exported="false"
android:label="Detail Barang"
android:parentActivityName=".activity.BarangActivity"
android:exported="false" />
android:parentActivityName=".activity.BarangActivity" />
<activity
android:name=".login.LoginActivity"
android:exported="true">
@ -28,7 +33,7 @@
</activity>
<activity
android:name=".activity.BarangActivity"
android:exported="true"></activity>
android:exported="true" />
</application>
</manifest>

View File

@ -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<ModelDashboardTop> 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<ModelDashboardTop> getTop() {
List<ModelDashboardTop> allItems = new ArrayList<ModelDashboardTop>();
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;
}
}

View File

@ -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<AdapterDashboardTop.MoreMenuHolder> {
private List<ModelDashboardTop> list_one;
private Context context;
public AdapterDashboardTop(List<ModelDashboardTop> 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) {
}
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

Binary file not shown.

After

(image error) Size: 6.4 KiB

View File

@ -0,0 +1,53 @@
<?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"
tools:context=".activity.DashboardActivity">
<View
android:id="@+id/view"
android:layout_width="0dp"
android:layout_height="250dp"
android:background="#636fe5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/sibanuputih" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rctop"
android:layout_width="0dp"
android:layout_height="150dp"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2">
</androidx.recyclerview.widget.RecyclerView>
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="Mr. Sugeng Wa"
android:textColor="#fff"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/imageView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView2" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -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" />
<Button
android:id="@+id/buttonEdit"
android:layout_width="120dp"
android:layout_height="60dp"
android:layout_marginTop="16dp"
android:drawableLeft="@drawable/ic_edit"
android:text="Edit"
android:textAllCaps="false"
app:cornerRadius="20dp"
app:layout_constraintStart_toStartOf="@+id/editTextWaktuInput"
app:layout_constraintTop_toBottomOf="@+id/editTextWaktuInput" />
<Button
android:id="@+id/buttonHapus"
android:layout_width="120dp"
android:layout_height="60dp"
android:layout_marginTop="16dp"
android:drawableLeft="@drawable/ic_hapus"
android:text="Hapus"
android:backgroundTint="#EC407A"
android:textAllCaps="false"
app:cornerRadius="20dp"
app:layout_constraintEnd_toEndOf="@+id/editTextWaktuInput"
app:layout_constraintTop_toBottomOf="@+id/editTextWaktuInput" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,42 @@
<?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"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="200dp"
android:layout_height="80dp"
android:layout_margin="5dp"
android:background="@drawable/rounded_white_kehadiran"
android:orientation="vertical"
android:padding="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
<TextView
android:id="@+id/tvKeterangan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="keterangan" />
<TextView
android:id="@+id/tvJumlah"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#292929"
android:textSize="18dp"
android:text="TextView" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_200">#9145ec</color>
<color name="purple_500">#4047d8</color>
<color name="dashboard">#636fe5</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>

View File

@ -2,8 +2,8 @@
<!-- Base application theme. -->
<style name="Theme.Inventaris" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorPrimary">@color/dashboard</item>
<item name="colorPrimaryVariant">@color/dashboard</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>