Skip to content

Commit

Permalink
[TEST] #7 - 배포 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
jung0115 committed Aug 20, 2024
1 parent fd900d1 commit 6cf9792
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 82 deletions.
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
manifestPlaceholders = [
appName : "@string/app_name",
appIcon: "@drawable/ic_mykkumi_logo",
// appIcon: "@drawable/ic_mykkumi_logo",
providerAuthority: "com.swmarastro.mykkumi.android.provider"
]
// signingConfig signingConfigs.config
}
debug {
applicationIdSuffix '.dev'
manifestPlaceholders = [
appName : "@string/app_name_dev",
appIcon: "@drawable/ic_mykkumi_logo_dev",
providerAuthority: "com.swmarastro.mykkumi.android.dev.provider"
]
}
// debug {
// applicationIdSuffix '.dev'
// manifestPlaceholders = [
// appName : "@string/app_name_dev",
// appIcon: "@drawable/ic_mykkumi_logo_dev",
// providerAuthority: "com.swmarastro.mykkumi.android.dev.provider"
// ]
// }
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="${appIcon}"
android:label="${appName}"
android:icon="@drawable/ic_mykkumi_logo"
android:label="@string/app_name"
android:roundIcon="@drawable/ic_mykkumi_logo_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyKkumi_AOS"
Expand All @@ -57,7 +57,7 @@

<!-- 이미지 저장하려면? -->
<provider
android:authorities="${providerAuthority}"
android:authorities="com.swmarastro.mykkumi.android.provider"
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,79 +45,43 @@ class PostImagesAdapter(

val parent = binding.imagePost

// if(position == 0) {
// parent.viewTreeObserver.addOnGlobalLayoutListener {
// if (parentWidth == 0 || parentHeight == 0) {
// if (parent.width != 0 && parent.height != 0) {
// if (parent.width > parent.height) {
// parentWidth = parent.width
// parentHeight = parent.height
// } else {
// parentWidth =
// (parent.width.toDouble() * (parent.width.toDouble() / parent.height.toDouble())).toInt()
// parentHeight = parent.width
// }
//
// binding.relativePinsOfImages.layoutParams.width = parentWidth
// binding.relativePinsOfImages.layoutParams.height = parentHeight
// binding.relativePinsOfImages.requestLayout()
//
// val width = parent.width
// parent.layoutParams.height = width
// parent.requestLayout()
//
// binding.relativePostImage.layoutParams.height = parentHeight
// binding.relativePostImage.requestLayout()
//
// notifyItemChanged(position)
// }
// }
// }
// }
//
// else {
// 이미지 세로 사이즈를 가로 사이즈와 동일하게 설정
parent.viewTreeObserver.addOnGlobalLayoutListener(object :
ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
if (parentWidth == 0 || parentHeight == 0) {
Log.d(
"test",
"${position} - width: ${parentWidth}, height: ${parentHeight}"
)
if (parent.width != 0 && parent.height != 0) {
if (parent.width > parent.height) {
parentWidth = parent.width
parentHeight = parent.height
} else {
parentWidth =
(parent.width.toDouble() * (parent.width.toDouble() / parent.height.toDouble())).toInt()
parentHeight = parent.width
}

binding.relativePinsOfImages.layoutParams.width = parentWidth
binding.relativePinsOfImages.layoutParams.height = parentHeight
binding.relativePinsOfImages.requestLayout()

val width = parent.width
parent.layoutParams.height = width
parent.requestLayout()

binding.relativePostImage.layoutParams.height = binding.relativePostImage.width
binding.relativePostImage.requestLayout()

//notifyItemChanged(position)
// 이미지 세로 사이즈를 가로 사이즈와 동일하게 설정
parent.viewTreeObserver.addOnGlobalLayoutListener(object :
ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
if (parentWidth == 0 || parentHeight == 0) {
if (parent.width != 0 && parent.height != 0) {
if (parent.width > parent.height) {
parentWidth = parent.width
parentHeight = parent.height
} else {
parentWidth =
(parent.width.toDouble() * (parent.width.toDouble() / parent.height.toDouble())).toInt()
parentHeight = parent.width
}
else {
notifyItemChanged(position)
}
}

// 리스너 제거
parent.viewTreeObserver.removeOnGlobalLayoutListener(this)
binding.relativePinsOfImages.layoutParams.width = parentWidth
binding.relativePinsOfImages.layoutParams.height = parentHeight
binding.relativePinsOfImages.requestLayout()

val width = parent.width
parent.layoutParams.height = width
parent.requestLayout()

binding.relativePostImage.layoutParams.height = binding.relativePostImage.width
binding.relativePostImage.requestLayout()

//notifyItemChanged(position)
}
else {
notifyItemChanged(position)
}
}
})
// }

// 리스너 제거
parent.viewTreeObserver.removeOnGlobalLayoutListener(this)
}
})

// 포스트에 핀 추가
for(idx in 0..<item.pins.size) {
Expand Down
13 changes: 13 additions & 0 deletions core/data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
// debug {
// // local.properties에서 base url, kakao native app key 받아오기
// def baseUrl = properties.getProperty('api.dev.baseurl', '')
// def kakaoNativeAppKey = properties.getProperty('kakao.native.app.key', '')
//
// if (!baseUrl.isEmpty()) buildConfigField "String", 'BASE_URL', "${baseUrl}"
// else throw new GradleException("BASE_URL is not set in local.properties")
//
// if (!kakaoNativeAppKey.isEmpty()) {
// buildConfigField "String", 'KAKAO_NATIVE_APP_KEY', "\"${kakaoNativeAppKey}\""
// //manifestPlaceholders = [KAKAO_NATIVE_APP_KEY: kakaoNativeAppKey]
// } else throw new GradleException("KAKAO_NATIVE_APP_KEY is not set in local.properties")
// }
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(R.layout.fragment_home) {

navController = view.findNavController()
binding.includeListLoading.visibility = View.VISIBLE
binding.emptyPostList.visibility = View.GONE

binding.scrollHomeBannerNPost.isSmoothScrollingEnabled = true
binding.scrollHomeBannerNPost.post {
Expand Down Expand Up @@ -80,6 +81,10 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(R.layout.fragment_home) {
postListAdapter.notifyItemRangeInserted(rangeEnd - count, rangeEnd)
}
}
else if(viewModel.bannerListUiState.value.isNullOrEmpty()) {
binding.includeListLoading.visibility = View.GONE
binding.emptyPostList.visibility = View.VISIBLE
}
})
}

Expand Down
30 changes: 30 additions & 0 deletions feature/home/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,36 @@
android:nestedScrollingEnabled="false"
android:layout_marginTop="24dp"/>

<RelativeLayout
android:id="@+id/empty_post_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="100dp"
android:paddingBottom="60dp"
android:gravity="center_vertical"
android:layout_below="@id/relative_banner"
android:visibility="gone">

<ImageView
android:id="@+id/img_logo"
android:layout_width="140dp"
android:layout_height="140dp"
android:src="@drawable/ic_mykkumi_character_notice"
android:layout_centerHorizontal="true"/>

<TextView
android:id="@+id/text_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/img_logo"
android:layout_centerHorizontal="true"
android:text="아직 작성된 포스트가 없습니다"
android:textSize="15sp"
android:textColor="@color/neutral_800"
android:fontFamily="@font/pretendard_bold"/>

</RelativeLayout>

<!-- 로딩 -->
<LinearLayout
android:id="@+id/include_list_loading"
Expand Down

0 comments on commit 6cf9792

Please sign in to comment.