1
- # oss-xamarin
2
- NativeCode Open Source Xamarin Mobile Packages
1
+ # [ Power to the people, Cos!] ( http://www.imdb.com/title/tt0105435/?ref_=nv_sr_1 )
2
+
3
+ Provide Material Design themes now for Xamarin.Forms apps natively without hacks! Check out the [ wiki] ( https://github.com/nativecode-dev/oss-xamarin/wiki ) for more information.
4
+
5
+ [ ![ TeamCity (simple build status)] ( https://img.shields.io/teamcity/http/nativecode.no-ip.org:90/s/xamarin_release.svg?style=flat-square&label=release )] ( http://nativecode.no-ip.org:90/viewType.html?buildTypeId=xamarin_release&guest=1 )
6
+ [ ![ TeamCity (simple build status)] ( https://img.shields.io/teamcity/http/nativecode.no-ip.org:90/s/xamarin_continuous.svg?style=flat-square&label=continuous )] ( http://nativecode.no-ip.org:90/viewType.html?buildTypeId=xamarin_continuous&guest=1 )
7
+
8
+ ## [ AppCompat] ( https://www.nuget.org/packages/NativeCode.Mobile.AppCompat/ ) [ ![ AppCompat] ( https://img.shields.io/nuget/v/NativeCode.Mobile.AppCompat.svg?style=flat-square&label=AppCompat )] ( https://www.nuget.org/packages/NativeCode.Mobile.AppCompat/ )
9
+
10
+ Simply install the NuGet package into your Android project.
11
+
12
+ ` Install-Package NativeCode.Mobile.AppCompat `
13
+
14
+ Once installed, you should replace your * FormsApplicationActivity* derived activities with * AppCompatFormsApplicationActivity* .
15
+
16
+ For instance:
17
+
18
+ ``` csharp
19
+ public class MainActivity : AppCompatFormsApplicationActivity
20
+ {
21
+ protected override void OnCreate (Bundle savedInstanceState )
22
+ {
23
+ base .OnCreate (savedInstanceState );
24
+
25
+ Forms .Init (this , savedInstanceState );
26
+
27
+ this .LoadApplication (new App ());
28
+ }
29
+ }
30
+ ```
31
+
32
+ You can then use the normal ` Forms.Init ` and ` LoadApplication ` methods to initialize your activities.
33
+
34
+ You should also set your ** Resources/values/styles.xml** to the following:
35
+ ``` xml
36
+ <?xml version =" 1.0" encoding =" utf-8" ?>
37
+
38
+ <resources >
39
+ <style name =" AppTheme.Base" parent =" Theme.AppCompat.Light.DarkActionBar" >
40
+ <item name =" android:windowDrawsSystemBarBackgrounds" >true</item >
41
+ <item name =" colorAccent" >#8BC34A</item >
42
+ <item name =" colorPrimary" >#03A9F4</item >
43
+ <item name =" colorPrimaryDark" >#0288D1</item >
44
+ <item name =" drawerArrowStyle" >@style/DrawerArrowStyle</item >
45
+ <item name =" windowActionModeOverlay" >true</item >
46
+ </style >
47
+
48
+ <style name =" AppTheme" parent =" AppTheme.Base" >
49
+ </style >
50
+
51
+ <style name =" DrawerArrowStyle" parent =" Widget.AppCompat.DrawerArrowToggle" >
52
+ <item name =" spinBars" >true</item >
53
+ <item name =" color" >@android:color/white</item >
54
+ </style >
55
+ </resources >
56
+ ```
57
+
58
+ And also set ** Resources/values-v21/styles.xml** to:
59
+ ``` xml
60
+ <?xml version =" 1.0" encoding =" utf-8" ?>
61
+
62
+ <resources >
63
+ <style name =" AppTheme" parent =" AppTheme.Base" >
64
+ <item name =" android:windowAllowEnterTransitionOverlap" >true</item >
65
+ <item name =" android:windowAllowReturnTransitionOverlap" >true</item >
66
+ <item name =" android:windowContentTransitions" >true</item >
67
+ <item name =" android:windowSharedElementEnterTransition" >@android:transition/move</item >
68
+ <item name =" android:windowSharedElementExitTransition" >@android:transition/move</item >
69
+ </style >
70
+ </resources >
71
+ ```
72
+
73
+ ## [ AppCompat Controls] ( https://www.nuget.org/packages/NativeCode.Mobile.AppCompat.Controls/ ) [ ![ AppCompat.Controls] ( https://img.shields.io/nuget/v/NativeCode.Mobile.AppCompat.Controls.svg?style=flat-square&label=AppCompat.Controls )] ( https://www.nuget.org/packages/NativeCode.Mobile.AppCompat.Controls/ )
74
+
75
+ Simply install the NuGet package into your PCL project that contains your UI.
76
+ NOTE: You must install the Renderers package into your Android project.
77
+
78
+ ` Install-Package NativeCode.Mobile.AppCompat.Controls `
79
+
80
+ ### Available controls
81
+ - FloatingButton ([ FloatingActionButton] ( https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html ) )
82
+ - IUserNotifier ([ Snackbar] ( https://developer.android.com/reference/android/support/design/widget/Snackbar.html ) )
83
+
84
+ ## [ AppCompat Renderers] ( https://www.nuget.org/packages/NativeCode.Mobile.AppCompat.Renderers/ ) [ ![ AppCompat.Renderers] ( https://img.shields.io/nuget/v/NativeCode.Mobile.AppCompat.Renderers.svg?style=flat-square&label=AppCompat.Renderers )] ( https://www.nuget.org/packages/NativeCode.Mobile.AppCompat.Renderers/ )
85
+
86
+ Simply install the NuGet package into your Android project.
87
+
88
+ ` Install-Package NativeCode.Mobile.AppCompat.Renderers `
89
+
90
+ Once installed, you will have to call ` AppCompatRenderers.EnableAll ` inside your OnCreate, after ` Forms.Init ` is called. This will register all of the AppCompat renderers to replace existing Xamarin.Forms renderers.
91
+
92
+ ``` csharp
93
+ public class MainActivity : AppCompatFormsApplicationActivity
94
+ {
95
+ protected override void OnCreate (Bundle savedInstanceState )
96
+ {
97
+ base .OnCreate (savedInstanceState );
98
+
99
+ Forms .Init (this , savedInstanceState );
100
+ AppCompatRenderers .EnableAll ();
101
+
102
+ this .LoadApplication (new App ());
103
+ }
104
+ }
105
+ ```
106
+
107
+
108
+ ### Current Renderers
109
+ - Button ([ AppCompatButton] ( http://developer.android.com/reference/android/support/v7/widget/AppCompatButton.html ) )
110
+ - Entry ([ AppCompatEditText] ( http://developer.android.com/reference/android/support/v7/widget/AppCompatEditText.html ) )
111
+ - Switch ([ SwitchCompat] ( http://developer.android.com/reference/android/support/v7/widget/SwitchCompat.html ) )
112
+ - MasterDetailPage
113
+
114
+ ## Devices Tested
115
+
116
+ ### Phones
117
+ - Nexus 5 (emulator)
118
+ - Samsung Galaxy S6
119
+
120
+ ### Tablets
121
+ - Samsung Tab 7
122
+ - Nexus 7
123
+
124
+ ## Screenshots
125
+
126
+ ![ screenshot] ( screenshots/screenshot.png )
127
+ ![ screenshot-masterdetail] ( screenshots/screenshot-masterdetail.png )
128
+ ![ screenshot-snackbar] ( screenshots/screenshot-snackbar.png )
129
+ ![ screenshot-moreactions] ( screenshots/screenshot-moreactions.png )
130
+ ![ movie-actionbardrawertoggle] ( screenshots/movie-actionbardrawertoggle.gif )
3
131
4
132
### LICENSE
5
133
```
@@ -9,7 +137,7 @@ NativeCode Open Source Xamarin Mobile Packages
9
137
you may not use this file except in compliance with the License.
10
138
You may obtain a copy of the License at
11
139
12
- http://www.apache.org/licenses/LICENSE-2.0
140
+ [ http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
13
141
14
142
Unless required by applicable law or agreed to in writing, software
15
143
distributed under the License is distributed on an "AS IS" BASIS,
0 commit comments