-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
307 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
app/src/main/java/com/project/jangburich/ui/home/WalletFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.project.jangburich.ui.home | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.lifecycle.ViewModelProvider | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.project.jangburich.MyApplication | ||
import com.project.jangburich.api.response.home.PurchaseHistory | ||
import com.project.jangburich.databinding.FragmentWalletBinding | ||
import com.project.jangburich.ui.MainActivity | ||
import com.project.jangburich.ui.home.adapter.WalletAdapter | ||
import com.project.jangburich.ui.home.viewModel.WalletViewModel | ||
|
||
class WalletFragment : Fragment() { | ||
|
||
lateinit var binding: FragmentWalletBinding | ||
lateinit var mainActivity: MainActivity | ||
lateinit var viewModel: WalletViewModel | ||
lateinit var walletAdapter: WalletAdapter | ||
|
||
var getPaymentHistory = mutableListOf<PurchaseHistory>() | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
|
||
binding = FragmentWalletBinding.inflate(layoutInflater) | ||
mainActivity = activity as MainActivity | ||
viewModel = ViewModelProvider(mainActivity)[WalletViewModel::class.java] | ||
|
||
|
||
binding.run { | ||
buttonCharge.setOnClickListener { | ||
} | ||
} | ||
|
||
return binding.root | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
initView() | ||
} | ||
|
||
|
||
fun initView() { | ||
viewModel.getWalletData(mainActivity) | ||
|
||
binding.run { | ||
textViewUserName.text = "${MyApplication.userName}님의 보유 금액" | ||
|
||
toolbar.run { | ||
textViewTitle.text = "나의 지갑" | ||
buttonBack.setOnClickListener { | ||
fragmentManager?.popBackStack() | ||
} | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
app/src/main/res/drawable/background_button_orange_round99.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<solid android:color="@color/main_orange"/> | ||
|
||
<corners android:radius="99dp"/> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:background="@color/gray_95" | ||
tools:context=".ui.home.WalletFragment"> | ||
|
||
<include | ||
android:id="@+id/toolbar" | ||
layout="@layout/toolbar_back_title_left" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="20dp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:id="@+id/constraintLayout3" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="20dp" | ||
android:layout_marginTop="30dp" | ||
android:background="@drawable/background_gray100_round10" | ||
android:padding="20dp" | ||
app:layout_constraintTop_toBottomOf="@+id/toolbar" | ||
tools:layout_editor_absoluteX="20dp"> | ||
|
||
<TextView | ||
android:id="@+id/textView_user_name" | ||
style="@style/Detail1" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="님의 보유 금액" | ||
android:textColor="@color/gray_30" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<View | ||
android:id="@+id/divider" | ||
android:layout_width="match_parent" | ||
android:layout_height="1dp" | ||
android:layout_marginTop="15dp" | ||
android:background="@color/gray_90" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView_user_name" /> | ||
|
||
<TextView | ||
android:id="@+id/textView_user_point" | ||
style="@style/Headline6" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="20dp" | ||
android:text="0원" | ||
android:textColor="@color/gray_20" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/divider" /> | ||
|
||
<TextView | ||
android:id="@+id/button_charge" | ||
style="@style/body2" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:background="@drawable/background_button_orange_round99" | ||
android:paddingHorizontal="12dp" | ||
android:paddingVertical="6dp" | ||
android:text="충전하기" | ||
android:textColor="@color/gray_100" | ||
app:layout_constraintBottom_toBottomOf="@+id/textView_user_point" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="@+id/textView_user_point" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_marginTop="25dp" | ||
android:background="@color/gray_100" | ||
android:padding="20dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout3"> | ||
|
||
<TextView | ||
android:id="@+id/textView_payment_title" | ||
style="@style/Headline4" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="결제 내역" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/textView_filter" | ||
style="@style/Detail1" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="10dp" | ||
android:text="전체" | ||
android:textColor="@color/gray_60" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView_payment_title" /> | ||
|
||
<ImageView | ||
android:id="@+id/imageView_filter" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:src="@drawable/ic_arrow_down" | ||
app:layout_constraintBottom_toBottomOf="@+id/textView_filter" | ||
app:layout_constraintStart_toEndOf="@+id/textView_filter" | ||
app:layout_constraintTop_toTopOf="@+id/textView_filter" /> | ||
|
||
<ImageView | ||
android:id="@+id/imageView_search" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:src="@drawable/ic_search_gray60" | ||
app:layout_constraintBottom_toBottomOf="@+id/textView_filter" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="@+id/textView_filter" /> | ||
|
||
<View | ||
android:id="@+id/divider_payment" | ||
android:layout_width="match_parent" | ||
android:layout_height="1dp" | ||
android:layout_marginTop="15dp" | ||
android:background="@color/gray_90" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView_filter" /> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:id="@+id/recyclerView_payment" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="15dp" | ||
app:layout_constraintTop_toBottomOf="@+id/divider_payment" | ||
tools:layout_editor_absoluteX="16dp" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?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="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginBottom="20dp"> | ||
|
||
<TextView | ||
android:id="@+id/textView_date" | ||
style="@style/body3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="11.23" | ||
android:textColor="@color/gray_60" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/textView_title" | ||
style="@style/body2" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="10dp" | ||
android:text="장부리치 지갑" | ||
android:textColor="@color/gray_30" | ||
app:layout_constraintStart_toEndOf="@+id/textView_date" | ||
app:layout_constraintTop_toTopOf="@+id/textView_date" /> | ||
|
||
<TextView | ||
android:id="@+id/textView_description" | ||
style="@style/Label3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="지갑 충전" | ||
android:textColor="@color/gray_50" | ||
app:layout_constraintStart_toStartOf="@+id/textView_title" | ||
app:layout_constraintTop_toBottomOf="@+id/textView_title" /> | ||
|
||
<TextView | ||
android:id="@+id/textView_payment_value" | ||
style="@style/body2" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="10dp" | ||
android:text="-00원" | ||
android:textColor="@color/gray_30" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?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="wrap_content" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<ImageView | ||
android:id="@+id/button_back" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginBottom="20dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:srcCompat="@drawable/ic_back" /> | ||
|
||
<TextView | ||
android:id="@+id/textView_title" | ||
style="@style/Headline3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="5dp" | ||
app:layout_constraintBottom_toBottomOf="@+id/button_back" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toEndOf="@+id/button_back" | ||
app:layout_constraintTop_toTopOf="@+id/button_back" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |