OpenLauncherTeam / openlauncher

Customizable and Open Source Launcher for Android
Apache License 2.0
1.43k stars 414 forks source link

Reduce & Merge Activity contents #42

Closed gsantner closed 7 years ago

gsantner commented 7 years ago

Currently there are very much fragments and activity in here, containing a lot of code duplicates. E.g. there is no need to have Acitivy_hideapps.java in here. Should all be integrated in one.

Of course, e.g. settings need to have it's own activity/fragment. And maybe some kind of common BaseActivity/Fragment. I tried to understand whats going on, but thats really hard to currenty, because it's hard to guess what gets really called/executed.

This should be one of our top priority issues, before integrating any new feature. Else this gets more bad with each new stuff, and at a certain point the project will become unmaintainable if not done.

dkanada commented 7 years ago

Alright, the activities we can probably modify first are MinibarEdit, About, and HideApps.

gsantner commented 7 years ago

I also don't know how much important the launcheranim, materialpreffragment, smoothviewpager libraries are, and if it's important to keep them as seperate lib. I cannot see much code and stuff in there, I think they can be merged into the app. This will reduce build and maintaining overhead, e.g. we don't need to update library versions double and threefold

dkanada commented 7 years ago

@BennyKok wanted to keep materialpreffragment separate but the other two can be merged.

BennyKok commented 7 years ago

I would like to extract materialpreffragment later to a new repository as a standalone library. And as for the launcheranim, I have used the vector drawable flag in the gradle file so we need to be careful when merging this one.

gsantner commented 7 years ago

Honestly, I dislike the materialpreffrag. Its quite a hacky solution, with everything done in code. which is quite unmaintainable. Android already supplys very good stuff here, no need to use a workaround library here.

Can be easily done in XML: https://github.com/Diaspora-for-Android/dandelion/blob/master/app/src/main/res/xml/preferences__master.xml and rather small pieces of appcompat overrides

And all of this also works in older versions + is material too + easy manageable strings, resources :).

tmp_8272-screenshot_20170401-0744011141963335

The only thing I dont know how I would do a moveable setting list in there. But that does Materialpreffrag also not supply, as its done seperatly in MinibarActivity.

I think we gonna have a lot of preferences..This way we let the layouting do automatically, coming from xml, and we only need take to care about some manual actions. As e.g. a checkbox toggle does automatically toggle a bool-preference, no code needed for it.

BennyKok commented 7 years ago

Because I use Gson for the entire settings and even desktop and dock data, so I created a custom workaround for me to easier inflate the settings to the interface. Why I did the whole thing because of I don't like switching between xml code and java at the same time need to pull the settings out from the SharedPreferences for each variable, using the Gson I can easily define list and array and custom object to store to the device, which is very easy in a lazy way. It is true "easy manageable", "unmaintainable", but that is the way I got started, I am fine with a total rewrite and switch to the traditional way.

Each Materialpreffrag has it own scrollview.

Great job man, a deep analyzing report. But before we ditch the Materialpreffrag out, we need to take care of the existing LauncherSettings.

gsantner commented 7 years ago

@BennyKok Good a idea with JSON, I think e.g. launcher positions&arrays can't be managed any better

BennyKok commented 7 years ago

I think first I will clean up the Home activity before I go any further (and fix some bugs along the way)

BennyKok commented 7 years ago

@gsantner are u still using xmpp, I found you id in you website, did you got my msg in xmpp

gsantner commented 7 years ago

@BennyKok Nope, I didn't receive a msg, but a contact request now, from "itechbenny", is that you?

BennyKok commented 7 years ago

yes

gsantner commented 6 years ago

@dkanada how are you? didnt hear something for quite sometime :). Your xmpp seems also not to work anymore since a long time, I/we have no other contact details too to mesaage you sadly :o

BennyKok commented 6 years ago

@dkanada don't freak me out, are u still alive?????

dkanada commented 6 years ago

Yeah haha, I have been really busy though. I still need to set up riot and then I will join the group chat you guys created over there.