Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • disapp disapp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 7
    • Issues 7
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • disrootdisroot
  • disappdisapp
  • Merge requests
  • !16

WIP: [ Step 1 ] Remove duplicate code using methods

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Juan requested to merge jdvr/disapp:refactor_s_1 into master Feb 19, 2019
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 2
  • [ Step 1 ] Remove duplicate code using methods
  • Next [ Step 2 ] Use polymorphism and extract code from MainActivity
  • Next [ Step 3 ] Follow (kind of) Clean Architecture to create well defined responsibilities

The goal of this three steps is to achieve the four rules of simple design

For this project Clean Architecture is a bit overkill, but it guides you to SOLID principles. The idea of this three steps refactors is to make the app easier to maintain. I am not an experienced android developer but I applied almost the same design patters for backend and frontend developments.

Code comments: I want to make and especial mention to comments while using a cvs as git is harder to keep dead code that to just remove it, make a very tinny commit and if you need the code again you can do a revert.

Changes:

I have chosen button setups as examples because IMHO is the easier and most valuable change I could do over the code.

  1. Make code more abstract to create just 4 ways of handle dashboard buttons:
  • launchActivity, from dashboard we launch another activity (eg. State)
  • launchRecommendedAppButton, from dashboard it launches another app (e.g. K9)
  • launchWebviewApp, from dashboard opens webview with url (e.g. Calc)
  • launchWebviewWithNativeBrowser, from dashboard, it requests a uri open to OS (e.g. Upload)

Disclaimer

I know this refactor remove two features:

  1. Let user choose xmpp client
  2. State long press dialog options

This two functionalities will be re-added during step 2 and 3.

PS. Gitlab diff is unclear... it messes up a lot of stuff

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: refactor_s_1