skydoves / pokedex Goto Github PK
View Code? Open in Web Editor NEW🗡️ Pokedex demonstrates modern Android development with Hilt, Material Motion, Coroutines, Flow, Jetpack (Room, ViewModel) based on MVVM architecture.
License: Apache License 2.0
🗡️ Pokedex demonstrates modern Android development with Hilt, Material Motion, Coroutines, Flow, Jetpack (Room, ViewModel) based on MVVM architecture.
License: Apache License 2.0
Please complete the following information:
Describe the Bug:
After submitting the list previous list is cleared and new is replacing it. Pagination is not working
Add a clear description of the problem.
I am using an API when I got a response from the server and submit the result it is resetting the recycler view and moving to position 0 in UI Edit)->If you direclty fetch from the network and submit list that will cause this issue
Expected Behavior:
pagination should work
A clear description of what you expected to happen.
I want to paginate data from the API and add data to the list and smooth scroll to the end
As the title, I don't quite understand why change the viewModel inject way, I would appreciate it if you can give some answer.
this app doesn't have responsive sizes
in devices with size 7+ inches , View size are shown very small
so I suggest using this library
Please complete the following information:
Describe the Bug:
currently the app cannot load the pokemon images
error:
W/Glide: Load failed for https://pokeres.bastionbot.org/images/pokemon/7.png with size [330x330]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
it seems the url (rest api) https://pokeres.bastionbot.org/images/pokemon/ does not work anymore.
Expected Behavior:
it should show the images of the pokemons
First of all I want to congratulate you, the animations when opening a pokemon are beautiful!
Here are my fb:
1 - It is difficult to access pokemon with high numbers, for example #318 (random number). A search bar can help solve this problem.
2 - It would be great to be able to have a list of favorite pokemon.
3 - I don't remember what the lateral scroll is called to quickly access in alphabetical or by number order in list order (a, b, c, d, e, f, etc.) but it can help to get a quick scroll. Hope to be clear.
Cheers!
Please complete the following information:
Describe the Bug:
The pokemon types are not being displayed properly on my device. Here's a screenshot:
Also, after rotating the device to landscape mode, the types are duplicated: (See comment bellow)
Expected Behavior:
Expected pokemon types to be displayed exactly like the screenshots on the repo.
Is your feature request related to a problem?
No
A clear and concise description of what the problem is.
Describe the solution you'd like:
There would be another drawer or some menu where you would see the list of pokémons you have caught. You could add pokémons to the list manually by clicking on the specific pokédex entry and clicking on a specific button.
A clear and concise description of what you want to happen.
Describe alternatives you've considered:
If you could find a Pokémon GO API you could even do it automatically.
A clear description of any alternative solutions you've considered.
I come across following error when syncing and building the project
Could not find fragment-1.2.4.jar (androidx.fragment:fragment:1.2.4).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/fragment/fragment/1.2.4/fragment-1.2.4.jar
I would add it above their name
/Users/admin/Desktop/移动开发/android/mydemo/Pokedex/app/build/generated/source/kapt/debug/com/skydoves/pokedex/test/hilt/HiltTestModule_GetHiltTestObjectFactory.java:23: 错误: 找不到符号
public final class HiltTestModule_GetHiltTestObjectFactory implements Factory {
^
符号: 类 HiltTestObject
其实这些东西都存在,都编译生成了, 就是爆红
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
.github/workflows/android.yml
actions/checkout v4
actions/setup-java v4
actions/cache v4
buildSrc/src/main/kotlin/com/skydoves/pokedex/Configuration.kt
gradle.properties
settings.gradle.kts
com.android.settings 8.4.0
build.gradle.kts
app/build.gradle.kts
benchmark/build.gradle.kts
buildSrc/build.gradle.kts
core-data/build.gradle.kts
core-database/build.gradle.kts
core-model/build.gradle.kts
core-network/build.gradle.kts
core-test/build.gradle.kts
gradle/libs.versions.toml
com.google.android.material:material 1.12.0
androidx.fragment:fragment-ktx 1.7.0
androidx.lifecycle:lifecycle-viewmodel-ktx 2.7.0
androidx.room:room-runtime 2.6.1
androidx.room:room-ktx 2.6.1
androidx.room:room-compiler 2.6.1
androidx.arch.core:core-testing 2.2.0
androidx.startup:startup-runtime 1.1.1
androidx.test:core 1.5.0
androidx.test.ext:junit 1.1.5
androidx.test.espresso:espresso-core 3.5.1
com.github.skydoves:bindables 1.1.0
com.google.dagger:hilt-android 2.51.1
com.google.dagger:hilt-compiler 2.51.1
com.google.dagger:hilt-android-testing 2.51.1
com.google.dagger:hilt-android-gradle-plugin 2.51.1
com.github.skydoves:sandwich-retrofit 2.0.7
com.squareup.retrofit2:converter-gson 2.11.0
com.squareup.retrofit2:converter-moshi 2.11.0
com.squareup.okhttp3:logging-interceptor 4.12.0
com.squareup.okhttp3:mockwebserver 4.12.0
com.squareup.moshi:moshi-kotlin 1.15.1
com.squareup.moshi:moshi-kotlin-codegen 1.15.1
org.jetbrains.kotlinx:kotlinx-coroutines-android 1.8.1
org.jetbrains.kotlinx:kotlinx-coroutines-test 1.8.1
com.github.skydoves:whatif 1.1.4
com.github.bumptech.glide:glide 4.16.0
com.github.florent37:glidepalette 2.1.2
com.github.skydoves:bundler 1.0.4
com.github.skydoves:transformationlayout 1.1.3
androidx.recyclerview:recyclerview 1.3.2
com.github.skydoves:baserecyclerviewadapter 1.0.4
com.github.skydoves:rainbow 1.0.4
com.github.skydoves:androidribbon 1.0.4
com.github.skydoves:progressview 1.1.3
com.jakewharton.timber:timber 5.0.1
junit:junit 4.13.2
org.mockito:mockito-core 5.11.0
org.mockito.kotlin:mockito-kotlin 5.3.1
app.cash.turbine:turbine 1.1.0
org.robolectric:robolectric 4.12.1
com.google.truth:truth 1.4.2
com.android.support.test:runner 1.3.0-beta01
androidx.profileinstaller:profileinstaller 1.3.1
androidx.benchmark:benchmark-macro-junit4 1.2.4
androidx.test.uiautomator:uiautomator 2.3.0
com.android.application 8.4.0
com.android.library 8.4.0
com.android.test 8.4.0
org.jetbrains.kotlin.android 1.9.24
org.jetbrains.kotlin.kapt 1.9.24
com.google.devtools.ksp 1.9.24-1.0.20
org.jetbrains.kotlin.plugin.parcelize 1.9.24
com.diffplug.spotless 6.25.0
com.google.dagger.hilt.android 2.51.1
gradle/wrapper/gradle-wrapper.properties
gradle 8.7
Is your feature request related to a problem?
Yes, Cannot inject the ViewModel into the dynamic feature. check this
Is it possible to use paging3
implementation "androidx.paging:paging-runtime:$paging_version"
How many downloads does your app have? For a university class I need to find a kotlin open source app with a lot of downloads.
And really nice project by the way, it is really good
Just a note of the great answers. 🥇
Hi! excellent work 👍
I'm wondering if the implementation of the repository interface in the MainRepository and DetailsRepository is necessary as it is empty.
how to provide private val savedStateHandle: SavedStateHandle
in DetailViewModel for ViewModel with AssistedInject?
because if I change into this
class DetailViewModel @AssistedInject constructor(
detailRepository: DetailRepository,
savedstateHandle: SavedstateHandle ,
@Assisted private val pokemonName: String
) : LiveCoroutinesViewModel() {
it will give me error, because i didnt proved savedstateHandle
in injection
In About page should be
Author name and contact
Source code - Github link
Licence
App version
Please complete the following information:
Describe the Bug:
Any class that uses MainCoroutinesRule doesn't actually run the test. If you put the line assertThat(-1, `is`(0))
in any class that uses MainCoroutinesRule it would pass.
Expected Behavior:
assertThat(-1, `is`(0))
should assert and fail
Proposed Solution:
The following code should change from:
@ExperimentalCoroutinesApi
class MainCoroutinesRule : TestRule, TestCoroutineScope by TestCoroutineScope() {
private val testCoroutinesDispatcher = TestCoroutineDispatcher()
override fun apply(base: Statement?, description: Description?) = object : Statement() {
override fun evaluate() {
Dispatchers.setMain(testCoroutinesDispatcher)
cleanupTestCoroutines()
Dispatchers.resetMain()
}
}
}
to this:
@ExperimentalCoroutinesApi
class MainCoroutinesRule : TestRule, TestCoroutineScope by TestCoroutineScope() {
private val testCoroutinesDispatcher = TestCoroutineDispatcher()
override fun apply(base: Statement?, description: Description?) = object : Statement() {
override fun evaluate() {
Dispatchers.setMain(testCoroutinesDispatcher)
try {
base?.evaluate()
} finally {
cleanupTestCoroutines()
Dispatchers.resetMain()
}
}
}
}
Please complete the following information:
Describe the Bug:
$ git clone https://github.com/skydoves/Pokedex
$ cd Pokedex
$ ./gradlew :app:aR
FAILURE: Build failed with an exception.
* What went wrong:
Circular dependency between the following tasks:
:app:kaptGenerateStubsReleaseKotlin
\--- :app:kspReleaseKotlin
\--- :app:kaptReleaseKotlin
\--- :app:kaptGenerateStubsReleaseKotlin (*)
(*) - details omitted (listed previously)
Here is gradle scan result : https://scans.gradle.com/s/2xsbxrhuos4b4
Expected Behavior:
This is not an issue, just a query/suggestion.
Since you are already using @Inject
in the DetailRepository
, why do you need the provideDetailRepository
function?
i add SwipeRefreshLayout for MainActivity ,and try to refresh but when page=0 nothing happened,Can you add refresh for this project?
If you change any value inside verify statement testing still asserting everything it's OK. Seems that there's some issue related with coroutines
Hi, I followed your implementation on my project. In unit test part, I have an error.
org.junit.runners.model.InvalidTestClassError: Invalid test class 'myApplicationID.repository.LoginRegisterServiceTest':
My test fun like below;
@Test
fun sendTokenTest() = runBlocking {
val mockData = Response<ResponseBody>(
error = false,
message = "OK",
result = null,
statusCode = 200,
errorCode = 0
)
val tokenRequest = TokenRequest("+905554443322")
whenever(service.sendToken(tokenRequest)).thenReturn(mockData)
repository.sendToken("+905554443322").test {
assertEquals(expectItem().message, "OK")
assertNull(expectItem().result)
assertFalse(expectItem().error)
assertEquals(expectItem().statusCode, 200)
assertEquals(expectItem().errorCode, 0)
expectComplete()
}
verify(service, atLeastOnce()).sendToken(tokenRequest)
}
Please complete the following information:
Describe the Bug:
private typealias AndroidExtension = com.android.build.api.dsl.CommonExtension<*, *, *, *, *, *>
5 type arguments expected for interface CommonExtension<BuildFeaturesT : BuildFeatures, BuildTypeT : BuildType, DefaultConfigT : DefaultConfig, ProductFlavorT : ProductFlavor, AndroidResourcesT : AndroidResources>
Expected Behavior:
The project will build perfectly
It should be Pikachu, not pikachu like in every other pokedex
Is your feature request related to a problem?
no.
Describe the solution you'd like:
A menu where you could filter pokemon by generation, name, type, etc.
Describe alternatives you've considered:
A search bar.
Hello,
Is there a plan for switching to ViewBinding ?
Could be there option to download all the data by one button?
If I get it correctly data is cached only after you look at it in online mode and wait for it to be cached. Specif info about Pokemons are hard to be cached, because its on different page.
this app doesn't have responsive font size
in devices with size 7+ inches , fonts are shown very small
so I suggest using this library
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.