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

DEVELOP :: Fixing Bug Model Library #33

Merged
merged 2 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 6 additions & 4 deletions .github/workflows/android-ci-generated-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ env:
on:
# Triggers the workflow on push or pull request events but only for default and protected branches
workflow_dispatch:
# The workflow will be dispatched to the default queue
# The workflow will be dispatched to the default queue

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

# Set Current Date As Env Variable
- name: Set current date as env variable
Expand All @@ -29,9 +29,11 @@ jobs:
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ on:
branches: [ master ]

workflow_dispatch:
# The workflow will be dispatched to the default queue
# The workflow will be dispatched to the default queue

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

# Set Current Date As Env Variable
- name: Set current date as env variable
Expand All @@ -34,9 +34,11 @@ jobs:
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew
Expand All @@ -47,4 +49,4 @@ jobs:

# Run Build Project
- name: Build gradle project
run: ./gradlew build
run: ./gradlew build
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
## Version Release
This Is Latest Release

$version_release = 2.4.7
$version_release = 2.4.8

What's New??

Expand Down Expand Up @@ -73,20 +73,20 @@ allprojects {

dependencies {
// library frogo-consume-api
implementation 'com.github.frogobox:frogo-consume-api:2.4.7'
implementation 'com.github.frogobox:frogo-consume-api:2.4.8'

// library frogo-consume-api for desktop
implementation 'com.github.frogobox.frogo-consume-api:frogocoreconsumeapi:2.4.7'
implementation 'com.github.frogobox.frogo-consume-api:core-api:2.4.8'
}

#### <Option 2> Kotlin DSL Gradle

dependencies {
// library frogo-consume-api
implementation("com.github.frogobox:frogo-consume-api:2.4.7")
implementation("com.github.frogobox:frogo-consume-api:2.4.8")

// library frogo-consume-api for desktop
implementation("com.github.frogobox.frogo-consume-api:frogocoreconsumeapi:2.4.7")
implementation("com.github.frogobox.frogo-consume-api:core-api:2.4.8")
}


Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ android {
dependencies {
implementation(project(DependencyGradle.FROGO_PATH_CORE_ANDROID_API))
implementation(project(DependencyGradle.FROGO_PATH_CORE_API))
implementation(DependencyGradle.FROGO_RECYCLER_VIEW)
implementation(DependencyGradle.FROGO_UI)

implementation(DependencyGradle.FROGO_SDK)
implementation(DependencyGradle.FROGO_UI)
implementation(DependencyGradle.FROGO_RECYCLER_VIEW)
}
20 changes: 10 additions & 10 deletions app/src/main/java/com/frogobox/appapi/di/ConsumeApiModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import com.frogobox.api.movie.ConsumeMovieApi
import com.frogobox.api.news.ConsumeNewsApi
import com.frogobox.api.pixabay.ConsumePixabayApi
import com.frogobox.api.sport.ConsumeTheSportDbApi
import com.frogobox.coremodel.meal.MealUrl
import com.frogobox.coremodel.movie.MovieUrl
import com.frogobox.coremodel.news.NewsUrl
import com.frogobox.coremodel.pixabay.PixabayUrl
import com.frogobox.coremodel.sport.SportUrl
import com.frogobox.coreutil.meal.MealUrl
import com.frogobox.coreutil.movie.MovieUrl
import com.frogobox.coreutil.news.NewsUrl
import com.frogobox.coreutil.pixabay.PixabayUrl
import com.frogobox.coreutil.sport.SportUrl
import org.koin.dsl.module


Expand All @@ -29,23 +29,23 @@ import org.koin.dsl.module
val consumeApiModule = module {

single {
ConsumeNewsApi(NewsUrl.API_KEY)
ConsumeNewsApi(com.frogobox.coreutil.news.NewsUrl.API_KEY)
}

single {
ConsumeTheSportDbApi(SportUrl.API_KEY)
ConsumeTheSportDbApi(com.frogobox.coreutil.sport.SportUrl.API_KEY)
}

single {
ConsumeTheMealDbApi(MealUrl.API_KEY)
ConsumeTheMealDbApi(com.frogobox.coreutil.meal.MealUrl.API_KEY)
}

single {
ConsumePixabayApi(PixabayUrl.API_KEY)
ConsumePixabayApi(com.frogobox.coreutil.pixabay.PixabayUrl.API_KEY)
}

single {
ConsumeMovieApi(MovieUrl.API_KEY)
ConsumeMovieApi(com.frogobox.coreutil.movie.MovieUrl.API_KEY)
}

}
20 changes: 10 additions & 10 deletions app/src/main/java/com/frogobox/appapi/mvvm/meal/MealActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import com.bumptech.glide.Glide
import com.frogobox.appapi.databinding.ActivityMealBinding
import com.frogobox.coremodel.meal.model.Meal
import com.frogobox.coreutil.meal.model.Meal
import com.frogobox.recycler.core.FrogoRecyclerNotifyListener
import com.frogobox.recycler.core.IFrogoBindingAdapter
import com.frogobox.sdk.ext.progressViewHandle
Expand Down Expand Up @@ -46,9 +46,9 @@ class MealActivity : FrogoBindActivity<ActivityMealBinding>() {
mealViewModel.getListMeals(this, "b")
}

private fun setupRv(data: List<Meal>) {
private fun setupRv(data: List<com.frogobox.coreutil.meal.model.Meal>) {

val adapterCallback = object : IFrogoBindingAdapter<Meal, FrogoRvGridType2Binding> {
val adapterCallback = object : IFrogoBindingAdapter<com.frogobox.coreutil.meal.model.Meal, FrogoRvGridType2Binding> {

override fun setViewBinding(parent: ViewGroup): FrogoRvGridType2Binding {
return FrogoRvGridType2Binding.inflate(
Expand All @@ -60,9 +60,9 @@ class MealActivity : FrogoBindActivity<ActivityMealBinding>() {

override fun setupInitComponent(
binding: FrogoRvGridType2Binding,
data: Meal,
data: com.frogobox.coreutil.meal.model.Meal,
position: Int,
notifyListener: FrogoRecyclerNotifyListener<Meal>
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coreutil.meal.model.Meal>
) {
binding.apply {
Glide.with(root.context).load(data.strMealThumb).into(frogoRvGridType2IvPoster)
Expand All @@ -73,25 +73,25 @@ class MealActivity : FrogoBindActivity<ActivityMealBinding>() {

override fun onItemClicked(
binding: FrogoRvGridType2Binding,
data: Meal,
data: com.frogobox.coreutil.meal.model.Meal,
position: Int,
notifyListener: FrogoRecyclerNotifyListener<Meal>
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coreutil.meal.model.Meal>
) {
data.strMeal?.let { showToast(it) }
}

override fun onItemLongClicked(
binding: FrogoRvGridType2Binding,
data: Meal,
data: com.frogobox.coreutil.meal.model.Meal,
position: Int,
notifyListener: FrogoRecyclerNotifyListener<Meal>
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coreutil.meal.model.Meal>
) {
data.strMeal?.let { showToast(it) }
}

}

binding.frogoRv.injectorBinding<Meal, FrogoRvGridType2Binding>()
binding.frogoRv.injectorBinding<com.frogobox.coreutil.meal.model.Meal, FrogoRvGridType2Binding>()
.addData(data)
.addCallback(adapterCallback)
.createLayoutGrid(2)
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/frogobox/appapi/mvvm/meal/MealViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import com.frogobox.appapi.core.BaseViewModel
import com.frogobox.appapi.source.ApiRepository
import com.frogobox.appapi.util.isDebug
import com.frogobox.coreapi.ConsumeApiResponse
import com.frogobox.coremodel.meal.model.Meal
import com.frogobox.coremodel.meal.response.MealResponse
import com.frogobox.coreutil.meal.model.Meal
import com.frogobox.coreutil.meal.response.MealResponse

/*
* Created by faisalamir on 28/07/21
Expand All @@ -26,15 +26,15 @@ class MealViewModel(
private val repository: ApiRepository
) : BaseViewModel() {

val _listData = MutableLiveData<List<Meal>>()
val listData: LiveData<List<Meal>> = _listData
val _listData = MutableLiveData<List<com.frogobox.coreutil.meal.model.Meal>>()
val listData: LiveData<List<com.frogobox.coreutil.meal.model.Meal>> = _listData

fun getListMeals(context: Context, firstLetter: String) {
val mealApi = repository.consumeTheMealDbApi().usingChuckInterceptor(isDebug, context)
mealApi.listAllMeal(
firstLetter,
object : ConsumeApiResponse<MealResponse<Meal>> {
override fun onSuccess(data: MealResponse<Meal>) {
object : ConsumeApiResponse<com.frogobox.coreutil.meal.response.MealResponse<com.frogobox.coreutil.meal.model.Meal>> {
override fun onSuccess(data: com.frogobox.coreutil.meal.response.MealResponse<com.frogobox.coreutil.meal.model.Meal>) {
// on Success Request
data.meals?.let { _listData.postValue(it) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import androidx.fragment.app.Fragment
import com.bumptech.glide.Glide
import com.frogobox.appapi.databinding.ContentItemBinding
import com.frogobox.appapi.databinding.FragmentTrendingChildBinding
import com.frogobox.coremodel.movie.MovieUrl
import com.frogobox.coremodel.movie.model.TrendingMovie
import com.frogobox.coreutil.movie.MovieUrl
import com.frogobox.recycler.core.FrogoRecyclerNotifyListener
import com.frogobox.recycler.core.IFrogoBindingAdapter
import com.frogobox.sdk.ext.progressViewHandle
Expand Down Expand Up @@ -52,22 +51,22 @@ class MovieDayFragment : FrogoBindFragment<FragmentTrendingChildBinding>() {
override fun onViewCreatedExt(view: View, savedInstanceState: Bundle?) {
}

private fun setupRV(data: List<com.frogobox.coremodel.movie.model.TrendingMovie>) {
private fun setupRV(data: List<com.frogobox.coreutil.movie.model.TrendingMovie>) {

val adapterCallback = object : IFrogoBindingAdapter<com.frogobox.coremodel.movie.model.TrendingMovie, ContentItemBinding> {
val adapterCallback = object : IFrogoBindingAdapter<com.frogobox.coreutil.movie.model.TrendingMovie, ContentItemBinding> {
override fun onItemClicked(
binding: ContentItemBinding,
data: com.frogobox.coremodel.movie.model.TrendingMovie,
data: com.frogobox.coreutil.movie.model.TrendingMovie,
position: Int,
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coremodel.movie.model.TrendingMovie>
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coreutil.movie.model.TrendingMovie>
) {
}

override fun onItemLongClicked(
binding: ContentItemBinding,
data: com.frogobox.coremodel.movie.model.TrendingMovie,
data: com.frogobox.coreutil.movie.model.TrendingMovie,
position: Int,
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coremodel.movie.model.TrendingMovie>
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coreutil.movie.model.TrendingMovie>
) {
}

Expand All @@ -81,21 +80,21 @@ class MovieDayFragment : FrogoBindFragment<FragmentTrendingChildBinding>() {

override fun setupInitComponent(
binding: ContentItemBinding,
data: com.frogobox.coremodel.movie.model.TrendingMovie,
data: com.frogobox.coreutil.movie.model.TrendingMovie,
position: Int,
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coremodel.movie.model.TrendingMovie>
notifyListener: FrogoRecyclerNotifyListener<com.frogobox.coreutil.movie.model.TrendingMovie>
) {
binding.apply {
tvTitle.text = data.title
tvOverview.text = data.overview
Glide.with(root.context)
.load("${MovieUrl.BASE_URL_IMAGE_ORIGNAL}${data.poster_path}")
.load("${com.frogobox.coreutil.movie.MovieUrl.BASE_URL_IMAGE_ORIGNAL}${data.poster_path}")
.into(ivPoster)
}
}
}

binding.frogoRecyclerView.injectorBinding<com.frogobox.coremodel.movie.model.TrendingMovie, ContentItemBinding>()
binding.frogoRecyclerView.injectorBinding<com.frogobox.coreutil.movie.model.TrendingMovie, ContentItemBinding>()
.addData(data)
.addCallback(adapterCallback)
.createLayoutGrid(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import android.app.Application
import com.frogobox.appapi.mvvm.movies.core.BaseMovieApiViewModel
import com.frogobox.appapi.source.ApiRepository
import com.frogobox.coreapi.ConsumeApiResponse
import com.frogobox.coremodel.movie.model.TrendingMovie
import com.frogobox.coremodel.movie.response.Trending
import com.frogobox.sdk.util.FrogoMutableLiveData

/*
Expand All @@ -25,12 +23,12 @@ class MovieViewModel(
private val repository: ApiRepository
) : BaseMovieApiViewModel(context, repository) {

val listDataDay = FrogoMutableLiveData<List<com.frogobox.coremodel.movie.model.TrendingMovie>>()
val listDataWeek = FrogoMutableLiveData<List<com.frogobox.coremodel.movie.model.TrendingMovie>>()
val listDataDay = FrogoMutableLiveData<List<com.frogobox.coreutil.movie.model.TrendingMovie>>()
val listDataWeek = FrogoMutableLiveData<List<com.frogobox.coreutil.movie.model.TrendingMovie>>()

fun getTrendingMovieDay() {
movieApi.getTrendingMovieDay(object : ConsumeApiResponse<com.frogobox.coremodel.movie.response.Trending<com.frogobox.coremodel.movie.model.TrendingMovie>> {
override fun onSuccess(data: com.frogobox.coremodel.movie.response.Trending<com.frogobox.coremodel.movie.model.TrendingMovie>) {
movieApi.getTrendingMovieDay(object : ConsumeApiResponse<com.frogobox.coreutil.movie.response.Trending<com.frogobox.coreutil.movie.model.TrendingMovie>> {
override fun onSuccess(data: com.frogobox.coreutil.movie.response.Trending<com.frogobox.coreutil.movie.model.TrendingMovie>) {
data.results?.let { listDataDay.postValue(it) }
}

Expand Down Expand Up @@ -58,8 +56,8 @@ class MovieViewModel(

fun getTrendingMovieWeek() {
movieApi.getTrendingMovieWeek(object :
ConsumeApiResponse<com.frogobox.coremodel.movie.response.Trending<com.frogobox.coremodel.movie.model.TrendingMovie>> {
override fun onSuccess(data: com.frogobox.coremodel.movie.response.Trending<com.frogobox.coremodel.movie.model.TrendingMovie>) {
ConsumeApiResponse<com.frogobox.coreutil.movie.response.Trending<com.frogobox.coreutil.movie.model.TrendingMovie>> {
override fun onSuccess(data: com.frogobox.coreutil.movie.response.Trending<com.frogobox.coreutil.movie.model.TrendingMovie>) {
data.results?.let { listDataWeek.postValue(it) }
}

Expand Down
Loading