-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Use DataBinding instead of ViewBinding in order to handle click lis…
…teners and different states of loading data inside recyclerView. + Handle loading state for article details webView.
- Loading branch information
Mina Mikhail
committed
Aug 20, 2021
1 parent
391f47b
commit eb374ec
Showing
27 changed files
with
489 additions
and
504 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -35,8 +35,8 @@ android { | |
} | ||
} | ||
|
||
buildFeatures { | ||
viewBinding true | ||
dataBinding { | ||
enabled = true | ||
} | ||
} | ||
|
||
|
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/mina_mikhail/newsapp/core/enums/DataStatus.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,11 @@ | ||
package com.mina_mikhail.newsapp.core.enums | ||
|
||
object DataStatus { | ||
|
||
const val LOADING = 1 | ||
const val SHOW_DATA = 2 | ||
const val NO_DATA = 3 | ||
const val NO_INTERNET = 4 | ||
const val LOADING_NEXT_PAGE = 5 | ||
|
||
} |
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
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/mina_mikhail/newsapp/core/view/BaseViewModel.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,10 @@ | ||
package com.mina_mikhail.newsapp.core.view | ||
|
||
import androidx.lifecycle.ViewModel | ||
import com.mina_mikhail.newsapp.core.utils.SingleLiveEvent | ||
|
||
open class BaseViewModel : ViewModel() { | ||
|
||
var dataLoadingEvent: SingleLiveEvent<Int> = SingleLiveEvent() | ||
|
||
} |
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
4 changes: 2 additions & 2 deletions
4
...om/mina_mikhail/newsapp/features/news/presentation/breaking_news/BreakingNewsViewModel.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
Oops, something went wrong.