forked from MvvmCross/MvvmCross
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Android Top Activity (MvvmCross#4290)
* Fix Android Top Activity, old code was overcomplicated * Fix layouts using old types
- Loading branch information
1 parent
2e4cc87
commit 829ceb6
Showing
15 changed files
with
121 additions
and
207 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MS-PL license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Android.Content; | ||
using Android.App; | ||
using MvvmCross.Core; | ||
|
||
namespace MvvmCross.Platforms.Android.Core | ||
{ | ||
#nullable enable | ||
public interface IMvxAndroidSetup : IMvxSetup | ||
{ | ||
void PlatformInitialize(Context applicationContext); | ||
void PlatformInitialize(Activity activity); | ||
} | ||
#nullable restore | ||
} |
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
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
116 changes: 0 additions & 116 deletions
116
MvvmCross/Platforms/Android/Views/MvxApplicationCallbacksCurrentTopActivity.cs
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
MvvmCross/Platforms/Android/Views/MvxCurrentTopActivity.cs
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,60 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MS-PL license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using Android.App; | ||
using Android.OS; | ||
using Android.Runtime; | ||
|
||
namespace MvvmCross.Platforms.Android.Views | ||
{ | ||
#nullable enable | ||
[Register("mvvmcross.platforms.android.MvxCurrentTopActivity")] | ||
public class MvxCurrentTopActivity | ||
: Java.Lang.Object, Application.IActivityLifecycleCallbacks, IMvxAndroidCurrentTopActivity | ||
{ | ||
[Weak] | ||
private Activity? _lastSeenActivity; | ||
|
||
public Activity? Activity => _lastSeenActivity; | ||
|
||
public static bool Initialized { get; set; } | ||
|
||
public void OnActivityCreated(Activity activity, Bundle? savedInstanceState) | ||
{ | ||
_lastSeenActivity = activity; | ||
} | ||
|
||
public void OnActivityPaused(Activity activity) | ||
{ | ||
_lastSeenActivity = activity; | ||
} | ||
|
||
public void OnActivityResumed(Activity activity) | ||
{ | ||
_lastSeenActivity = activity; | ||
} | ||
|
||
public void OnActivityDestroyed(Activity activity) | ||
{ | ||
// not interested in this | ||
} | ||
|
||
public void OnActivitySaveInstanceState(Activity activity, Bundle outState) | ||
{ | ||
// not interested in this | ||
} | ||
|
||
public void OnActivityStarted(Activity activity) | ||
{ | ||
// not interested in this | ||
} | ||
|
||
public void OnActivityStopped(Activity activity) | ||
{ | ||
// not interested in this | ||
} | ||
} | ||
#nullable restore | ||
} |
45 changes: 0 additions & 45 deletions
45
MvvmCross/Platforms/Android/Views/MvxLifecycleMonitorCurrentTopActivity.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.