Skip to content

Commit 231dd52

Browse files
author
mochammadfawwaz
committed
0.4.1 add fragment tambah tabungan
1 parent 1651568 commit 231dd52

File tree

5 files changed

+188
-4
lines changed

5 files changed

+188
-4
lines changed

.idea/misc.xml

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package com.fs.monize.ui.activity.menabung
2+
3+
import android.os.Bundle
4+
import androidx.fragment.app.Fragment
5+
import android.view.LayoutInflater
6+
import android.view.View
7+
import android.view.ViewGroup
8+
import com.fs.monize.R
9+
10+
// TODO: Rename parameter arguments, choose names that match
11+
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
12+
private const val ARG_PARAM1 = "param1"
13+
private const val ARG_PARAM2 = "param2"
14+
15+
/**
16+
* A simple [Fragment] subclass.
17+
* Use the [addSaving.newInstance] factory method to
18+
* create an instance of this fragment.
19+
*/
20+
class addSaving : Fragment() {
21+
// TODO: Rename and change types of parameters
22+
private var param1: String? = null
23+
private var param2: String? = null
24+
25+
override fun onCreate(savedInstanceState: Bundle?) {
26+
super.onCreate(savedInstanceState)
27+
arguments?.let {
28+
param1 = it.getString(ARG_PARAM1)
29+
param2 = it.getString(ARG_PARAM2)
30+
}
31+
}
32+
33+
override fun onCreateView(
34+
inflater: LayoutInflater, container: ViewGroup?,
35+
savedInstanceState: Bundle?
36+
): View? {
37+
// Inflate the layout for this fragment
38+
return inflater.inflate(R.layout.fragment_add_saving, container, false)
39+
}
40+
41+
companion object {
42+
/**
43+
* Use this factory method to create a new instance of
44+
* this fragment using the provided parameters.
45+
*
46+
* @param param1 Parameter 1.
47+
* @param param2 Parameter 2.
48+
* @return A new instance of fragment addSaving.
49+
*/
50+
// TODO: Rename and change types and number of parameters
51+
@JvmStatic
52+
fun newInstance(param1: String, param2: String) =
53+
addSaving().apply {
54+
arguments = Bundle().apply {
55+
putString(ARG_PARAM1, param1)
56+
putString(ARG_PARAM2, param2)
57+
}
58+
}
59+
}
60+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
8+
tools:context=".ui.activity.menabung.addSaving">
9+
10+
<!-- TODO: Update blank fragment layout -->
11+
<LinearLayout
12+
android:layout_width="match_parent"
13+
android:layout_height="match_parent"
14+
android:orientation="vertical">
15+
16+
<TextView
17+
android:layout_marginStart="30sp"
18+
android:layout_marginTop="20sp"
19+
android:layout_width="wrap_content"
20+
android:layout_height="wrap_content"
21+
android:fontFamily="@font/poppins_medium"
22+
android:text="@string/hello_blank_fragment"
23+
tools:text="Tambah Rencana Menabung" />
24+
25+
<ImageView
26+
android:id="@+id/imageView2"
27+
android:layout_width="207dp"
28+
android:layout_height="263dp"
29+
android:layout_marginStart="90sp"
30+
android:layout_marginTop="10sp"
31+
android:src="@drawable/background_menabung"/>
32+
33+
<TextView
34+
android:id="@+id/tvDeskripsi"
35+
android:layout_width="match_parent"
36+
android:layout_height="wrap_content"
37+
android:layout_marginStart="40dp"
38+
android:layout_marginTop="10dp"
39+
android:layout_marginEnd="60dp"
40+
android:textSize="14sp"
41+
android:text="@string/buat_rencana_menabung_dan_capai_tujuanmu"
42+
android:textAlignment="center" />
43+
44+
<EditText
45+
android:id="@+id/etJumlahMenabung"
46+
android:layout_width="match_parent"
47+
android:layout_height="wrap_content"
48+
android:layout_marginLeft="30dp"
49+
android:layout_marginTop="10dp"
50+
android:layout_marginRight="30dp"
51+
android:ems="10"
52+
53+
android:inputType="textPersonName"
54+
android:minHeight="48dp"
55+
android:text="@string/jumlah_menabung"
56+
android:textSize="14sp" />
57+
58+
<EditText
59+
android:id="@+id/etKeterangan"
60+
android:layout_width="match_parent"
61+
android:layout_height="wrap_content"
62+
android:layout_marginLeft="30dp"
63+
android:layout_marginTop="10dp"
64+
android:layout_marginRight="30dp"
65+
android:ems="10"
66+
android:inputType="textPersonName"
67+
android:minHeight="48dp"
68+
android:text="@string/keterangan_menabung"
69+
android:textSize="14sp" />
70+
71+
<EditText
72+
android:id="@+id/etTabungan"
73+
android:layout_width="match_parent"
74+
android:layout_height="wrap_content"
75+
android:layout_marginLeft="30dp"
76+
android:layout_marginTop="10dp"
77+
android:layout_marginRight="30dp"
78+
android:ems="10"
79+
android:inputType="textPersonName"
80+
android:minHeight="48dp"
81+
android:text="@string/nominal_tabungan"
82+
android:textSize="14sp" />
83+
84+
<Button
85+
android:id="@+id/btn_save_tabungan"
86+
android:layout_width="205dp"
87+
android:layout_height="48dp"
88+
android:layout_marginStart="100sp"
89+
android:layout_marginTop="16dp"
90+
android:background="@drawable/round_button1"
91+
android:backgroundTint="@color/purple_500"
92+
android:text="@string/tambah_tabungan"
93+
android:textAllCaps="false"
94+
app:layout_constraintEnd_toEndOf="parent"
95+
app:layout_constraintStart_toStartOf="parent"
96+
app:layout_constraintTop_toBottomOf="@+id/img_transaction" />
97+
</LinearLayout>
98+
99+
</FrameLayout>

app/src/main/res/layout/fragment_saving.xml

+19-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
6+
xmlns:app="http://schemas.android.com/apk/res-auto"
67
tools:context=".ui.activity.dashboard.SavingFragment">
78
<LinearLayout
89
android:layout_width="match_parent"
@@ -46,12 +47,29 @@
4647
android:layout_height="500dp"
4748
android:background="@drawable/round_bg_blue"
4849
android:orientation="vertical">
50+
51+
<Button
52+
android:id="@+id/button2"
53+
android:layout_width="wrap_content"
54+
android:layout_height="wrap_content"
55+
android:layout_marginStart="60sp"
56+
android:layout_marginLeft="60sp"
57+
android:layout_marginTop="30sp"
58+
android:background="@drawable/round_button"
59+
android:fontFamily="@font/poppins_medium"
60+
android:text="Tambah Data"
61+
android:textColor="#3F51B5"
62+
app:backgroundTint="@color/white" />
63+
4964
<androidx.recyclerview.widget.RecyclerView
5065
android:id="@+id/rv_transaction"
5166
android:layout_width="match_parent"
5267
android:layout_height="wrap_content"
5368
android:paddingBottom="26dp"
54-
tools:listitem="@layout/item_saving"/>
69+
tools:listitem="@layout/item_saving">
70+
71+
</androidx.recyclerview.widget.RecyclerView>
72+
5573
</LinearLayout>
5674
</LinearLayout>
5775
</FrameLayout>

app/src/main/res/values/strings.xml

+6
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@
1111
<string name="ambil_data_dari_data_yang_dipilih_oleh_user">Ambil data dari data yang dipilih oleh user</string>
1212
<string name="ambil_data_dari_data_yang_dipilih_oleh_user">Ambil data dari data yang dipilih oleh user</string>
1313
<string name="tanggal_menyimpan">Tanggal Menyimpan</string>
14+
<string name="tambah_tabungan">Tambah Tabungan</string>
15+
<string name="nominal_tabungan">Nominal Tabungan</string>
16+
<string name="jumlah_menabung">Jumlah Menabung</string>
17+
<string name="keterangan_menabung">Keterangan Menabung</string>
18+
<string name="null">null</string>
19+
<string name="buat_rencana_menabung_dan_capai_tujuanmu">Buat rencana menabung dan capai tujuanmu</string>
1420
</resources>

0 commit comments

Comments
 (0)