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

Persons databse #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Persons databse #3

wants to merge 3 commits into from

Conversation

gmiklay
Copy link

@gmiklay gmiklay commented Jun 14, 2019

No description provided.

@emresaracoglu
Copy link

Hello,

What is the feature of this?
It is shown on a different page for the details of the person, right?

@gmiklay
Copy link
Author

gmiklay commented Jun 8, 2020

Hello,

Sorry for this Pull Request. It wasn't intentional. When I forked a repo from someone else and git push-ed to it, it pushed to my own forked repo by default.
But after a while github changed something and the git push went to the original repo by default. I made some accidental git push before I realized what's happening.

Sorry

@emresaracoglu
Copy link

Hello,

Sorry for this Pull Request. It wasn't intentional. When I forked a repo from someone else and git push-ed to it, it pushed to my own forked repo by default.
But after a while github changed something and the git push went to the original repo by default. I made some accidental git push before I realized what's happening.

Sorry

I understand, well; for example, you searched. When you touch any person in the search result, it shows the details of that person, is not it?

@gmiklay
Copy link
Author

gmiklay commented Jun 8, 2020

Hello,
Sorry for this Pull Request. It wasn't intentional. When I forked a repo from someone else and git push-ed to it, it pushed to my own forked repo by default.
But after a while github changed something and the git push went to the original repo by default. I made some accidental git push before I realized what's happening.
Sorry

I understand, well; for example, you searched. When you touch any person in the search result, it shows the details of that person, is not it?

Look it was a year ago, and at the moment we're in Ravi Tamada's github repo. Long story short: I used this rxJava search in my project, just to see how to implement into my app. I remember at first I made a PersonBook application, in Java which implemented this rxJava search. I will make my PersonBook public, so you can see it.

But later I started Kotlin and basically rewrote PersonBook to RestApiBrowser. And also replaced this rxJava search function with Kotlin's Coroutine.

@gmiklay
Copy link
Author

gmiklay commented Jun 8, 2020

Hello,
Sorry for this Pull Request. It wasn't intentional. When I forked a repo from someone else and git push-ed to it, it pushed to my own forked repo by default.
But after a while github changed something and the git push went to the original repo by default. I made some accidental git push before I realized what's happening.
Sorry

I understand, well; for example, you searched. When you touch any person in the search result, it shows the details of that person, is not it?

Look it was a year ago, and at the moment we're in Ravi Tamada's github repo. Long story short: I used this rxJava search in my project, just to see how to implement into my app. I remember at first I made a PersonBook application, in Java which implemented this rxJava search. I will make my PersonBook public, so you can see it.

But later I started Kotlin and basically rewrote PersonBook to RestApiBrowser. And also replaced this rxJava search function with Kotlin's Coroutine.

So, if yout goto: https://github.com/gmiklay/PersonBook

BAck to your question ("When you touch any person in the search result, it shows the details of that person, is not it?): I don't remember if I finished the functionality or not, but this behaviour what you wrote should happen.

@gmiklay
Copy link
Author

gmiklay commented Jun 8, 2020

RestApiBrowser: PersonsBaseFragment.kt

private fun getSearchViewTextWatcher(searchViewCodeBlock: ()-> Unit) = object : SearchView.OnQueryTextListener {
	private var searchJob: CompletableJob = Job()
	override fun onQueryTextSubmit(s: String): Boolean {return true}
	override fun onQueryTextChange(s: String): Boolean {//start search
		searchJob.cancel()
		if (s.isNotEmpty()) {
			searchJob = Job()
			mainCoroutineScope.launch(searchJob) {
				delay(userPreferenceValue(UI_REACTION_DELAY_KEY) as Long)
				paginationState = PaginationState()
				recyclerAdapter.resetRecyclerView()
				paginationState.searchString = s
				recyclerAdapter.searchString = s
				searchViewCodeBlock()
			}
		}
		return true
	}
}

Basically this function is responsible for the search to start after some inactivity from the user (delay(userPreferenceValue(UI_REACTION_DELAY_KEY) as Long)), or to wait for another time if the user entered a new character.

@gmiklay
Copy link
Author

gmiklay commented Jun 8, 2020

if you have any questions about these samples just ask me.

I hoped I could help.

Gábor

@emresaracoglu
Copy link

Great, thank you for your information. I needed something like this in my project and I think I will do it with your help, thank you for advance.

@gmiklay
Copy link
Author

gmiklay commented Jun 8, 2020

No problem. I'm glad I could help.

@gmiklay
Copy link
Author

gmiklay commented Jun 8, 2020

In the meantime I found this and made public: https://github.com/gmiklay/PersonsApplication

Maybe it contains something useful.

@emresaracoglu
Copy link

In the meantime I found this and made public: https://github.com/gmiklay/PersonsApplication

Maybe it contains something useful.

Thank you 👍

@gmiklay
Copy link
Author

gmiklay commented Jun 14, 2020

I've made PersonBook and PersonApplication private, cause these are not something I'd like to present.

If you're still interested I can share them with you. Just write me.

@emresaracoglu
Copy link

I've made PersonBook and PersonApplication private, cause these are not something I'd like to present.

If you're still interested I can share them with you. Just write me.

When I got the 404 error, I thought you would give up. I would be incredibly happy if you share.

@gmiklay
Copy link
Author

gmiklay commented Jun 15, 2020

It's done!

@emresaracoglu
Copy link

It's done!

Thank you!

@gmiklay
Copy link
Author

gmiklay commented Jun 15, 2020

https://github.com/gmiklay/RestApiBrowser
This is the latest (3rd) version of these 2 application (PersonBook and PersonApplication). Check this out also. It also works with rest_api_demo. Not 100% polished, I'm gonna make the necessary changes soon.

@gmiklay
Copy link
Author

gmiklay commented Jun 15, 2020

We can see, how I got from Persons Database's minimal code of mine + ravi's code in Java, through the PersonsBook, to the RestApiBrowser's Kotlin code + rest_api_demo's Php+MySql backend with authentication. Quite a transformation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants