rename from Pixiview to Gallery
19
Gallery.Android/Assets/AboutAssets.txt
Executable file
@ -0,0 +1,19 @@
|
||||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with your package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
BIN
Gallery.Android/Assets/fa-light-300.ttf
Executable file
BIN
Gallery.Android/Assets/fa-regular-400.ttf
Executable file
BIN
Gallery.Android/Assets/fa-solid-900.ttf
Executable file
49
Gallery.Android/Effects/LongPressEffectImplement.cs
Executable file
@ -0,0 +1,49 @@
|
||||
using Gallery.Droid.Effects;
|
||||
using Gallery.Utils;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
using static Android.Views.View;
|
||||
|
||||
[assembly: ResolutionGroupName("Gallery")]
|
||||
[assembly: ExportEffect(typeof(LongPressEffectImplement), "LongPressEffect")]
|
||||
namespace Gallery.Droid.Effects
|
||||
{
|
||||
public class LongPressEffectImplement : PlatformEffect
|
||||
{
|
||||
private bool attached;
|
||||
|
||||
protected override void OnAttached()
|
||||
{
|
||||
if (!attached)
|
||||
{
|
||||
attached = true;
|
||||
Control.LongClick += Container_LongClick;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDetached()
|
||||
{
|
||||
if (attached)
|
||||
{
|
||||
attached = false;
|
||||
Control.LongClick -= Container_LongClick;
|
||||
}
|
||||
}
|
||||
|
||||
private void Container_LongClick(object sender, LongClickEventArgs e)
|
||||
{
|
||||
var element = Element;
|
||||
if (element != null)
|
||||
{
|
||||
var command = LongPressEffect.GetCommand(element);
|
||||
if (command != null)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
||||
var o = LongPressEffect.GetCommandParameter(element);
|
||||
command.Execute(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
294
Gallery.Android/Gallery.Android.csproj
Normal file
@ -0,0 +1,294 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B695E0C4-084A-456D-B075-718E55BA1FD6}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Gallery.Droid</RootNamespace>
|
||||
<AssemblyName>Gallery.Android</AssemblyName>
|
||||
<Deterministic>True</Deterministic>
|
||||
<AndroidApplication>True</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
|
||||
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
||||
<AndroidUseAapt2>true</AndroidUseAapt2>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;LOG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<ConsolePause>true</ConsolePause>
|
||||
<EmbedAssembliesIntoApk></EmbedAssembliesIntoApk>
|
||||
<AndroidSupportedAbis>arm64-v8a;armeabi-v7a;x86;x86_64</AndroidSupportedAbis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType></DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<DefineConstants>LOG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
<AndroidCreatePackagePerAbi>true</AndroidCreatePackagePerAbi>
|
||||
<AndroidSupportedAbis>arm64-v8a;armeabi-v7a</AndroidSupportedAbis>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
|
||||
<PackageReference Include="Newtonsoft.Json">
|
||||
<Version>13.0.1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Effects\LongPressEffectImplement.cs" />
|
||||
<Compile Include="Renderers\CircleImageRenderer.cs" />
|
||||
<Compile Include="Renderers\CardViewRenderer.cs" />
|
||||
<Compile Include="Renderers\BlurryPanelRenderer.cs" />
|
||||
<Compile Include="Renderers\SegmentedControlRenderer.cs" />
|
||||
<Compile Include="Renderers\OptionEntryRenderer.cs" />
|
||||
<Compile Include="Renderers\RoundLabelRenderer.cs" />
|
||||
<Compile Include="Renderers\AppShellRenderer.cs" />
|
||||
<Compile Include="Renderers\AppShellSection\AppShellBottomNavViewAppearanceTracker.cs" />
|
||||
<Compile Include="Renderers\AppShellSection\AppColorChangeRevealDrawable.cs" />
|
||||
<Compile Include="Renderers\SearchBarRenderer.cs" />
|
||||
<Compile Include="SplashActivity.cs" />
|
||||
<Compile Include="Renderers\RoundImageRenderer.cs" />
|
||||
<Compile Include="Renderers\AdaptedPageRenderer.cs" />
|
||||
<Compile Include="Renderers\HybridWebViewRenderer.cs" />
|
||||
<Compile Include="Renderers\OptionPickerRenderer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\Tabbar.xml" />
|
||||
<AndroidResource Include="Resources\layout\Toolbar.xml" />
|
||||
<AndroidResource Include="Resources\values\styles.xml" />
|
||||
<AndroidResource Include="Resources\values\colors.xml" />
|
||||
<AndroidResource Include="Resources\drawable\download.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon_foreground.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon_round.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\icon_foreground.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\icon_round.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\icon_foreground.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\icon_round.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\icon_foreground.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\icon_round.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\icon.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\icon_foreground.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\icon_round.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\icon.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\color\segmented_control_text.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\segmented_control_background.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\segmented_control_first_background.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\segmented_control_last_background.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\layout\RadioButton.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\layout\RadioGroup.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\splash_logo.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\splash_screen.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable-night\ic_search.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_search.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\no_profile.png">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_bookmark.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_option.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_rank.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_sparkles.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_user.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable-night\ic_bookmark.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable-night\ic_option.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable-night\ic_rank.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable-night\ic_sparkles.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable-night\ic_user.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_bookmark_regular.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_rank_regular.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_sparkles_regular.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\drawable\ic_user_regular.xml">
|
||||
<SubType></SubType>
|
||||
<Generator></Generator>
|
||||
</AndroidResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\drawable\" />
|
||||
<Folder Include="Effects\" />
|
||||
<Folder Include="Resources\mipmap-anydpi-v26\" />
|
||||
<Folder Include="Resources\mipmap-hdpi\" />
|
||||
<Folder Include="Resources\mipmap-mdpi\" />
|
||||
<Folder Include="Resources\mipmap-xhdpi\" />
|
||||
<Folder Include="Resources\mipmap-xxhdpi\" />
|
||||
<Folder Include="Resources\mipmap-xxxhdpi\" />
|
||||
<Folder Include="Renderers\" />
|
||||
<Folder Include="Resources\color\" />
|
||||
<Folder Include="Renderers\AppShellSection\" />
|
||||
<Folder Include="Resources\drawable-night\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidAsset Include="Assets\fa-light-300.ttf" />
|
||||
<AndroidAsset Include="Assets\fa-regular-400.ttf" />
|
||||
<AndroidAsset Include="Assets\fa-solid-900.ttf" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\Gallery\Gallery.projitems" Label="Shared" Condition="Exists('..\Gallery\Gallery.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
11
Gallery.Android/GlobalSuppressions.cs
Executable file
@ -0,0 +1,11 @@
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[assembly: SuppressMessage("Style", "IDE0056:Use index operator", Justification = "<Pending>")]
|
||||
[assembly: SuppressMessage("Style", "IDE0057:Use range operator", Justification = "<Pending>")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Use simple 'using' statement", Justification = "<Pending>")]
|
||||
[assembly: SuppressMessage("Style", "IDE0066:Convert switch statement to expression", Justification = "<Pending>")]
|
35
Gallery.Android/MainActivity.cs
Executable file
@ -0,0 +1,35 @@
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
using Android.Runtime;
|
||||
|
||||
namespace Gallery.Droid
|
||||
{
|
||||
[Activity(Label = "Gallery", Icon = "@mipmap/icon", Theme = "@style/MainTheme", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
public static MainActivity Main { get; private set; }
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
Main = this;
|
||||
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||
Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
LoadApplication(new App());
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Code Notifications", "XA0001:Find issues with Android API usage", Justification = "<Pending>")]
|
||||
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Permission[] grantResults)
|
||||
{
|
||||
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
}
|
6
Gallery.Android/Properties/AndroidManifest.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0.927" package="org.tsanie.gallery" android:versionCode="25">
|
||||
<uses-sdk android:minSdkVersion="25" android:targetSdkVersion="30" />
|
||||
<application android:label="Gallery" android:icon="@mipmap/icon" android:roundIcon="@mipmap/icon_round"></application>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
30
Gallery.Android/Properties/AssemblyInfo.cs
Executable file
@ -0,0 +1,30 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// 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("Gallery.Android")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Gallery.Android")]
|
||||
[assembly: AssemblyCopyright("Copyright © Tsanie.Org 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
43
Gallery.Android/Renderers/AdaptedPageRenderer.cs
Executable file
@ -0,0 +1,43 @@
|
||||
using Android.Content;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(AdaptedPage), typeof(AdaptedPageRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class AdaptedPageRenderer : PageRenderer
|
||||
{
|
||||
public AdaptedPageRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnAttachedToWindow()
|
||||
{
|
||||
base.OnAttachedToWindow();
|
||||
|
||||
if (Element is AdaptedPage page)
|
||||
{
|
||||
page.OnLoad();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (Element is AdaptedPage page)
|
||||
{
|
||||
page.OnUnload();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
//protected override void OnDetachedFromWindow()
|
||||
//{
|
||||
// App.DebugPrint("detached from window");
|
||||
|
||||
// base.OnDetachedFromWindow();
|
||||
//}
|
||||
}
|
||||
}
|
21
Gallery.Android/Renderers/AppShellRenderer.cs
Executable file
@ -0,0 +1,21 @@
|
||||
using Android.Content;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.Droid.Renderers.AppShellSection;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(Shell), typeof(AppShellRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class AppShellRenderer : ShellRenderer
|
||||
{
|
||||
public AppShellRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override IShellBottomNavViewAppearanceTracker CreateBottomNavViewAppearanceTracker(ShellItem shellItem)
|
||||
{
|
||||
return new AppShellBottomNavViewAppearanceTracker(this, shellItem);
|
||||
}
|
||||
}
|
||||
}
|
98
Gallery.Android/Renderers/AppShellSection/AppColorChangeRevealDrawable.cs
Executable file
@ -0,0 +1,98 @@
|
||||
using Android.Animation;
|
||||
using Android.Graphics;
|
||||
using Android.Graphics.Drawables;
|
||||
using System;
|
||||
using AColor = Android.Graphics.Color;
|
||||
|
||||
namespace Gallery.Droid.Renderers.AppShellSection
|
||||
{
|
||||
public class AppColorChangeRevealDrawable : AnimationDrawable
|
||||
{
|
||||
readonly Point _center;
|
||||
float _progress;
|
||||
bool _disposed;
|
||||
ValueAnimator _animator;
|
||||
|
||||
internal AColor StartColor { get; }
|
||||
internal AColor EndColor { get; }
|
||||
|
||||
public AppColorChangeRevealDrawable(AColor startColor, AColor endColor, Point center) : base()
|
||||
{
|
||||
StartColor = startColor;
|
||||
EndColor = endColor;
|
||||
|
||||
if (StartColor != EndColor)
|
||||
{
|
||||
_animator = ValueAnimator.OfFloat(0, 1);
|
||||
_animator.SetInterpolator(new Android.Views.Animations.DecelerateInterpolator());
|
||||
_animator.SetDuration(500);
|
||||
_animator.Update += OnUpdate;
|
||||
_animator.Start();
|
||||
_center = center;
|
||||
}
|
||||
else
|
||||
{
|
||||
_progress = 1;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Draw(Canvas canvas)
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
if (_progress == 1)
|
||||
{
|
||||
canvas.DrawColor(EndColor);
|
||||
return;
|
||||
}
|
||||
|
||||
canvas.DrawColor(StartColor);
|
||||
var bounds = Bounds;
|
||||
float centerX = _center.X;
|
||||
float centerY = _center.Y;
|
||||
|
||||
float width = bounds.Width();
|
||||
float distanceFromCenter = Math.Abs(width / 2 - _center.X);
|
||||
float radius = (width / 2 + distanceFromCenter) * 1.1f;
|
||||
|
||||
var paint = new Paint
|
||||
{
|
||||
Color = EndColor
|
||||
};
|
||||
|
||||
canvas.DrawCircle(centerX, centerY, radius * _progress, paint);
|
||||
}
|
||||
|
||||
void OnUpdate(object sender, ValueAnimator.AnimatorUpdateEventArgs e)
|
||||
{
|
||||
_progress = (float)e.Animation.AnimatedValue;
|
||||
|
||||
InvalidateSelf();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
_disposed = true;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
if (_animator != null)
|
||||
{
|
||||
_animator.Update -= OnUpdate;
|
||||
|
||||
_animator.Cancel();
|
||||
|
||||
_animator.Dispose();
|
||||
|
||||
_animator = null;
|
||||
}
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,191 @@
|
||||
using Android.Content.Res;
|
||||
using Android.Graphics.Drawables;
|
||||
#if __ANDROID_29__
|
||||
using AndroidX.Core.Widget;
|
||||
using Google.Android.Material.BottomNavigation;
|
||||
#else
|
||||
using Android.Support.Design.Internal;
|
||||
using Android.Support.Design.Widget;
|
||||
#endif
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
using AColor = Android.Graphics.Color;
|
||||
using R = Android.Resource;
|
||||
|
||||
namespace Gallery.Droid.Renderers.AppShellSection
|
||||
{
|
||||
public class AppShellBottomNavViewAppearanceTracker : IShellBottomNavViewAppearanceTracker
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0052:Remove unread private members", Justification = "<Pending>")]
|
||||
IShellContext _shellContext;
|
||||
ShellItem _shellItem;
|
||||
ColorStateList _defaultList;
|
||||
bool _disposed;
|
||||
ColorStateList _colorStateList;
|
||||
|
||||
public AppShellBottomNavViewAppearanceTracker(IShellContext shellContext, ShellItem shellItem)
|
||||
{
|
||||
_shellItem = shellItem;
|
||||
_shellContext = shellContext;
|
||||
}
|
||||
|
||||
public virtual void ResetAppearance(BottomNavigationView bottomView)
|
||||
{
|
||||
if (_defaultList != null)
|
||||
{
|
||||
bottomView.ItemTextColor = _defaultList;
|
||||
bottomView.ItemIconTintList = _defaultList;
|
||||
}
|
||||
|
||||
SetBackgroundColor(bottomView, Color.White);
|
||||
}
|
||||
|
||||
public virtual void SetAppearance(BottomNavigationView bottomView, IShellAppearanceElement appearance)
|
||||
{
|
||||
IShellAppearanceElement controller = appearance;
|
||||
var backgroundColor = controller.EffectiveTabBarBackgroundColor;
|
||||
var foregroundColor = controller.EffectiveTabBarForegroundColor;
|
||||
var disabledColor = controller.EffectiveTabBarDisabledColor;
|
||||
var unselectedColor = controller.EffectiveTabBarUnselectedColor; // currently unused
|
||||
var titleColor = controller.EffectiveTabBarTitleColor;
|
||||
|
||||
if (_defaultList == null)
|
||||
{
|
||||
#if __ANDROID_28__
|
||||
_defaultList = bottomView.ItemTextColor ?? bottomView.ItemIconTintList
|
||||
?? MakeColorStateList(titleColor.ToAndroid().ToArgb(), disabledColor.ToAndroid().ToArgb(), foregroundColor.ToAndroid().ToArgb());
|
||||
#else
|
||||
_defaultList = bottomView.ItemTextColor ?? bottomView.ItemIconTintList;
|
||||
#endif
|
||||
}
|
||||
|
||||
_colorStateList = MakeColorStateList(titleColor, disabledColor, foregroundColor);
|
||||
bottomView.ItemTextColor = _colorStateList;
|
||||
bottomView.ItemIconTintList = _colorStateList;
|
||||
|
||||
var menu = bottomView.Menu;
|
||||
if (menu != null && menu.HasVisibleItems && menu.Size() == 4)
|
||||
{
|
||||
var itemUser = menu.GetItem(0);
|
||||
itemUser.SetIcon(itemUser.IsChecked ?
|
||||
Resource.Drawable.ic_user :
|
||||
Resource.Drawable.ic_user_regular);
|
||||
var itemRecommend = menu.GetItem(1);
|
||||
itemRecommend.SetIcon(itemRecommend.IsChecked ?
|
||||
Resource.Drawable.ic_sparkles :
|
||||
Resource.Drawable.ic_sparkles_regular);
|
||||
var itemRank = menu.GetItem(2);
|
||||
itemRank.SetIcon(itemRank.IsChecked ?
|
||||
Resource.Drawable.ic_rank :
|
||||
Resource.Drawable.ic_rank_regular);
|
||||
var itemFavorite = menu.GetItem(3);
|
||||
itemFavorite.SetIcon(itemFavorite.IsChecked ?
|
||||
Resource.Drawable.ic_bookmark :
|
||||
Resource.Drawable.ic_bookmark_regular);
|
||||
}
|
||||
|
||||
SetBackgroundColor(bottomView, backgroundColor);
|
||||
}
|
||||
|
||||
protected virtual void SetBackgroundColor(BottomNavigationView bottomView, Color color)
|
||||
{
|
||||
var oldBackground = bottomView.Background;
|
||||
var colorDrawable = oldBackground as ColorDrawable;
|
||||
var colorChangeRevealDrawable = oldBackground as AppColorChangeRevealDrawable;
|
||||
AColor lastColor = colorChangeRevealDrawable?.EndColor ?? colorDrawable?.Color ?? Color.Default.ToAndroid();
|
||||
AColor newColor;
|
||||
|
||||
if (color == Color.Default)
|
||||
newColor = Color.White.ToAndroid();
|
||||
else
|
||||
newColor = color.ToAndroid();
|
||||
|
||||
if (!(bottomView.GetChildAt(0) is BottomNavigationMenuView menuView))
|
||||
{
|
||||
if (colorDrawable != null && lastColor == newColor)
|
||||
return;
|
||||
|
||||
if (lastColor != newColor || colorDrawable == null)
|
||||
{
|
||||
bottomView.SetBackground(new ColorDrawable(newColor));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (colorChangeRevealDrawable != null && lastColor == newColor)
|
||||
return;
|
||||
|
||||
var index = ((IShellItemController)_shellItem).GetItems().IndexOf(_shellItem.CurrentItem);
|
||||
var menu = bottomView.Menu;
|
||||
index = Math.Min(index, menu.Size() - 1);
|
||||
|
||||
var child = menuView.GetChildAt(index);
|
||||
if (child == null)
|
||||
return;
|
||||
|
||||
var touchPoint = new Android.Graphics.Point(child.Left + (child.Right - child.Left) / 2, child.Top + (child.Bottom - child.Top) / 2);
|
||||
|
||||
bottomView.SetBackground(new AppColorChangeRevealDrawable(lastColor, newColor, touchPoint));
|
||||
}
|
||||
}
|
||||
|
||||
ColorStateList MakeColorStateList(Color titleColor, Color disabledColor, Color unselectedColor)
|
||||
{
|
||||
var disabledInt = disabledColor.IsDefault ?
|
||||
_defaultList.GetColorForState(new[] { -R.Attribute.StateEnabled }, AColor.Gray) :
|
||||
disabledColor.ToAndroid().ToArgb();
|
||||
|
||||
var checkedInt = titleColor.IsDefault ?
|
||||
_defaultList.GetColorForState(new[] { R.Attribute.StateChecked }, AColor.Black) :
|
||||
titleColor.ToAndroid().ToArgb();
|
||||
|
||||
var defaultColor = unselectedColor.IsDefault ?
|
||||
_defaultList.DefaultColor :
|
||||
unselectedColor.ToAndroid().ToArgb();
|
||||
|
||||
return MakeColorStateList(checkedInt, disabledInt, defaultColor);
|
||||
}
|
||||
|
||||
ColorStateList MakeColorStateList(int titleColorInt, int disabledColorInt, int defaultColor)
|
||||
{
|
||||
var states = new int[][] {
|
||||
new int[] { -R.Attribute.StateEnabled },
|
||||
new int[] {R.Attribute.StateChecked },
|
||||
new int[] { }
|
||||
};
|
||||
|
||||
var colors = new[] { disabledColorInt, titleColorInt, defaultColor };
|
||||
|
||||
return new ColorStateList(states, colors);
|
||||
}
|
||||
|
||||
#region IDisposable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
_disposed = true;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
_defaultList?.Dispose();
|
||||
_colorStateList?.Dispose();
|
||||
|
||||
_shellItem = null;
|
||||
_shellContext = null;
|
||||
_defaultList = null;
|
||||
_colorStateList = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion IDisposable
|
||||
}
|
||||
}
|
30
Gallery.Android/Renderers/BlurryPanelRenderer.cs
Executable file
@ -0,0 +1,30 @@
|
||||
using Android.Content;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(BlurryPanel), typeof(BlurryPanelRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class BlurryPanelRenderer : ViewRenderer
|
||||
{
|
||||
public BlurryPanelRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<View> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var color = e.NewElement.BackgroundColor;
|
||||
if (!color.IsDefault)
|
||||
{
|
||||
SetBackgroundColor(color.MultiplyAlpha(.94).ToAndroid());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
84
Gallery.Android/Renderers/CardViewRenderer.cs
Executable file
@ -0,0 +1,84 @@
|
||||
using System.ComponentModel;
|
||||
using Android.Content;
|
||||
using Android.Graphics;
|
||||
using Android.Views;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(CardView), typeof(CardViewRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class CardViewRenderer : VisualElementRenderer<CardView>
|
||||
{
|
||||
public CardViewRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<CardView> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
var element = e.NewElement;
|
||||
if (element != null)
|
||||
{
|
||||
var radius = element.CornerRadius;
|
||||
if (radius > 0)
|
||||
{
|
||||
var density = Resources.DisplayMetrics.Density;
|
||||
|
||||
OutlineProvider = new CornerRadiusOutlineProvider(element, radius, density);
|
||||
ClipToOutline = true;
|
||||
|
||||
//var drawable = new RoundCornerDrawable(radius * density);
|
||||
//drawable.SetColorFilter(element.BackgroundColor.ToAndroid(), PorterDuff.Mode.Src);
|
||||
//((Android.Views.View)this).SetBackground(drawable);
|
||||
|
||||
Elevation = (float)(element.ShadowOffset.Height + 2) * density;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
base.OnElementPropertyChanged(sender, e);
|
||||
|
||||
var element = Element;
|
||||
if (element == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch (e.PropertyName)
|
||||
{
|
||||
case nameof(CardView.ShadowOffset):
|
||||
var density = Resources.DisplayMetrics.Density;
|
||||
Elevation = (float)(element.ShadowOffset.Height + 2) * density;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
class CornerRadiusOutlineProvider : ViewOutlineProvider
|
||||
{
|
||||
readonly Element element;
|
||||
readonly float radius;
|
||||
readonly float density;
|
||||
|
||||
public CornerRadiusOutlineProvider(Element formsElement, float radius, float density)
|
||||
{
|
||||
element = formsElement;
|
||||
this.radius = radius * density;
|
||||
this.density = density;
|
||||
}
|
||||
|
||||
public override void GetOutline(Android.Views.View view, Outline outline)
|
||||
{
|
||||
float scale = density;
|
||||
double width = (double)element.GetValue(VisualElement.WidthProperty) * scale;
|
||||
double height = (double)element.GetValue(VisualElement.HeightProperty) * scale;
|
||||
var rect = new Android.Graphics.Rect(0, 0, (int)width, (int)height);
|
||||
outline.SetRoundRect(rect, radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
66
Gallery.Android/Renderers/CircleImageRenderer.cs
Executable file
@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using Android.Content;
|
||||
using Android.Graphics;
|
||||
using Android.Graphics.Drawables;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms;
|
||||
|
||||
[assembly: ExportRenderer(typeof(CircleImage), typeof(CircleImageRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class CircleImageRenderer : Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer
|
||||
{
|
||||
private Paint paint;
|
||||
private int radius;
|
||||
private float scale;
|
||||
|
||||
public CircleImageRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
|
||||
{
|
||||
base.OnMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
int size = Math.Min(MeasuredWidth, MeasuredHeight);
|
||||
radius = size / 2;
|
||||
SetMeasuredDimension(size, size);
|
||||
}
|
||||
|
||||
protected override void OnDraw(Canvas canvas)
|
||||
{
|
||||
paint = new Paint();
|
||||
var bitmap = DrawableToBitmap(Drawable);
|
||||
if (bitmap == null)
|
||||
{
|
||||
base.OnDraw(canvas);
|
||||
return;
|
||||
}
|
||||
var bitmapShader = new BitmapShader(bitmap, Shader.TileMode.Clamp, Shader.TileMode.Clamp);
|
||||
scale = radius * 2.0f / Math.Min(bitmap.Width, bitmap.Height);
|
||||
|
||||
var matrix = new Matrix();
|
||||
matrix.SetScale(scale, scale);
|
||||
bitmapShader.SetLocalMatrix(matrix);
|
||||
paint.SetShader(bitmapShader);
|
||||
|
||||
canvas.DrawCircle(radius, radius, radius, paint);
|
||||
}
|
||||
|
||||
private Bitmap DrawableToBitmap(Drawable drawable)
|
||||
{
|
||||
if (drawable is BitmapDrawable bd)
|
||||
{
|
||||
return bd.Bitmap;
|
||||
}
|
||||
int w = drawable.IntrinsicWidth;
|
||||
int h = drawable.IntrinsicHeight;
|
||||
var bitmap = Bitmap.CreateBitmap(w, h, Bitmap.Config.Argb8888);
|
||||
var canvas = new Canvas(bitmap);
|
||||
drawable.SetBounds(0, 0, w, h);
|
||||
drawable.Draw(canvas);
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
}
|
117
Gallery.Android/Renderers/HybridWebViewRenderer.cs
Executable file
@ -0,0 +1,117 @@
|
||||
using Android.Content;
|
||||
using Android.Webkit;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.Login;
|
||||
using Gallery.Utils;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(HybridWebView), typeof(HybridWebViewRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class HybridWebViewRenderer : WebViewRenderer
|
||||
{
|
||||
public HybridWebViewRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.WebView> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.NewElement is HybridWebView webView)
|
||||
{
|
||||
Control.SetWebViewClient(new PixivWebViewClient(this));
|
||||
Control.LoadUrl(webView.Uri);
|
||||
}
|
||||
}
|
||||
|
||||
private class PixivWebViewClient : FormsWebViewClient
|
||||
{
|
||||
private readonly HybridWebView webView;
|
||||
|
||||
public PixivWebViewClient(HybridWebViewRenderer renderer) : base(renderer)
|
||||
{
|
||||
if (renderer.Element is HybridWebView view)
|
||||
{
|
||||
webView = view;
|
||||
}
|
||||
}
|
||||
|
||||
//public override bool ShouldOverrideUrlLoading(Android.Webkit.WebView view, IWebResourceRequest request)
|
||||
//{
|
||||
// var uri = request.Url;
|
||||
// if (uri.Host == "www.pixiv.net" && uri.Path == "/")
|
||||
// {
|
||||
// var client = new HttpClient(new HttpClientHandler { UseCookies = false })
|
||||
// {
|
||||
// BaseAddress = new Uri($"{uri.Scheme}://{uri.Host}"),
|
||||
// Timeout = TimeSpan.FromSeconds(30)
|
||||
// };
|
||||
// var pathAndQuery = uri.Path;
|
||||
// if (!string.IsNullOrEmpty(uri.Query))
|
||||
// {
|
||||
// pathAndQuery += "?" + uri.EncodedQuery;
|
||||
// }
|
||||
// using (var req = new HttpRequestMessage(
|
||||
// request.Method == "POST" ? HttpMethod.Post : HttpMethod.Get,
|
||||
// pathAndQuery))
|
||||
// {
|
||||
// var headers = req.Headers;
|
||||
// if (request.RequestHeaders != null)
|
||||
// {
|
||||
// foreach (var h in request.RequestHeaders)
|
||||
// {
|
||||
// headers.Add(h.Key, h.Value);
|
||||
// }
|
||||
// }
|
||||
|
||||
// using (var response = client.SendAsync(req, HttpCompletionOption.ResponseHeadersRead).Result)
|
||||
// {
|
||||
// if (response.Headers.TryGetValues("x-userid", out var vals))
|
||||
// {
|
||||
// Configs.SetUserId(string.Join(';', vals), true);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// return base.ShouldOverrideUrlLoading(view, request);
|
||||
//}
|
||||
|
||||
public override void OnPageFinished(Android.Webkit.WebView view, string url)
|
||||
{
|
||||
base.OnPageFinished(view, url);
|
||||
|
||||
if (url == "https://www.pixiv.net/" ||
|
||||
url == "https://www.pixiv.net/en/")
|
||||
{
|
||||
var cookieManager = CookieManager.Instance;
|
||||
var cookie = cookieManager.GetCookie(url);
|
||||
Configs.SetCookie(cookie, true);
|
||||
|
||||
// user-id
|
||||
if (cookie != null)
|
||||
{
|
||||
var index = cookie.IndexOf("PHPSESSID=");
|
||||
if (index >= 0)
|
||||
{
|
||||
var session = cookie.Substring(index + 10);
|
||||
index = session.IndexOf('_');
|
||||
if (index > 0)
|
||||
{
|
||||
session = session.Substring(0, index);
|
||||
Configs.SetUserId(session, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (webView != null)
|
||||
{
|
||||
webView.OnLoginHandle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
28
Gallery.Android/Renderers/OptionEntryRenderer.cs
Executable file
@ -0,0 +1,28 @@
|
||||
using Android.Content;
|
||||
using Android.Graphics.Drawables;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(OptionEntry), typeof(OptionEntryRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class OptionEntryRenderer : EntryRenderer
|
||||
{
|
||||
public OptionEntryRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var drawable = new ColorDrawable(e.NewElement.BackgroundColor.ToAndroid());
|
||||
Control.SetBackground(drawable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
29
Gallery.Android/Renderers/OptionPickerRenderer.cs
Executable file
@ -0,0 +1,29 @@
|
||||
using Android.Content;
|
||||
using Android.Graphics.Drawables;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(OptionPicker), typeof(OptionPickerRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class OptionPickerRenderer : PickerRenderer
|
||||
{
|
||||
public OptionPickerRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
var drawable = new ColorDrawable(e.NewElement.BackgroundColor.ToAndroid());
|
||||
Control.Gravity = Android.Views.GravityFlags.Right;
|
||||
Control.SetBackground(drawable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
60
Gallery.Android/Renderers/RoundImageRenderer.cs
Executable file
@ -0,0 +1,60 @@
|
||||
using Android.Content;
|
||||
using Android.Graphics;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms;
|
||||
|
||||
[assembly: ExportRenderer(typeof(RoundImage), typeof(RoundImageRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class RoundImageRenderer : Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer
|
||||
{
|
||||
public RoundImageRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetBackgroundColor(Android.Graphics.Color color)
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
||||
protected override void OnDraw(Canvas canvas)
|
||||
{
|
||||
if (Element is RoundImage image)
|
||||
{
|
||||
var radius = image.CornerRadius;
|
||||
var mask = image.CornerMasks;
|
||||
if (radius > 0 && mask != CornerMask.None)
|
||||
{
|
||||
var r = Resources.DisplayMetrics.Density * radius;
|
||||
|
||||
var radii = new float[8];
|
||||
if ((mask & CornerMask.LeftTop) == CornerMask.LeftTop)
|
||||
{
|
||||
radii[0] = radii[1] = r;
|
||||
}
|
||||
if ((mask & CornerMask.RightTop) == CornerMask.RightTop)
|
||||
{
|
||||
radii[2] = radii[3] = r;
|
||||
}
|
||||
if ((mask & CornerMask.RightBottom) == CornerMask.RightBottom)
|
||||
{
|
||||
radii[4] = radii[5] = r;
|
||||
}
|
||||
if ((mask & CornerMask.LeftBottom) == CornerMask.LeftBottom)
|
||||
{
|
||||
radii[6] = radii[7] = r;
|
||||
}
|
||||
|
||||
var path = new Path();
|
||||
int width = Width;
|
||||
int height = Height;
|
||||
path.AddRoundRect(new RectF(0, 0, width, height), radii, Path.Direction.Cw);
|
||||
canvas.ClipPath(path);
|
||||
}
|
||||
}
|
||||
|
||||
base.OnDraw(canvas);
|
||||
}
|
||||
}
|
||||
}
|
70
Gallery.Android/Renderers/RoundLabelRenderer.cs
Executable file
@ -0,0 +1,70 @@
|
||||
using Android.Content;
|
||||
using Android.Graphics;
|
||||
using Android.Graphics.Drawables;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(RoundLabel), typeof(RoundLabelRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class RoundLabelRenderer : Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer
|
||||
{
|
||||
public RoundLabelRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.NewElement is RoundLabel label)
|
||||
{
|
||||
var density = Resources.DisplayMetrics.Density;
|
||||
var drawable = new RoundCornerDrawable(label.CornerRadius * density);
|
||||
drawable.SetColorFilter(label.BackgroundColor.ToAndroid(), PorterDuff.Mode.Src);
|
||||
Control.SetBackground(drawable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RoundCornerDrawable : Drawable
|
||||
{
|
||||
private readonly Paint paint;
|
||||
private readonly float radius;
|
||||
private RectF rect;
|
||||
|
||||
public override int Opacity => (int)Format.Translucent;
|
||||
|
||||
public RoundCornerDrawable(float radius)
|
||||
{
|
||||
paint = new Paint
|
||||
{
|
||||
AntiAlias = true
|
||||
};
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public override void SetBounds(int left, int top, int right, int bottom)
|
||||
{
|
||||
base.SetBounds(left, top, right, bottom);
|
||||
rect = new RectF(left, top, right, bottom);
|
||||
}
|
||||
|
||||
public override void Draw(Canvas canvas)
|
||||
{
|
||||
canvas.DrawRoundRect(rect, radius, radius, paint);
|
||||
}
|
||||
|
||||
public override void SetAlpha(int alpha)
|
||||
{
|
||||
paint.Alpha = alpha;
|
||||
}
|
||||
|
||||
public override void SetColorFilter(ColorFilter colorFilter)
|
||||
{
|
||||
paint.SetColorFilter(colorFilter);
|
||||
}
|
||||
}
|
||||
}
|
30
Gallery.Android/Renderers/SearchBarRenderer.cs
Executable file
@ -0,0 +1,30 @@
|
||||
using Android.Content;
|
||||
using Android.Widget;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(SearchBar), typeof(Gallery.Droid.Renderers.SearchBarRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class SearchBarRenderer : Xamarin.Forms.Platform.Android.SearchBarRenderer
|
||||
{
|
||||
public SearchBarRenderer(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (e.NewElement != null && Control is SearchView searchView)
|
||||
{
|
||||
searchView.Iconified = true;
|
||||
searchView.SetIconifiedByDefault(false);
|
||||
// (Resource.Id.search_mag_icon); is wrong / Xammie bug
|
||||
int searchIconId = Context.Resources.GetIdentifier("android:id/search_mag_icon", null, null);
|
||||
var icon = searchView.FindViewById(searchIconId);
|
||||
(icon as ImageView).SetImageResource(Resource.Drawable.ic_search);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
246
Gallery.Android/Renderers/SegmentedControlRenderer.cs
Executable file
@ -0,0 +1,246 @@
|
||||
using Android.Content;
|
||||
using Android.Graphics.Drawables;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Gallery.Droid.Renderers;
|
||||
using Gallery.UI;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: Xamarin.Forms.ExportRenderer(typeof(SegmentedControl), typeof(SegmentedControlRenderer))]
|
||||
namespace Gallery.Droid.Renderers
|
||||
{
|
||||
public class SegmentedControlRenderer : ViewRenderer<SegmentedControl, RadioGroup>
|
||||
{
|
||||
RadioGroup nativeControl;
|
||||
RadioButton _rb;
|
||||
readonly Context context;
|
||||
|
||||
public SegmentedControlRenderer(Context context) : base(context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<SegmentedControl> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
if (Control == null)
|
||||
{
|
||||
// Instantiate the native control and assign it to the Control property with
|
||||
// the SetNativeControl method
|
||||
|
||||
var layoutInflater = LayoutInflater.From(context);
|
||||
|
||||
var view = layoutInflater.Inflate(Resource.Layout.RadioGroup, null);
|
||||
|
||||
nativeControl = (RadioGroup)layoutInflater.Inflate(Resource.Layout.RadioGroup, null);
|
||||
var density = context.Resources.DisplayMetrics.Density;
|
||||
|
||||
for (var i = 0; i < Element.Children.Count; i++)
|
||||
{
|
||||
var o = Element.Children[i];
|
||||
var rb = (RadioButton)layoutInflater.Inflate(Resource.Layout.RadioButton, null);
|
||||
|
||||
var width = rb.Paint.MeasureText(o.Text) * density + 0.5f;
|
||||
rb.LayoutParameters = new RadioGroup.LayoutParams((int)width, LayoutParams.WrapContent, 1f);
|
||||
rb.Text = o.Text;
|
||||
|
||||
if (i == 0)
|
||||
rb.SetBackgroundResource(Resource.Drawable.segmented_control_first_background);
|
||||
else if (i == Element.Children.Count - 1)
|
||||
rb.SetBackgroundResource(Resource.Drawable.segmented_control_last_background);
|
||||
else
|
||||
rb.SetBackgroundResource(Resource.Drawable.segmented_control_background);
|
||||
|
||||
ConfigureRadioButton(i, rb);
|
||||
|
||||
nativeControl.AddView(rb);
|
||||
}
|
||||
|
||||
var option = (RadioButton)nativeControl.GetChildAt(Element.SelectedSegmentIndex);
|
||||
|
||||
if (option != null)
|
||||
option.Checked = true;
|
||||
|
||||
SetNativeControl(nativeControl);
|
||||
}
|
||||
|
||||
if (e.OldElement != null)
|
||||
{
|
||||
// Unsubscribe from event handlers and cleanup any resources
|
||||
|
||||
if (nativeControl != null)
|
||||
nativeControl.CheckedChange -= NativeControl_ValueChanged;
|
||||
}
|
||||
|
||||
if (e.NewElement != null)
|
||||
{
|
||||
// Configure the control and subscribe to event handlers
|
||||
|
||||
nativeControl.CheckedChange += NativeControl_ValueChanged;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
base.OnElementPropertyChanged(sender, e);
|
||||
|
||||
if (nativeControl == null || Element == null) return;
|
||||
|
||||
switch (e.PropertyName)
|
||||
{
|
||||
case "Renderer":
|
||||
Element?.SendValueChanged();
|
||||
break;
|
||||
case nameof(SegmentedControl.SelectedSegmentIndex):
|
||||
var option = (RadioButton)nativeControl.GetChildAt(Element.SelectedSegmentIndex);
|
||||
|
||||
if (option != null)
|
||||
option.Checked = true;
|
||||
|
||||
if (Element.SelectedSegmentIndex < 0)
|
||||
{
|
||||
var layoutInflater = LayoutInflater.From(context);
|
||||
|
||||
nativeControl = (RadioGroup)layoutInflater.Inflate(Resource.Layout.RadioGroup, null);
|
||||
|
||||
for (var i = 0; i < Element.Children.Count; i++)
|
||||
{
|
||||
var o = Element.Children[i];
|
||||
var rb = (RadioButton)layoutInflater.Inflate(Resource.Layout.RadioButton, null);
|
||||
|
||||
var width = rb.Paint.MeasureText(o.Text);
|
||||
rb.LayoutParameters = new RadioGroup.LayoutParams((int)width, LayoutParams.WrapContent, 1f);
|
||||
rb.Text = o.Text;
|
||||
|
||||
if (i == 0)
|
||||
rb.SetBackgroundResource(Resource.Drawable.segmented_control_first_background);
|
||||
else if (i == Element.Children.Count - 1)
|
||||
rb.SetBackgroundResource(Resource.Drawable.segmented_control_last_background);
|
||||
else
|
||||
rb.SetBackgroundResource(Resource.Drawable.segmented_control_background);
|
||||
|
||||
ConfigureRadioButton(i, rb);
|
||||
|
||||
nativeControl.AddView(rb);
|
||||
}
|
||||
|
||||
nativeControl.CheckedChange += NativeControl_ValueChanged;
|
||||
|
||||
SetNativeControl(nativeControl);
|
||||
}
|
||||
|
||||
Element.SendValueChanged();
|
||||
break;
|
||||
case nameof(SegmentedControl.TintColor):
|
||||
OnPropertyChanged();
|
||||
break;
|
||||
case nameof(SegmentedControl.IsEnabled):
|
||||
OnPropertyChanged();
|
||||
break;
|
||||
case nameof(SegmentedControl.SelectedTextColor):
|
||||
var v = (RadioButton)nativeControl.GetChildAt(Element.SelectedSegmentIndex);
|
||||
v.SetTextColor(Element.SelectedTextColor.ToAndroid());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnPropertyChanged()
|
||||
{
|
||||
if (nativeControl != null && Element != null)
|
||||
{
|
||||
for (var i = 0; i < Element.Children.Count; i++)
|
||||
{
|
||||
var rb = (RadioButton)nativeControl.GetChildAt(i);
|
||||
|
||||
ConfigureRadioButton(i, rb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureRadioButton(int i, RadioButton rb)
|
||||
{
|
||||
var textColor = Element.SelectedTextColor;
|
||||
if (i == Element.SelectedSegmentIndex)
|
||||
{
|
||||
rb.SetTextColor(textColor.ToAndroid());
|
||||
rb.Paint.FakeBoldText = true;
|
||||
_rb = rb;
|
||||
}
|
||||
else
|
||||
{
|
||||
var tColor = Element.IsEnabled ?
|
||||
textColor.IsDefault ? Element.TintColor.ToAndroid() : textColor.MultiplyAlpha(.6).ToAndroid() :
|
||||
Element.DisabledColor.ToAndroid();
|
||||
rb.SetTextColor(tColor);
|
||||
}
|
||||
|
||||
GradientDrawable selectedShape;
|
||||
GradientDrawable unselectedShape;
|
||||
|
||||
var gradientDrawable = (StateListDrawable)rb.Background;
|
||||
var drawableContainerState = (DrawableContainer.DrawableContainerState)gradientDrawable.GetConstantState();
|
||||
var children = drawableContainerState.GetChildren();
|
||||
|
||||
// Doesnt works on API < 18
|
||||
selectedShape = children[0] is GradientDrawable ? (GradientDrawable)children[0] : (GradientDrawable)((InsetDrawable)children[0]).Drawable;
|
||||
unselectedShape = children[1] is GradientDrawable ? (GradientDrawable)children[1] : (GradientDrawable)((InsetDrawable)children[1]).Drawable;
|
||||
|
||||
var color = Element.IsEnabled ? Element.TintColor.ToAndroid() : Element.DisabledColor.ToAndroid();
|
||||
|
||||
selectedShape.SetStroke(3, color);
|
||||
selectedShape.SetColor(color);
|
||||
unselectedShape.SetStroke(3, color);
|
||||
|
||||
rb.Enabled = Element.IsEnabled;
|
||||
}
|
||||
|
||||
void NativeControl_ValueChanged(object sender, RadioGroup.CheckedChangeEventArgs e)
|
||||
{
|
||||
var rg = (RadioGroup)sender;
|
||||
if (rg.CheckedRadioButtonId != -1)
|
||||
{
|
||||
var id = rg.CheckedRadioButtonId;
|
||||
var radioButton = rg.FindViewById(id);
|
||||
var radioId = rg.IndexOfChild(radioButton);
|
||||
|
||||
var rb = (RadioButton)rg.GetChildAt(radioId);
|
||||
|
||||
var textColor = Element.SelectedTextColor;
|
||||
var color = Element.IsEnabled ?
|
||||
textColor.IsDefault ? Element.TintColor.ToAndroid() : textColor.MultiplyAlpha(.6).ToAndroid() :
|
||||
Element.DisabledColor.ToAndroid();
|
||||
if (_rb != null)
|
||||
{
|
||||
_rb.SetTextColor(color);
|
||||
_rb.Paint.FakeBoldText = false;
|
||||
}
|
||||
rb.SetTextColor(Element.SelectedTextColor.ToAndroid());
|
||||
rb.Paint.FakeBoldText = true;
|
||||
_rb = rb;
|
||||
|
||||
Element.SelectedSegmentIndex = radioId;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (nativeControl != null)
|
||||
{
|
||||
nativeControl.CheckedChange -= NativeControl_ValueChanged;
|
||||
nativeControl.Dispose();
|
||||
nativeControl = null;
|
||||
_rb = null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
Gallery.Android/Resources/AboutResources.txt
Executable file
@ -0,0 +1,50 @@
|
||||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.xml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable-hdpi/
|
||||
icon.png
|
||||
|
||||
drawable-ldpi/
|
||||
icon.png
|
||||
|
||||
drawable-mdpi/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.xml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called
|
||||
"Resource" that contains the tokens for each one of the resources included. For example,
|
||||
for the above Resources layout, this is what the Resource class would expose:
|
||||
|
||||
public class Resource {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
|
||||
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
20892
Gallery.Android/Resources/Resource.designer.cs
generated
Normal file
5
Gallery.Android/Resources/color/segmented_control_text.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:color="@color/normal"/>
|
||||
<item android:color="@color/selected" />
|
||||
</selector>
|
5
Gallery.Android/Resources/drawable-night/ic_bookmark.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="512" android:viewportWidth="384"
|
||||
android:width="15dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable-night/ic_option.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable-night/ic_rank.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M276 192h152a20 20 0 0 0 20-20V52a20 20 0 0 0-20-20H276a20 20 0 0 0-20 20v120a20 20 0 0 0 20 20zm208 64H284a28 28 0 0 0-28 28v168a28 28 0 0 0 28 28h200a28 28 0 0 0 28-28V284a28 28 0 0 0-28-28zM107.31 36.69a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.77 160 16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.38-17.24 11.31-27.31z"/>
|
||||
</vector>
|
6
Gallery.Android/Resources/drawable-night/ic_search.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector android:height="24dp" android:tint="#DDDDDD"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable-night/ic_sparkles.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M324.42 103.15L384 128l24.84 59.58a8 8 0 0 0 14.32 0L448 128l59.58-24.85a8 8 0 0 0 0-14.31L448 64 423.16 4.42a8 8 0 0 0-14.32 0L384 64l-59.58 24.84a8 8 0 0 0 0 14.31zm183.16 305.69L448 384l-24.84-59.58a8 8 0 0 0-14.32 0L384 384l-59.58 24.84a8 8 0 0 0 0 14.32L384 448l24.84 59.58a8 8 0 0 0 14.32 0L448 448l59.58-24.84a8 8 0 0 0 0-14.32zM384 255.64a16.06 16.06 0 0 0-8.84-14.33l-112.57-56.39-56.28-112.77c-5.44-10.87-23.19-10.87-28.62 0l-56.28 112.77L8.84 241.31a16 16 0 0 0 0 28.67l112.57 56.39 56.28 112.77a16 16 0 0 0 28.62 0l56.28-112.77L375.16 270a16.07 16.07 0 0 0 8.84-14.36z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable-night/ic_user.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="512" android:viewportWidth="448"
|
||||
android:width="17.5dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/>
|
||||
</vector>
|
BIN
Gallery.Android/Resources/drawable/download.png
Executable file
After Width: | Height: | Size: 1.9 KiB |
5
Gallery.Android/Resources/drawable/ic_bookmark.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="384"
|
||||
android:width="15dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable/ic_bookmark_regular.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="384"
|
||||
android:width="15dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M336 0H48C21.49 0 0 21.49 0 48v464l192-112 192 112V48c0-26.51-21.49-48-48-48zm0 428.43l-144-84-144 84V54a6 6 0 0 1 6-6h276c3.314 0 6 2.683 6 5.996V428.43z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable/ic_option.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable/ic_rank.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M276 192h152a20 20 0 0 0 20-20V52a20 20 0 0 0-20-20H276a20 20 0 0 0-20 20v120a20 20 0 0 0 20 20zm208 64H284a28 28 0 0 0-28 28v168a28 28 0 0 0 28 28h200a28 28 0 0 0 28-28V284a28 28 0 0 0-28-28zM107.31 36.69a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.77 160 16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.38-17.24 11.31-27.31z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable/ic_rank_regular.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M484 256H252a28 28 0 0 0-28 28v168a28 28 0 0 0 28 28h232a28 28 0 0 0 28-28V284a28 28 0 0 0-28-28zm-20 176H272V304h192zM244 192h184a20 20 0 0 0 20-20V52a20 20 0 0 0-20-20H244a20 20 0 0 0-20 20v120a20 20 0 0 0 20 20zm28-112h128v64H272zM104.72 35.76a12 12 0 0 0-17.44 0l-68 72A12 12 0 0 0 28 128h44v336a16 16 0 0 0 16 16h16a16 16 0 0 0 16-16V128h44a12 12 0 0 0 8.73-20.24z"/>
|
||||
</vector>
|
6
Gallery.Android/Resources/drawable/ic_search.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector android:height="24dp" android:tint="#333333"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable/ic_sparkles.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M324.42 103.15L384 128l24.84 59.58a8 8 0 0 0 14.32 0L448 128l59.58-24.85a8 8 0 0 0 0-14.31L448 64 423.16 4.42a8 8 0 0 0-14.32 0L384 64l-59.58 24.84a8 8 0 0 0 0 14.31zm183.16 305.69L448 384l-24.84-59.58a8 8 0 0 0-14.32 0L384 384l-59.58 24.84a8 8 0 0 0 0 14.32L384 448l24.84 59.58a8 8 0 0 0 14.32 0L448 448l59.58-24.84a8 8 0 0 0 0-14.32zM384 255.64a16.06 16.06 0 0 0-8.84-14.33l-112.57-56.39-56.28-112.77c-5.44-10.87-23.19-10.87-28.62 0l-56.28 112.77L8.84 241.31a16 16 0 0 0 0 28.67l112.57 56.39 56.28 112.77a16 16 0 0 0 28.62 0l56.28-112.77L375.16 270a16.07 16.07 0 0 0 8.84-14.36z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable/ic_sparkles_regular.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M324.42 103.16L384 128l24.84 59.58a8 8 0 0 0 14.32 0L448 128l59.58-24.84a8 8 0 0 0 0-14.32L448 64 423.16 4.42a8 8 0 0 0-14.32 0L384 64l-59.58 24.84a8 8 0 0 0 0 14.32zm183.16 305.68L448 384l-24.84-59.58a8 8 0 0 0-14.32 0L384 384l-59.58 24.84a8 8 0 0 0 0 14.32L384 448l24.84 59.58a8 8 0 0 0 14.32 0L448 448l59.58-24.84a8 8 0 0 0 0-14.32zM384 256a24 24 0 0 0-13.28-21.47l-104.85-52.42-52.4-104.84c-8.13-16.25-34.81-16.25-42.94 0l-52.41 104.84-104.84 52.42a24 24 0 0 0 0 42.94l104.84 52.42 52.41 104.85a24 24 0 0 0 42.94 0l52.4-104.85 104.85-52.42A24 24 0 0 0 384 256zm-146.72 34.53a24 24 0 0 0-10.75 10.74L192 370.33l-34.53-69.06a24 24 0 0 0-10.75-10.74L77.66 256l69.06-34.53a24 24 0 0 0 10.75-10.73L192 141.67l34.53 69.07a24 24 0 0 0 10.75 10.73L306.34 256z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable/ic_user.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="448"
|
||||
android:width="17.5dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/>
|
||||
</vector>
|
5
Gallery.Android/Resources/drawable/ic_user_regular.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<vector android:height="20dp" android:tint="#000000"
|
||||
android:viewportHeight="512" android:viewportWidth="448"
|
||||
android:width="17.5dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M313.6 304c-28.7 0-42.5 16-89.6 16-47.1 0-60.8-16-89.6-16C60.2 304 0 364.2 0 438.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-25.6c0-74.2-60.2-134.4-134.4-134.4zM400 464H48v-25.6c0-47.6 38.8-86.4 86.4-86.4 14.6 0 38.3 16 89.6 16 51.7 0 74.9-16 89.6-16 47.6 0 86.4 38.8 86.4 86.4V464zM224 288c79.5 0 144-64.5 144-144S303.5 0 224 0 80 64.5 80 144s64.5 144 144 144zm0-240c52.9 0 96 43.1 96 96s-43.1 96-96 96-96-43.1-96-96 43.1-96 96-96z"/>
|
||||
</vector>
|
BIN
Gallery.Android/Resources/drawable/no_profile.png
Executable file
After Width: | Height: | Size: 1.7 KiB |
19
Gallery.Android/Resources/drawable/segmented_control_background.xml
Executable file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<inset android:insetRight="-1dp">
|
||||
<shape android:id="@+id/shape_id" xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/selected" />
|
||||
<stroke android:width="1dp" android:color="@color/selected" />
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
<item android:state_checked="false">
|
||||
<inset android:insetRight="-1dp">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/normal" />
|
||||
<stroke android:width="1dp" android:color="@color/selected" />
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
</selector>
|
21
Gallery.Android/Resources/drawable/segmented_control_first_background.xml
Executable file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<inset android:insetRight="-1dp">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/selected" />
|
||||
<stroke android:width="1dp" android:color="@color/selected" />
|
||||
<corners android:topLeftRadius="2sp" android:bottomLeftRadius="2sp" />
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
<item android:state_checked="false">
|
||||
<inset android:insetRight="-1dp">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/normal" />
|
||||
<stroke android:width="1dp" android:color="@color/selected" />
|
||||
<corners android:topLeftRadius="2sp" android:bottomLeftRadius="2sp" />
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
</selector>
|
17
Gallery.Android/Resources/drawable/segmented_control_last_background.xml
Executable file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/selected" />
|
||||
<stroke android:width="1dp" android:color="@color/selected" />
|
||||
<corners android:topRightRadius="2sp" android:bottomRightRadius="2sp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_checked="false">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/normal" />
|
||||
<stroke android:width="1dp" android:color="@color/selected" />
|
||||
<corners android:topRightRadius="2sp" android:bottomRightRadius="2sp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
BIN
Gallery.Android/Resources/drawable/splash_logo.png
Executable file
After Width: | Height: | Size: 6.5 KiB |
12
Gallery.Android/Resources/drawable/splash_screen.xml
Executable file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<color android:color="@color/splash_background"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap
|
||||
android:src="@drawable/splash_logo"
|
||||
android:tileMode="disabled"
|
||||
android:gravity="center"/>
|
||||
</item>
|
||||
</layer-list>
|
13
Gallery.Android/Resources/layout/RadioButton.xml
Executable file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<RadioButton xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/segmented_control_background"
|
||||
android:textColor="@color/segmented_control_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:minHeight="30dp"
|
||||
android:textSize="12sp" />
|
6
Gallery.Android/Resources/layout/RadioGroup.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/SegControl" />
|
2
Gallery.Android/Resources/layout/Tabbar.xml
Executable file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:tabIndicatorColor="@android:color/white" app:tabGravity="fill" app:tabMode="fixed" />
|
2
Gallery.Android/Resources/layout/Toolbar.xml
Executable file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
5
Gallery.Android/Resources/mipmap-anydpi-v26/icon.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/icon_background"/>
|
||||
<foreground android:drawable="@mipmap/icon_foreground"/>
|
||||
</adaptive-icon>
|
5
Gallery.Android/Resources/mipmap-anydpi-v26/icon_round.xml
Executable file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/icon_background"/>
|
||||
<foreground android:drawable="@mipmap/icon_foreground"/>
|
||||
</adaptive-icon>
|
BIN
Gallery.Android/Resources/mipmap-hdpi/icon.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
Gallery.Android/Resources/mipmap-hdpi/icon_foreground.png
Executable file
After Width: | Height: | Size: 2.0 KiB |
BIN
Gallery.Android/Resources/mipmap-hdpi/icon_round.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
Gallery.Android/Resources/mipmap-mdpi/icon.png
Executable file
After Width: | Height: | Size: 1.2 KiB |
BIN
Gallery.Android/Resources/mipmap-mdpi/icon_foreground.png
Executable file
After Width: | Height: | Size: 1.3 KiB |
BIN
Gallery.Android/Resources/mipmap-mdpi/icon_round.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
Gallery.Android/Resources/mipmap-xhdpi/icon.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
Gallery.Android/Resources/mipmap-xhdpi/icon_foreground.png
Executable file
After Width: | Height: | Size: 2.7 KiB |
BIN
Gallery.Android/Resources/mipmap-xhdpi/icon_round.png
Executable file
After Width: | Height: | Size: 5.1 KiB |
BIN
Gallery.Android/Resources/mipmap-xxhdpi/icon.png
Executable file
After Width: | Height: | Size: 3.5 KiB |
BIN
Gallery.Android/Resources/mipmap-xxhdpi/icon_foreground.png
Executable file
After Width: | Height: | Size: 4.6 KiB |
BIN
Gallery.Android/Resources/mipmap-xxhdpi/icon_round.png
Executable file
After Width: | Height: | Size: 8.0 KiB |
BIN
Gallery.Android/Resources/mipmap-xxxhdpi/icon.png
Executable file
After Width: | Height: | Size: 4.9 KiB |
BIN
Gallery.Android/Resources/mipmap-xxxhdpi/icon_foreground.png
Executable file
After Width: | Height: | Size: 6.6 KiB |
BIN
Gallery.Android/Resources/mipmap-xxxhdpi/icon_round.png
Executable file
After Width: | Height: | Size: 12 KiB |
10
Gallery.Android/Resources/values/colors.xml
Executable file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="icon_background">#1999F7</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="normal">@android:color/transparent</color>
|
||||
<color name="selected">#007AFF</color>
|
||||
<color name="splash_background">?android:attr/colorBackground</color>
|
||||
</resources>
|
38
Gallery.Android/Resources/values/styles.xml
Executable file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="MainTheme" parent="MainTheme.Base">
|
||||
</style>
|
||||
<!-- Base theme applied no matter what API -->
|
||||
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!--We will be using the toolbar so no need to show ActionBar-->
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- Set theme colors from https://aka.ms/material-colors -->
|
||||
<!-- colorPrimary is used for the default action bar background -->
|
||||
<item name="colorPrimary">#2196F3</item>
|
||||
<!-- colorPrimaryDark is used for the status bar -->
|
||||
<item name="colorPrimaryDark">#1976D2</item>
|
||||
<!-- colorAccent is used as the default value for colorControlActivated
|
||||
which is used to tint widgets -->
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
<!-- You can also set colorControlNormal, colorControlActivated
|
||||
colorControlHighlight and colorSwitchThumbNormal. -->
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
|
||||
</style>
|
||||
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
</style>
|
||||
<style name="MainTheme.Splash" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<item name="android:windowBackground">@drawable/splash_screen</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowActionBar">true</item>
|
||||
</style>
|
||||
<dimen name="design_bottom_navigation_active_text_size">11sp</dimen>
|
||||
<dimen name="design_bottom_navigation_text_size">11sp</dimen>
|
||||
<dimen name="design_bottom_navigation_margin">12dp</dimen>
|
||||
<dimen name="design_bottom_navigation_icon_size">20dp</dimen>
|
||||
</resources>
|
43
Gallery.Android/SplashActivity.cs
Executable file
@ -0,0 +1,43 @@
|
||||
using System.Threading.Tasks;
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using AndroidX.AppCompat.App;
|
||||
|
||||
namespace Gallery.Droid
|
||||
{
|
||||
[Activity(
|
||||
MainLauncher = true,
|
||||
NoHistory = true,
|
||||
Theme = "@style/MainTheme.Splash",
|
||||
Name = "org.tsanie.gallery.SplashScreen")]
|
||||
//[MetaData("android.app.shortcuts", Resource = "@xml/shortcuts")]
|
||||
public class SplashActivity : AppCompatActivity
|
||||
{
|
||||
public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState, persistentState);
|
||||
|
||||
//var intent = new Intent(this, typeof(MainActivity));
|
||||
//if (Intent != null && Intent.Data != null)
|
||||
//{
|
||||
// intent.SetData(Intent.Data);
|
||||
//}
|
||||
//StartActivity(intent);
|
||||
//Finish();
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
base.OnResume();
|
||||
Task.Run(Start);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
|
||||
}
|
||||
|
||||
public override void OnBackPressed() { }
|
||||
}
|
||||
}
|