proxer / ProxerAndroid

The official Android App of Proxer.Me
https://proxer.me
GNU General Public License v3.0
122 stars 20 forks source link

AndroidTV Support #17

Open Graphicscore opened 6 years ago

Graphicscore commented 6 years ago

Hi, this is more a feature request / nice to have. I've used Proxer regularly now for a long time and would like to contribute back to the community. Since animes can be enjoyed the most on big TV screens I would like to implement AndroidTV support for the Proxer android app. I know that a lot of people don't have an AndroidTV compatible device (yet) but seeing the development and engagement that the google development team is putting into the TV version I feel like they got a device coming up either with the next OS (P) or Q. No need to mention all the devices that are already running on ATV.

Since the android TV development isn't widely spead yet it will probably take a fair amount of time and tinkering to get it going properly. I'm not yet really familiar with RxJava and Kotlin which are used a lot in this project but I will try my best to match your coding style and the high quality of code that is maintained in this project.

I forked the repository and will develop on a side branch. If this feature is not wanted at all or already planned to be developed my somebody else please let me know.

Progess :

General

TVActivity

AnimeBrowseFragment

NewsFragment

AnimeDetailsFragment

VideoPlaybackFragment

rubengees commented 6 years ago

That sounds great! I also thought about that, but never actually did it, because I have no AndroidTV device and testing on my phone doesn't seem right. I am still not sure if an AndroidTV app should be an app on it's own or not, maybe you can share your findings once you have started!

If you have any questions you can PM me wherever you like or continue the discussion here.

rubengees commented 6 years ago

Answering myself after googling:

Note: We recommend having a single app that supports both mobile devices and TV devices. If you need separate apps for mobile devices and TV devices, you can publish multiple apps under the same listing on Google Play by using multiple APK support. For more information, see Multiple APK Support.

So yes, this would be a most welcome addition.

Graphicscore commented 6 years ago

I luckily got an Nexus Player before they took it out of their store :) It's possible to declare activities especially for android tv. I'm still in the process of figuring out how the Leanback framework works in detail because they use a MVC architecture that differs from the traditional adapter architecture. Once I got that figured out with sample data I'll probably need some help hooking it up to the right api calls. I will PM you If I run into any issues or hit any noticeable milestones

rubengees commented 6 years ago

That sounds great, looking forward to it. I'll look into the tv architecture and the specific apis in the meantime.

Graphicscore commented 6 years ago

Awesome ! From what I can tell it looks like they've got a "Main" Activity which is basically a layout with a BrowseSupportFragment inside. It seem like this BrowseSupportFragment is responsible for adding the side navigation headers which are linked to certain "Rows" or "Pages" and it does provide the logic for spawning addition support fragments. It seems like A LOT of it is tied to code rather than layout XMLs. The samples are not really helpful either because they all use Deprecated classes and libraries. But I am looking forward to work on this feature and improve my Kotlin skills. BTW, awesome architecture for the dependecies, never saw it like that, I'll probably adapt that for my own projects.

Graphicscore commented 6 years ago

I'm slowly starting to get a hold of the Leanback framework. It's currently running on Java but I'll migrate it Kotlin soon. It's already a dynamic layout coupled with fragments that can be used. And dynamically filled with data =) Launch Menu InApp

rubengees commented 6 years ago

Cool! Starting with Java and converting these files to Kotlin has helped me too.

The Kotlin plugin also has an option to convert Java to Kotlin which you can compare to see what is happening. The Decompile Kotlin to Java option is also helpful to see what is generated under the hood.

Once you have Kotlin code remember to run the detektCheck and ktlintCheck Gradle tasks on it to find potential problems and code style issues.

Graphicscore commented 6 years ago

Awesome! Will do! Github won't let me create issues/tickets inside my fork sadly so I've added a rough sketch of my ToDo-List on the first post in this discussion. I didn't wanted to spam todos in the issue board of the proxer app...., there are probably far more points than I've noted here yet - hah.

rubengees commented 6 years ago

Since there has been no activity on this for quite some time, I'm closing this issues for now. If you ever come back to it, please reopen!

Graphicscore commented 5 years ago

It took a year 😄 . I finally moved my TV from the living room into my bedroom so this topic just came to mind again. Maybe this time I will stick around and push this through because now I actually have a proper TV to use it on. Sadly they made the leanback tv framework even more complex and weird compared to a year ago. I'm probably better off just starting from scratch again.

I will report if I make any noticable progress.

PS: Since last year they published x64 tv system images for the emulator which work quite well. 🎉

rubengees commented 5 years ago

Cool, looking forward! Let me know if I can help you with anything :)

Graphicscore commented 5 years ago

Is it normal that the repository requires the latest preview build ?

This version of Android Studio cannot open this project, please retry with Android Studio 3.6 or newer.

rubengees commented 5 years ago

Yes, I also use this project to explore the latest features and technologies in the Android world, so Android Studio and most libraries are preview versions.

xdreamskillzxx commented 4 years ago

@Graphicscore someone already implemented this. But as it is it is already outdated. But maybe you can use some of this code. Look here for more Info