├── art
└── nugeticon.png
├── screenshots
├── image1.jpg
├── image2.jpg
├── image3.jpg
├── image4.jpg
├── image5.jpg
└── image6.jpg
├── Sample
├── Resources
│ ├── drawable-hdpi
│ │ └── icon.jpg
│ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ ├── background.jpg
│ │ ├── perm_group_accounts.png
│ │ ├── perm_group_calendar.png
│ │ ├── perm_group_messages.png
│ │ ├── perm_group_microphone.png
│ │ ├── perm_group_phone_calls.png
│ │ ├── perm_group_system_clock.png
│ │ ├── perm_group_system_tools.png
│ │ └── perm_group_user_dictionary.png
│ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ ├── drawable-v21
│ │ └── list_selector.xml
│ ├── anim
│ │ └── bs_list_layout_fade_in.xml
│ ├── menu
│ │ ├── noicon.xml
│ │ ├── list.xml
│ │ └── longlist.xml
│ ├── values-v19
│ │ └── styles.xml
│ ├── values
│ │ ├── strings.xml
│ │ └── styles.xml
│ ├── drawable
│ │ └── list_selector.xml
│ ├── layout
│ │ ├── Main.axml
│ │ └── bs_custom_header.axml
│ └── AboutResources.txt
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── packages.config
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
├── BottomSheetListActivity.cs
├── Sample.csproj
└── Fragments
│ └── BottomSheetFragment.cs
├── BottomSheet-Xamarin.Android
├── Jars
│ ├── bottomsheet-1.3.0.aar
│ └── AboutJars.txt
├── packages.config
├── Transforms
│ ├── EnumMethods.xml
│ ├── EnumFields.xml
│ └── Metadata.xml
├── Properties
│ └── AssemblyInfo.cs
├── Additions
│ └── AboutAdditions.txt
└── BottomSheet-Xamarin.Android.csproj
├── .gitignore
├── README.md
├── BottomSheet-Xamarin.Android.nuspec
├── BottomSheet-Xamarin.Android.sln
└── LICENSE.md
/art/nugeticon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/art/nugeticon.png
--------------------------------------------------------------------------------
/screenshots/image1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/screenshots/image1.jpg
--------------------------------------------------------------------------------
/screenshots/image2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/screenshots/image2.jpg
--------------------------------------------------------------------------------
/screenshots/image3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/screenshots/image3.jpg
--------------------------------------------------------------------------------
/screenshots/image4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/screenshots/image4.jpg
--------------------------------------------------------------------------------
/screenshots/image5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/screenshots/image5.jpg
--------------------------------------------------------------------------------
/screenshots/image6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/screenshots/image6.jpg
--------------------------------------------------------------------------------
/Sample/Resources/drawable-hdpi/icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-hdpi/icon.jpg
--------------------------------------------------------------------------------
/Sample/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/background.jpg
--------------------------------------------------------------------------------
/Sample/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/Jars/bottomsheet-1.3.0.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/BottomSheet-Xamarin.Android/Jars/bottomsheet-1.3.0.aar
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/perm_group_accounts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/perm_group_accounts.png
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/perm_group_calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/perm_group_calendar.png
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/perm_group_messages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/perm_group_messages.png
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/perm_group_microphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/perm_group_microphone.png
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/perm_group_phone_calls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/perm_group_phone_calls.png
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/perm_group_system_clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/perm_group_system_clock.png
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/perm_group_system_tools.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/perm_group_system_tools.png
--------------------------------------------------------------------------------
/Sample/Resources/drawable-xxhdpi/perm_group_user_dictionary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/HEAD/Sample/Resources/drawable-xxhdpi/perm_group_user_dictionary.png
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Sample/Resources/drawable-v21/list_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/Sample/Resources/anim/bs_list_layout_fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Sample/Resources/menu/noicon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Sample/Resources/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
--------------------------------------------------------------------------------
/Sample/Resources/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Share
4 | Upload
5 | Copy
6 | Print this page
7 | Call
8 | Help
9 | BottomSheet Sample
10 |
--------------------------------------------------------------------------------
/Sample/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Sample/Resources/drawable/list_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Sample/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #Autosave files
2 | *~
3 |
4 | #build
5 | [Oo]bj/
6 | [Bb]in/
7 | packages/
8 | TestResults/
9 |
10 | # globs
11 | Makefile.in
12 | *.DS_Store
13 | *.sln.cache
14 | *.suo
15 | *.cache
16 | *.pidb
17 | *.userprefs
18 | *.usertasks
19 | config.log
20 | config.make
21 | config.status
22 | aclocal.m4
23 | install-sh
24 | autom4te.cache/
25 | *.user
26 | *.tar.gz
27 | tarballs/
28 | test-results/
29 | Thumbs.db
30 |
31 | #Mac bundle stuff
32 | *.dmg
33 | *.app
34 |
35 | #resharper
36 | *_Resharper.*
37 | *.Resharper
38 |
39 | #dotCover
40 | *.dotCover
41 |
--------------------------------------------------------------------------------
/Sample/Resources/menu/list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Sample/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/Transforms/EnumMethods.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/Transforms/EnumFields.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 |
6 | [assembly: AssemblyTitle ("BottomSheet-Xamarin")]
7 | [assembly: AssemblyDescription ("Present a set of actions as a sheet of paper that slides up from the bottom edge of the screen.")]
8 | [assembly: AssemblyConfiguration ("")]
9 | [assembly: AssemblyCompany ("")]
10 | [assembly: AssemblyProduct ("A Xamarin binding library of the BottomSheet library by Kai Liao")]
11 | [assembly: AssemblyCopyright ("Fabio Nuno")]
12 | [assembly: AssemblyTrademark ("")]
13 | [assembly: AssemblyCulture ("")]
14 |
15 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
16 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
17 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
18 |
19 | [assembly: AssemblyVersion ("1.1.1.0")]
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Cocosw.BottomSheet for Xamarin.Android
2 |
3 | [](http://badge.fury.io/nu/Cocosw.BottomSheet.Xamarin.Android)
4 |
5 | This is a Java Library binding for the [Kai Liao BottomSheet](https://github.com/soarcn/BottomSheet) version **1.1.0**.
6 |
7 | ### Installation
8 | To add this binding to your Xamarin.Android project [use the NuGet package](https://www.nuget.org/packages/Cocosw.BottomSheet.Xamarin.Android/) :
9 |
10 | PM> Install-Package Cocosw.BottomSheet.Xamarin.Android
11 |
12 |
13 | ### Requirements
14 | The library works on Android 2.1+
15 |
16 | ## Screenshots
17 |      
18 |
19 | ## Credits
20 | Kai Liao for create its library [BottomSheet](https://github.com/soarcn/BottomSheet).
21 |
--------------------------------------------------------------------------------
/Sample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle("Sample")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Sikur")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("Sikur")]
14 | [assembly: AssemblyTrademark("Sikur")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
29 |
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Cocosw.BottomSheet.Xamarin.Android
5 | 1.1.1.0
6 | Cocosw.BottomSheet for Xamarin.Android
7 | Fabio Nuno
8 | Fabio Nuno
9 | https://github.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android
10 | https://github.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/blob/master/LICENSE.md
11 | https://raw.githubusercontent.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android/master/art/nugeticon.png
12 | false
13 | C# bindings for Cocosw BottomSheet library v1.1.0
14 |
15 | Supports Cocosw BottomSheet version 1.1.0;
16 |
17 | Copyright 2015
18 | BottomSheet, material, xamarin, xamarin android
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/Jars/AboutJars.txt:
--------------------------------------------------------------------------------
1 | This directory is for Android .jars.
2 |
3 | There are 4 types of jars that are supported:
4 |
5 | == Input Jar and Embedded Jar ==
6 |
7 | This is the jar that bindings should be generated for.
8 |
9 | For example, if you were binding the Google Maps library, this would
10 | be Google's "maps.jar".
11 |
12 | The difference between EmbeddedJar and InputJar is, EmbeddedJar is to be
13 | embedded in the resulting dll as EmbeddedResource, while InputJar is not.
14 | There are couple of reasons you wouldn't like to embed the target jar
15 | in your dll (the ones that could be internally loaded by
16 | feature e.g. maps.jar, or you cannot embed jars that are under some
17 | proprietary license).
18 |
19 | Set the build action for these jars in the properties page to "InputJar".
20 |
21 |
22 | == Reference Jar and Embedded Reference Jar ==
23 |
24 | These are jars that are referenced by the input jar. C# bindings will
25 | not be created for these jars. These jars will be used to resolve
26 | types used by the input jar.
27 |
28 | NOTE: Do not add "android.jar" as a reference jar. It will be added automatically
29 | based on the Target Framework selected.
30 |
31 | Set the build action for these jars in the properties page to "ReferenceJar".
32 |
33 | "EmbeddedJar" works like "ReferenceJar", but like "EmbeddedJar", it is
34 | embedded in your dll. But at application build time, they are not included
35 | in the final apk, like ReferenceJar files.
36 |
37 |
38 |
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BottomSheet-Xamarin.Android", "BottomSheet-Xamarin.Android\BottomSheet-Xamarin.Android.csproj", "{A843452F-ECD2-4F83-8357-F548B9106B64}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Sample\Sample.csproj", "{A393C424-854D-4C11-83F7-78D886CF3046}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {A393C424-854D-4C11-83F7-78D886CF3046}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {A393C424-854D-4C11-83F7-78D886CF3046}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {A393C424-854D-4C11-83F7-78D886CF3046}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {A393C424-854D-4C11-83F7-78D886CF3046}.Release|Any CPU.Build.0 = Release|Any CPU
18 | {A843452F-ECD2-4F83-8357-F548B9106B64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {A843452F-ECD2-4F83-8357-F548B9106B64}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {A843452F-ECD2-4F83-8357-F548B9106B64}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {A843452F-ECD2-4F83-8357-F548B9106B64}.Release|Any CPU.Build.0 = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(MonoDevelopProperties) = preSolution
24 | version = 1.1.0.0
25 | EndGlobalSection
26 | EndGlobal
27 |
--------------------------------------------------------------------------------
/Sample/Resources/layout/bs_custom_header.axml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
18 |
25 |
30 |
37 |
38 |
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/Additions/AboutAdditions.txt:
--------------------------------------------------------------------------------
1 | Additions allow you to add arbitrary C# to the generated classes
2 | before they are compiled. This can be helpful for providing convenience
3 | methods or adding pure C# classes.
4 |
5 | == Adding Methods to Generated Classes ==
6 |
7 | Let's say the library being bound has a Rectangle class with a constructor
8 | that takes an x and y position, and a width and length size. It will look like
9 | this:
10 |
11 | public partial class Rectangle
12 | {
13 | public Rectangle (int x, int y, int width, int height)
14 | {
15 | // JNI bindings
16 | }
17 | }
18 |
19 | Imagine we want to add a constructor to this class that takes a Point and
20 | Size structure instead of 4 ints. We can add a new file called Rectangle.cs
21 | with a partial class containing our new method:
22 |
23 | public partial class Rectangle
24 | {
25 | public Rectangle (Point location, Size size) :
26 | this (location.X, location.Y, size.Width, size.Height)
27 | {
28 | }
29 | }
30 |
31 | At compile time, the additions class will be added to the generated class
32 | and the final assembly will a Rectangle class with both constructors.
33 |
34 |
35 | == Adding C# Classes ==
36 |
37 | Another thing that can be done is adding fully C# managed classes to the
38 | generated library. In the above example, let's assume that there isn't a
39 | Point class available in Java or our library. The one we create doesn't need
40 | to interact with Java, so we'll create it like a normal class in C#.
41 |
42 | By adding a Point.cs file with this class, it will end up in the binding library:
43 |
44 | public class Point
45 | {
46 | public int X { get; set; }
47 | public int Y { get; set; }
48 | }
49 |
--------------------------------------------------------------------------------
/Sample/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/Sample/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content;
5 | using Android.Runtime;
6 | using Android.Views;
7 | using Android.Widget;
8 | using Android.OS;
9 |
10 | using Cocosw.BottomSheetActions;
11 | using Android.Support.V7.App;
12 |
13 | namespace BottomSheets.Sample
14 | {
15 | [Activity(Label = "BottomSheet Sample", MainLauncher = true)]
16 | public class MainActivity : AppCompatActivity
17 | {
18 | private ListView listView;
19 | private ArrayAdapter adapter;
20 |
21 | protected override void OnCreate(Bundle bundle)
22 | {
23 | base.OnCreate(bundle);
24 | SetContentView(Resource.Layout.Main);
25 |
26 | String[] items = new String[]{"From Xml", "Without Icon", "Dark Theme", "Grid", "Style", "Style from Theme", "ShareAction", "ShareAction Show All", "Menu Manipulate", "Header Layout"};
27 | this.adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Android.Resource.Id.Text1, items);
28 |
29 | this.listView = FindViewById(Resource.Id.listView);
30 | this.listView.Adapter = this.adapter;
31 | }
32 |
33 | protected override void OnResume()
34 | {
35 | base.OnResume();
36 | this.listView.ItemClick += ListView_ItemClick;
37 | }
38 |
39 | protected override void OnPause()
40 | {
41 | this.listView.ItemClick -= ListView_ItemClick;
42 | base.OnPause();
43 | }
44 |
45 | private void ListView_ItemClick (object sender, AdapterView.ItemClickEventArgs e)
46 | {
47 | Intent intent = new Intent(this, typeof(BottomSheetListActivity));
48 | intent.PutExtra("action", e.Position);
49 | intent.PutExtra("title", this.adapter.GetItem(e.Position));
50 | intent.PutExtra("style", (e.Position == 5));
51 | StartActivity(intent);
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/Sample/Resources/menu/longlist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Sample/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
12 |
13 |
24 |
25 |
29 |
30 |
43 |
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/BottomSheet-Xamarin.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {A843452F-ECD2-4F83-8357-F548B9106B64}
8 | Library
9 | Cocosw.BottomSheetActions
10 | Resources
11 | Assets
12 | False
13 | Cocosw.BottomSheet-Xamarin.Android
14 | v4.4
15 | 1.1.0.0
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug
22 | DEBUG;
23 | prompt
24 | 4
25 | None
26 | false
27 |
28 |
29 | true
30 | bin\Release
31 | prompt
32 | 4
33 | false
34 | false
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | ..\packages\Xamarin.Android.Support.v4.23.2.1\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/Sample/BottomSheetListActivity.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | using Android.App;
8 | using Android.Content;
9 | using Android.OS;
10 | using Android.Runtime;
11 | using Android.Views;
12 | using Android.Widget;
13 | using Android.Support.V7.App;
14 | using Cocosw.BottomSheetActions;
15 | using Android.Graphics.Drawables;
16 | using Android.Graphics;
17 | using Android.Support.V4.Graphics.Drawable;
18 |
19 |
20 | namespace BottomSheets.Sample
21 | {
22 | [Activity]
23 | public class BottomSheetListActivity : AppCompatActivity, AdapterView.IOnItemClickListener, IDialogInterfaceOnClickListener
24 | {
25 | private int action;
26 | private ArrayAdapter adapter;
27 | private int selectedPosition;
28 |
29 | protected override void OnCreate(Bundle bundle)
30 | {
31 | if (Intent.GetBooleanExtra("style", false))
32 | {
33 | this.SetTheme(Resource.Style.StyleTheme);
34 | }
35 |
36 | base.OnCreate(bundle);
37 | SetContentView(Resource.Layout.Main);
38 |
39 | SupportActionBar.SetDisplayHomeAsUpEnabled(true);
40 | SupportActionBar.SetDisplayShowHomeEnabled(true);
41 |
42 | this.Title = Intent.GetStringExtra("title");
43 | this.action = Intent.GetIntExtra("action", 0);
44 |
45 | String[] items = new String[]{"Miguel de Icaza", "Nat Friedman", "James Montemagno", "Joseph Hill", "Stephanie Schatz\n"};
46 |
47 | this.adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Android.Resource.Id.Text1, items);
48 | var listView = FindViewById(Resource.Id.listView);
49 | listView.Adapter = this.adapter;
50 | listView.OnItemClickListener = this;
51 |
52 | }
53 |
54 | public override bool OnOptionsItemSelected(IMenuItem item)
55 | {
56 | if (item.ItemId == Android.Resource.Id.Home)
57 | this.Finish();
58 |
59 | return base.OnOptionsItemSelected(item);
60 | }
61 |
62 | public void OnItemClick(AdapterView parent, View view, int position, long id)
63 | {
64 | this.selectedPosition = position;
65 | this.ShowBottomSheet(this.selectedPosition);
66 | }
67 |
68 | private void ShowBottomSheet(int position)
69 | {
70 | BottomSheetFragment fragment =
71 | BottomSheetFragment.NewInstance(this.action, this.adapter.GetItem(position));
72 |
73 | fragment.Show(this.SupportFragmentManager, "dialog");
74 |
75 | }
76 |
77 | public void OnClick(IDialogInterface dialog, int which)
78 | {
79 | string name = this.adapter.GetItem(this.selectedPosition);
80 | switch (which)
81 | {
82 | case Resource.Id.share:
83 | Toast.MakeText(this, "Share to " + name, ToastLength.Short).Show();
84 | break;
85 | case Resource.Id.upload:
86 | Toast.MakeText(this, "Upload for " + name, ToastLength.Short).Show();
87 | break;
88 | case Resource.Id.call:
89 | Toast.MakeText(this, "Call to " + name, ToastLength.Short).Show();
90 | break;
91 | case Resource.Id.help:
92 | Toast.MakeText(this, "Help me!", ToastLength.Short).Show();
93 | break;
94 | }
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/BottomSheet-Xamarin.Android/Transforms/Metadata.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Cocosw.BottomSheetActions
7 |
8 |
9 | attrs
10 | context
11 |
12 |
13 | context
14 | defStyleAttr
15 |
16 | icon
17 | iconRes
18 |
19 | limitRes
20 | listener
21 | listener
22 | listener
23 | menuRes
24 |
25 | id
26 | iconRes
27 | text
28 |
29 | id
30 | iconRes
31 | textRes
32 |
33 |
34 | id
35 | textRes
36 |
37 | id
38 | text
39 |
40 | textRes
41 | text
42 |
43 |
44 | cancel
45 |
46 |
47 |
48 | activity
49 | intent
50 |
--------------------------------------------------------------------------------
/Sample/Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {A393C424-854D-4C11-83F7-78D886CF3046}
8 | Library
9 | BottomSheets.Sample
10 | Assets
11 | Resources
12 | Resource
13 | Resources\Resource.designer.cs
14 | True
15 | True
16 | Sample
17 | Properties\AndroidManifest.xml
18 | 1.1.0.0
19 | v6.0
20 |
21 |
22 | true
23 | full
24 | false
25 | bin\Debug
26 | DEBUG;
27 | prompt
28 | 4
29 | None
30 | false
31 |
32 |
33 | full
34 | true
35 | bin\Release
36 | prompt
37 | 4
38 | false
39 | false
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | ..\packages\Xamarin.Android.Support.v4.23.2.1\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
48 |
49 |
50 | ..\packages\Xamarin.Android.Support.Vector.Drawable.23.2.1\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll
51 |
52 |
53 | ..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.2.1\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll
54 |
55 |
56 | ..\packages\Xamarin.Android.Support.v7.AppCompat.23.2.1\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | {A843452F-ECD2-4F83-8357-F548B9106B64}
119 | BottomSheet-Xamarin.Android
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/Sample/Fragments/BottomSheetFragment.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | using Android.App;
8 | using Android.Content;
9 | using Android.OS;
10 | using Android.Runtime;
11 | using Android.Util;
12 | using Android.Views;
13 | using Android.Widget;
14 | using Cocosw.BottomSheetActions;
15 | using Android.Graphics.Drawables;
16 | using Android.Graphics;
17 | using Android.Support.V4.Graphics.Drawable;
18 |
19 |
20 |
21 | namespace BottomSheets.Sample
22 | {
23 | public class BottomSheetFragment : Android.Support.V4.App.DialogFragment
24 | {
25 | private string name;
26 | private int action;
27 |
28 | public static BottomSheetFragment NewInstance(int action, string title)
29 | {
30 | BottomSheetFragment frag = new BottomSheetFragment();
31 | Bundle args = new Bundle();
32 | args.PutString("title", title);
33 | args.PutInt("action", action);
34 | frag.Arguments = args;
35 | return frag;
36 | }
37 |
38 | public override Dialog OnCreateDialog(Bundle savedInstanceState)
39 | {
40 | this.name = this.Arguments.GetString("title");
41 | this.action = this.Arguments.GetInt("action");
42 |
43 | switch (this.action)
44 | {
45 | default:
46 | case 0:
47 | return SheetFromXml();
48 | case 1:
49 | return SheetWithoutIcon();
50 | case 2:
51 | return SheetDarkTheme();
52 | case 3:
53 | return SheetGrid();
54 | case 4:
55 | return SheetStyle();
56 | case 5:
57 | return SheetStyleFromTheme();
58 | case 6:
59 | return SheetShareItem();
60 | case 7:
61 | return SheetShareItemShowAll();
62 | case 8:
63 | return SheetMenuManipulate();
64 | case 9:
65 | return SheetHeaderLayout();
66 | }
67 |
68 | }
69 |
70 |
71 | private BottomSheet SheetFromXml()
72 | {
73 | BottomSheet sheet = new BottomSheet.Builder(this.Activity)
74 | .Icon(this.GetRoundedBitmap(Resource.Drawable.icon))
75 | .Title(String.Format("To {0}", this.name))
76 | .Listener((IDialogInterfaceOnClickListener)this.Activity)
77 | .Sheet(Resource.Menu.list)
78 | .Build();
79 |
80 | return sheet;
81 | }
82 |
83 | private BottomSheet SheetWithoutIcon()
84 | {
85 | BottomSheet sheet = new BottomSheet.Builder(this.Activity)
86 | .Sheet(Resource.Menu.noicon)
87 | .Listener((IDialogInterfaceOnClickListener)this.Activity)
88 | .Build();
89 |
90 | return sheet;
91 | }
92 |
93 | private BottomSheet SheetDarkTheme()
94 | {
95 | BottomSheet sheet = new BottomSheet.Builder(this.Activity)
96 | .DarkTheme()
97 | .Title(String.Format("To {0}", this.name))
98 | .Sheet(Resource.Menu.list)
99 | .Listener((IDialogInterfaceOnClickListener)this.Activity)
100 | .Build();
101 |
102 | return sheet;
103 | }
104 |
105 | private BottomSheet SheetGrid()
106 | {
107 | BottomSheet sheet = new BottomSheet.Builder(this.Activity)
108 | .Sheet(Resource.Menu.list)
109 | .Listener((IDialogInterfaceOnClickListener)this.Activity)
110 | .Grid()
111 | .Build();
112 |
113 | return sheet;
114 | }
115 |
116 | private BottomSheet SheetStyle()
117 | {
118 | BottomSheet sheet = new BottomSheet.Builder(this.Activity, Resource.Style.BottomSheet_StyleDialog)
119 | .Title(String.Format("To {0}", this.name))
120 | .Sheet(Resource.Menu.list)
121 | .Listener((IDialogInterfaceOnClickListener)this.Activity)
122 | .Build();
123 |
124 | return sheet;
125 | }
126 |
127 | private BottomSheet SheetStyleFromTheme()
128 | {
129 | BottomSheet sheet = new BottomSheet.Builder(this.Activity)
130 | .Title(String.Format("To {0}", this.name))
131 | .Sheet(Resource.Menu.longlist)
132 | .Listener((IDialogInterfaceOnClickListener)this.Activity)
133 | .Limit(Resource.Integer.bs_initial_list_row)
134 | .Build();
135 |
136 | return sheet;
137 | }
138 |
139 | private BottomSheet SheetShareItem()
140 | {
141 | BottomSheet sheet = GetShareActions("Hello " + this.name)
142 | .Title("Share To " + this.name)
143 | .Build();
144 |
145 | return sheet;
146 | }
147 |
148 | private BottomSheet SheetShareItemShowAll()
149 | {
150 | BottomSheet sheet = GetShareActions("Hello " + this.name)
151 | .Title("Share To " + this.name)
152 | //Set initial number of actions which will be shown in current sheet.
153 | //* If more actions need to be shown, a "more" action will be displayed in the last position.
154 | .Limit(Resource.Integer.no_limit)
155 | .Build();
156 |
157 | return sheet;
158 | }
159 |
160 | private BottomSheet SheetMenuManipulate()
161 | {
162 | BottomSheet sheet = new BottomSheet.Builder(this.Activity)
163 | .Icon(this.GetRoundedBitmap(Resource.Drawable.icon))
164 | .Title(String.Format("To {0}", this.name))
165 | .Sheet(Resource.Menu.list)
166 | .Listener((IDialogInterfaceOnClickListener)this.Activity)
167 | .Build();
168 |
169 |
170 | IMenu menu = sheet.Menu;
171 | menu.GetItem(0).SetTitle("MenuClickListener");
172 | menu.GetItem(0).SetOnMenuItemClickListener(new MenuItemListener());
173 |
174 | menu.GetItem(1).SetVisible(false);
175 | menu.GetItem(2).SetEnabled(false);
176 | menu.Add(Menu.None, 23, Menu.None, "Fresh meal!");
177 |
178 | menu.FindItem(23).SetIcon(Resource.Drawable.perm_group_user_dictionary);
179 | menu.FindItem(23).SetOnMenuItemClickListener(new MenuItemListener());
180 | menu.SetGroupVisible(Android.Resource.Id.Empty, false);
181 |
182 | return sheet;
183 | }
184 |
185 | private BottomSheet SheetHeaderLayout()
186 | {
187 | BottomSheet sheet = new BottomSheet.Builder(this.Activity, Resource.Style.BottomSheet_CustomDialog)
188 | .Title(String.Format("To {0}", this.name))
189 | .Sheet(Resource.Menu.list)
190 | .Listener((IDialogInterfaceOnClickListener)this.Activity)
191 | .Build();
192 |
193 | sheet.ShowEvent += (object sender, EventArgs e) => {
194 | Toast.MakeText(this.Activity, "I'm showing", ToastLength.Short).Show();
195 | };
196 |
197 | sheet.DismissEvent += (object sender, EventArgs e) => {
198 | Toast.MakeText(this.Activity, "I'm dismissing", ToastLength.Short).Show();
199 | };
200 |
201 | return sheet;
202 | }
203 |
204 | private Drawable GetRoundedBitmap(int imageId)
205 | {
206 | Bitmap src = BitmapFactory.DecodeResource(this.Resources, imageId);
207 | Bitmap dst;
208 | if (src.Width >= src.Height) {
209 | dst = Bitmap.CreateBitmap(src, src.Width / 2 - src.Height / 2, 0, src.Height, src.Height);
210 | } else {
211 | dst = Bitmap.CreateBitmap(src, 0, src.Height / 2 - src.Width / 2, src.Width, src.Width);
212 | }
213 | RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.Create(this.Resources, dst);
214 | roundedBitmapDrawable.CornerRadius = (dst.Width / 2);
215 | roundedBitmapDrawable.SetAntiAlias(true);
216 | return roundedBitmapDrawable;
217 | }
218 |
219 | private BottomSheet.Builder GetShareActions(String text)
220 | {
221 | Intent shareIntent = new Intent(Intent.ActionSend);
222 | shareIntent.SetType("text/plain");
223 | shareIntent.PutExtra(Intent.ExtraText, text);
224 |
225 | return BottomSheetHelper.ShareAction(this.Activity, shareIntent);
226 | }
227 |
228 | private class MenuItemListener : Java.Lang.Object, IMenuItemOnMenuItemClickListener
229 | {
230 | public bool OnMenuItemClick(IMenuItem item)
231 | {
232 | string msg = string.Empty;
233 | if (item.ItemId == 23)
234 | msg = "Hello";
235 | else
236 | msg = "You can set OnMenuItemClickListener for each item";
237 |
238 | Toast.MakeText(Application.Context, msg, ToastLength.Short).Show();
239 | return true;
240 | }
241 | }
242 | }
243 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | ```
2 | -------------------------------------------------------------------------
3 | Apache License
4 | Version 2.0, January 2004
5 | http://www.apache.org/licenses/
6 |
7 |
8 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9 |
10 | 1. Definitions.
11 |
12 | "License" shall mean the terms and conditions for use, reproduction,
13 | and distribution as defined by Sections 1 through 9 of this document.
14 |
15 | "Licensor" shall mean the copyright owner or entity authorized by
16 | the copyright owner that is granting the License.
17 |
18 | "Legal Entity" shall mean the union of the acting entity and all
19 | other entities that control, are controlled by, or are under common
20 | control with that entity. For the purposes of this definition,
21 | "control" means (i) the power, direct or indirect, to cause the
22 | direction or management of such entity, whether by contract or
23 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
24 | outstanding shares, or (iii) beneficial ownership of such entity.
25 |
26 | "You" (or "Your") shall mean an individual or Legal Entity
27 | exercising permissions granted by this License.
28 |
29 | "Source" form shall mean the preferred form for making modifications,
30 | including but not limited to software source code, documentation
31 | source, and configuration files.
32 |
33 | "Object" form shall mean any form resulting from mechanical
34 | transformation or translation of a Source form, including but
35 | not limited to compiled object code, generated documentation,
36 | and conversions to other media types.
37 |
38 | "Work" shall mean the work of authorship, whether in Source or
39 | Object form, made available under the License, as indicated by a
40 | copyright notice that is included in or attached to the work
41 | (an example is provided in the Appendix below).
42 |
43 | "Derivative Works" shall mean any work, whether in Source or Object
44 | form, that is based on (or derived from) the Work and for which the
45 | editorial revisions, annotations, elaborations, or other modifications
46 | represent, as a whole, an original work of authorship. For the purposes
47 | of this License, Derivative Works shall not include works that remain
48 | separable from, or merely link (or bind by name) to the interfaces of,
49 | the Work and Derivative Works thereof.
50 |
51 | "Contribution" shall mean any work of authorship, including
52 | the original version of the Work and any modifications or additions
53 | to that Work or Derivative Works thereof, that is intentionally
54 | submitted to Licensor for inclusion in the Work by the copyright owner
55 | or by an individual or Legal Entity authorized to submit on behalf of
56 | the copyright owner. For the purposes of this definition, "submitted"
57 | means any form of electronic, verbal, or written communication sent
58 | to the Licensor or its representatives, including but not limited to
59 | communication on electronic mailing lists, source code control systems,
60 | and issue tracking systems that are managed by, or on behalf of, the
61 | Licensor for the purpose of discussing and improving the Work, but
62 | excluding communication that is conspicuously marked or otherwise
63 | designated in writing by the copyright owner as "Not a Contribution."
64 |
65 | "Contributor" shall mean Licensor and any individual or Legal Entity
66 | on behalf of whom a Contribution has been received by Licensor and
67 | subsequently incorporated within the Work.
68 |
69 | 2. Grant of Copyright License. Subject to the terms and conditions of
70 | this License, each Contributor hereby grants to You a perpetual,
71 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
72 | copyright license to reproduce, prepare Derivative Works of,
73 | publicly display, publicly perform, sublicense, and distribute the
74 | Work and such Derivative Works in Source or Object form.
75 |
76 | 3. Grant of Patent License. Subject to the terms and conditions of
77 | this License, each Contributor hereby grants to You a perpetual,
78 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
79 | (except as stated in this section) patent license to make, have made,
80 | use, offer to sell, sell, import, and otherwise transfer the Work,
81 | where such license applies only to those patent claims licensable
82 | by such Contributor that are necessarily infringed by their
83 | Contribution(s) alone or by combination of their Contribution(s)
84 | with the Work to which such Contribution(s) was submitted. If You
85 | institute patent litigation against any entity (including a
86 | cross-claim or counterclaim in a lawsuit) alleging that the Work
87 | or a Contribution incorporated within the Work constitutes direct
88 | or contributory patent infringement, then any patent licenses
89 | granted to You under this License for that Work shall terminate
90 | as of the date such litigation is filed.
91 |
92 | 4. Redistribution. You may reproduce and distribute copies of the
93 | Work or Derivative Works thereof in any medium, with or without
94 | modifications, and in Source or Object form, provided that You
95 | meet the following conditions:
96 |
97 | (a) You must give any other recipients of the Work or
98 | Derivative Works a copy of this License; and
99 |
100 | (b) You must cause any modified files to carry prominent notices
101 | stating that You changed the files; and
102 |
103 | (c) You must retain, in the Source form of any Derivative Works
104 | that You distribute, all copyright, patent, trademark, and
105 | attribution notices from the Source form of the Work,
106 | excluding those notices that do not pertain to any part of
107 | the Derivative Works; and
108 |
109 | (d) If the Work includes a "NOTICE" text file as part of its
110 | distribution, then any Derivative Works that You distribute must
111 | include a readable copy of the attribution notices contained
112 | within such NOTICE file, excluding those notices that do not
113 | pertain to any part of the Derivative Works, in at least one
114 | of the following places: within a NOTICE text file distributed
115 | as part of the Derivative Works; within the Source form or
116 | documentation, if provided along with the Derivative Works; or,
117 | within a display generated by the Derivative Works, if and
118 | wherever such third-party notices normally appear. The contents
119 | of the NOTICE file are for informational purposes only and
120 | do not modify the License. You may add Your own attribution
121 | notices within Derivative Works that You distribute, alongside
122 | or as an addendum to the NOTICE text from the Work, provided
123 | that such additional attribution notices cannot be construed
124 | as modifying the License.
125 |
126 | You may add Your own copyright statement to Your modifications and
127 | may provide additional or different license terms and conditions
128 | for use, reproduction, or distribution of Your modifications, or
129 | for any such Derivative Works as a whole, provided Your use,
130 | reproduction, and distribution of the Work otherwise complies with
131 | the conditions stated in this License.
132 |
133 | 5. Submission of Contributions. Unless You explicitly state otherwise,
134 | any Contribution intentionally submitted for inclusion in the Work
135 | by You to the Licensor shall be under the terms and conditions of
136 | this License, without any additional terms or conditions.
137 | Notwithstanding the above, nothing herein shall supersede or modify
138 | the terms of any separate license agreement you may have executed
139 | with Licensor regarding such Contributions.
140 |
141 | 6. Trademarks. This License does not grant permission to use the trade
142 | names, trademarks, service marks, or product names of the Licensor,
143 | except as required for reasonable and customary use in describing the
144 | origin of the Work and reproducing the content of the NOTICE file.
145 |
146 | 7. Disclaimer of Warranty. Unless required by applicable law or
147 | agreed to in writing, Licensor provides the Work (and each
148 | Contributor provides its Contributions) on an "AS IS" BASIS,
149 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
150 | implied, including, without limitation, any warranties or conditions
151 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152 | PARTICULAR PURPOSE. You are solely responsible for determining the
153 | appropriateness of using or redistributing the Work and assume any
154 | risks associated with Your exercise of permissions under this License.
155 |
156 | 8. Limitation of Liability. In no event and under no legal theory,
157 | whether in tort (including negligence), contract, or otherwise,
158 | unless required by applicable law (such as deliberate and grossly
159 | negligent acts) or agreed to in writing, shall any Contributor be
160 | liable to You for damages, including any direct, indirect, special,
161 | incidental, or consequential damages of any character arising as a
162 | result of this License or out of the use or inability to use the
163 | Work (including but not limited to damages for loss of goodwill,
164 | work stoppage, computer failure or malfunction, or any and all
165 | other commercial damages or losses), even if such Contributor
166 | has been advised of the possibility of such damages.
167 |
168 | 9. Accepting Warranty or Additional Liability. While redistributing
169 | the Work or Derivative Works thereof, You may choose to offer,
170 | and charge a fee for, acceptance of support, warranty, indemnity,
171 | or other liability obligations and/or rights consistent with this
172 | License. However, in accepting such obligations, You may act only
173 | on Your own behalf and on Your sole responsibility, not on behalf
174 | of any other Contributor, and only if You agree to indemnify,
175 | defend, and hold each Contributor harmless for any liability
176 | incurred by, or claims asserted against, such Contributor by reason
177 | of your accepting any such warranty or additional liability.
178 |
179 | END OF TERMS AND CONDITIONS
180 | ```
--------------------------------------------------------------------------------