Skip to content
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

Feat/#15 첫화면로그인 구현 #19

Merged
merged 74 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
b3004a3
Merge branch 'feat/#4_honey_tips_fragment' into develop
kyujin0911 Jan 9, 2024
0b77608
feat: 디자인시스템 & baseActivity, baseFragment 구현
hangunhee39 Jan 13, 2024
d1e9694
chore :
hangunhee39 Jan 13, 2024
343e6e3
Merge pull request #6 from ttoklip/feat/#1_home_news_fragment
hangunhee39 Jan 13, 2024
4cf0cde
feat: 마이페이지 이미지 및 프로필부분 화면 구성
posite Jan 13, 2024
0d655dc
feat: app name 추가 및 hilt annotaion 추가
posite Jan 14, 2024
57f5be6
feat: 네트워키 기초작업
posite Jan 14, 2024
e075162
Merge pull request #8 from ttoklip/feat/#7_Api_기초작업
posite Jan 14, 2024
c842d8d
chore: pull develop branch
posite Jan 14, 2024
9b8113c
feat : new UI 구현
hangunhee39 Jan 14, 2024
bfd251e
Merge branch 'develop' into feat/#1_home_news_fragment
hangunhee39 Jan 14, 2024
490a188
chore:
hangunhee39 Jan 14, 2024
67cb62b
chore : sdk 변경
hangunhee39 Jan 14, 2024
401620a
Merge pull request #10 from ttoklip/chore/#9_sdk_update
hangunhee39 Jan 14, 2024
28f25be
Merge branch 'develop' into faet/#2_마이페이지_구현
posite Jan 14, 2024
56692b6
Merge branch 'develop' into feat/#1_home_news_fragment
hangunhee39 Jan 14, 2024
b61232d
Merge branch 'develop' into feat/#4_honey_tips_fragment
kyujin0911 Jan 15, 2024
31d571b
Merge branch 'main' into develop
posite Jan 15, 2024
70d58c4
Merge pull request #11 from ttoklip/feat/#1_home_news_fragment
hangunhee39 Jan 15, 2024
ff0e699
Merge branch 'develop' into feat/#1_home_news_fragment
hangunhee39 Jan 15, 2024
9e2ee4f
Merge branch 'develop' into faet/#2_마이페이지_구현
posite Jan 15, 2024
b28d197
feet: home ui 구현
hangunhee39 Jan 16, 2024
8db6a85
feat: string 추가 및 거래내역 버튼까지 UI 구현
posite Jan 16, 2024
bc4ca94
feat: 마이페이지 UI 구현
posite Jan 16, 2024
9fa64f5
chore: 마이페이지 아이콘 수정 및 UI 수정
posite Jan 17, 2024
5021a30
feat: 내 정보 관리화면 activity 추가
posite Jan 17, 2024
c69c9ff
feat: core에 initView, initObserver 추가 및 fragment의 databinding 해제
posite Jan 17, 2024
20452a3
Merge branch 'develop' into feat/#1_home_news_fragment
hangunhee39 Jan 18, 2024
771ee71
Merge pull request #13 from ttoklip/feat/#12_core부분_수정
hangunhee39 Jan 18, 2024
e30a662
Merge branch 'develop' into feat/#1_home_news_fragment
hangunhee39 Jan 18, 2024
27acdfe
chore : base 변경으로 메서드 추가
hangunhee39 Jan 18, 2024
30512be
fix: BaseActivity의 binding 접근제한자 오류 수정
posite Jan 18, 2024
5db8269
feat : 바텀네비게이션 설정
hangunhee39 Jan 18, 2024
1945126
refact : NewDetail 부분 viewModel 구조 변경
hangunhee39 Jan 18, 2024
f815dc1
faet : 임시 fragment
hangunhee39 Jan 18, 2024
78507e7
feat : 홈 데이터 바인딩 작업
hangunhee39 Jan 18, 2024
d74e786
feat : ui 추가 작업
hangunhee39 Jan 18, 2024
943c979
chore:
hangunhee39 Jan 18, 2024
ad112d3
fix : lifecycle bug fix
hangunhee39 Jan 18, 2024
5b1c652
Merge pull request #14 from ttoklip/feat/#12_core부분_수정
posite Jan 18, 2024
342c23e
Merge branch 'develop' into faet/#2_마이페이지_구현
posite Jan 18, 2024
8e4fa0a
feat : articleList data binding
hangunhee39 Jan 18, 2024
4aee3d3
feat: 내 프로필 관리 UI 구현
posite Jan 19, 2024
9281e21
feat: 독립 경험 기간 입력을 위한 dialog UI 구현
posite Jan 19, 2024
9becd4d
feat: 관심사 선택 dialog 구현 및 기간 입력 기능 구현
posite Jan 20, 2024
7f67b19
feat : newsRVA & viewPagerAdapter
hangunhee39 Jan 20, 2024
9f2e624
feat: 주소 찾기 ui 구현 및 관심사 선택 관심사 추가
posite Jan 21, 2024
4fe1741
feat: 알림 화면 구현
hangunhee39 Jan 22, 2024
a312b65
feat : 검색 화면 구현
hangunhee39 Jan 22, 2024
07f985e
refact : 뉴스 글 목록 디자인 변경
hangunhee39 Jan 22, 2024
f3db2fc
chore :
hangunhee39 Jan 22, 2024
d7cef7e
Merge branch 'develop' into feat/#1_home_news_fragment
hangunhee39 Jan 22, 2024
b537e3b
feat: 꿀팁 공유해요 UI 구현
kyujin0911 Jan 22, 2024
5133154
feat: 공지사항 UI 구현
posite Jan 22, 2024
5c1f593
feat: 이용관리 UI 구현
posite Jan 22, 2024
ed4a40c
fix: 주요 관심사 UI 오류 수정
posite Jan 22, 2024
b652d13
feat: 우리동네 설정 UI 구현
posite Jan 22, 2024
4cc2b4a
chore: 상수 분리 및 ui 오류 수정
posite Jan 22, 2024
8b4c4a6
feat: 첫화면로그인 화면 구성
40food Jan 23, 2024
79053ec
feat: 계정정보관리 화면 구성
posite Jan 23, 2024
002bb0e
Merge branch 'feat/#15_첫화면로그인_구현' of https://github.com/ttoklip/Front…
40food Jan 23, 2024
9a99eef
feat: Dialog UI 구현
kyujin0911 Jan 23, 2024
def7eff
feat: 검색 필터 하는 중
hangunhee39 Jan 23, 2024
57a8889
Merge pull request #16 from ttoklip/feat/#1_home_news_fragment
hangunhee39 Jan 23, 2024
d5094ae
Merge branch 'develop' of https://github.com/ttoklip/FrontEnd into fe…
kyujin0911 Jan 23, 2024
4b0143b
feat: UI 중간 병합
kyujin0911 Jan 23, 2024
f33803d
Merge pull request #17 from ttoklip/feat/#4_honey_tips_fragment
kyujin0911 Jan 23, 2024
b184108
Merge branch 'develop' into faet/#2_마이페이지_구현
posite Jan 23, 2024
1f6cfbc
feat: 1/23 UI 중간 병합
posite Jan 23, 2024
5dc06ca
Merge pull request #18 from ttoklip/faet/#2_마이페이지_구현
posite Jan 23, 2024
b89300a
feat: 레이아웃 수정
40food Jan 23, 2024
2bc0fc0
Merge branch 'develop' of https://github.com/40food/FrontEnd into dev…
40food Jan 23, 2024
3e931a8
Merge branch 'feat/#15_첫화면로그인_구현' into develop
40food Jan 23, 2024
135c75a
feat: 오류 수정
40food Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ captures
.cxx
local.properties
.idea
strings.xml
constant.xml
27 changes: 22 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ plugins {
id 'dagger.hilt.android.plugin'
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

android {
namespace 'com.umc.ttoklip'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.umc.ttoklip"
minSdk 24
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -33,11 +36,11 @@ android {
kotlinOptions {
jvmTarget = '17'
}
dataBinding{
dataBinding {
enabled = true
}
viewBinding{
enabled =true
viewBinding {
enabled = true
}
}

Expand Down Expand Up @@ -66,6 +69,7 @@ dependencies {
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
implementation "androidx.lifecycle:lifecycle-runtime:2.6.2"
implementation "androidx.activity:activity-ktx:1.7.2"


//lifecycle
Expand All @@ -74,6 +78,7 @@ dependencies {
//Retrofit
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation "com.squareup.retrofit2:converter-scalars:2.9.0"

// https://github.com/square/okhttp
implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.2"
Expand All @@ -88,6 +93,18 @@ dependencies {
implementation "com.google.dagger:hilt-android:2.47"
kapt "com.google.dagger:hilt-compiler:2.47"

//indicator : https://github.com/tommybuonomo/dotsindicator?utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=7127
implementation "com.tbuonomo:dotsindicator:5.0"

//circleViwe: https://github.com/hdodenhof/CircleImageView
implementation 'de.hdodenhof:circleimageview:3.1.0'


implementation 'androidx.navigation:navigation-fragment-ktx:2.7.6'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.6'

//naver map
//implementation "com.naver.maps:map-sdk:3.16.2"
}
kapt {
correctErrorTypes true
Expand Down
53 changes: 50 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".TtoklipApplication"
Expand All @@ -18,6 +19,35 @@
android:supportsRtl="true"
android:theme="@style/Theme.Ttoklip"
tools:targetApi="31">

<activity
android:name=".presentation.mypage.ManageMyInfoActivity"
android:exported="false" />
<activity
android:name=".presentation.honeytip.read.ReadActivity"
android:exported="false" />
<activity
android:name=".presentation.honeytip.write.WriteHoneyTipActivity"
android:exported="false"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".presentation.alarm.AlarmActivity"
android:exported="false" />
<activity
android:name=".presentation.news.detail.ArticleActivity"
android:exported="false" />
<activity
android:name=".presentation.mypage.SetAnnouncementActivity"
android:exported="false" />
<activity
android:name=".presentation.mypage.ManageUsageActivity"
android:exported="false" />
<activity
android:name=".presentation.mypage.MyHometownAddressActivity"
android:exported="false" />
<activity
android:name=".presentation.mypage.ManageAccountActivity"
android:exported="false" />
<activity
android:name=".presentation.MainActivity"
android:exported="true">
Expand All @@ -27,6 +57,23 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<service
android:name="com.google.android.gms.metadata.ModuleDependencies"
android:enabled="false"
android:exported="false"
tools:ignore="MissingClass">
<intent-filter>
<action android:name="com.google.android.gms.metadata.MODULE_DEPENDENCIES" />
</intent-filter>

<meta-data
android:name="photopicker_activity:0:required"
android:value="" />
</service>
<activity
android:name=".presentation.search.SearchActivity"
android:exported="false" />
</application>

</manifest>
35 changes: 34 additions & 1 deletion app/src/main/java/com/umc/ttoklip/TtoklipApplication.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
package com.umc.ttoklip

import android.annotation.SuppressLint
import android.app.Application
import android.content.Context
import androidx.annotation.StringRes
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import com.umc.ttoklip.module.NetworkConnectionChecker
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class TtoklipApplication : Application() {
class TtoklipApplication : Application(), DefaultLifecycleObserver {
override fun onCreate() {
super<Application>.onCreate()
context = applicationContext
networkConnectionChecker = NetworkConnectionChecker(context)
}

override fun onStop(owner: LifecycleOwner) {
networkConnectionChecker.unregister()
super.onStop(owner)
}

override fun onStart(owner: LifecycleOwner) {
networkConnectionChecker.register()
super.onStart(owner)
}

companion object {
@SuppressLint("StaticFieldLeak")
private lateinit var context: Context

fun getString(@StringRes stringResId: Int): String {
return context.getString(stringResId)
}

private lateinit var networkConnectionChecker: NetworkConnectionChecker
fun isOnline() = networkConnectionChecker.isOnline()
}
}
11 changes: 11 additions & 0 deletions app/src/main/java/com/umc/ttoklip/data/api/TestApi.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.umc.ttoklip.data.api

import com.umc.ttoklip.data.model.TestResponse
import retrofit2.Response
import retrofit2.http.GET

//테스트용 api
interface TestApi {
@GET("/")
suspend fun testGet(): Response<TestResponse>
}
9 changes: 9 additions & 0 deletions app/src/main/java/com/umc/ttoklip/data/model/TestResponse.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.umc.ttoklip.data.model


//테스트용 response
data class TestResponse(
val time: String,
val milliseconds_since_epoch: Long,
val date: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.umc.ttoklip.data.repository

import com.umc.ttoklip.data.model.TestResponse
import retrofit2.Response

//테스트용 repository
interface TestRepository {

suspend fun test(): Response<TestResponse>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.umc.ttoklip.data.repository

import com.umc.ttoklip.data.api.TestApi
import com.umc.ttoklip.data.model.TestResponse
import retrofit2.Response
import javax.inject.Inject
import javax.inject.Singleton


//테스트용 repositoryimpl
@Singleton
class TestRepositoryImpl @Inject constructor(
private val api: TestApi
) : TestRepository {
override suspend fun test(): Response<TestResponse> {
return api.testGet()
}
}
52 changes: 52 additions & 0 deletions app/src/main/java/com/umc/ttoklip/di/NetworkModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.umc.ttoklip.di

import com.umc.ttoklip.R
import com.umc.ttoklip.TtoklipApplication
import com.umc.ttoklip.data.api.TestApi
import com.umc.ttoklip.module.HttpRequestInterceptor
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.converter.scalars.ScalarsConverterFactory
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object NetworkModule {
const val NETWORK_EXCEPTION_OFFLINE_CASE = "network status is offline"
const val NETWORK_EXCEPTION_BODY_IS_NULL = "result body is null"

@Provides
@Singleton
fun provideOKHttpClient(): OkHttpClient {
return OkHttpClient.Builder()
.addInterceptor(HttpRequestInterceptor())
.retryOnConnectionFailure(false)
.build()
}

@Provides
@Singleton
fun provideRetrofit(okHttpClient: OkHttpClient): Retrofit {
return Retrofit.Builder()
.client(okHttpClient)
.baseUrl(TtoklipApplication.getString(R.string.base_url))
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.build()
}

@Provides
@Singleton
fun provideTestApi(retrofit: Retrofit): TestApi {
return retrofit.buildService()
}

private inline fun <reified T> Retrofit.buildService(): T {
return this.create(T::class.java)
}
}
5 changes: 5 additions & 0 deletions app/src/main/java/com/umc/ttoklip/module/AppConfig.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.umc.ttoklip.module

object AppConfig {
const val TAG_DEBUG = "TAG_DEBUG"
}
37 changes: 37 additions & 0 deletions app/src/main/java/com/umc/ttoklip/module/HandleApi.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.umc.ttoklip.module

import com.umc.ttoklip.TtoklipApplication
import com.umc.ttoklip.di.NetworkModule
import retrofit2.Response

suspend fun <T : Any, R : Any> handleApi(
execute: suspend () -> Response<T>,
mapper: (T) -> R
): NetworkResult<R> {
if (TtoklipApplication.isOnline().not()) {
return NetworkResult.Error(Exception(NetworkModule.NETWORK_EXCEPTION_OFFLINE_CASE))
}

return try {
val response = execute()
val body = response.body()
if (response.isSuccessful) {
body?.let {
NetworkResult.Success(mapper(it))
} ?: run {
throw NullPointerException(NetworkModule.NETWORK_EXCEPTION_BODY_IS_NULL)
}
} else {
getFailDataResult(body, response)
}
} catch (e: Exception) {
NetworkResult.Error(e)
}
}


private fun <T : Any> getFailDataResult(body: T?, response: Response<T>) = body?.let {
NetworkResult.Fail(statusCode = response.code(), message = it.toString())
} ?: run {
NetworkResult.Fail(statusCode = response.code(), message = response.message())
}
19 changes: 19 additions & 0 deletions app/src/main/java/com/umc/ttoklip/module/HttpRequestInterceptor.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.umc.ttoklip.module

import android.util.Log
import okhttp3.Interceptor
import okhttp3.Response

class HttpRequestInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
try {
val originRequest = chain.request()
Log.d(AppConfig.TAG_DEBUG, "HttpRequestInterceptor: ${originRequest.url}")

return chain.proceed(originRequest)
} catch (e: Exception) {
Log.d(AppConfig.TAG_DEBUG, "HttpRequestInterceptor error: ${e.message}")
throw e
}
}
}
Loading