-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT/#364] 공고 상세 뷰 / 카카오톡 공유하기 #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7ad80c9
3974c5a
24ac877
6eba5ae
a41ae24
d756d2f
67f8a29
928ec39
ca45ac9
af08d07
d9cb76e
20bfc93
fe74e77
3c4f0ff
d4c6b23
f364a0d
b279d27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package com.terning.core.designsystem.util | ||
|
|
||
| import android.content.Context | ||
| import android.content.Intent | ||
| import androidx.browser.customtabs.CustomTabsIntent | ||
| import com.kakao.sdk.share.ShareClient | ||
| import com.kakao.sdk.share.WebSharerClient | ||
| import dagger.hilt.android.qualifiers.ApplicationContext | ||
| import timber.log.Timber | ||
| import javax.inject.Inject | ||
|
|
||
| class KakaoUtil @Inject constructor( | ||
| @ApplicationContext private val context: Context | ||
| ) { | ||
| private val templateId = 118600L | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 templateId는 무슨 기준으로 넣는건가요?? 단순 궁금증ㅎ
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 카카오 공유하기 메시지를 커스텀으로 만들때 식별하는 ID인데 일단 임의로 넣어둔 값이고 지금은 의미가 없어서 ㅜㅜ 다음 feature에서 유동적으로 수정하려고 합니당! |
||
|
|
||
| fun shareToKakaoTalk(templateArgs: Map<String, String>) { | ||
| if (ShareClient.instance.isKakaoTalkSharingAvailable(context)) { | ||
| ShareClient.instance.shareCustom( | ||
| context, | ||
| templateId, | ||
| templateArgs | ||
| ) { sharingResult, error -> | ||
| if (error != null) { | ||
| Timber.e("카카오톡 공유 실패: ${error.message}") | ||
| } else if (sharingResult != null) { | ||
| context.startActivity(sharingResult.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) | ||
| } | ||
| } | ||
| } else { | ||
| val sharerUrl = WebSharerClient.instance.makeCustomUrl(templateId, templateArgs) | ||
| try { | ||
| val intent = CustomTabsIntent.Builder().build().intent | ||
| intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
| intent.data = sharerUrl | ||
| context.startActivity(intent) | ||
| } catch (e: Exception) { | ||
| Timber.e("웹 공유 실패: ${e.message}") | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.terning.feature.intern | ||
|
|
||
| import androidx.annotation.StringRes | ||
|
|
||
| sealed class InternSideEffect { | ||
| data class Toast(@StringRes val message: Int) : | ||
| InternSideEffect() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| package com.terning.feature.intern | ||
|
|
||
| import androidx.annotation.StringRes | ||
|
|
||
| sealed class InternViewSideEffect { | ||
| data class ShowToast(@StringRes val message: Int) : | ||
| data class Toast(@StringRes val message: Int) : | ||
| InternViewSideEffect() | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="32dp" | ||
| android:height="32dp" | ||
| android:viewportWidth="32" | ||
| android:viewportHeight="32"> | ||
| <path | ||
| android:pathData="M12.71,11.71L15,9.41V19C15,19.265 15.105,19.52 15.293,19.707C15.48,19.895 15.735,20 16,20C16.265,20 16.52,19.895 16.707,19.707C16.895,19.52 17,19.265 17,19V9.41L19.29,11.71C19.383,11.804 19.494,11.878 19.615,11.929C19.737,11.98 19.868,12.006 20,12.006C20.132,12.006 20.263,11.98 20.385,11.929C20.506,11.878 20.617,11.804 20.71,11.71C20.804,11.617 20.878,11.506 20.929,11.385C20.98,11.263 21.006,11.132 21.006,11C21.006,10.868 20.98,10.737 20.929,10.615C20.878,10.494 20.804,10.383 20.71,10.29L16.71,6.29C16.615,6.199 16.503,6.128 16.38,6.08C16.136,5.98 15.863,5.98 15.62,6.08C15.497,6.128 15.385,6.199 15.29,6.29L11.29,10.29C11.197,10.383 11.123,10.494 11.072,10.616C11.022,10.738 10.996,10.868 10.996,11C10.996,11.132 11.022,11.262 11.072,11.384C11.123,11.506 11.197,11.617 11.29,11.71C11.383,11.803 11.494,11.877 11.616,11.928C11.738,11.978 11.868,12.004 12,12.004C12.132,12.004 12.262,11.978 12.384,11.928C12.506,11.877 12.617,11.803 12.71,11.71ZM25,16C24.735,16 24.48,16.105 24.293,16.293C24.105,16.48 24,16.735 24,17V23C24,23.265 23.895,23.52 23.707,23.707C23.52,23.895 23.265,24 23,24H9C8.735,24 8.48,23.895 8.293,23.707C8.105,23.52 8,23.265 8,23V17C8,16.735 7.895,16.48 7.707,16.293C7.52,16.105 7.265,16 7,16C6.735,16 6.48,16.105 6.293,16.293C6.105,16.48 6,16.735 6,17V23C6,23.796 6.316,24.559 6.879,25.121C7.441,25.684 8.204,26 9,26H23C23.796,26 24.559,25.684 25.121,25.121C25.684,24.559 26,23.796 26,23V17C26,16.735 25.895,16.48 25.707,16.293C25.52,16.105 25.265,16 25,16Z" | ||
| android:fillColor="#373737"/> | ||
| </vector> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
멋있따!