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

Implement click functionality on cast names to initiate a Google search #1465

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

Conversation

bilal96aslam
Copy link

This change will resolve #861 improvement Do a Google search when clicking on movie/series Cast with real name

@AvocadoWasSeized
Copy link

This won't work, especially for anime as when you click the actor it swaps to their character. It would also be very annoying for the people who accidentally click on the actors when scrolling down, this has happened to me a lot. I think if this were to be implemented there should be a setting to enable/disable due to these issues, mainly the anime one though.

@KingLucius
Copy link
Contributor

Better to use internal search for character related search but this is not supported yet in extensions apis

@bilal96aslam
Copy link
Author

@AvocadoWasSeized Thanks for your feedback! I've implemented the functionality on long-press instead of click to avoid accidental activations while scrolling. I’ve also tested it for anime cases, and it works similarly to TV/movies. Let me know if there are further improvements you’d suggest!

@fire-light42
Copy link
Collaborator

This won't work, especially for anime as when you click the actor it swaps to their character. It would also be very annoying for the people who accidentally click on the actors when scrolling down, this has happened to me a lot. I think if this were to be implemented there should be a setting to enable/disable due to these issues, mainly the anime one though.

This is LongClick not click.

Copy link
Collaborator

@fire-light42 fire-light42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am open to merging this pr while we add better actor support. However I am unsure if hard-coding google is the best option. Is there no way to get the default search engine on android?

@bilal96aslam
Copy link
Author

To avoid hard-coding the Google URL and use the user's default search engine:
itemView.setOnLongClickListener {
val intent = Intent(Intent.ACTION_WEB_SEARCH).apply {
putExtra(SearchManager.QUERY, actor.actor.name)
}
intent.resolveActivity(itemView.context.packageManager)?.let {
itemView.context.startActivity(intent)
} ?: itemView.context.openBrowser(url = "https://www.google.com/search?q=${Uri.encode(actor.actor.name)}")
true
}
This checks for a web search app and falls back to Google if none is available.

@IndusAryan
Copy link
Contributor

IndusAryan commented Jan 7, 2025

I think this should only be available for mobile with view intent of browser instead of url.

@fire-light42
Copy link
Collaborator

I think this should only be available for mobile with view intent of browser instead of url.

@bilal96aslam I would want you to both only limit this to mobile (use for example islayout) as well as adding Intent.ACTION_WEB_SEARCH before I merge this 👍

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.

Do a Google search when clicking on movie/series Cast with real name
5 participants