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

Update to XF3.5 and start to refactor out BindableLayout :) #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Suppress: EC112
# top-most EditorConfig file
root = true

# Don't use tabs for indentation.
[*]
indent_style = space
# (Please don't specify an indent_size here; that has too many unintended consequences.)

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4

# Code files
[*.sln]
indent_size = 4

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# JSON files
[*.json]
indent_size = 2

# XML files
[*.xml]
indent_size = 2

# Dotnet code style settings:
[*.{cs,vb}]
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
dotnet_style_require_accessibility_modifiers = omit_if_default:warning

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

# Naming Conventions:
# Pascal Casing
dotnet_naming_symbols.method_and_property_symbols.applicable_kinds= method,property,enum
dotnet_naming_symbols.method_and_property_symbols.applicable_accessibilities = *
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

dotnet_naming_rule.methods_and_properties_must_be_pascal_case.severity = warning
dotnet_naming_rule.methods_and_properties_must_be_pascal_case.symbols = method_and_property_symbols
dotnet_naming_rule.methods_and_properties_must_be_pascal_case.style = pascal_case_style

# Non-public members must be lower-case
dotnet_naming_symbols.non_public_symbols.applicable_kinds = field
dotnet_naming_symbols.non_public_symbols.applicable_accessibilities = private
dotnet_naming_style.all_lower_case_style.capitalization = camel_case

dotnet_naming_rule.non_public_members_must_be_lower_case.severity = warning
dotnet_naming_rule.non_public_members_must_be_lower_case.symbols = non_public_symbols
dotnet_naming_rule.non_public_members_must_be_lower_case.style = all_lower_case_style

# CSharp code style settings:
[*.cs]
# Do not prefer "var" everywhere
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = true:error

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = true:suggestion
csharp_style_expression_bodied_constructors = true:suggestion
csharp_style_expression_bodied_operators = true:suggestion

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

83 changes: 42 additions & 41 deletions src/Conference.Android/Conference.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidApplication>True</AndroidApplication>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
Expand Down Expand Up @@ -115,6 +115,7 @@
<Reference Include="System.Web.Services" />
</ItemGroup>
<ItemGroup>
<Compile Include="Effects\RippleEffect.cs" />
<Compile Include="MainActivity.cs" />
<Compile Include="Notifications\ConferenceGcmListenerService.cs" />
<Compile Include="Notifications\ConferenceInstanceIDListenerService.cs" />
Expand All @@ -134,7 +135,7 @@
<Compile Include="Renderers\ConferenceSearchBarRenderer.cs" />
<Compile Include="Backgrounding\DataRefreshService.cs" />
<Compile Include="Backgrounding\DataRefreshServiceBinder.cs" />
<Compile Include="Helpers\ListViewSelectionOnTopEffect.cs" />
<Compile Include="Effects\ListViewSelectionOnTopEffect.cs" />
</ItemGroup>
<ItemGroup>
<ProguardConfiguration Include="proguard.cfg" />
Expand Down Expand Up @@ -377,20 +378,26 @@
<PackageReference Include="FormsToolkit">
<Version>2.0.1</Version>
</PackageReference>
<PackageReference Include="glidex">
<Version>1.0.3</Version>
</PackageReference>
<PackageReference Include="glidex.forms">
<Version>1.0.3</Version>
</PackageReference>
<PackageReference Include="Humanizer">
<Version>2.5.16</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter">
<Version>1.11.0</Version>
<Version>1.13.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Analytics">
<Version>1.11.0</Version>
<Version>1.13.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Crashes">
<Version>1.11.0</Version>
<Version>1.13.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Distribute">
<Version>1.11.0</Version>
<Version>1.13.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Azure.Mobile.Client.SQLiteStore">
<Version>4.0.2</Version>
Expand All @@ -399,7 +406,7 @@
<Version>12.0.1</Version>
</PackageReference>
<PackageReference Include="NodaTime">
<Version>2.4.2</Version>
<Version>2.4.4</Version>
</PackageReference>
<PackageReference Include="Plugin.Permissions">
<Version>3.0.0.12</Version>
Expand All @@ -414,55 +421,49 @@
<Version>2.2.3</Version>
</PackageReference>
<PackageReference Include="SQLitePCLRaw.bundle_green">
<Version>1.1.11</Version>
</PackageReference>
<PackageReference Include="Square.Picasso">
<Version>2.5.2.1</Version>
</PackageReference>
<PackageReference Include="Xam.Plugin.ExternalMaps">
<Version>4.0.1</Version>
<Version>1.1.13</Version>
</PackageReference>
<PackageReference Include="Xam.Plugins.Forms.ImageCircle">
<Version>3.0.0.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Animated.Vector.Drawable" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Annotations" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Compat" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Core.UI" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Fragment" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Media.Compat" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Transition" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.Palette" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.RecyclerView" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Vector.Drawable" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Animated.Vector.Drawable" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Annotations" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Compat" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Core.UI" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Fragment" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Media.Compat" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Transition" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.Palette" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.RecyclerView" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Vector.Drawable" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Azure.NotificationHubs.Android">
<Version>0.5.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Build.Download">
<Version>0.4.9</Version>
<Version>0.4.11</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials">
<Version>0.8.0-preview</Version>
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms">
<Version>3.4.0.1008975</Version>
<Version>3.5.0.129452</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms.Maps">
<Version>3.4.0.1008975</Version>
<Version>3.5.0.129452</Version>
</PackageReference>
<PackageReference Include="Xamarin.GooglePlayServices.Base" Version="42.1021.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Basement" Version="42.1021.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Gcm" Version="42.1021.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Iid" Version="42.1021.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Maps" Version="42.1021.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Tasks" Version="42.1021.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Base" Version="60.1142.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Basement" Version="60.1142.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Gcm" Version="60.1142.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Iid" Version="60.1142.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Maps" Version="60.1142.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Tasks" Version="60.1142.1" />
<PackageReference Include="ZXing.Net.Mobile">
<Version>2.4.1</Version>
</PackageReference>
Expand Down
42 changes: 42 additions & 0 deletions src/Conference.Android/Effects/RippleEffect.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using Android.Widget;
using Conference.Droid;
using Android.Util;

[assembly: ExportEffect(typeof(RippleEffect), "RippleEffect")]
namespace Conference.Droid
{
public class RippleEffect : PlatformEffect
{
protected override void OnAttached()
{
try
{
if (Container is Android.Views.View view)
{
view.Clickable = true;
view.Focusable = true;

using (var outValue = new TypedValue())
{
view.Context.Theme.ResolveAttribute(Android.Resource.Attribute.SelectableItemBackground, outValue, true);
view.SetBackgroundResource(outValue.ResourceId);
}

}
}
catch (Exception ex)
{

}
}

protected override void OnDetached()
{

}
}
}

4 changes: 2 additions & 2 deletions src/Conference.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected override void OnCreate (Bundle savedInstanceState)
typeof (Color).GetProperty ("Accent", BindingFlags.Public | BindingFlags.Static).SetValue (null, Color.FromHex ("#757575"));

ImageCircle.Forms.Plugin.Droid.ImageCircleRenderer.Init ();

Android.Glide.Forms.Init();
ZXing.Net.Mobile.Forms.Android.Platform.Init ();
#if ENABLE_TEST_CLOUD
//Mapping StyleID to element content descriptions
Expand Down Expand Up @@ -130,7 +130,7 @@ private void RegisterWithGCM()

public bool IsPlayServicesAvailable ()
{
int resultCode = GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable (this);
var resultCode = GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable (this);
if (resultCode != ConnectionResult.Success)
{
if (GoogleApiAvailability.Instance.IsUserResolvableError(resultCode))
Expand Down
2 changes: 1 addition & 1 deletion src/Conference.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="51" android:versionName="1.0.50" package="com.sample.conference" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
Expand Down
4 changes: 2 additions & 2 deletions src/Conference.Android/Renderers/ImageCellEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ protected override Android.Views.View GetCellCore(Cell item, Android.Views.View
layoutParams.Height = ViewGroup.LayoutParams.WrapContent;
layoutParams.Width = ViewGroup.LayoutParams.WrapContent;

int px12 = (int)TypedValue.ApplyDimension(
var px12 = (int)TypedValue.ApplyDimension(
ComplexUnitType.Dip,
12f,
context.Resources.DisplayMetrics
);

int px8 = (int)TypedValue.ApplyDimension(
var px8 = (int)TypedValue.ApplyDimension(
ComplexUnitType.Dip,
8f,
context.Resources.DisplayMetrics
Expand Down
11 changes: 6 additions & 5 deletions src/Conference.Android/Renderers/NavigationViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
using Android.Widget;
using FormsToolkit;
using Android.Views;
using Square.Picasso;

[assembly: ExportRenderer (typeof(Conference.Clients.UI.NavigationView), typeof(NavigationViewRenderer))]
namespace Conference.Droid
{
#pragma warning disable CS0618 // Type or member is obsolete
public class NavigationViewRenderer : ViewRenderer<Conference.Clients.UI.NavigationView, NavigationView>
{
NavigationView navView;
Expand Down Expand Up @@ -73,9 +73,9 @@ void UpdateName()

void UpdateImage()
{
Picasso.With(Forms.Context)
Android.Glide.Glide.With(Forms.Context)
.Load(Settings.Current.UserAvatar)
.Error(Resource.Drawable.profile_generic)
//.Error(Resource.Drawable.profile_generic)
.Into(profileImage);

}
Expand All @@ -100,7 +100,7 @@ void NavView_NavigationItemSelected (object sender, NavigationView.NavigationIte

previousItem = e.MenuItem;

int id = 0;
var id = 0;
switch (e.MenuItem.ItemId)
{
case Resource.Id.nav_feed:
Expand Down Expand Up @@ -141,7 +141,8 @@ void NavView_NavigationItemSelected (object sender, NavigationView.NavigationIte
});
}


}
#pragma warning restore CS0618 // Type or member is obsolete
}

Loading