jerrellmardis / Amphitheatre

Amphitheatre is an Android TV app that connects with network shares, organizes and serves videos to any Android capable media player app.
Apache License 2.0
437 stars 87 forks source link

Adds a network search dialog to automatically find available network shares. #23

Closed rharter closed 10 years ago

rharter commented 10 years ago

This adds a search icon next to the path field on the AddSourceDialogFragment. Using that, it will search the local network for all available unhidden shares, thus avoiding things like /printers$, etc.

Review the search code, I'm not sure it's the best architecture. You have to search smb:// for all domains (can't assume just WORKGROUP), then search each of those domains for servers, then search each server for shares. Right now it's just embedded for loops, but that works alright since they shouldn't be enormous lists (unless you live in a dorm), and they will only ever be those 3 levels deep.

In the future I'd like to look into turning this into a file browser of sorts, so you could navigate down the tree. But that will take design thought and more time, so this works for now.

JakeWharton commented 10 years ago

This adds a search icon next to the path field on the AddSourceDialogFragment. Using that, it will search the local network for all available unhidden shares, thus avoiding things like /printers$, etc.

I think the dialog should start by searching since this is 99% of what you'll want to do. Entering a path manually is the worst-case scenario and should be de-emphasized as much as possible.

JakeWharton commented 10 years ago

GitHub search icons? Just use the platform's indeterminate progress bar.

JakeWharton commented 10 years ago

Oh nevermind that's GitHub being stupid and searching.

rharter commented 10 years ago

@JakeWharton I agree with you about the default action being search. I was struggling with how to design it from a UX perspective. What do you think of this?

The search is all handled with the AddSource dialog, with a Spinner instead of an EditText for the path. The spinner is populated with discovered shares and an entry for "Manually Enter Address". If the user chooses the manual option, an EditText appears below the spinner (so they can still change their choice) to manually enter the path. If no shares are found, the manual option is selected by default, otherwise the first discovered share is selected by default.

/cc @jerrellmardis

JakeWharton commented 10 years ago

Sounds good to me.