Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] 시스템 설정 화면 UI + Chrome 연결 #56

Merged
merged 5 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[fix] 코드 수정
  • Loading branch information
Mnseo committed Feb 27, 2023
commit 7c80721598882e87df8d32bba7252a1dca6d284c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ abstract class BaseDialog<VB: ViewDataBinding>(@LayoutRes private val layoutId:
ONE, TWO
}

class DialogBody(title : String, message : String) {
lateinit var title : String
lateinit var message : String
}

override fun onCreate(savedInstance: Bundle?) {
super.onCreate(savedInstance)
setStyle(STYLE_NO_TITLE, R.style.dialog_default)
Expand Down
90 changes: 45 additions & 45 deletions app/src/main/java/com/promiseeight/www/ui/dialog/PushDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,53 @@ package com.promiseeight.www.ui.dialog

import android.view.View
import android.widget.Button
import com.google.firebase.messaging.ktx.remoteMessage
import com.promiseeight.www.R
import com.promiseeight.www.databinding.FragmentPushDialogBinding
//import kotlinx.coroutines.NonCancellable.message
import java.math.BigInteger.TWO

//class PushDialog(
// private val buttonType: ButtonType,
// private val content:DialogBody,
// private var onCancelListener : (()->Unit)? = null,
// private var onConfirmListener : (()->Unit)? = null
//) : BaseDialog<FragmentPushDialogBinding>(R.layout.fragment_push_dialog){
//
// override fun initView() {
// super.initView()
//
// //Button Type
// when(buttonType) {
// ButtonType.ONE -> {
// binding.layoutBottomTypeOne.visibility.
// }
// ButtonType.TWO -> {
class PushDialog(
private val buttonType: ButtonType,
private val content:DialogBody,
private var onCancelListener : (()->Unit)? = null,
private var onConfirmListener : (()->Unit)? = null
) : BaseDialog<FragmentPushDialogBinding>(R.layout.fragment_push_dialog){


override fun initView() {
super.initView()

//Button Type
when(buttonType) {
ButtonType.ONE -> {
// binding.layoutBottomTypeOne.visibility(View.VISIBLE)
}
ButtonType.TWO -> {
// binding.layoutBottomTypeTwo.visible()
// }
// }
//
// content.run {
// binding.
// }
// }
//
// override fun setEvent() {
// super.setEvent()
// binding.btnCancleTypeTwo.setOnClickListener {
// onCancelListener?.invoke()
// dismiss()
// }
// binding.btnCompleteTypeTwo.setOnClickListener {
// onConfirmListener?.invoke()
// dismiss()
// }
// binding.btnCompleteTypeOne.setOnClickListener {
// onConfirmListener?.invoke()
// dismiss()
// }
// }
//
// fun visible() {
//
// }

//}
}
}

content.run {
binding.titleSystemCustomDialog.text = title
binding.contentSystemCustomDialog.text = message ?: ""
}
}

override fun setEvent() {
super.setEvent()
binding.btnCancleTypeTwo.setOnClickListener {
onCancelListener?.invoke()
dismiss()
}
binding.btnCompleteTypeTwo.setOnClickListener {
onConfirmListener?.invoke()
dismiss()
}
binding.btnCompleteTypeOne.setOnClickListener {
onConfirmListener?.invoke()
dismiss()
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.findNavController
import com.promiseeight.www.BuildConfig
import com.promiseeight.www.databinding.FragmentSettingBinding
import com.promiseeight.www.ui.common.BaseFragment
Expand All @@ -24,7 +25,12 @@ class SettingFragment : BaseFragment<FragmentSettingBinding>() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

binding.tvSettingAppVersion.text = getVersionInfo();
binding.tvSettingAppVersion.text = getVersionInfo()
binding.ivBack.setOnClickListener {
findNavController().navigate(
SettingFragmentDirections.actionFragmentSettingToFragmentHome()
)
}

}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_push_dialog.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand Down Expand Up @@ -119,4 +119,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>


</FrameLayout>
</layout>
3 changes: 3 additions & 0 deletions app/src/main/res/navigation/main_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
<fragment
android:id="@+id/fragment_setting"
android:name="com.promiseeight.www.ui.setting.SettingFragment">
<action
android:id="@+id/action_fragment_setting_to_fragment_home"
app:destination="@id/fragment_home" />
</fragment>


Expand Down