-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
901ff2f
commit ddaaa51
Showing
34 changed files
with
1,757 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="github.dev_playground.jeju_road.data"> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ internal class RestaurantRepositoryImpl( | |
}.getOrThrow() | ||
} | ||
|
||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...c/main/java/github/dev_playground/jeju_road/data/util/NetworkHealthCheckingInterceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package github.dev_playground.jeju_road.data.util | ||
|
||
import okhttp3.Interceptor | ||
import okhttp3.Response | ||
import java.io.IOException | ||
|
||
class NetworkHealthCheckingInterceptor() : Interceptor { | ||
override fun intercept(chain: Interceptor.Chain): Response { | ||
val request = chain.request() | ||
val response = chain.proceed(request) | ||
|
||
if (response.code == 500) { | ||
throw ConnectionShutdownException() | ||
} | ||
return response | ||
} | ||
} | ||
|
||
class ConnectionShutdownException : IOException() { | ||
override val message: String | ||
get() = "500 ERROR: 서버가 종료되었습니다. 다시 시도해주세요." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
presentation/src/main/java/github/dev_playground/jeju_road/presentation/SplashActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package github.dev_playground.jeju_road.presentation | ||
|
||
import android.annotation.SuppressLint | ||
import android.os.Bundle | ||
import android.view.WindowManager | ||
import androidx.appcompat.app.AppCompatActivity | ||
import github.dev_playground.jeju_road.presentation.ui.main.MainActivity | ||
import github.dev_playground.jeju_road.presentation.util.startActivity | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.launch | ||
|
||
@SuppressLint("CustomSplashScreen") | ||
class SplashActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
window.setFlags( | ||
WindowManager.LayoutParams.FLAG_FULLSCREEN, | ||
WindowManager.LayoutParams.FLAG_FULLSCREEN | ||
) | ||
|
||
setContentView(R.layout.activity_splash) | ||
|
||
CoroutineScope(Dispatchers.IO).launch { | ||
delay(2000) | ||
|
||
this@SplashActivity.startActivity<MainActivity> { } | ||
finish() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.../src/main/java/github/dev_playground/jeju_road/presentation/ui/base/BaseDialogFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package github.dev_playground.jeju_road.presentation.ui.base | ||
|
||
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.DialogFragment | ||
|
||
abstract class BaseDialogFragment<VB: ViewDataBinding>( | ||
@LayoutRes val layoutId: Int | ||
) : DialogFragment() { | ||
private var _binding: VB? = null | ||
val binding: VB by lazy { _binding!! } | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
_binding = DataBindingUtil.inflate( | ||
inflater, | ||
layoutId, | ||
container, | ||
false | ||
) | ||
|
||
binding { | ||
lifecycleOwner = viewLifecycleOwner | ||
} | ||
|
||
return binding.root | ||
} | ||
|
||
protected fun binding(action: VB.() -> Unit) { | ||
binding.run(action) | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...rc/main/java/github/dev_playground/jeju_road/presentation/ui/error/ErrorDialogFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package github.dev_playground.jeju_road.presentation.ui.error | ||
|
||
import android.app.Dialog | ||
import android.graphics.Point | ||
import android.os.Bundle | ||
import android.view.* | ||
import androidx.fragment.app.DialogFragment | ||
import github.dev_playground.jeju_road.presentation.R | ||
import github.dev_playground.jeju_road.presentation.databinding.ActivityRestaurantDetailBinding | ||
import github.dev_playground.jeju_road.presentation.databinding.FragmentDialogErrorBinding | ||
import github.dev_playground.jeju_road.presentation.ui.base.BaseDialogFragment | ||
|
||
class ErrorDialogFragment | ||
: BaseDialogFragment<FragmentDialogErrorBinding>(R.layout.fragment_dialog_error) { | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
dialog?.setCanceledOnTouchOutside(false) | ||
binding { | ||
imageViewCloseErrorDialog.setOnClickListener { | ||
dialog?.dismiss() | ||
} | ||
} | ||
} | ||
|
||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
setStyle(STYLE_NO_TITLE, R.style.Dialog_ERROR_DIALOG) | ||
return super.onCreateDialog(savedInstanceState) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
presentation/src/main/res/drawable/bg_error_dialog_radius_shape.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/white"/> | ||
<corners android:radius="@dimen/error_dialog_radius"/> | ||
</shape> |
5 changes: 5 additions & 0 deletions
5
presentation/src/main/res/drawable/bg_error_dialog_retry_shape.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/orangeMainColor"/> | ||
<corners android:radius="@dimen/error_dialog_retry_button_radius"/> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="40dp" | ||
android:height="40dp" | ||
android:viewportWidth="40" | ||
android:viewportHeight="40"> | ||
<path | ||
android:pathData="M11.615,11.615C11.731,11.499 11.869,11.406 12.021,11.343C12.173,11.28 12.336,11.248 12.5,11.248C12.665,11.248 12.827,11.28 12.979,11.343C13.131,11.406 13.269,11.499 13.385,11.615L20,18.233L26.615,11.615C26.731,11.499 26.869,11.407 27.021,11.344C27.173,11.281 27.336,11.248 27.5,11.248C27.664,11.248 27.827,11.281 27.979,11.344C28.131,11.407 28.269,11.499 28.385,11.615C28.501,11.731 28.593,11.869 28.656,12.021C28.719,12.173 28.752,12.336 28.752,12.5C28.752,12.664 28.719,12.827 28.656,12.979C28.593,13.131 28.501,13.269 28.385,13.385L21.767,20L28.385,26.615C28.501,26.731 28.593,26.869 28.656,27.021C28.719,27.173 28.752,27.336 28.752,27.5C28.752,27.664 28.719,27.827 28.656,27.979C28.593,28.131 28.501,28.269 28.385,28.385C28.269,28.501 28.131,28.593 27.979,28.656C27.827,28.719 27.664,28.752 27.5,28.752C27.336,28.752 27.173,28.719 27.021,28.656C26.869,28.593 26.731,28.501 26.615,28.385L20,21.767L13.385,28.385C13.269,28.501 13.131,28.593 12.979,28.656C12.827,28.719 12.664,28.752 12.5,28.752C12.336,28.752 12.173,28.719 12.021,28.656C11.869,28.593 11.731,28.501 11.615,28.385C11.499,28.269 11.407,28.131 11.344,27.979C11.281,27.827 11.248,27.664 11.248,27.5C11.248,27.336 11.281,27.173 11.344,27.021C11.407,26.869 11.499,26.731 11.615,26.615L18.233,20L11.615,13.385C11.499,13.269 11.406,13.131 11.343,12.979C11.28,12.827 11.248,12.665 11.248,12.5C11.248,12.336 11.28,12.173 11.343,12.021C11.406,11.869 11.499,11.731 11.615,11.615Z" | ||
android:fillColor="#141414"/> | ||
</vector> |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.