-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update NuGets, Plugins, and add Geolocator
- Loading branch information
1 parent
9da2b35
commit d8842b2
Showing
29 changed files
with
2,259 additions
and
584 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
|
||
using Android.App; | ||
using Android.OS; | ||
using Android.Runtime; | ||
using Plugin.CurrentActivity; | ||
|
||
namespace MyWeather.Droid | ||
{ | ||
//You can specify additional application information in this attribute | ||
[Application] | ||
public class MainApplication : Application, Application.IActivityLifecycleCallbacks | ||
{ | ||
public MainApplication(IntPtr handle, JniHandleOwnership transer) | ||
:base(handle, transer) | ||
{ | ||
} | ||
|
||
public override void OnCreate() | ||
{ | ||
base.OnCreate(); | ||
RegisterActivityLifecycleCallbacks(this); | ||
//A great place to initialize Xamarin.Insights and Dependency Services! | ||
} | ||
|
||
public override void OnTerminate() | ||
{ | ||
base.OnTerminate(); | ||
UnregisterActivityLifecycleCallbacks(this); | ||
} | ||
|
||
public void OnActivityCreated(Activity activity, Bundle savedInstanceState) | ||
{ | ||
CrossCurrentActivity.Current.Activity = activity; | ||
} | ||
|
||
public void OnActivityDestroyed(Activity activity) | ||
{ | ||
} | ||
|
||
public void OnActivityPaused(Activity activity) | ||
{ | ||
} | ||
|
||
public void OnActivityResumed(Activity activity) | ||
{ | ||
CrossCurrentActivity.Current.Activity = activity; | ||
} | ||
|
||
public void OnActivitySaveInstanceState(Activity activity, Bundle outState) | ||
{ | ||
} | ||
|
||
public void OnActivityStarted(Activity activity) | ||
{ | ||
CrossCurrentActivity.Current.Activity = activity; | ||
} | ||
|
||
public void OnActivityStopped(Activity activity) | ||
{ | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CurrentActivity Readme | ||
|
||
Find the most up to date information at: | ||
https://github.com/jamesmontemagno/Xamarin.Plugins | ||
|
||
|
||
This plugin provides base functionality for Plugins for Xamarin to gain access to the applications main activity. | ||
|
||
When this plugin is installed it installs a "MainApplication.cs" into the root of your application. | ||
|
||
This file exposes an Android "Application" that registers for Activity changes. | ||
|
||
If you already have an "Application" class please comment out this class and implement: | ||
Application.IActivityLifecycleCallbacks on your Application. | ||
|
||
Then set: | ||
CrossCurrentActivity.Current.Activity = activity; | ||
|
||
on the: OnActivityCreated, OnActivityStarted, OnActivityResumed | ||
|
||
Additionally: | ||
public override void OnCreate() | ||
{ | ||
base.OnCreate(); | ||
RegisterActivityLifecycleCallbacks(this); | ||
} | ||
|
||
public override void OnTerminate() | ||
{ | ||
base.OnTerminate(); | ||
UnregisterActivityLifecycleCallbacks(this); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Permissions Readme | ||
Find the most up to date information at: https://github.com/jamesmontemagno/Xamarin.Plugins | ||
|
||
**IMPORTANT** | ||
Android: | ||
It is required that you add the following override to any Activity that you will be requesting permissions from: | ||
|
||
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) | ||
{ | ||
Plugin.Permissions.PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults); | ||
} | ||
|
||
Additionally, Plugin.CurrentActivity was installed to propogate the current Activity up to this plugin. Please ensure that your Application class is correct configured. | ||
|
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,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" /> | ||
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23" /> | ||
<application android:label="MyWeather" android:theme="@style/MyTheme"></application> | ||
</manifest> |
Oops, something went wrong.