Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Fix sample
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Jul 5, 2022
1 parent 0138655 commit 66bcf22
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 45 deletions.
20 changes: 19 additions & 1 deletion Locations-MotionActivity/Sample.Android/MainApplication.cs
Expand Up @@ -13,7 +13,25 @@ public class MainApplication : Application

public override void OnCreate()
{
this.ShinyOnCreate(new Startup());
var methodName = "Initialize";
var type = typeof(JNIEnv);
var first = true;
var methods = type.GetMethods(bindingAttr: System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
foreach (var method in methods)
{
if (method.Name.Contains(methodName))
{
if (first)
{
first = false;
continue;
}
System.Diagnostics.Debug.WriteLine("Method: " + method.Name);
method.Invoke(null, null);
}
}

this.ShinyOnCreate(new Startup());
base.OnCreate();
}
}
Expand Down
Expand Up @@ -3,4 +3,5 @@
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="31" />
<application android:theme="@style/MainTheme" android:label="Motion Activity" android:icon="@mipmap/icon"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
</manifest>
13 changes: 11 additions & 2 deletions Locations-MotionActivity/Sample.iOS/Info.plist
Expand Up @@ -23,9 +23,9 @@
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleDisplayName</key>
<string>Sample</string>
<string>Motion Activity</string>
<key>CFBundleIdentifier</key>
<string>com.shiny.test</string>
<string>org.shiny.motionactivity</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UILaunchStoryboardName</key>
Expand All @@ -34,5 +34,14 @@
<string>Sample</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>NSMotionUsageDescription</key>
<string>We use sensors</string>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
<string>bluetooth-peripheral</string>
</array>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>New Entry</string>
</dict>
</plist>

This file was deleted.

16 changes: 0 additions & 16 deletions Locations-MotionActivity/Sample/Infrastructure/ShinyEvent.cs

This file was deleted.

7 changes: 3 additions & 4 deletions Locations-MotionActivity/Sample/ListPage.xaml
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<shared:SampleContentPage xmlns="http://xamarin.com/schemas/2014/forms"
<sample:SampleContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:sample="clr-namespace:Sample"
xmlns:shared="clr-namespace:Sample;assembly=Sample.Shared"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
x:Class="Sample.ListPage"
Title="Activities">
Expand Down Expand Up @@ -49,7 +48,7 @@

<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout x:DataType="shared:CommandItem">
<StackLayout x:DataType="sample:CommandItem">
<Label Text="{Binding Text}" FontSize="Title" />
<Label Text="{Binding Detail}" FontSize="Subtitle" />
<BoxView HeightRequest="1"
Expand All @@ -62,4 +61,4 @@
</RefreshView>
</Grid>
</ContentPage.Content>
</shared:SampleContentPage>
</sample:SampleContentPage>
5 changes: 2 additions & 3 deletions Locations-MotionActivity/Sample/OtherExtensionsPage.xaml
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<shared:SampleContentPage xmlns="http://xamarin.com/schemas/2014/forms"
<sample:SampleContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sample="clr-namespace:Sample"
xmlns:shared="clr-namespace:Sample;assembly=Sample.Shared"
x:DataType="sample:OtherExtensionsViewModel"
mc:Ignorable="d"
x:Class="Sample.OtherExtensionsPage"
Expand All @@ -25,4 +24,4 @@
</TableRoot>
</TableView>
</ContentPage.Content>
</shared:SampleContentPage>
</sample:SampleContentPage>

0 comments on commit 66bcf22

Please sign in to comment.