From d4cbb80a0069e3f88b5453a21eea6dac28d4613f Mon Sep 17 00:00:00 2001 From: NaZe0320 Date: Sat, 10 Jun 2023 17:33:23 +0900 Subject: [PATCH 01/22] =?UTF-8?q?[ADD]=20BindingActivity,=20BindingFragmen?= =?UTF-8?q?t=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 1 + .../java/com/nbit/Idear/BindingActivity.kt | 16 ++++++++++++ .../java/com/nbit/Idear/BindingFragment.kt | 25 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 app/src/main/java/com/nbit/Idear/BindingActivity.kt create mode 100644 app/src/main/java/com/nbit/Idear/BindingFragment.kt diff --git a/app/build.gradle b/app/build.gradle index 813188f..7ec3436 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,6 +42,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.9.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.android.gms:play-services-measurement-api:20.1.2' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' diff --git a/app/src/main/java/com/nbit/Idear/BindingActivity.kt b/app/src/main/java/com/nbit/Idear/BindingActivity.kt new file mode 100644 index 0000000..f669984 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/BindingActivity.kt @@ -0,0 +1,16 @@ +package com.nbit.Idear + +import android.os.Bundle +import androidx.annotation.LayoutRes +import androidx.appcompat.app.AppCompatActivity +import androidx.databinding.DataBindingUtil +import androidx.databinding.ViewDataBinding + +abstract class BindingActivity (@LayoutRes private val layoutRes: Int): AppCompatActivity() { + lateinit var binding: B + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = DataBindingUtil.setContentView(this, layoutRes) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/BindingFragment.kt b/app/src/main/java/com/nbit/Idear/BindingFragment.kt new file mode 100644 index 0000000..9e57103 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/BindingFragment.kt @@ -0,0 +1,25 @@ +package com.nbit.Idear + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.annotation.LayoutRes +import androidx.databinding.DataBindingUtil +import androidx.databinding.ViewDataBinding +import androidx.fragment.app.Fragment + +abstract class BindingFragment(@LayoutRes private val layoutRes: Int): Fragment() { + private var _binding: B? = null + val binding get() = requireNotNull(_binding!!) { "${this::class.java.simpleName}에서 에러가 발생했습니다."} + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + _binding = DataBindingUtil.inflate(inflater, layoutRes, container, false) + return binding.root + } + +} \ No newline at end of file From 71dbab048071185cdaec0ee57c3a84d96cda04d2 Mon Sep 17 00:00:00 2001 From: NaZe0320 Date: Sat, 10 Jun 2023 19:11:30 +0900 Subject: [PATCH 02/22] =?UTF-8?q?[ADD]=20Write=20=EA=B4=80=EB=A0=A8=20Acti?= =?UTF-8?q?vity=20=EB=B0=8F=20Fragment=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 3 +++ .../com/nbit/Idear/write/WriteActivity.kt | 14 +++++++++++ .../nbit/Idear/write/WriteFirstFragment.kt | 14 +++++++++++ .../nbit/Idear/write/WriteFourthFragment.kt | 14 +++++++++++ .../Idear/write/WriteSecondPrivateFragment.kt | 14 +++++++++++ .../Idear/write/WriteSecondPublicFragment.kt | 14 +++++++++++ .../nbit/Idear/write/WriteThirdFragment.kt | 14 +++++++++++ .../com/nbit/Idear/write/WriteViewModel.kt | 7 ++++++ app/src/main/res/layout/activity_write.xml | 23 +++++++++++++++++++ .../main/res/layout/fragment_write_first.xml | 23 +++++++++++++++++++ .../main/res/layout/fragment_write_fourth.xml | 23 +++++++++++++++++++ .../layout/fragment_write_second_private.xml | 23 +++++++++++++++++++ .../layout/fragment_write_second_public.xml | 23 +++++++++++++++++++ .../main/res/layout/fragment_write_third.xml | 23 +++++++++++++++++++ 14 files changed, 232 insertions(+) create mode 100644 app/src/main/java/com/nbit/Idear/write/WriteActivity.kt create mode 100644 app/src/main/java/com/nbit/Idear/write/WriteFirstFragment.kt create mode 100644 app/src/main/java/com/nbit/Idear/write/WriteFourthFragment.kt create mode 100644 app/src/main/java/com/nbit/Idear/write/WriteSecondPrivateFragment.kt create mode 100644 app/src/main/java/com/nbit/Idear/write/WriteSecondPublicFragment.kt create mode 100644 app/src/main/java/com/nbit/Idear/write/WriteThirdFragment.kt create mode 100644 app/src/main/java/com/nbit/Idear/write/WriteViewModel.kt create mode 100644 app/src/main/res/layout/activity_write.xml create mode 100644 app/src/main/res/layout/fragment_write_first.xml create mode 100644 app/src/main/res/layout/fragment_write_fourth.xml create mode 100644 app/src/main/res/layout/fragment_write_second_private.xml create mode 100644 app/src/main/res/layout/fragment_write_second_public.xml create mode 100644 app/src/main/res/layout/fragment_write_third.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1e32a1a..8cfdd6d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,6 +11,9 @@ android:supportsRtl="true" android:theme="@style/Theme.IDear" tools:targetApi="31"> + 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..55f8af8 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteActivity.kt @@ -0,0 +1,14 @@ +package com.nbit.Idear.write + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import com.nbit.Idear.BindingActivity +import com.nbit.Idear.R +import com.nbit.Idear.databinding.ActivityWriteBinding + +class WriteActivity : BindingActivity(R.layout.activity_write) { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + } +} \ 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..c6191ea --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteFirstFragment.kt @@ -0,0 +1,14 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import android.view.View +import com.nbit.Idear.BindingFragment +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding + +class WriteFirstFragment: BindingFragment(R.layout.fragment_write_first) { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + } +} \ 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..483f85d --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteFourthFragment.kt @@ -0,0 +1,14 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import android.view.View +import com.nbit.Idear.BindingFragment +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding + +class WriteFourthFragment: BindingFragment(R.layout.fragment_write_fourth) { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + } +} \ 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..89a2370 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteSecondPrivateFragment.kt @@ -0,0 +1,14 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import android.view.View +import com.nbit.Idear.BindingFragment +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding + +class WriteSecondPrivateFragment: BindingFragment(R.layout.fragment_write_second_private) { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + } +} \ 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..46b59a2 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteSecondPublicFragment.kt @@ -0,0 +1,14 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import android.view.View +import com.nbit.Idear.BindingFragment +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding + +class WriteSecondPublicFragment: BindingFragment(R.layout.fragment_write_second_public) { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + } +} \ 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..0eb67e5 --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteThirdFragment.kt @@ -0,0 +1,14 @@ +package com.nbit.Idear.write + +import android.os.Bundle +import android.view.View +import com.nbit.Idear.BindingFragment +import com.nbit.Idear.R +import com.nbit.Idear.databinding.FragmentWriteFirstBinding + +class WriteThirdFragment: BindingFragment(R.layout.fragment_write_third) { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nbit/Idear/write/WriteViewModel.kt b/app/src/main/java/com/nbit/Idear/write/WriteViewModel.kt new file mode 100644 index 0000000..df4607a --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/write/WriteViewModel.kt @@ -0,0 +1,7 @@ +package com.nbit.Idear.write + +import androidx.lifecycle.ViewModel + +class WriteViewModel: ViewModel() { + +} \ 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..0452519 --- /dev/null +++ b/app/src/main/res/layout/activity_write.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + \ 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..e1821fc --- /dev/null +++ b/app/src/main/res/layout/fragment_write_first.xml @@ -0,0 +1,23 @@ + + + + + + + + + +