Is it a ?
[ ] Bug Report
[ ] Feature Request
[x] Refactor
Right now the package structure isn't very good. Infact it isn't followed very well. It should be made robust and code should be packaged into different sections on the basis of features. It is crucial before trying to make the application testable.
@mhutti1 @brijeshshah13 views ?
@srv-twry I very much agree with you. Even I felt the same need because whenever I try to introduce something new by replacing the old, I end up dealing with multiple conflicts with several packages. May I ask how do you plan to solve this?
@brijeshshah13 Please check the PR :)
@siddharth2010 Since you are refactoring the package structure we should discuss the new package structure in this issue. Can you propose a new package structure here as is done in #471. Also, you are using underscore in some package names like content_provider which I think should be changed to contentprovider according to the Java docs here.
I think we should change the name of KiwixMobileAcitvity to MainActivity. What is your opinion?
@abdulwd , I think the package structure suggested in #471 is really good. So I would suggest the same basic structure, with a few minor changes here and there. (like the renaming of the package main (containing SplashActivity.java) to splash).
Also, I yes, you are absolutely right. According to the google java style guide , all the names like library_view, fileselect_view, zim_manager, content_provider need to be changed.
So here is the structure proposed by me:
.
โโโ common
โ โโโ base
โ โ โโโ BaseActivity.java
โ โ โโโ BasePresenter.java
โ โ โโโ BaseFragment.java
โ โ โโโ contract
โ โ โ โโโ Presenter.java
โ โ โ โโโ ViewCallback.java
โ โโโ data
โ โ โโโ contentprovider
โ โ โ โโโ ZimContentProvider.java
โ โ โโโ database
โ โ โ โโโ entity
โ โ โ โ โโโ BookDataSource.java
โ โ โ โ โโโ BookmarksSpec.java
โ โ โ โ โโโ LibraryDataSource.java
โ โ โ โ โโโ NetworkLanguageSpec.java
โ โ โ โ โโโ RecentSearchSpec.java
โ โ โ โโโ BookDao.java
โ โ โ โโโ BookmarksDao.java
โ โ โ โโโ KiwixDatabase.java
โ โ โ โโโ NetworkLanguageDao.java
โ โ โ โโโ RecentSearchDao.java
โ โ โโโ network
โ โ โ โโโ KiwixService.java
โ โ โ โโโ UserAgentInterceptor.java
โ โโโ di
โ โ โโโ components
โ โ โ โโโ ApplicationComponent.java
โ โ โโโ modules
โ โ โ โโโ ApplicationBindingModule.java
โ โ โ โโโ ApplicationModule.java
โ โ โ โโโ JNIModule.java
โ โ โ โโโ NetworkModule.java
โ โ โโโ PerActivity.java
โ โโโ settings
โ โ โโโ CustomSwitchPreference.java
โ โ โโโ KiwixSettingsActivity.java
โ โโโ utils
โ โ โโโ files
โ โ โ โโโ FileReader.java
โ โ โ โโโ FileSearch.java
โ โ โ โโโ FileUtils.java
โ โ โโโ BookUtils.java
โ โ โโโ Constants.java
โ โ โโโ DimenUtils.java
โ โ โโโ DocumentParser.java
โ โ โโโ LanguageUtils.java
โ โ โโโ NetworkUtils.java
โ โ โโโ RateAppCounter.java
โ โ โโโ StorageUtils.java
โ โ โโโ StyleUtils.java
โ โ โโโ TestingUtils.java
โ โโโ views
โ โ โโโ bottomtab
โ โ โ โโโ PageBottomTab.java
โ โ โ โโโ PageBottomTabLayout.java
โ โ โ โโโ TabDrawerAdapter.java
โ โ โโโ table
โ โ โ โโโ TableDrawerAdapter.java
โ โ โโโ web
โ โ โ โโโ KiwixWebView.java
โ โ โ โโโ ToolbarScrollingKiwixWebView.java
โ โ โ โโโ ToolbarStaticKiwixWebView.java
โ โ โ โโโ WebViewCallback.java
โ โ โโโ AnimatedProgressBar.java
โ โ โโโ AutoCompleteAdapter.java
โ โ โโโ CompatFindActionModeCallback.java
โ โ โโโ KiwixActionBarDrawerToggle.java
โ โ โโโ LanguageSelectDialog.java
โ โ โโโ SliderPreference.java
โโโ modules
โ โโโ bookmarksview
โ โ โโโ BookmarksActivity.java
โ โ โโโ BookmarksPresenter.java
โ โ โโโ contract
โ โ โโโ BookmarksViewCallback.java
โ โโโ clients
โ โ โโโ KiwixWebChromeClient.java
โ โ โโโ KiwixWebViewClient.java
โ โโโ downloader
โ โ โโโ Chunk.java
โ โ โโโ ChunkUtils.java
โ โ โโโ DownloadFragment.java
โ โ โโโ DownloadIntent.java
โ โ โโโ DownloadService.java
โ โโโ library
โ โ โโโ entity
โ โ โ โโโ LibraryNetworkEntity.java
โ โ โ โโโ MetaLinkNetworkEntity.java
โ โ โโโ LibraryAdapter.java
โ โโโ main
โ โ โโโ SplashActivity.java
โ โโโ search
โ โ โโโ contract
โ โ โ โโโ SearchViewCallback.java
โ โ โโโ KiwixSearchWidget.java
โ โ โโโ SearchActivity.java
โ โ โโโ SearchPresenter.java
โ โโโ texttospeech
โ โ โโโ KiwixTextToSpeech.java
โ โโโ zimmanager
โ โ โโโ contract
โ โ โ โโโ ZimManageViewCallback.java
โ โ โโโ fileselectview
โ โ โ โโโ contract
โ โ โ โ โโโ ZimFileSelectViewCallback.java
โ โ โ โโโ ZimFileSelectFragment.java
โ โ โ โโโ ZimFileSelectPresenter.java
โ โ โโโ libraryview
โ โ โ โโโ contract
โ โ โ โ โโโ LibraryViewCallback.java
โ โ โ โโโ LibraryFragment.java
โ โ โ โโโ LibraryPresenter.java
โ โ โ โโโ LibraryUtils.java
โ โ โโโ SectionsPagerAdapter.java
โ โ โโโ ZimManageActivity.java
โ โ โโโ ZimManagePresenter.java
โโโ KiwixApplication.java
โโโ KiwixMobileActivity.java
โโโ KiwixMobileErrorActivity.java
The structure is in the branch: siddharth2010/Package_Refactor, in the main kiwix repo.
@siddharth2010 I think we should have separate packages for KiwixMobileActivity and KiwixErrorActivity. We can rename KiwixMobileActivity to MainActivity and move it to a package called main.
Please have a look at this sample app so that it may give us a greater insight into architecture. You can find more sample apps at this link.
@abdulwd Sure. I will look into it right now and get back to you as soon as possible.
@abdulwd , I guess I now understand the idea behind having separate packages for KiwixMobileActivity and KiwixErrorActivity, and I think it's the right way to go. I will do this.
Closed via #748
Most helpful comment
@abdulwd , I guess I now understand the idea behind having separate packages for
KiwixMobileActivityandKiwixErrorActivity, and I think it's the right way to go. I will do this.