-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add Drawer Personalization #4104
Conversation
Maybe it should be under Appearance? Worth discussion, I think. |
I think so since changing the drawer changes the Appearance |
Thank you for your contribution @werererer! |
Or, far easier, you can just tick the boxes by clicking on them after you've already created the post. |
What do you mean with Gradle in a separate PR @TobiGr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo these changes
Since you used Android Studio, you must have gotten that update prompt "Update Gradle Plugin". There is some stupid setting that Google introduced which automatically screws with your current projects, namely Newpipe. When you get that prompt, just close it. Or, now that you have updated already, just undo that change from the build.gradle file as wb9688 said. |
Ok |
Ok fixed it |
Some tips for reviewing (as i didn't split up the pull request sry. After some research I know now that it should be done :/):
|
@werererer could you take a look at this: while your working on this, I wish if customizing can be done directly from drawer, without the need to dig into settings. In my opinion, the easiest way to solve this is by using pop-up menu (similarly to video pop-up menu). the menu should have all the function needed (remove, add, reorder...etc). similarly, the menu can be activated by long pressing on the item or tab you want to change. If customization could be done this way, it would make personalization of all the services so much easier. I know this needs more effort from you but it's worth it. newPipe deserves perfection 💖 |
good idea i will work on it later :) |
I looked at it and i realized that this would require way more work than expected. I also don't really have the knowledge to implement this :/(it would require a new drawer and panel that has a recyclerview in it?). As for this PR it may be overkill :/ |
I think just having it inside the settings is OK |
ok I think everything works now I don't plan to make any greater changes in this PR (if I didn't introduce bugs) |
Could you rebase on dev and fix potential Checkstyle issues? I'll take a look at the UI and code later. |
how do i rebase? (sry still relatively new to github) |
nevermind working on it now |
Something like:
Then close the editor it opens. After that try building it again in Android Studio and you might get some (Checkstyle) errors that you need to fix. Edit: you might need to do additional stuff in case of merge conflicts though. If it says "Could not apply", you have to run |
fixed it |
is it correct that almost all variables have to be declared final now? |
@werererer: Yes, that's true and you could see on CI that you didn't do that. Also for the future: we prefer rebases over merges. |
Ah sorry I messed up than :/. Fixed the checkstyle now |
Oh, no problem. At least CI is green now. I hope I'll be able to look at this PR soon. |
My PR doesn't seem to be reviewed anymore :/. Should I split this PR up into multiple smaller ones so that it is easier to review? I am willing to do it if it raises the chance of getting this feature. |
@litetex Ok just as an info I am currently working on it and I realized that roughly 30% of the code became too outdated. I will have to rewrite them manually so it may take a few days. |
@litetex nevermind was easier than I though lol xD. It works now in my build I will clean now things up and make it ready to pull. |
…e are shown anyways
@litetex ok it's done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I reviewed the PR and found a bunch of issues:
- There is documentation / comments missing on some key-classes/methods (e.g. https://github.com/TeamNewPipe/NewPipe/pull/4104/files#diff-6e999cc285df1003629c36815181e973e47fd00bb85c98782a0b42d1154d36c9R308 /
NewPipe/app/src/main/java/org/schabi/newpipe/settings/drawer_items/ChooseDrawerItemsFragment.java
Line 308 in 128354e
final int minimumAbsVelocity = Math.max(12, - Logic is stretched all over the place and not isolated inside classes
- e.g. DrawerItem (which is a container to hold an item) is not isolated and has logic from UI, persistence and services inside it
- I'm not happy with the package name, as it contains a "_"
- There are multiple typos
- Code is duplicated (e.g. DrawerItem#ITEM_ID...)
- Logging is missing on certain places / e.printStackTrace()
- The draweritems for the kiosk are in the settings multiple times?
- There is unused and commented out code in some places
- Persistence is done using one JSON string - I don't know if this is a good idea
- It's possible to add draweritems multiple times - I don't think that that is making sence (e.g. download)
- There are unused drawer items: BLANK, SETTING and ABOUT
- Finding the edit option for the menu is a bit un-intuitive, as it's hidden in the content settings
I think we have to rethink if we even want to add this in the first place because the corresponding issue has 4 upvotes in total...
People seem to mainly want a "distraction" or "addiction" free mode which I personally don't understand because simply uninstalling the app or don't using the phone is a way better approach.
@litetex Thanks for the review. with most of your issues I agree and they are mostly a result of hastly written code.. Anyways I want to point out that my drawer_items code is mostly based on tab*.java code. I didn’t want to make another abstraction around it to avoid merge conflicts. So issues mentioned in the DrawerItem class may also appear in the Tab classes already existing in the code base and I dont know if I am able to resolve this issue quickly. The reason drawer items exist multiple times in the config is because the number of kiosks is not defined and the default kiosks will be replaced with the given kiosks in order excluding all kiosks that the user specifically added himself(e.g. youtube trending). I didnt find a better way to configure it without having to write my own fragment for it. That you can add downloads specifically multiple times is a bug I didnt found... where would you put the configuration instead of putting it under content? I just put it near the configuration for the tabs. To your last point about addiction. I think this app has great elements to cope with addiciton with youtube. You can toggle comments and recommendations. Stop watching youtube cold turkey is pretty hard/nearly impossible. Watching videos on newpipe though is an easier alternative as you can still watch certain youtubers that you really want to follow without getting distracted by unimportant content because of said features. (source personal experience) Whether we still want to have this feature depends though It is not easy to maintain this code since I lost interest for it myself... Anyways If we still want to have this feature I will fix mentioned issues. |
I did some further discussion with our dev team (again) and we came to the conclusion, that we don't want to add this feature as it's a) only relevant to few people (marked the issue as niche) and b) that the code - in the current form - it's not maintainable by us (would probably introduce new problems, etc). TL;DR For now I will close the PR due to the above points. Anyway, thank you for the PR and everyone else for the work that went into this. |
ok sounds reasonable |
What a shame, thank you for the hard work though @werererer, I wish it would have become a reality |
What is it?
Description of the changes in your PR
Fixes the following issue(s)
Test Apk
newpipeDrawerupdateApk.zip
Agreement
This is my first PR that had android studio involved. It incoporates a feature to Configure the left Panel/Drawer. This can be done under settings/Content/Content of main page.
I also seperated Drawerlogic from the main Activity class. The Drawerlogic is now in the DrawerFragment class.