diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e3c4cf54..b91dbcb5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -40,10 +40,6 @@ android { } } - buildFeatures { - dataBinding = true - } - buildTypes { debug { firebaseAppDistribution { diff --git a/app/src/main/java/com/teampophory/pophory/feature/home/photo/AddPhotoActivity.kt b/app/src/main/java/com/teampophory/pophory/feature/home/photo/AddPhotoActivity.kt index 293b8b47..44e914ae 100644 --- a/app/src/main/java/com/teampophory/pophory/feature/home/photo/AddPhotoActivity.kt +++ b/app/src/main/java/com/teampophory/pophory/feature/home/photo/AddPhotoActivity.kt @@ -6,6 +6,7 @@ import android.net.Uri import android.os.Bundle import android.util.Size import androidx.activity.viewModels +import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import coil.load @@ -13,7 +14,6 @@ import com.google.android.material.datepicker.CalendarConstraints import com.google.android.material.datepicker.DateValidatorPointBackward import com.google.android.material.datepicker.MaterialDatePicker import com.teampophory.pophory.R -import com.teampophory.pophory.common.activity.BindingActivity import com.teampophory.pophory.common.context.colorOf import com.teampophory.pophory.common.context.snackBar import com.teampophory.pophory.common.context.toast @@ -22,6 +22,7 @@ import com.teampophory.pophory.common.image.getAdjustedSize import com.teampophory.pophory.common.intent.stringExtra import com.teampophory.pophory.common.time.systemNow import com.teampophory.pophory.common.view.setOnSingleClickListener +import com.teampophory.pophory.common.view.viewBinding import com.teampophory.pophory.databinding.ActivityAddPhotoBinding import com.teampophory.pophory.feature.home.store.model.AlbumItem import dagger.hilt.android.AndroidEntryPoint @@ -34,12 +35,14 @@ import java.util.Locale import java.util.TimeZone @AndroidEntryPoint -class AddPhotoActivity : BindingActivity(R.layout.activity_add_photo) { +class AddPhotoActivity : AppCompatActivity() { + private val binding by viewBinding(ActivityAddPhotoBinding::inflate) private val viewModel: AddPhotoViewModel by viewModels() private val imageUri by stringExtra() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + setContentView(binding.root) loadImage() initView() subscribeEvent() @@ -152,7 +155,7 @@ class AddPhotoActivity : BindingActivity(R.layout.activ } companion object { - const val IMAGE_URL_EXTRA = "imageUri" + private const val IMAGE_URL_EXTRA = "imageUri" const val ALBUM_ITEM_EXTRA = "albumItem" const val IMAGE_MIME_TYPE = "image/*" diff --git a/app/src/main/res/layout/activity_add_photo.xml b/app/src/main/res/layout/activity_add_photo.xml index c0af02d9..4cd80680 100644 --- a/app/src/main/res/layout/activity_add_photo.xml +++ b/app/src/main/res/layout/activity_add_photo.xml @@ -1,179 +1,172 @@ - + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> - + - - - - - + android:layout_height="0dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toBottomOf="@+id/toolbar_add_photo"> - + android:layout_height="wrap_content" + android:paddingBottom="24dp"> + android:layout_height="0dp" + app:layout_constraintDimensionRatio="360:313" + app:layout_constraintTop_toTopOf="parent"> - - - - - - - - + android:layout_height="match_parent" + android:background="@color/black" + android:scaleType="centerCrop" + tools:src="@drawable/img_background_width" /> - + app:layout_constraintTop_toTopOf="parent" /> - - - - - - + app:layout_constraintTop_toTopOf="parent" + tools:visibility="gone" /> + + + + + + app:layout_constraintTop_toTopOf="parent" + tools:text="2020.06.06 (금)" /> - - - - - - + app:layout_constraintTop_toTopOf="parent" /> + + + + + + android:textAppearance="?textAppearanceText1" + android:textColor="?colorOnSurface100" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:text="사진관을 선택해주세요" /> + - - - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/com/teampophory/pophory/plugin/AndroidHiltPlugin.kt b/build-logic/convention/src/main/kotlin/com/teampophory/pophory/plugin/AndroidHiltPlugin.kt index 788e92d1..8f4c6aad 100644 --- a/build-logic/convention/src/main/kotlin/com/teampophory/pophory/plugin/AndroidHiltPlugin.kt +++ b/build-logic/convention/src/main/kotlin/com/teampophory/pophory/plugin/AndroidHiltPlugin.kt @@ -18,7 +18,7 @@ class AndroidHiltPlugin : Plugin { "implementation"(libs.findLibrary("hilt").get()) "ksp"(libs.findLibrary("hilt.compiler").get()) "testImplementation"(libs.findLibrary("hilt.testing").get()) - "kaptTest"(libs.findLibrary("hilt.testing.compiler").get()) + "kspTest"(libs.findLibrary("hilt.testing.compiler").get()) } } } diff --git a/build-logic/convention/src/main/kotlin/com/teampophory/pophory/plugin/CommonConfigs.kt b/build-logic/convention/src/main/kotlin/com/teampophory/pophory/plugin/CommonConfigs.kt index a29f8e56..fba50146 100644 --- a/build-logic/convention/src/main/kotlin/com/teampophory/pophory/plugin/CommonConfigs.kt +++ b/build-logic/convention/src/main/kotlin/com/teampophory/pophory/plugin/CommonConfigs.kt @@ -16,7 +16,6 @@ internal fun Project.configureAndroidCommonPlugin() { apply() apply() with(plugins) { - apply("kotlin-kapt") apply("kotlin-parcelize") } apply() diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts index 81877110..5638f623 100644 --- a/core/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -7,10 +7,6 @@ plugins { android { namespace = "com.teampophory.pophory.common" - buildFeatures { - dataBinding = true - } - defaultConfig { consumerProguardFiles("consumer-rules.pro") } diff --git a/core/common/src/main/java/com/teampophory/pophory/common/activity/BindingActivity.kt b/core/common/src/main/java/com/teampophory/pophory/common/activity/BindingActivity.kt deleted file mode 100644 index 326c5aff..00000000 --- a/core/common/src/main/java/com/teampophory/pophory/common/activity/BindingActivity.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.teampophory.pophory.common.activity - -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 layoutResId: Int -) : AppCompatActivity() { - protected lateinit var binding: T - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - binding = DataBindingUtil.setContentView(this, layoutResId) - binding.lifecycleOwner = this - } -} diff --git a/core/common/src/main/java/com/teampophory/pophory/common/fragment/BindingFragment.kt b/core/common/src/main/java/com/teampophory/pophory/common/fragment/BindingFragment.kt deleted file mode 100644 index a7c9139e..00000000 --- a/core/common/src/main/java/com/teampophory/pophory/common/fragment/BindingFragment.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.teampophory.pophory.common.fragment - -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 layoutResId: Int -) : Fragment() { - private var _binding: T? = null - protected val binding: T - get() = requireNotNull(_binding) { "binding object is not initialized" } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - _binding = DataBindingUtil.inflate(inflater, layoutResId, container, false) - binding.lifecycleOwner = viewLifecycleOwner - return binding.root - } - - override fun onDestroyView() { - super.onDestroyView() - // Nunu: 안드로이드 공식문서에서 _binding 객체는 super.onDestroyView() 이후에 하는 것이라고 명시되어있습니다. - _binding = null - } -}