Skip to content

Commit

Permalink
+ Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Mina Mikhail committed Aug 20, 2021
1 parent af7ca87 commit 391f47b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ object RetrofitModule {
OkHttpClient.Builder()
.readTimeout(REQUEST_TIME_OUT, TimeUnit.SECONDS)
.connectTimeout(REQUEST_TIME_OUT, TimeUnit.SECONDS)
.addNetworkInterceptor(headersInterceptor)
.addInterceptor(headersInterceptor)
.addNetworkInterceptor(logging)
.addInterceptor(PlutoInterceptor())
.build()
} else {
OkHttpClient.Builder()
.readTimeout(REQUEST_TIME_OUT, TimeUnit.SECONDS)
.connectTimeout(REQUEST_TIME_OUT, TimeUnit.SECONDS)
.addNetworkInterceptor(headersInterceptor)
.addInterceptor(headersInterceptor)
.build()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ abstract class BaseFragment<VB : ViewBinding> : Fragment() {

if (!hasInitializedRootView) {
setUpViews()
observeAPICall()
handleClickListeners()
subscribeToObservables();

Expand All @@ -67,6 +68,8 @@ abstract class BaseFragment<VB : ViewBinding> : Fragment() {

open fun setUpViews() {}

open fun observeAPICall() {}

open fun handleClickListeners() {}

open fun subscribeToObservables() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class BreakingNewsFragment : BaseFragment<FragmentBreakingNewsBinding>() {
setUpRecyclerView()

initSwipeRefreshLayout()
}

override
fun observeAPICall() {
getBreakingNews()
}

Expand Down

0 comments on commit 391f47b

Please sign in to comment.