Skip to content
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
3 changes: 1 addition & 2 deletions VisualChallenge.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualChallenge.Android", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualChallenge.iOS", "VisualChallenge\VisualChallenge.iOS\VisualChallenge.iOS.csproj", "{728A2889-2E6F-4B3D-B2AC-57151FF2BC0F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualChallenge", "VisualChallenge\VisualChallenge\VisualChallenge.csproj", "{DF343C5B-66F1-4EF5-B721-6246D8F1DC39}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualChallenge", "VisualChallenge\VisualChallenge\VisualChallenge.csproj", "{DF343C5B-66F1-4EF5-B721-6246D8F1DC39}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -38,7 +38,6 @@ Global
{164F8568-3F55-464E-BF3F-43E085FB0BEF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{164F8568-3F55-464E-BF3F-43E085FB0BEF}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
{728A2889-2E6F-4B3D-B2AC-57151FF2BC0F}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{728A2889-2E6F-4B3D-B2AC-57151FF2BC0F}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{728A2889-2E6F-4B3D-B2AC-57151FF2BC0F}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator
{728A2889-2E6F-4B3D-B2AC-57151FF2BC0F}.Debug|iPhone.ActiveCfg = Debug|iPhone
{728A2889-2E6F-4B3D-B2AC-57151FF2BC0F}.Debug|iPhone.Build.0 = Debug|iPhone
Expand Down
47 changes: 47 additions & 0 deletions VisualChallenge/VisualChallenge.Android/BorderlessEffectDroid.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System.ComponentModel;
using Android.Widget;
using VisualChallenge.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ResolutionGroupName("companyname")]
[assembly: ExportEffect(typeof(BorderlessEffectDroid), "BorderlessSearchEffect")]
namespace VisualChallenge.Droid
{
public class BorderlessEffectDroid : PlatformEffect
{
protected override void OnAttached()
{
UpdateHasBorder();
}

protected override void OnDetached()
{

}

protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
{
base.OnElementPropertyChanged(args);

if (args.PropertyName == BorderlessEffect.HasBorderProperty.PropertyName)
UpdateHasBorder();
}

private void UpdateHasBorder()
{
var searchbar = Control as SearchView;
if (searchbar == null)
return;

var bHasBorder = (bool)Element.GetValue(BorderlessEffect.HasBorderProperty);

if (!bHasBorder)
{
int searchPlateId = searchbar.Context.Resources.GetIdentifier("android:id/search_plate", null, null);
Android.Views.View searchPlateView = searchbar.FindViewById(searchPlateId);
searchPlateView.SetBackgroundColor(Android.Graphics.Color.Transparent);
}
}
}
}
4 changes: 3 additions & 1 deletion VisualChallenge/VisualChallenge.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Android.Views;
using Android.Widget;
using Android.OS;
using ImageCircle.Forms.Plugin.Droid;

namespace VisualChallenge.Droid
{
Expand All @@ -24,7 +25,8 @@ protected override void OnCreate(Bundle savedInstanceState)
global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
global::Xamarin.Forms.FormsMaterial.Init(this, savedInstanceState);
LoadApplication(new App());
ImageCircleRenderer.Init();
LoadApplication(new App());
}
}
}
Loading