Skip to content

Commit

Permalink
Merge pull request #97 from Baseflow/feature/improvements
Browse files Browse the repository at this point in the history
Renamed the Chameleon.Android project
  • Loading branch information
martijn00 authored Nov 22, 2019
2 parents f134f13 + a53f182 commit fb19460
Show file tree
Hide file tree
Showing 299 changed files with 45 additions and 48 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
<OutputType>Library</OutputType>
<RootNamespace>Chameleon.Android</RootNamespace>
<AssemblyName>Chameleon.Android</AssemblyName>
<RootNamespace>Chameleon.Droid</RootNamespace>
<AssemblyName>Chameleon.Droid</AssemblyName>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
Expand Down Expand Up @@ -37,9 +37,7 @@
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<AndroidLinkMode>None</AndroidLinkMode>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<BundleAssemblies>false</BundleAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -58,8 +56,6 @@
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot>
<AndroidPackageFormat>aab</AndroidPackageFormat>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<BundleAssemblies>false</BundleAssemblies>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
Expand Down Expand Up @@ -146,7 +142,6 @@
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Tabbar.axml" />
<AndroidResource Include="Resources\layout\Toolbar.axml" />
<AndroidResource Include="Resources\values\styles.xml" />
<AndroidResource Include="Resources\values\colors.xml" />
Expand Down Expand Up @@ -1640,6 +1635,7 @@
<Generator>
</Generator>
</AndroidResource>
<AndroidResource Include="Resources\layout\Tabbar.axml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\xml\file_paths.xml">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.ComponentModel;
using Android.Content;
using Android.Graphics.Drawables;
using Chameleon.Android.CustomRenderers;
using Chameleon.Droid.CustomRenderers;
using Chameleon.Core;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ExportRenderer(typeof(ColoredTableView), typeof(ColoredTableViewRenderer))]
namespace Chameleon.Android.CustomRenderers
namespace Chameleon.Droid.CustomRenderers
{
public class ColoredTableViewRenderer : TableViewRenderer
{
Expand All @@ -21,7 +21,7 @@ protected override void OnElementChanged(ElementChangedEventArgs<TableView> e)
if (Control == null)
return;

var listView = Control as global::Android.Widget.ListView;
var listView = Control as Android.Widget.ListView;
var coloredTableView = (ColoredTableView)Element;

listView.Divider.SetTint(Color.Transparent.GetHashCode());
Expand All @@ -35,7 +35,7 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == "SeparatorColor")
{
var listView = Control as global::Android.Widget.ListView;
var listView = Control as Android.Widget.ListView;
var coloredTableView = (ColoredTableView)Element;

listView.Divider.SetTint(Color.Transparent.GetHashCode());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Android.Content;
using Android.Widget;
using Chameleon.Android.CustomRenderers;
using Chameleon.Droid.CustomRenderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ExportRenderer(typeof(SearchBar), typeof(MySearchBarRenderer))]
namespace Chameleon.Android.CustomRenderers
namespace Chameleon.Droid.CustomRenderers
{
public class MySearchBarRenderer : SearchBarRenderer
{
Expand All @@ -17,15 +17,15 @@ protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
{
base.OnElementChanged(e);

SearchView searchView = (base.Control as SearchView);
var searchView = Control as SearchView;

int textViewId = searchView.Context.Resources.GetIdentifier("android:id/search_src_text", null, null);
EditText textView = (searchView.FindViewById(textViewId) as EditText);
var textViewId = searchView.Context.Resources.GetIdentifier("android:id/search_src_text", null, null);
var textView = (searchView.FindViewById(textViewId) as EditText);
if (textView != null)
{
int searchMagIcon = searchView.Context.Resources.GetIdentifier("android:id/search_mag_icon", null, null);
ImageView magIcon = (ImageView)searchView.FindViewById(searchMagIcon);
magIcon.SetColorFilter(global::Android.Graphics.Color.Rgb(255, 255, 255));
var searchMagIcon = searchView.Context.Resources.GetIdentifier("android:id/search_mag_icon", null, null);
var magIcon = (ImageView)searchView.FindViewById(searchMagIcon);
magIcon.SetColorFilter(Android.Graphics.Color.Rgb(255, 255, 255));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using System.Linq;
using Android.Util;
using Chameleon.Android.Effects;
using Chameleon.Droid.Effects;
using Chameleon.Core.Effects;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ResolutionGroupName("Chameleon")]
[assembly: ExportEffect(typeof(AndroidTransparentSelectableEffect), nameof(TransparentSelectableEffect))]
namespace Chameleon.Android.Effects
namespace Chameleon.Droid.Effects
{
public class AndroidTransparentSelectableEffect : PlatformEffect
{
Expand All @@ -19,16 +19,15 @@ protected override void OnAttached()
var effect = (TransparentSelectableEffect)Element.Effects.FirstOrDefault(e => e is TransparentSelectableEffect);
int resid = 0;
if (effect != null && effect.Borderless)
resid = global::Android.Resource.Attribute.SelectableItemBackgroundBorderless;
resid = Android.Resource.Attribute.SelectableItemBackgroundBorderless;
else
resid = global::Android.Resource.Attribute.SelectableItemBackground;
resid = Android.Resource.Attribute.SelectableItemBackground;

var value = new TypedValue();
global::Android.App.Application.Context.Theme.ResolveAttribute(resid, value, true);
Android.App.Application.Context.Theme.ResolveAttribute(resid, value, true);

if (Control != null)
Control.SetBackgroundResource(value.ResourceId);
//else if (Container != null)
// Container.Foreground = ContextCompat.GetDrawable(Container.Context, value.ResourceId); // SetBackgroundResource(value.ResourceId);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System.Windows.Input;
using Android.App;
using Android.Runtime;
using Android.Support.Design.Internal;
using Android.Support.Design.Widget;
using Android.Support.V7.Widget;
using Android.Views;
using Android.Widget;
using MvvmCross.Binding.BindingContext;
Expand All @@ -14,7 +16,7 @@
using MvvmCross.Navigation;
using MvvmCross.ViewModels;

namespace Chameleon.Android
namespace Chameleon.Droid
{
// This class is never actually executed, but when Xamarin linking is enabled it does how to ensure types and properties
// are preserved in the deployed app
Expand Down Expand Up @@ -140,14 +142,14 @@ public void Include(MvvmCross.Plugin.Json.Plugin plugin)
plugin.Load();
}

public void Include(global::Android.Support.V7.Widget.AlertDialogLayout alertDialog)
public void Include(AlertDialogLayout alertDialog)
{
_ = new global::Android.Support.V7.Widget.AlertDialogLayout(Application.Context);
_ = new AlertDialogLayout(Application.Context);
}

public void Include(global::Android.Support.Design.Internal.BaselineLayout baselineLayout)
public void Include(BaselineLayout baselineLayout)
{
_ = new global::Android.Support.Design.Internal.BaselineLayout(Application.Context);
_ = new BaselineLayout(Application.Context);
}

public void IncludeMvvmcross64()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Android.Content.Res;
using Android.OS;
using Android.Runtime;
using Android.Support.V7.App;
using Chameleon.Core;
using Chameleon.Core.Helpers;
using Chameleon.Core.ViewModels;
Expand All @@ -14,9 +13,9 @@
using MvvmCross.Navigation;
using Plugin.CurrentActivity;
using Xamarin.Forms;
using Intent = global::Android.Content.Intent;
using Intent = Android.Content.Intent;

namespace Chameleon.Android
namespace Chameleon.Droid
{
[Activity(
Label = "@string/app_name",
Expand All @@ -25,15 +24,15 @@ namespace Chameleon.Android
MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode)]
[IntentFilter(new[] { Intent.ActionSend, Intent.ActionSendMultiple, Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable, Intent.CategoryAppMusic }, DataMimeTypes = new[] { "video/*", "audio/*" }, Label = "@string/app_name")]
public class MainActivity : MvxFormsAppCompatActivity<Setup, Core.App, FormsApp>
public class MainActivity : MvxFormsAppCompatActivity<Setup, App, FormsApp>
{
protected override void OnCreate(Bundle savedInstanceState)
{
Forms.SetFlags("CollectionView_Experimental");

TabLayoutResource = Android.Resource.Layout.Tabbar;
ToolbarResource = Android.Resource.Layout.Toolbar;
SetTheme(Android.Resource.Style.MainTheme);
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
SetTheme(Resource.Style.MainTheme);

base.OnCreate(savedInstanceState);

Expand Down Expand Up @@ -90,7 +89,7 @@ private void UpdateTheme(Configuration newConfig)
}
}

public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] global::Android.Content.PM.Permission[] grantResults)
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Permission[] grantResults)
{
Plugin.Permissions.PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Chameleon.Android")]
[assembly: AssemblyTitle("Chameleon.Droid")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Baseflow B.V.")]
[assembly: AssemblyProduct("Chameleon.Android")]
[assembly: AssemblyProduct("Chameleon.Droid")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions Chameleon.Android/Setup.cs → Chameleon.Droid/Setup.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
using System.Collections.Generic;
using System.Reflection;
using Acr.UserDialogs;
using Android.Support.Design.Widget;
using Chameleon.Core;
using Chameleon.Core.Helpers;
using MvvmCross;
using MvvmCross.Forms.Platforms.Android.Core;
using MvvmCross.IoC;
using MvvmCross.Platforms.Android;

namespace Chameleon.Android
namespace Chameleon.Droid
{
public class Setup : MvxFormsAndroidSetup<Core.App, FormsApp>
public class Setup : MvxFormsAndroidSetup<App, FormsApp>
{
protected override void InitializeFirstChance()
{
base.InitializeFirstChance();
UserDialogs.Init(() => Mvx.IoCProvider.Resolve<IMvxAndroidCurrentTopActivity>().Activity);
ActionSheetConfig.DefaultAndroidStyleId = Android.Resource.Style.MainTheme_BottomSheet;
ActionSheetConfig.DefaultAndroidStyleId = Resource.Style.MainTheme_BottomSheet;
}

protected override void InitializeLastChance()
Expand All @@ -28,7 +29,7 @@ protected override void InitializeLastChance()
protected override IEnumerable<Assembly> AndroidViewAssemblies =>
new List<Assembly>(base.AndroidViewAssemblies)
{
typeof(global::Android.Support.Design.Widget.BottomNavigationView).Assembly
typeof(BottomNavigationView).Assembly
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using MvvmCross;
using MvvmCross.Platforms.Android;

namespace Chameleon.Android
namespace Chameleon.Droid
{
public class ThemeService : ThemeServiceBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ then
exit
fi

ANDROID_MANIFEST_FILE=$APPCENTER_SOURCE_DIRECTORY/Chameleon.Android/Properties/AndroidManifest.xml
ANDROID_MANIFEST_FILE=$APPCENTER_SOURCE_DIRECTORY/Chameleon.Droid/Properties/AndroidManifest.xml
VERSION=${VERSION_NAME}.${APPCENTER_BUILD_ID}
if [ ${APPCENTER_BRANCH} != "master" ]
then
Expand Down
2 changes: 1 addition & 1 deletion Chameleon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.29102.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Chameleon.Core", "Chameleon.Core\Chameleon.Core.csproj", "{77A38872-12A8-4E03-AD48-827F2AAB5318}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chameleon.Android", "Chameleon.Android\Chameleon.Android.csproj", "{23B9D7A8-8013-483A-ABB3-839DA8A7D930}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chameleon.Droid", "Chameleon.Droid\Chameleon.Droid.csproj", "{23B9D7A8-8013-483A-ABB3-839DA8A7D930}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chameleon.iOS", "Chameleon.iOS\Chameleon.iOS.csproj", "{84BCE6E4-7B30-4A78-A73F-D188F4A57C86}"
EndProject
Expand Down

0 comments on commit fb19460

Please sign in to comment.