-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing ALL instance creation of Futils EXCEPT in BasicActivity.
- BasicActivity implements UtilitiesProviderInterface which is used to inject application-wide properties (currently only Futils but that will change soon) and is the ONLY place where Futils is intantiated - For methods used in only one class, the helper method has been moved to the class - For methods that could be put static: added static modifier so no instance of Futils is needed - For Futils::getString: replaced by getResources().getString as Futils::getString was just a shortcut adding an 'unwanted' dependency - Imports cleaning
- Loading branch information
Rémi Piotaix
committed
Oct 17, 2016
1 parent
8e68890
commit 185b497
Showing
40 changed files
with
352 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/com/amaze/filemanager/activities/BasicActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.amaze.filemanager.activities; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
|
||
import com.amaze.filemanager.utils.Futils; | ||
import com.amaze.filemanager.utils.UtilitiesProviderInterface; | ||
|
||
/** | ||
* Created by rpiotaix on 17/10/16. | ||
*/ | ||
public class BasicActivity extends AppCompatActivity implements UtilitiesProviderInterface { | ||
private Futils utils; | ||
|
||
@Override | ||
public Futils getFutils() { | ||
return utils; | ||
} | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
utils = new Futils(); | ||
} | ||
} |
4 changes: 1 addition & 3 deletions
4
src/main/java/com/amaze/filemanager/activities/ChangelogActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package com.amaze.filemanager.activities; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
|
||
/** | ||
* Created by vishal on 7/8/16. | ||
*/ | ||
public class ChangelogActivity extends AppCompatActivity { | ||
public class ChangelogActivity extends BasicActivity { | ||
|
||
private static final String URL_CHANGELOG = "https://api.github.com/repos/arpitkh96/AmazeFileManager/commits"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.