diff --git a/.idea/gradle.xml b/.idea/gradle.xml index a2d7c21..a0de2a1 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -7,6 +7,7 @@ + diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..2b8a50f --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index bdd9278..1996b74 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,7 +1,7 @@ - + diff --git a/app/build.gradle b/app/build.gradle index 813188f..84ba81d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { jvmTarget = '1.8' } buildFeatures { - dataBinding = true + viewBinding = true } } @@ -47,14 +47,18 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' //ktx - implementation 'androidx.activity:activity-ktx:1.7.2' - implementation 'androidx.fragment:fragment-ktx:1.6.0' + implementation 'androidx.activity:activity-ktx:1.7.0' + implementation 'androidx.fragment:fragment-ktx:1.5.6' implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1" - implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha06' - implementation 'androidx.navigation:navigation-fragment-ktx:2.6.0' - implementation 'androidx.navigation:navigation-ui-ktx:2.6.0' + implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha05' + implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3' + implementation 'androidx.navigation:navigation-ui-ktx:2.5.3' //Retrofit implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' + + implementation 'com.google.android.flexbox:flexbox:3.0.0' + + implementation 'androidx.viewpager2:viewpager2:1.0.0' } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1e32a1a..ab0c13e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,6 +11,12 @@ android:supportsRtl="true" android:theme="@style/Theme.IDear" tools:targetApi="31"> + + diff --git a/app/src/main/java/com/nbit/Idear/MainActivity.kt b/app/src/main/java/com/nbit/Idear/MainActivity.kt index 5c73921..41c0e4b 100644 --- a/app/src/main/java/com/nbit/Idear/MainActivity.kt +++ b/app/src/main/java/com/nbit/Idear/MainActivity.kt @@ -1,11 +1,121 @@ package com.nbit.Idear +import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import androidx.core.view.GravityCompat +import androidx.recyclerview.widget.LinearLayoutManager +import com.nbit.Idear.databinding.ActivityMainBinding +import com.nbit.Idear.databinding.MainIncludeDrawerBinding +import com.nbit.Idear.home.ProxyWriteAdapter +import com.nbit.Idear.home.ProxyWriteData +import com.nbit.Idear.home.WriteSubData +import com.nbit.Idear.mypage.MyPageActivity +import com.nbit.Idear.write.WriteActivity +// 메인 페이지 class MainActivity : AppCompatActivity() { + // ViewBinding Setting + lateinit var drawerBinding: MainIncludeDrawerBinding // 메뉴 Drawer + lateinit var mainBinding: ActivityMainBinding // 메인 페이지 override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) + + // 메뉴 Drawer ViewBinding + drawerBinding = MainIncludeDrawerBinding.inflate(layoutInflater) + setContentView(drawerBinding.root) + + // 메인 페이지 viewBinding + mainBinding = drawerBinding.includeMainActivity + + // 메뉴 열기 버튼 누르면 열림 + mainBinding.btnOpenMenu.setOnClickListener { + drawerBinding.mainDrawerLayout.openDrawer((GravityCompat.END)) + } + + // 마이페이지 메뉴 버튼 선택 + drawerBinding.btnMenuMypage.setOnClickListener { + // 마이페이지 이동 + val intent = Intent(this, MyPageActivity::class.java) + startActivity(intent) + + // 메뉴 닫기 + drawerBinding.mainDrawerLayout.closeDrawer((GravityCompat.END)) + } + + // 즐겨찾기 메뉴 버튼 선택 + drawerBinding.btnMenuBookmark.setOnClickListener { + // 즐겨찾기 목록 이동 + + // 메뉴 닫기 + drawerBinding.mainDrawerLayout.closeDrawer((GravityCompat.END)) + } + + // 환경설정 메뉴 버튼 선택 + drawerBinding.btnMenuSetting.setOnClickListener { + // 환경설정 이동 + + // 메뉴 닫기 + drawerBinding.mainDrawerLayout.closeDrawer((GravityCompat.END)) + } + + // 로그인/로그아웃 메뉴 버튼 선택 + drawerBinding.btnMenuLoginLogout.setOnClickListener { + // 로그인/로그아웃 이동 + + // 메뉴 닫기 + drawerBinding.mainDrawerLayout.closeDrawer((GravityCompat.END)) + } + + + // mainBinding=ActivityMainBinding.inflate(layoutInflater) + + val dataDataList:ArrayList = arrayListOf() + + dataDataList.apply{ + /* add(ProxyWriteData(2023,6,12,"친구에게 전하는 생일 편지", + "생일 축하해! 이 특별한 날을 기념하여 마음 가득한 축하의 말을 전하고 싶어요. " + + "너의 생일은 항상 특별한 순간이야. 너의 유쾌한 에너지와 친절한 마음으로 언제나 우리 주위를 환하게 " + + "비춰줘서 고마워! 정말...",null)) + + */ + add(ProxyWriteData(2023,6,12,"친구에게 전하는 생일 편지","생일 축하해! 이 특별한 날을 기념하여 마음 가득한 축하의 말을 전하고 싶어요. 너의 생일은 항상 특별한 순간이야. 너의 유쾌한 에너지와 친절한 마음으로 언제나 우리 주위를 환하게 비춰줘...", + arrayListOf(WriteSubData("너는 내게 있어서 특별한 존재야. 우리가 ..."), + WriteSubData("너는 내게 있어서 특별한 존재야. 우리가...")))) + + /* + + */ + add(ProxyWriteData(2023,6,12,"친구에게 전하는 생일 편지","생일 축하해! 이 특별한 날을 기념하여 마음 가득한 축하의 말을 전하고 싶어요. 너의 생일은 항상 특별한 순간이야. 너의 유쾌한 에너지와 친절한 마음으로 언제나 우리 주위를 환하게 비춰줘...", + arrayListOf(WriteSubData("너는 내게 있어서 특별한 존재야. 우리가..."), + WriteSubData("너는 내게 있어서 특별한 존재야. 우리가..."), + WriteSubData("너는 내게 있어서 특별한 존재야. 우리가...")))) + + add(ProxyWriteData(2023,6,12,"친구에게 전하는 생일 축하", + "생일 축하해! 이 특별한 날을 기념하여 마음 가득한 축하의 말을 전하고 싶어요. " + + "너의 생일은 항상 특별한 순간이야. 너의 유쾌한 에너지와 친절한 마음으로 언제나 우리 주위를 환하게 " + + "비춰줘서...",null)) + + } + + mainBinding.mainRecyclerView.layoutManager=LinearLayoutManager(this) + val adapter=ProxyWriteAdapter(dataDataList) + mainBinding.mainRecyclerView.adapter=adapter + + mainBinding.fab.setOnClickListener { + + val intent = Intent(this, WriteActivity::class.java) + startActivity(intent) + } + + //val retrofit = Retrofit.Builder() + // .baseUrl("https://api.example.com/") // 서버의 baseUrl을 설정합니다. + // .addConverterFactory(GsonConverterFactory.create()) // JSON 데이터 변환을 위한 Gson 변환기를 추가합니다. + // .build() + + // val apiService = retrofit.create(RetrofitInterface::class.java) + // val apiService = RetrofitInterface.create() + + } } \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/home/ProxyWriteAdapter.kt b/app/src/main/java/com/nbit/Idear/home/ProxyWriteAdapter.kt new file mode 100644 index 0000000..4e6f40e --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/home/ProxyWriteAdapter.kt @@ -0,0 +1,81 @@ +package com.nbit.Idear.home + +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.nbit.Idear.R +import com.nbit.Idear.databinding.ItemWriteBinding + +class ProxyWriteAdapter (private val dataList:ArrayList): + RecyclerView.Adapter() { + inner class DataViewHolder(private val viewBinding: ItemWriteBinding) : RecyclerView.ViewHolder(viewBinding.root) { + // var chk=false; + fun bind(data: ProxyWriteData) { + viewBinding.yearText.text = data.year.toString() + viewBinding.monthText.text = data.month.toString() + viewBinding.dayText.text = data.day.toString() + viewBinding.titleText.text=data.title + + viewBinding.mainContent.text = data.content + + + viewBinding.upBtn.setOnClickListener { + if (data.additionalContent!= null) { + if (!viewBinding.upBtn.isSelected) { + viewBinding.upBtn.setImageResource(R.drawable.downbtn) + viewBinding.subCardView.visibility=View.VISIBLE + viewBinding.recyclerView.visibility = View.VISIBLE + + + viewBinding.recyclerView.apply { + setHasFixedSize(true) + layoutManager = LinearLayoutManager(viewBinding.root.context) + adapter = SubAdapter(data.additionalContent) + } + viewBinding.upBtn.isSelected = true + } else { + viewBinding.upBtn.setImageResource(R.drawable.upbtn) + viewBinding.subCardView.visibility=View.GONE + viewBinding.recyclerView.visibility = View.GONE + + viewBinding.upBtn.isSelected = false + } + + } + else{ + if (!viewBinding.upBtn.isSelected) { + viewBinding.subCardView.visibility=View.VISIBLE + viewBinding.upBtn.isSelected = true + + } + else { + viewBinding.subCardView.visibility=View.GONE + viewBinding.upBtn.isSelected = false + } + } + } + } + + + } + + + + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ProxyWriteAdapter.DataViewHolder { + val binding = ItemWriteBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return DataViewHolder(binding) + } + + override fun onBindViewHolder(holder: DataViewHolder, position: Int) { + holder.bind(dataList[position]) + } + + override fun getItemCount(): Int { + return dataList.size + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/home/ProxyWriteData.kt b/app/src/main/java/com/nbit/Idear/home/ProxyWriteData.kt new file mode 100644 index 0000000..a381ba1 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/home/ProxyWriteData.kt @@ -0,0 +1,9 @@ +package com.nbit.Idear.home + +data class ProxyWriteData(val year:Int, + val month:Int, + val day:Int, + val title:String, + val content:String, + val additionalContent:ArrayList?) + //val phoneNumArray:ArrayList) diff --git a/app/src/main/java/com/nbit/Idear/home/SubAdapter.kt b/app/src/main/java/com/nbit/Idear/home/SubAdapter.kt new file mode 100644 index 0000000..e74b4fa --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/home/SubAdapter.kt @@ -0,0 +1,34 @@ +package com.nbit.Idear.home + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import com.nbit.Idear.databinding.ItemSubWriteBinding + +class SubAdapter(private val dataList:ArrayList): + RecyclerView.Adapter(){ + inner class DataViewHolder(private val viewBinding:ItemSubWriteBinding) :RecyclerView.ViewHolder(viewBinding.root){ + + fun bind(data:WriteSubData){ + viewBinding.subContentText.text=data.subContent + + viewBinding.cardView.setOnClickListener { + + } + } + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SubAdapter.DataViewHolder { + val viewBinding = ItemSubWriteBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return DataViewHolder(viewBinding) + } + + override fun onBindViewHolder(holder: DataViewHolder, position: Int) { + holder.bind(dataList[position]) + } + + override fun getItemCount(): Int { + return dataList.size + } + +} diff --git a/app/src/main/java/com/nbit/Idear/home/WriteSubData.kt b/app/src/main/java/com/nbit/Idear/home/WriteSubData.kt new file mode 100644 index 0000000..d0cd09f --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/home/WriteSubData.kt @@ -0,0 +1,3 @@ +package com.nbit.Idear.home + +data class WriteSubData (val subContent:String) \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/mypage/AddProfileFragment.kt b/app/src/main/java/com/nbit/Idear/mypage/AddProfileFragment.kt new file mode 100644 index 0000000..2c9ad83 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/mypage/AddProfileFragment.kt @@ -0,0 +1,25 @@ +package com.nbit.Idear.mypage + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentAddProfileBinding + + +// 프로필 추가/수정 +class AddProfileFragment : Fragment() { + // ViewBinding Setting + lateinit var binding: FragmentAddProfileBinding + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // ViewBinding Setting + binding = FragmentAddProfileBinding.inflate(layoutInflater) + return binding.root + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/mypage/MyPageActivity.kt b/app/src/main/java/com/nbit/Idear/mypage/MyPageActivity.kt new file mode 100644 index 0000000..c5ee7c6 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/mypage/MyPageActivity.kt @@ -0,0 +1,20 @@ +package com.nbit.Idear.mypage + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import com.nbit.Idear.R +import com.nbit.Idear.databinding.ActivityMyPageBinding + +// 마이 페이지: 프로필 리스트 +class MyPageActivity : AppCompatActivity() { + // ViewBinding Setting + lateinit var binding: ActivityMyPageBinding + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + // ViewBinding Setting + binding = ActivityMyPageBinding.inflate(layoutInflater) + setContentView(binding.root) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/text/AiTextAdapter.kt b/app/src/main/java/com/nbit/Idear/text/AiTextAdapter.kt new file mode 100644 index 0000000..687f778 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/text/AiTextAdapter.kt @@ -0,0 +1,46 @@ +package com.nbit.Idear.text + +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.constraintlayout.utils.widget.ImageFilterButton +import androidx.recyclerview.widget.RecyclerView +import com.nbit.Idear.R + +class AiTextAdapter: RecyclerView.Adapter() { + + private val items: MutableList = mutableListOf() + + fun addItem(item: AiTextResult) { + items.add(item) + notifyDataSetChanged() + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AiTextAdapter.ViewHolder { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_write_example, parent, false) + return ViewHolder(view) + } + + override fun onBindViewHolder(holder: AiTextAdapter.ViewHolder, position: Int) { + val item = items[position] + holder.bind(item) + + } + + override fun getItemCount(): Int { + return items.size + } + + inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + private val textView1: TextView = itemView.findViewById(R.id.tv_ai_text) + private val favBtn: ImageFilterButton = itemView.findViewById(R.id.btn_favorite) + + fun bind(item: AiTextResult) { + textView1.text = item.content + favBtn.isSelected = item.favorite + } + } +} + +data class AiTextResult(val content: String, val favorite: Boolean) \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/write/FlexBoxAdapter.kt b/app/src/main/java/com/nbit/Idear/write/FlexBoxAdapter.kt new file mode 100644 index 0000000..7250d01 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/FlexBoxAdapter.kt @@ -0,0 +1,39 @@ +package com.nbit.Idear.write + +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Button +import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView +import com.nbit.Idear.R + +class FlexBoxAdapter(private val buttonTextList: List, private val buttonClickListener: (String, Boolean) -> Unit) : RecyclerView.Adapter() { + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_keyword_btn, parent, false) + return ViewHolder(view) + } + + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + val buttonText = buttonTextList[position] + + // 버튼 텍스트 설정 + holder.button.text = buttonText + + // 버튼 클릭 리스너 설정 + holder.button.setOnClickListener { + + buttonClickListener.invoke(buttonText, holder.button.isSelected) + holder.button.isSelected = !holder.button.isSelected + } + } + + override fun getItemCount(): Int { + return buttonTextList.size + } + + class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + val button: TextView = itemView.findViewById(R.id.button) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/write/WriteActivity.kt b/app/src/main/java/com/nbit/Idear/write/WriteActivity.kt new file mode 100644 index 0000000..200c315 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteActivity.kt @@ -0,0 +1,22 @@ +package com.nbit.Idear.write + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import com.nbit.Idear.R +import com.nbit.Idear.databinding.ActivityWriteBinding + +class WriteActivity : AppCompatActivity() { + private lateinit var binding: ActivityWriteBinding + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding = ActivityWriteBinding.inflate(layoutInflater) + setContentView(binding.root) + + supportFragmentManager.beginTransaction() + .add(R.id.fl_write, WriteFirstFragment()) // fragment_container는 Fragment를 삽입할 레이아웃의 ID입니다. + .commit() + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/write/WriteFirstFragment.kt b/app/src/main/java/com/nbit/Idear/write/WriteFirstFragment.kt new file mode 100644 index 0000000..a829949 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteFirstFragment.kt @@ -0,0 +1,94 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Toast +import com.google.android.flexbox.FlexDirection +import com.google.android.flexbox.FlexWrap +import com.google.android.flexbox.FlexboxLayoutManager +import com.google.android.flexbox.JustifyContent +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding +import com.nbit.Idear.databinding.FragmentWriteSecondPrivateBinding + +class WriteFirstFragment : Fragment() { + + private lateinit var flexBoxAdapter: FlexBoxAdapter + + private var _binding: FragmentWriteFirstBinding? = null + private val binding get() = _binding!! + + private var select: Boolean = false + private var selectItem: String = "" + private var next: Int = 0 + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + _binding = FragmentWriteFirstBinding.inflate(inflater, container, false) + + val buttonTextList = listOf("가족","친구","동료","스승","연인","지인","제자","고객") // 버튼에 표시할 텍스트 리스트 + flexBoxAdapter = FlexBoxAdapter(buttonTextList) { buttonText, selected -> + // 버튼 클릭 이벤트 처리 + if (selected) { + next ++ + } else { + next -- + } + onNextButton() + Toast.makeText(context,"클릭한 버튼: $buttonText",Toast.LENGTH_SHORT).show() + } + + binding.btnPrivate.setOnClickListener { + binding.btnPrivate.isSelected = true + binding.btnPublic.isSelected = false + select = true + selectItem = "사적" + onNextButton() + } + + binding.btnPublic.setOnClickListener { + binding.btnPrivate.isSelected = false + binding.btnPublic.isSelected = true + select = true + selectItem = "공적" + onNextButton() + } + + + FlexboxLayoutManager(context).apply { + flexWrap = FlexWrap.WRAP + flexDirection = FlexDirection.ROW + justifyContent = JustifyContent.FLEX_START + }.let { + binding.rvKeyword.layoutManager = it + binding.rvKeyword.adapter = flexBoxAdapter + } + + binding.btnNext.setOnClickListener { + if (selectItem == "공적") + parentFragmentManager.beginTransaction() + .add(R.id.fl_write, WriteSecondPublicFragment()) + .addToBackStack("Write") + .commit() + else + parentFragmentManager.beginTransaction() + .add(R.id.fl_write, WriteSecondPrivateFragment()) + .addToBackStack("Write") + .commit() + } + return binding.root + } + + private fun onNextButton() { + binding.btnNext.isEnabled = (next != 0 && select) + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/write/WriteFourthFragment.kt b/app/src/main/java/com/nbit/Idear/write/WriteFourthFragment.kt new file mode 100644 index 0000000..bf79f09 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteFourthFragment.kt @@ -0,0 +1,86 @@ +package com.nbit.Idear.write + +import android.R +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.core.view.ViewCompat +import androidx.fragment.app.Fragment +import androidx.viewpager2.widget.ViewPager2 +import com.nbit.Idear.databinding.FragmentWriteFourthBinding +import com.nbit.Idear.text.AiTextAdapter +import com.nbit.Idear.text.AiTextResult + + +class WriteFourthFragment : Fragment() { + + private var _binding: FragmentWriteFourthBinding? = null + private val binding get() = _binding!! + + private var keyboardIsOpen: Boolean = false + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + _binding = FragmentWriteFourthBinding.inflate(inflater, container, false) + + var aiTextAdapter = AiTextAdapter() + + + val item1 = AiTextResult("1231123123",false) + val item2 = AiTextResult("2231123123",false) + val item3 = AiTextResult("333",false) + + aiTextAdapter.addItem(item1) + aiTextAdapter.addItem(item2) + aiTextAdapter.addItem(item3) + binding.viewpagerText.adapter = aiTextAdapter + + val pageMargin = resources.getDimensionPixelOffset(com.nbit.Idear.R.dimen.pageMargin).toFloat() + val pageOffset = resources.getDimensionPixelOffset(com.nbit.Idear.R.dimen.offset).toFloat() + binding.viewpagerText.offscreenPageLimit = 3 + binding.viewpagerText.setPageTransformer(ViewPager2.PageTransformer { page, position -> + val myOffset = position * -(2 * pageOffset + pageMargin) + if (binding.viewpagerText.orientation === ViewPager2.ORIENTATION_HORIZONTAL) { + if (ViewCompat.getLayoutDirection(binding.viewpagerText) == ViewCompat.LAYOUT_DIRECTION_RTL) { + page.translationX = -myOffset + } else { + page.translationX = myOffset + } + } else { + page.translationY = myOffset + } + }) + + binding.btnRequest.setOnClickListener { + val item4 = AiTextResult("123123123123",false) + aiTextAdapter.addItem(item4) + } + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + view.viewTreeObserver.addOnGlobalLayoutListener { + val rootView = view.rootView + val heightDiff = rootView.height - view.height + val keyboardOpenThreshold = rootView.height * 0.15 + + if (heightDiff > keyboardOpenThreshold && !keyboardIsOpen) { + // 키보드가 활성화됨 + keyboardIsOpen = true + binding.btnRequest.visibility = View.INVISIBLE + } else if (heightDiff < keyboardOpenThreshold && keyboardIsOpen) { + // 키보드가 비활성화됨 + keyboardIsOpen = false + binding.btnRequest.visibility = View.VISIBLE + } + } + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/write/WriteSecondPrivateFragment.kt b/app/src/main/java/com/nbit/Idear/write/WriteSecondPrivateFragment.kt new file mode 100644 index 0000000..00b6138 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteSecondPrivateFragment.kt @@ -0,0 +1,58 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Toast +import com.google.android.flexbox.FlexDirection +import com.google.android.flexbox.FlexWrap +import com.google.android.flexbox.FlexboxLayoutManager +import com.google.android.flexbox.JustifyContent +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding +import com.nbit.Idear.databinding.FragmentWriteSecondPrivateBinding + +class WriteSecondPrivateFragment : Fragment() { + + private lateinit var flexBoxAdapter: FlexBoxAdapter + + private var _binding: FragmentWriteSecondPrivateBinding? = null + private val binding get() = _binding!! + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + _binding = FragmentWriteSecondPrivateBinding.inflate(inflater, container, false) + + val buttonTextList = listOf("우정","감사","입학 축하","조의","생일 축하","조언","격려","사랑", "인사") // 버튼에 표시할 텍스트 리스트 + flexBoxAdapter = FlexBoxAdapter(buttonTextList) { buttonText, selected -> + // 버튼 클릭 이벤트 처리 + //데이터 처리 + Toast.makeText(context,"클릭한 버튼: $buttonText",Toast.LENGTH_SHORT).show() + } + + FlexboxLayoutManager(context).apply { + flexWrap = FlexWrap.WRAP + flexDirection = FlexDirection.ROW + justifyContent = JustifyContent.FLEX_START + }.let { + binding.rvKeyword.layoutManager = it + binding.rvKeyword.adapter = flexBoxAdapter + } + + binding.btnNext.setOnClickListener { + parentFragmentManager.beginTransaction() + .add(R.id.fl_write, WriteThirdFragment()) + .addToBackStack("Write") + .commit() + } + return binding.root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/write/WriteSecondPublicFragment.kt b/app/src/main/java/com/nbit/Idear/write/WriteSecondPublicFragment.kt new file mode 100644 index 0000000..2339aa0 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteSecondPublicFragment.kt @@ -0,0 +1,70 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Toast +import com.google.android.flexbox.FlexDirection +import com.google.android.flexbox.FlexWrap +import com.google.android.flexbox.FlexboxLayoutManager +import com.google.android.flexbox.JustifyContent +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding +import com.nbit.Idear.databinding.FragmentWriteSecondPrivateBinding +import com.nbit.Idear.databinding.FragmentWriteSecondPublicBinding + +class WriteSecondPublicFragment : Fragment() { + + private lateinit var flexBoxAdapter: FlexBoxAdapter + + + private var next: Int = 0 + + private var _binding: FragmentWriteSecondPublicBinding? = null + private val binding get() = _binding!! + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + _binding = FragmentWriteSecondPublicBinding.inflate(inflater, container, false) + + val buttonTextList = listOf("추천서","내용확인","문의 사항","조의","인사","상업적 제안서","면담 요청","상담 요청", "클레임", "조언") // 버튼에 표시할 텍스트 리스트 + flexBoxAdapter = FlexBoxAdapter(buttonTextList) { buttonText, selected -> + // 버튼 클릭 이벤트 처리 + //데이터 처리 + if (selected) { + next ++ + } else { + next -- + } + onNextButton() + Toast.makeText(context,"클릭한 버튼: $buttonText",Toast.LENGTH_SHORT).show() + } + binding.btnNext.setOnClickListener { + parentFragmentManager.beginTransaction() + .add(R.id.fl_write, WriteThirdFragment()) + .addToBackStack("Write") + .commit() + } + + FlexboxLayoutManager(context).apply { + flexWrap = FlexWrap.WRAP + flexDirection = FlexDirection.ROW + justifyContent = JustifyContent.FLEX_START + }.let { + binding.rvKeyword.layoutManager = it + binding.rvKeyword.adapter = flexBoxAdapter + } + return binding.root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } + private fun onNextButton() { + binding.btnNext.isEnabled = (next != 0) + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/write/WriteThirdFragment.kt b/app/src/main/java/com/nbit/Idear/write/WriteThirdFragment.kt new file mode 100644 index 0000000..ee3c0b1 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteThirdFragment.kt @@ -0,0 +1,47 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Toast +import com.google.android.flexbox.FlexDirection +import com.google.android.flexbox.FlexWrap +import com.google.android.flexbox.FlexboxLayoutManager +import com.google.android.flexbox.JustifyContent +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding +import com.nbit.Idear.databinding.FragmentWriteSecondPrivateBinding +import com.nbit.Idear.databinding.FragmentWriteThirdBinding + +class WriteThirdFragment : Fragment() { + + private lateinit var flexBoxAdapter: FlexBoxAdapter + + private var _binding: FragmentWriteThirdBinding? = null + private val binding get() = _binding!! + + private var select: Boolean = false + private var selectItem: String = "" + private var next: Int = 0 + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + _binding = FragmentWriteThirdBinding.inflate(inflater, container, false) + + binding.btnNext.setOnClickListener { + parentFragmentManager.beginTransaction() + .add(R.id.fl_write, WriteFourthFragment()) + .addToBackStack("Write") + .commit() + } + return binding.root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } + + +} \ No newline at end of file diff --git a/app/src/main/res/drawable/chevron_right.xml b/app/src/main/res/drawable/chevron_right.xml new file mode 100644 index 0000000..805a507 --- /dev/null +++ b/app/src/main/res/drawable/chevron_right.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/downbtn.xml b/app/src/main/res/drawable/downbtn.xml new file mode 100644 index 0000000..ea39654 --- /dev/null +++ b/app/src/main/res/drawable/downbtn.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/floatingbtn.xml b/app/src/main/res/drawable/floatingbtn.xml new file mode 100644 index 0000000..7255547 --- /dev/null +++ b/app/src/main/res/drawable/floatingbtn.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_back_arrow.xml b/app/src/main/res/drawable/ic_back_arrow.xml new file mode 100644 index 0000000..2b64384 --- /dev/null +++ b/app/src/main/res/drawable/ic_back_arrow.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/ic_delete_profile.xml b/app/src/main/res/drawable/ic_delete_profile.xml new file mode 100644 index 0000000..ab01182 --- /dev/null +++ b/app/src/main/res/drawable/ic_delete_profile.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_favorite.xml b/app/src/main/res/drawable/ic_favorite.xml new file mode 100644 index 0000000..781cc53 --- /dev/null +++ b/app/src/main/res/drawable/ic_favorite.xml @@ -0,0 +1,18 @@ + + + + diff --git a/app/src/main/res/drawable/ic_navigation.xml b/app/src/main/res/drawable/ic_navigation.xml new file mode 100644 index 0000000..e8f2ef4 --- /dev/null +++ b/app/src/main/res/drawable/ic_navigation.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/ic_open_arrow_right.xml b/app/src/main/res/drawable/ic_open_arrow_right.xml new file mode 100644 index 0000000..5d3b2f3 --- /dev/null +++ b/app/src/main/res/drawable/ic_open_arrow_right.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/ic_profile_test.xml b/app/src/main/res/drawable/ic_profile_test.xml new file mode 100644 index 0000000..acb006d --- /dev/null +++ b/app/src/main/res/drawable/ic_profile_test.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_rotate.xml b/app/src/main/res/drawable/ic_rotate.xml new file mode 100644 index 0000000..61229da --- /dev/null +++ b/app/src/main/res/drawable/ic_rotate.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/app/src/main/res/drawable/ic_share.xml b/app/src/main/res/drawable/ic_share.xml new file mode 100644 index 0000000..fca6546 --- /dev/null +++ b/app/src/main/res/drawable/ic_share.xml @@ -0,0 +1,32 @@ + + + + + + diff --git a/app/src/main/res/drawable/menu.xml b/app/src/main/res/drawable/menu.xml new file mode 100644 index 0000000..d44ca49 --- /dev/null +++ b/app/src/main/res/drawable/menu.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/app/src/main/res/drawable/selector_keyword.xml b/app/src/main/res/drawable/selector_keyword.xml new file mode 100644 index 0000000..58c7458 --- /dev/null +++ b/app/src/main/res/drawable/selector_keyword.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_menu_radius.xml b/app/src/main/res/drawable/shape_menu_radius.xml new file mode 100644 index 0000000..3fc6067 --- /dev/null +++ b/app/src/main/res/drawable/shape_menu_radius.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_round_rec.xml b/app/src/main/res/drawable/shape_round_rec.xml new file mode 100644 index 0000000..86746db --- /dev/null +++ b/app/src/main/res/drawable/shape_round_rec.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_round_rec_navi.xml b/app/src/main/res/drawable/shape_round_rec_navi.xml new file mode 100644 index 0000000..d381bf7 --- /dev/null +++ b/app/src/main/res/drawable/shape_round_rec_navi.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_round_rec_request.xml b/app/src/main/res/drawable/shape_round_rec_request.xml new file mode 100644 index 0000000..fa44f9e --- /dev/null +++ b/app/src/main/res/drawable/shape_round_rec_request.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_select_keyword.xml b/app/src/main/res/drawable/shape_select_keyword.xml new file mode 100644 index 0000000..e147dbb --- /dev/null +++ b/app/src/main/res/drawable/shape_select_keyword.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_unselect_keyword.xml b/app/src/main/res/drawable/shape_unselect_keyword.xml new file mode 100644 index 0000000..3def164 --- /dev/null +++ b/app/src/main/res/drawable/shape_unselect_keyword.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/upbtn.xml b/app/src/main/res/drawable/upbtn.xml new file mode 100644 index 0000000..accf97f --- /dev/null +++ b/app/src/main/res/drawable/upbtn.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 17eab17..279154c 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,18 +1,57 @@ - + tools:context=".MainActivity" + android:background="#F5F5F5" + android:orientation="vertical"> - + + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + + app:layout_constraintHorizontal_bias="0.94" + /> + + + + + - \ No newline at end of file + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_my_page.xml b/app/src/main/res/layout/activity_my_page.xml new file mode 100644 index 0000000..659a451 --- /dev/null +++ b/app/src/main/res/layout/activity_my_page.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_write.xml b/app/src/main/res/layout/activity_write.xml new file mode 100644 index 0000000..e91ea6e --- /dev/null +++ b/app/src/main/res/layout/activity_write.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_add_profile.xml b/app/src/main/res/layout/fragment_add_profile.xml new file mode 100644 index 0000000..2b67255 --- /dev/null +++ b/app/src/main/res/layout/fragment_add_profile.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_write_first.xml b/app/src/main/res/layout/fragment_write_first.xml new file mode 100644 index 0000000..57ded3b --- /dev/null +++ b/app/src/main/res/layout/fragment_write_first.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_write_fourth.xml b/app/src/main/res/layout/fragment_write_fourth.xml new file mode 100644 index 0000000..b014ba0 --- /dev/null +++ b/app/src/main/res/layout/fragment_write_fourth.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_write_second_private.xml b/app/src/main/res/layout/fragment_write_second_private.xml new file mode 100644 index 0000000..a1cfa86 --- /dev/null +++ b/app/src/main/res/layout/fragment_write_second_private.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_write_second_public.xml b/app/src/main/res/layout/fragment_write_second_public.xml new file mode 100644 index 0000000..136663a --- /dev/null +++ b/app/src/main/res/layout/fragment_write_second_public.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_write_third.xml b/app/src/main/res/layout/fragment_write_third.xml new file mode 100644 index 0000000..bad355f --- /dev/null +++ b/app/src/main/res/layout/fragment_write_third.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_keyword_btn.xml b/app/src/main/res/layout/item_keyword_btn.xml new file mode 100644 index 0000000..193133b --- /dev/null +++ b/app/src/main/res/layout/item_keyword_btn.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_profile_list.xml b/app/src/main/res/layout/item_profile_list.xml new file mode 100644 index 0000000..ba6d25c --- /dev/null +++ b/app/src/main/res/layout/item_profile_list.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_sub_write.xml b/app/src/main/res/layout/item_sub_write.xml new file mode 100644 index 0000000..6f4b4a0 --- /dev/null +++ b/app/src/main/res/layout/item_sub_write.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_text_profile.xml b/app/src/main/res/layout/item_text_profile.xml new file mode 100644 index 0000000..b7a0be3 --- /dev/null +++ b/app/src/main/res/layout/item_text_profile.xml @@ -0,0 +1,38 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_write.xml b/app/src/main/res/layout/item_write.xml new file mode 100644 index 0000000..7924554 --- /dev/null +++ b/app/src/main/res/layout/item_write.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_write_example.xml b/app/src/main/res/layout/item_write_example.xml new file mode 100644 index 0000000..bcd144d --- /dev/null +++ b/app/src/main/res/layout/item_write_example.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/main_include_drawer.xml b/app/src/main/res/layout/main_include_drawer.xml new file mode 100644 index 0000000..3c02710 --- /dev/null +++ b/app/src/main/res/layout/main_include_drawer.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 0b9ab45..b24a8cc 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -12,5 +12,8 @@ ?attr/colorPrimaryVariant + + false + true \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index f8c6127..a749fbd 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -7,4 +7,27 @@ #FF018786 #FF000000 #FFFFFFFF + #00FFFFFF + + + #00FF0000 + + + #F6F6F6 + #E8E8E8 + #C8C8C8 + #B7B7B7 + #949494 + #616161 + #272727 + #111111 + + #0BA7A3 + #ABDEDD + #72C5C2 + + + #F5F5F5 + + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..e54de4f --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,7 @@ + + + 8dp + 16dp + 40dp + 358dp + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f702609..ea3e633 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,20 @@ IDear + + + 마이페이지 + 즐겨찾기 목록 + 환경설정 + 로그인/로그아웃 + + + 프로필 + + + Hello blank fragment + + 생일 축하해! 이 특별한 날을 기념하여 마음 가득한 축하의 말을 전하고 싶어요. 너의 생일은 항상 특별한 순간이야. 너의 유쾌한 에너지와 친절한 마음으로 언제나 우리 주위를 밝게 만들어줘서 감사해요. +너와 함께 보낸 모든 순간은 소중한 추억으로 남을 거야. 너의 웃음 소리와 함께 한 이야기들은 언제나 나에게 힘이 되어줬어. 그래서 이번 생일은 너에게 최고의 행복과 성공을 빌어주고 싶어요. +새로운 한 해가 너에게 뜻깊은 순간들을 안겨줄 거라 믿어요. 너의 꿈과 목표를 이루고 많은 성취를 이루길 바래요. 어떤 어려움이 있더라도 넌 강하고 용기있는 사람이니까 분명히 극복할 수 있을 거야. +생일 축하해, 내 친구! 너와 함께한 모든 순간은 나에게 큰 행운이야. 오늘은 너만을 위한 특별한 날, 너의 웃음과 행복이 끊이지 않기를 바라며, 너의 풍요로운 미래에 건배해요! \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index d321034..dcc2c19 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -12,5 +12,8 @@ ?attr/colorPrimaryVariant + + false + true \ No newline at end of file diff --git a/build.gradle b/build.gradle index eb5c5d7..8946fe9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + google() + mavenCentral() + maven { url 'https://jitpack.io' } + } +} + plugins { id 'com.android.application' version '7.3.1' apply false id 'com.android.library' version '7.3.1' apply false - id 'org.jetbrains.kotlin.android' version '1.8.0' apply false + id 'org.jetbrains.kotlin.android' version '1.8.20' apply false } \ No newline at end of file