diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml new file mode 100644 index 00000000..02b915b8 --- /dev/null +++ b/.idea/git_toolbox_prj.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 00000000..7e340a77 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index a27ad946..5dc691fd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,17 +8,29 @@ plugins { id 'kotlin-parcelize' } +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) + android { - compileSdk 31 + compileSdk 33 defaultConfig { applicationId "com.teamsparker.android" minSdk 26 - targetSdk 31 - versionCode 5 - versionName "1.1.0" + targetSdk 33 + versionCode 6 + versionName "1.1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + buildConfigField( + "String", + "FACEBOOK_APP_ID", + properties.getProperty("FACEBOOK_APP_ID") + ) + + manifestPlaceholders["FACEBOOK_APP_ID"] = + properties.getProperty("FACEBOOK_APP_ID") } buildTypes { @@ -122,4 +134,7 @@ dependencies { // Timber implementation 'com.jakewharton.timber:timber:5.0.1' + + // Facebook + implementation "com.facebook.android:facebook-android-sdk:[8,9)" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 09d28f8b..a33b9cf9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,14 +1,21 @@ - + + + + + @@ -25,6 +32,13 @@ android:roundIcon="@mipmap/ic_app_logo_round" android:supportsRtl="true" android:theme="@style/Theme.SparkAndroid"> + + + + + = Build.VERSION_CODES.TIRAMISU) { + android.Manifest.permission.READ_MEDIA_IMAGES + } else { + android.Manifest.permission.READ_EXTERNAL_STORAGE + } + binding.tvProfileBottomFromAlbum.setOnClickListener { when (PackageManager.PERMISSION_GRANTED) { ContextCompat.checkSelfPermission( requireContext(), - android.Manifest.permission.READ_EXTERNAL_STORAGE + permission, ) -> { fromAlbumActivityLauncher.launch( Intent( @@ -107,7 +113,7 @@ class ProfileBottomSheet : BottomSheetDialogFragment() { else -> { ActivityCompat.requestPermissions( requireActivity(), - arrayOf(android.Manifest.permission.READ_EXTERNAL_STORAGE), + arrayOf(permission), REQUEST_READ_STORAGE_PERMISSION ) } diff --git a/app/src/main/java/com/teamsparker/android/ui/certify/CertifyBottomSheet.kt b/app/src/main/java/com/teamsparker/android/ui/certify/CertifyBottomSheet.kt index ba2c5fb1..b3b7e6e4 100644 --- a/app/src/main/java/com/teamsparker/android/ui/certify/CertifyBottomSheet.kt +++ b/app/src/main/java/com/teamsparker/android/ui/certify/CertifyBottomSheet.kt @@ -105,11 +105,17 @@ class CertifyBottomSheet : BottomSheetDialogFragment() { } private fun initFromAlbumBtnClickListener() { + val permission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + android.Manifest.permission.READ_MEDIA_IMAGES + } else { + android.Manifest.permission.READ_EXTERNAL_STORAGE + } + binding.tvCertifyAlbum.setOnClickListener { when (PackageManager.PERMISSION_GRANTED) { ContextCompat.checkSelfPermission( requireContext(), - android.Manifest.permission.READ_EXTERNAL_STORAGE + permission, ), -> { fromAlbumActivityLauncher.launch( @@ -122,7 +128,7 @@ class CertifyBottomSheet : BottomSheetDialogFragment() { else -> { ActivityCompat.requestPermissions( requireActivity(), - arrayOf(android.Manifest.permission.READ_EXTERNAL_STORAGE), + arrayOf(permission), REQUEST_READ_STORAGE_PERMISSION ) } diff --git a/app/src/main/java/com/teamsparker/android/ui/feed/adapter/FeedAdapter.kt b/app/src/main/java/com/teamsparker/android/ui/feed/adapter/FeedAdapter.kt index c29cdd07..285e928f 100644 --- a/app/src/main/java/com/teamsparker/android/ui/feed/adapter/FeedAdapter.kt +++ b/app/src/main/java/com/teamsparker/android/ui/feed/adapter/FeedAdapter.kt @@ -79,14 +79,14 @@ class FeedAdapter( it.visibility = View.VISIBLE it.playAnimation() it.addAnimatorListener(object : Animator.AnimatorListener { - override fun onAnimationEnd(animation: Animator?) { + override fun onAnimationEnd(animation: Animator) { it.visibility = View.INVISIBLE binding.btnFeedHeart.isEnabled = true } - override fun onAnimationStart(animation: Animator?) {} - override fun onAnimationCancel(animation: Animator?) {} - override fun onAnimationRepeat(animation: Animator?) {} + override fun onAnimationStart(animation: Animator) {} + override fun onAnimationCancel(animation: Animator) {} + override fun onAnimationRepeat(animation: Animator) {} }) } diff --git a/app/src/main/java/com/teamsparker/android/ui/intro/IntroActivity.kt b/app/src/main/java/com/teamsparker/android/ui/intro/IntroActivity.kt index c058d3f6..acb62df3 100644 --- a/app/src/main/java/com/teamsparker/android/ui/intro/IntroActivity.kt +++ b/app/src/main/java/com/teamsparker/android/ui/intro/IntroActivity.kt @@ -87,13 +87,13 @@ class IntroActivity : BaseActivity(R.layout.activity_intro private fun initLottieListener() { binding.lottieIntroBg.addAnimatorListener(object : Animator.AnimatorListener { - override fun onAnimationEnd(animation: Animator?) { + override fun onAnimationEnd(animation: Animator) { introViewModel.initIsEndLottie() } - override fun onAnimationStart(animation: Animator?) {} - override fun onAnimationCancel(animation: Animator?) {} - override fun onAnimationRepeat(animation: Animator?) {} + override fun onAnimationStart(animation: Animator) {} + override fun onAnimationCancel(animation: Animator) {} + override fun onAnimationRepeat(animation: Animator) {} }) } diff --git a/app/src/main/java/com/teamsparker/android/ui/mypage/MyPageViewModel.kt b/app/src/main/java/com/teamsparker/android/ui/mypage/MyPageViewModel.kt index 54f085ec..c54ee5a2 100644 --- a/app/src/main/java/com/teamsparker/android/ui/mypage/MyPageViewModel.kt +++ b/app/src/main/java/com/teamsparker/android/ui/mypage/MyPageViewModel.kt @@ -4,6 +4,7 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope +import com.teamsparker.android.BuildConfig import com.teamsparker.android.data.remote.entity.response.ProfileResponse import com.teamsparker.android.data.remote.repository.AlarmSettingRepository import com.teamsparker.android.data.remote.repository.AuthRepository @@ -20,6 +21,8 @@ class MyPageViewModel @Inject constructor( private val authRepository: AuthRepository, private val alarmSettingRepository: AlarmSettingRepository ) : ViewModel() { + val appVersion = BuildConfig.VERSION_NAME + private val _profileData = MutableLiveData() val profileData: LiveData = _profileData diff --git a/app/src/main/java/com/teamsparker/android/ui/share/InstaActivity.kt b/app/src/main/java/com/teamsparker/android/ui/share/InstaActivity.kt index f13ea001..ae055b34 100644 --- a/app/src/main/java/com/teamsparker/android/ui/share/InstaActivity.kt +++ b/app/src/main/java/com/teamsparker/android/ui/share/InstaActivity.kt @@ -21,6 +21,7 @@ import com.teamsparker.android.ui.main.MainActivity import com.teamsparker.android.ui.main.MainActivity.Companion.FROM_WHERE import com.teamsparker.android.util.showToast import android.provider.MediaStore +import com.teamsparker.android.BuildConfig import timber.log.Timber import java.io.ByteArrayOutputStream import java.io.OutputStream @@ -111,18 +112,15 @@ class InstaActivity : BaseActivity(R.layout.activity_insta } private fun shareInsta(uri: Uri) { - - val sourceApplication = "com.spark.android" - val intent = Intent("com.instagram.share.ADD_TO_STORY") intent.type = "image/jpeg" - intent.putExtra("source_application", sourceApplication) + intent.putExtra("com.facebook.platform.extra.APPLICATION_ID", BuildConfig.FACEBOOK_APP_ID) + intent.putExtra("interactive_asset_uri", uri) intent.putExtra("top_background_color", "#737376") intent.putExtra("bottom_background_color", "#737376") - intent.putExtra("interactive_asset_uri", uri) grantUriPermission( - "com.instagram.android", + "com.facebook.katana", uri, Intent.FLAG_GRANT_READ_URI_PERMISSION ) diff --git a/app/src/main/java/com/teamsparker/android/util/AnimationUtil.kt b/app/src/main/java/com/teamsparker/android/util/AnimationUtil.kt index 688b3573..efa6048b 100644 --- a/app/src/main/java/com/teamsparker/android/util/AnimationUtil.kt +++ b/app/src/main/java/com/teamsparker/android/util/AnimationUtil.kt @@ -113,7 +113,7 @@ object AnimationUtil { ObjectAnimator.ofFloat(constraintLayout, "translationY", 0f).apply { start() addListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator?) { + override fun onAnimationEnd(animation: Animator) { super.onAnimationEnd(animation) ObjectAnimator.ofFloat(textviewTwo, View.ALPHA, 0f, 1f).apply { duration = EDIT_TEXT_FOCUS_TRANSLATION @@ -121,7 +121,7 @@ object AnimationUtil { } ObjectAnimator.ofFloat(textviewOne, View.ALPHA, 0f, 1f).apply { addListener(object : AnimatorListenerAdapter() { - override fun onAnimationStart(animation: Animator?) { + override fun onAnimationStart(animation: Animator) { super.onAnimationStart(animation) textviewOne.visibility = View.VISIBLE textviewTwo.visibility = View.VISIBLE @@ -152,12 +152,12 @@ object AnimationUtil { } ObjectAnimator.ofFloat(textviewOne, View.ALPHA, 1f, 0f).apply { addListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator?) { + override fun onAnimationEnd(animation: Animator) { super.onAnimationEnd(animation) ObjectAnimator.ofFloat(constraintLayout, "translationY", -220f).apply { start() addListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator?) { + override fun onAnimationEnd(animation: Animator) { super.onAnimationEnd(animation) textviewOne.visibility = View.GONE textviewTwo.visibility = View.GONE diff --git a/app/src/main/res/layout/fragment_my_page_main.xml b/app/src/main/res/layout/fragment_my_page_main.xml index b31d9917..eb603aec 100644 --- a/app/src/main/res/layout/fragment_my_page_main.xml +++ b/app/src/main/res/layout/fragment_my_page_main.xml @@ -288,7 +288,7 @@ android:layout_marginEnd="28dp" android:fontFamily="@font/futura_medium" android:includeFontPadding="false" - android:text="@string/my_page_main_version" + android:text="@{@string/my_page_main_version(myPageViewModel.appVersion)}" android:textColor="@color/spark_light_dark_gray" android:textSize="12dp" app:layout_constraintBottom_toBottomOf="@id/tv_my_page_main_version_info" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6f72ea92..5320c0ed 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -299,7 +299,7 @@ 약관 및 정책 오픈소스 라이선스 버전 정보 - v1.0.0 + v%s 로그아웃 회원 탈퇴 로그아웃되었습니다.