Skip to content

Commit 23662fe

Browse files
author
unknown-user
committed
Initial check-in of module EAIntroView
0 parents  commit 23662fe

22 files changed

+1025
-0
lines changed

EAIntroView.Sample/AppDelegate.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System;
2+
using System.Linq;
3+
using System.Collections.Generic;
4+
5+
using Foundation;
6+
using UIKit;
7+
8+
namespace EAIntroView.Sample
9+
{
10+
// The UIApplicationDelegate for the application. This class is responsible for launching the
11+
// User Interface of the application, as well as listening (and optionally responding) to
12+
// application events from iOS.
13+
[Register("AppDelegate")]
14+
public partial class AppDelegate : UIApplicationDelegate
15+
{
16+
// class-level declarations
17+
18+
public override UIWindow Window
19+
{
20+
get;
21+
set;
22+
}
23+
24+
// This method is invoked when the application is about to move from active to inactive state.
25+
// OpenGL applications should use this method to pause.
26+
public override void OnResignActivation(UIApplication application)
27+
{
28+
}
29+
30+
// This method should be used to release shared resources and it should store the application state.
31+
// If your application supports background exection this method is called instead of WillTerminate
32+
// when the user quits.
33+
public override void DidEnterBackground(UIApplication application)
34+
{
35+
}
36+
37+
// This method is called as part of the transiton from background to active state.
38+
public override void WillEnterForeground(UIApplication application)
39+
{
40+
}
41+
42+
// This method is called when the application is about to terminate. Save data, if needed.
43+
public override void WillTerminate(UIApplication application)
44+
{
45+
}
46+
}
47+
}
48+
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
6+
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
7+
<ProjectGuid>{E6FB8A74-81D7-463C-A2E5-28D208324594}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>EAIntroView.Sample</RootNamespace>
10+
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
11+
<AssemblyName>EAIntroView.Sample</AssemblyName>
12+
</PropertyGroup>
13+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
14+
<DebugSymbols>true</DebugSymbols>
15+
<DebugType>full</DebugType>
16+
<Optimize>false</Optimize>
17+
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
18+
<DefineConstants>DEBUG;</DefineConstants>
19+
<ErrorReport>prompt</ErrorReport>
20+
<WarningLevel>4</WarningLevel>
21+
<ConsolePause>false</ConsolePause>
22+
<MtouchArch>i386</MtouchArch>
23+
<MtouchLink>None</MtouchLink>
24+
<MtouchDebug>true</MtouchDebug>
25+
<MtouchProfiling>true</MtouchProfiling>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
28+
<DebugType>full</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
<MtouchArch>i386</MtouchArch>
34+
<ConsolePause>false</ConsolePause>
35+
<MtouchLink>None</MtouchLink>
36+
</PropertyGroup>
37+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
38+
<DebugSymbols>true</DebugSymbols>
39+
<DebugType>full</DebugType>
40+
<Optimize>false</Optimize>
41+
<OutputPath>bin\iPhone\Debug</OutputPath>
42+
<DefineConstants>DEBUG;</DefineConstants>
43+
<ErrorReport>prompt</ErrorReport>
44+
<WarningLevel>4</WarningLevel>
45+
<ConsolePause>false</ConsolePause>
46+
<MtouchArch>ARMv7, ARM64</MtouchArch>
47+
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
48+
<MtouchProfiling>true</MtouchProfiling>
49+
<CodesignKey>iPhone Developer</CodesignKey>
50+
<MtouchDebug>true</MtouchDebug>
51+
</PropertyGroup>
52+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
53+
<DebugType>full</DebugType>
54+
<Optimize>true</Optimize>
55+
<OutputPath>bin\iPhone\Release</OutputPath>
56+
<ErrorReport>prompt</ErrorReport>
57+
<WarningLevel>4</WarningLevel>
58+
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
59+
<MtouchArch>ARMv7, ARM64</MtouchArch>
60+
<ConsolePause>false</ConsolePause>
61+
<CodesignKey>iPhone Developer</CodesignKey>
62+
</PropertyGroup>
63+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
64+
<DebugType>full</DebugType>
65+
<Optimize>true</Optimize>
66+
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
67+
<ErrorReport>prompt</ErrorReport>
68+
<WarningLevel>4</WarningLevel>
69+
<ConsolePause>false</ConsolePause>
70+
<MtouchArch>ARMv7, ARM64</MtouchArch>
71+
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
72+
<IpaIncludeArtwork>true</IpaIncludeArtwork>
73+
<CodesignKey>iPhone Distribution</CodesignKey>
74+
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
75+
<BuildIpa>true</BuildIpa>
76+
</PropertyGroup>
77+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
78+
<DebugType>full</DebugType>
79+
<Optimize>true</Optimize>
80+
<OutputPath>bin\iPhone\AppStore</OutputPath>
81+
<ErrorReport>prompt</ErrorReport>
82+
<WarningLevel>4</WarningLevel>
83+
<ConsolePause>false</ConsolePause>
84+
<MtouchArch>ARMv7, ARM64</MtouchArch>
85+
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
86+
<CodesignProvision>Automatic:AppStore</CodesignProvision>
87+
<CodesignKey>iPhone Distribution</CodesignKey>
88+
</PropertyGroup>
89+
<ItemGroup>
90+
<Reference Include="System" />
91+
<Reference Include="System.Xml" />
92+
<Reference Include="System.Core" />
93+
<Reference Include="Xamarin.iOS" />
94+
<Reference Include="Refractored.Xam.Settings">
95+
<HintPath>..\packages\Xam.Plugins.Settings.1.5.0\lib\Xamarin.iOS10\Refractored.Xam.Settings.dll</HintPath>
96+
</Reference>
97+
<Reference Include="Refractored.Xam.Settings.Abstractions">
98+
<HintPath>..\packages\Xam.Plugins.Settings.1.5.0\lib\Xamarin.iOS10\Refractored.Xam.Settings.Abstractions.dll</HintPath>
99+
</Reference>
100+
</ItemGroup>
101+
<ItemGroup>
102+
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json" />
103+
</ItemGroup>
104+
<ItemGroup>
105+
<InterfaceDefinition Include="Resources\LaunchScreen.xib" />
106+
<InterfaceDefinition Include="MainStoryboard.storyboard" />
107+
</ItemGroup>
108+
<ItemGroup>
109+
<None Include="Info.plist" />
110+
<None Include="Entitlements.plist" />
111+
<None Include="Properties\_SettingsStarted.txt" />
112+
<None Include="packages.config" />
113+
</ItemGroup>
114+
<ItemGroup>
115+
<Compile Include="Main.cs" />
116+
<Compile Include="AppDelegate.cs" />
117+
<Compile Include="EAIntroView.SampleViewController.cs" />
118+
<Compile Include="EAIntroView.SampleViewController.designer.cs">
119+
<DependentUpon>EAIntroView.SampleViewController.cs</DependentUpon>
120+
</Compile>
121+
</ItemGroup>
122+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
123+
<ItemGroup>
124+
<ProjectReference Include="..\EAIntroViewBinding\EAIntroViewBinding.csproj">
125+
<Project>{C8EAAE74-3F42-4656-9BD8-9A3E84191E5B}</Project>
126+
<Name>EAIntroViewBinding</Name>
127+
</ProjectReference>
128+
</ItemGroup>
129+
<ItemGroup>
130+
<BundleResource Include="Resources\Visual-Studio.jpg" />
131+
</ItemGroup>
132+
</Project>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
using System;
2+
using UIKit;
3+
using Refractored.Xam.Settings;
4+
using Refractored.Xam.Settings.Abstractions;
5+
using CoreGraphics;
6+
7+
namespace EAIntroView.Sample
8+
{
9+
public partial class EAIntroView_SampleViewController : UIViewController
10+
{
11+
public EAIntroView_SampleViewController(IntPtr handle)
12+
: base(handle)
13+
{
14+
}
15+
16+
/// <summary>
17+
/// App设置
18+
/// </summary>
19+
/// <value>The app settings.</value>
20+
private static ISettings AppSettings
21+
{
22+
get
23+
{
24+
return CrossSettings.Current;
25+
}
26+
}
27+
28+
public override void ViewDidLoad()
29+
{
30+
base.ViewDidLoad();
31+
32+
// Perform any additional setup after loading the view, typically from a nib.
33+
34+
//在主界面中添加一个UILabel用于区分
35+
var label = new UILabel(new CGRect(0, 200, 320, 60));
36+
label.Text = "这里是主界面哦~";
37+
label.TextAlignment = UITextAlignment.Center;
38+
label.Font = UIFont.SystemFontOfSize(40);
39+
this.View.AddSubview(label);
40+
41+
//通过Setting获取启动次数,当第一次启动的时候获取到的值为0
42+
var BootTimes = AppSettings.GetValueOrDefault<int>("BootTimes");
43+
44+
//第一个欢迎页面,我们在上面显示本次是第几次启动App
45+
EAIntroPage page1 = new EAIntroPage();
46+
page1.Title = "Page1";
47+
page1.Desc = "Hello World Page1 no Description";
48+
page1.BgColor = UIColor.Orange;
49+
50+
//在正常情况下我们可以通过判断BootTimes的值来决定是否显示欢迎界面
51+
if (BootTimes <= 0)
52+
{
53+
page1.Desc = "你是第一次启动哦~~~";
54+
BootTimes = 1;
55+
}
56+
else
57+
{
58+
page1.Desc = string.Format("本次是你第{0}次启动本程序", BootTimes);
59+
}
60+
EAIntroPage page2 = new EAIntroPage();
61+
page2.Title = "Page2";
62+
page2.Desc = "Hello World Page2 no Description";
63+
page2.BgColor = UIColor.Red;
64+
65+
EAIntroPage page3 = new EAIntroPage();
66+
page3.Title = "Page3";
67+
page3.Desc = "Hello World Page3 no Description";
68+
page3.BgImage = UIImage.FromBundle("Visual-Studio.jpg");
69+
70+
//欢迎界面
71+
EAIntroView introView = new EAIntroView(this.View.Frame, new []{ page1, page2, page3 });
72+
//显示欢迎界面
73+
introView.ShowInView(this.View);
74+
75+
//将启动次数增加1,并保存在配置文件中
76+
AppSettings.AddOrUpdateValue("BootTimes", ++BootTimes);
77+
}
78+
}
79+
}
80+

EAIntroView.Sample/EAIntroView.SampleViewController.designer.cs

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
</dict>
6+
</plist>

EAIntroView.Sample/Info.plist

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDisplayName</key>
6+
<string>EAIntroView.Sample</string>
7+
<key>CFBundleIdentifier</key>
8+
<string>com.your-company.EAIntroView.Sample</string>
9+
<key>CFBundleShortVersionString</key>
10+
<string>1.0</string>
11+
<key>CFBundleVersion</key>
12+
<string>1.0</string>
13+
<key>LSRequiresIPhoneOS</key>
14+
<true/>
15+
<key>MinimumOSVersion</key>
16+
<string>8.0</string>
17+
<key>UIDeviceFamily</key>
18+
<array>
19+
<integer>1</integer>
20+
</array>
21+
<key>UILaunchStoryboardName</key>
22+
<string>LaunchScreen</string>
23+
<key>UIMainStoryboardFile</key>
24+
<string>MainStoryboard</string>
25+
<key>UIRequiredDeviceCapabilities</key>
26+
<array>
27+
<string>armv7</string>
28+
</array>
29+
<key>UISupportedInterfaceOrientations</key>
30+
<array>
31+
<string>UIInterfaceOrientationPortrait</string>
32+
<string>UIInterfaceOrientationLandscapeLeft</string>
33+
<string>UIInterfaceOrientationLandscapeRight</string>
34+
</array>
35+
<key>XSAppIconAssets</key>
36+
<string>Resources/Images.xcassets/AppIcons.appiconset</string>
37+
</dict>
38+
</plist>

EAIntroView.Sample/Main.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
5+
using Foundation;
6+
using UIKit;
7+
8+
namespace EAIntroView.Sample
9+
{
10+
public class Application
11+
{
12+
// This is the main entry point of the application.
13+
static void Main(string[] args)
14+
{
15+
// if you want to use a different Application Delegate class from "AppDelegate"
16+
// you can specify it here.
17+
UIApplication.Main(args, null, "AppDelegate");
18+
}
19+
}
20+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676" />
5+
</dependencies>
6+
<scenes>
7+
<!--class Prefix:identifier View Controller-->
8+
<scene sceneID="ufC-wZ-h7g">
9+
<objects>
10+
<viewController id="vXZ-lx-hvc" customClass="EAIntroView_SampleViewController" sceneMemberID="viewController">
11+
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
12+
<rect key="frame" x="0.0" y="0.0" width="320" height="568" />
13+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES" />
14+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
15+
</view>
16+
</viewController>
17+
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder" />
18+
</objects>
19+
</scene>
20+
</scenes>
21+
<simulatedMetricsContainer key="defaultSimulatedMetrics">
22+
<simulatedStatusBarMetrics key="statusBar" />
23+
<simulatedOrientationMetrics key="orientation" />
24+
<simulatedScreenMetrics key="destination" type="retina4" />
25+
</simulatedMetricsContainer>
26+
</document>

0 commit comments

Comments
 (0)