Skip to content

Commit

Permalink
Merge branch 'develop' into feature/#20-mypage-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
CHANGEL1004 authored Jan 6, 2024
2 parents f6a2eae + 430ad90 commit 1e851dd
Show file tree
Hide file tree
Showing 86 changed files with 2,101 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
|스크린샷|
|:--:|
|파일첨부바람|

<!-- <img width="300" src="이미지 주소" /> -->
## 📮 관련 이슈
- Resolved: #이슈번호
69 changes: 68 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,68 @@
# Android
# TOASTER-AOS
<img src="https://img.shields.io/badge/Kotlin-0095D5?&style=flat-square&logo=kotlin&logoColor=white"/> <img src="https://img.shields.io/badge/Android-3DDC84?style=flat-square&logo=android&logoColor=white"/>

더 이상 링크를 태우지 마세요. 토스트 먹듯이 간단하게!
유저가 링크를 산재된 플랫폼에 저장함으로 인해 발생하는 모든 불편함을 토스터에서 해소해줄 수 있어요.

- 33기 DO SOPT APP-JAM (2023.12.17 ~ )
- Development Environment : `Hedgehog | 2023.1.1`

<br>

## AOS Developer

| [상욱](operawook@catholic.ac.kr) | [이삭](lsls4868@gmail.com) | [채은](parkchangel@naver.com) | [민영](codingmy@naver.com) |
| :--: | :--: | :--: | :--: |
| <img width="600" alt="상욱" src="https://avatars.githubusercontent.com/u/113014331?v=4"> | <img width="600" alt="이삭" src="https://avatars.githubusercontent.com/u/93514333?v=4"> | <img width="600" alt="채은" src="https://avatars.githubusercontent.com/u/107169027?v=4"> | <img width="600" alt="민영" src="https://avatars.githubusercontent.com/u/97686638?v=4"> |
| <p align = "center">`타이머페이지` | <p align = "center">`메인페이지` `링크저장` | <p align = "center">`로그인, 검색` `마이페이지` | <p align = "center"> `카테고리페이지` |

<br>

## 💻 Code Convention
[NOTION Code Convetion Link](https://hill-agenda-2b0.notion.site/Code-Convention-f492a5bdf5b444a6aae561e53d9d4e10)
</br>

## 🔖 Branch Strategy
[NOTION Branch Strategy](https://hill-agenda-2b0.notion.site/Branch-Strategy-e3a9c5e70f6241ae9ccad544666b095c?pvs=4)
</br>

## 🎁 Git Convention
[NOTION Git Convention](https://hill-agenda-2b0.notion.site/Git-Convention-064dee5df78e4b0c9dd59d18c775a460?pvs=4)
</br>

## 💻 Kanban Board
[GIT Kanban Board](https://github.com/orgs/Link-MIND/projects/1/views/1)
</br>

## 📜 Project Plan
[Project Plan](https://hill-agenda-2b0.notion.site/7a635a2c014c470899899073be2ff49f?v=4de94ec87af045d8ba9a69afa39511af)

### 📂 Module
```bash
├── LinkMind-Android
├── 📁 app
├── 📁 build-logic
├── 📁 Convention
├── 📁 core
│ ├── 🗂️ auth
│ ├── 🗂️ authimpl
│ ├── 🗂️ common
│ ├── 🗂️ datastore
│ ├── 🗂️ model
│ ├── 🗂️ network
│ ├── 🗂️ ui
├── 📁 data
│ ├── 🗂️ linkminddata
│ ├── 🗂️ oauthdata
├── 📁 data-local
│ ├── 🗂️ linkminddata-local
├── 📁 data- remote
│ ├── 🗂️ linkminddata-remote
├── 📁 domain
│ ├── 🗂️ linkminddomain
│ ├── 🗂️ oauthdomain
├── 📁 feature
│ ├── 🗂️ mainfeature
```


Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.sopt.network.authenticator
import android.content.Context
import com.jakewharton.processphoenix.ProcessPhoenix
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import okhttp3.Authenticator
import okhttp3.Request
Expand All @@ -23,7 +24,7 @@ class LinkMindAuthenticator @Inject constructor(
if (response.code == CODE_TOKEN_EXPIRED) {
val newTokens = runCatching {
runBlocking {
tokenRefreshService.postAuthRefresh()
tokenRefreshService.postAuthRefresh(dataStore.flowRefreshToken().first())
}
}.onSuccess {
runBlocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class AuthenticationIntercept @Inject constructor(
runBlocking { dataStore.setAutoLogin(false) }
ProcessPhoenix.triggerRebirth(context, intentProvider.getAuthIntent())
}
response.close()
return chain.proceed(authRequest)
return response
}

private fun handleRequest(originalRequest: Request) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package org.sopt.network.service

import org.sopt.network.model.response.ResponsePostAuthRefreshDto
import org.sopt.network.model.response.base.BaseResponse
import retrofit2.http.Header
import retrofit2.http.POST

interface TokenRefreshService {
@POST("auth/token")
suspend fun postAuthRefresh(): BaseResponse<ResponsePostAuthRefreshDto>
suspend fun postAuthRefresh(
@Header("refreshToken") refreshToken: String,
): BaseResponse<ResponsePostAuthRefreshDto>
}
1 change: 1 addition & 0 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ android {

buildFeatures {
dataBinding = true
viewBinding = true
}
}
13 changes: 6 additions & 7 deletions core/ui/src/main/java/org/sopt/ui/base/BindingActivity.kt
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package org.sopt.ui.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.viewbinding.ViewBinding
import org.sopt.ui.context.hideKeyboard

abstract class BindingActivity<T : ViewDataBinding>(
@LayoutRes private val layoutRes: Int,
abstract class BindingActivity<T : ViewBinding>(
private val inflater: (LayoutInflater) -> T,
) : AppCompatActivity() {
protected lateinit var binding: T

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, layoutRes)
binding.lifecycleOwner = this
binding = inflater(layoutInflater)
setContentView(binding.root)
}

override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package org.sopt.ui.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.viewbinding.ViewBinding
import com.google.android.material.bottomsheet.BottomSheetDialogFragment

abstract class BindingBottomSheetDialogFragment<T : ViewBinding>(
private val inflater: (LayoutInflater) -> T,
) : BottomSheetDialogFragment() {
private var _binding: T? = null
protected val binding get() = requireNotNull(_binding) { { "binding object is not initialized" } }

override fun onStart() {
super.onStart()
dialog?.window?.apply {
setLayout(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT,
)
}
}

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
_binding = inflater(layoutInflater)
return binding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}

override fun onDestroyView() {
_binding = null
super.onDestroyView()
}
}
11 changes: 4 additions & 7 deletions core/ui/src/main/java/org/sopt/ui/base/BindingDialogFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.annotation.LayoutRes
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.DialogFragment
import androidx.viewbinding.ViewBinding

abstract class BindingDialogFragment<T : ViewDataBinding>(
@LayoutRes val layoutRes: Int,
abstract class BindingDialogFragment<T : ViewBinding>(
private val inflater: (LayoutInflater) -> T,
) : DialogFragment() {
private var _binding: T? = null
protected val binding get() = requireNotNull(_binding) { { "binding object is not initialized" } }
Expand All @@ -31,13 +29,12 @@ abstract class BindingDialogFragment<T : ViewDataBinding>(
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
_binding = DataBindingUtil.inflate(inflater, layoutRes, container, false)
_binding = inflater(layoutInflater)
return binding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.lifecycleOwner = viewLifecycleOwner
}

override fun onDestroyView() {
Expand Down
16 changes: 7 additions & 9 deletions core/ui/src/main/java/org/sopt/ui/base/BindingFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@ 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
import androidx.viewbinding.ViewBinding

abstract class BindingFragment<T : ViewDataBinding>(
@LayoutRes private val layoutRes: Int,
abstract class BindingFragment<T : ViewBinding>(
private val inflater: (LayoutInflater) -> T,
) : Fragment() {
private var _binding: T? = null
protected val binding get() = requireNotNull(_binding) {
}
protected val binding
get() = requireNotNull(_binding) {
}

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View? {
_binding = DataBindingUtil.inflate(inflater, layoutRes, container, false)
binding.lifecycleOwner = viewLifecycleOwner
_binding = inflater(layoutInflater)
return binding.root
}

Expand Down
64 changes: 33 additions & 31 deletions feature/mainfeature/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools">

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

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.LinkMind"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".onboarding.LoginActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.LinkMind"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".onboarding.LoginActivity"
android:exported="true"></activity>
<activity
android:name=".ExampleActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait" />
<activity
android:name=".SplashActivity"
android:exported="true"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ExampleActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait">

</activity>
</application>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Loading

0 comments on commit 1e851dd

Please sign in to comment.