-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Extract account logic from BaseActivity into a mixin #5064
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
Extract account logic from BaseActivity into a mixin #5064
Conversation
62185ae to
3148156
Compare
Codecov Report
@@ Coverage Diff @@
## master #5064 +/- ##
============================================
+ Coverage 17.71% 19.96% +2.24%
Complexity 3 3
============================================
Files 392 397 +5
Lines 33147 33232 +85
Branches 4656 4662 +6
============================================
+ Hits 5873 6635 +762
+ Misses 26324 25516 -808
- Partials 950 1081 +131
|
3148156 to
75c6622
Compare
5472a0a to
0a56b09
Compare
0a56b09 to
3d84267
Compare
692ad68 to
51f893f
Compare
|
@ezaquarii looks good to me code-wise. 👍 |
src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java
Outdated
Show resolved
Hide resolved
|
Oupsie! This is my private debug code - it should not be there. I'll fix it.
…On February 4, 2020 8:11:07 AM UTC, Tobias Kaminsky ***@***.***> wrote:
tobiasKaminsky commented on this pull request.
> @@ -32,6 +33,7 @@
@OverRide
public final void onActivityCreated(Activity activity, Bundle
savedInstanceState) {
+ Log.d("mytag",
String.format("ActivityInjector.onActivityCreated(): %s", activity));
Why do we use Log instead of Log_OC here?
"mytag" is also too generic. You could generate a tag from the
activity?
Or call it "ActivityInjector"
> @@ -1359,12 +1358,13 @@ private View findQuotaViewById(int id) {
*/
protected abstract void restart();
- @OverRide
- protected void
onAccountCreationSuccessful(AccountManagerFuture<Bundle> future) {
- super.onAccountCreationSuccessful(future);
- updateAccountList();
- restart();
- }
+// @OverRide
Can you remove this?
> @OverRide
protected void onCreate(Bundle savedInstanceState) {
Log_OC.v(TAG, "onCreate() start");
-
+ Log.d("mytag", "FileDisplayActivity.onCreate(): before
super");
Same questions regarding log :-)
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#5064 (review)
|
6b2f879 to
7b64b1d
Compare
|
Did a smoke test and it works 👍 |
Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
7b64b1d to
26f2d52
Compare
|
Complexity decreasing per file
==============================
+ src/main/java/com/owncloud/android/ui/activity/BaseActivity.java -5
See the complete overview on Codacy |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12569.apk |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12570.apk |
Codacy337Lint
SpotBugs (new)
SpotBugs (master)
|
92ddf10 Merge remote-tracking branch 'origin/master' into dev 5905b1c Merge pull request #5432 from nextcloud/ezaquarii/migrate-drawer-menu-utils-to-new-user-model 4be18ad Merge pull request #5064 from nextcloud/ezaquarii/extract-account-logic-from-base-activity-into-mixin 619b5d0 Merge pull request #5419 from nextcloud/dependabot/gradle/org.projectlombok-lombok-1.18.12 2d6e73d Merge pull request #5414 from nextcloud/fixContactCrash 1bb04aa also increase annotationProcessor 6048243 Fix crash: Caused by: java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.Void[] 0027df9 [tx-robot] updated from transifex 6dd5d92 Merge pull request #5443 from nextcloud/fixTransifex b4db9d0 do not break line on transifex b5fb9c1 Migrate drawer menu utilities to new user model a906a14 daily dev 20200208


This PR moves some account-related shared logic in
BaseActivityinto a mix-in.My intention is to collect various account handling logic there, although it is still in a research phase.
@tobiasKaminsky @AndyScherzinger I tried to bring a test coverage to some acceptable level, but this code is so untestable that the task proven to be counter-productive. This code generally must go anyway.
The session mixin has the original, account-related code moved verbatim, without functional changes, so the mixin should behave indentically to the original and
#5031 (comment) is also accounted for.