1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-20 02:03:49 +00:00

Android styles and theme, updated to extended controls

This commit is contained in:
Kyle Spearrin
2016-05-10 22:53:34 -04:00
parent 3f251d0d12
commit 15be1cbf43
16 changed files with 274 additions and 148 deletions

View File

@@ -224,6 +224,15 @@
<Name>App</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values-v21\styles.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values\styles.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values\colors.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View File

@@ -26,7 +26,6 @@ namespace Bit.Android.Controls
}
SetBorder(view);
SetPlaceholderTextColor(view);
SetMaxLength(view);
}
@@ -36,14 +35,10 @@ namespace Bit.Android.Controls
if(e.PropertyName == ExtendedEntry.HasBorderProperty.PropertyName
|| e.PropertyName == ExtendedEntry.HasOnlyBottomBorderProperty.PropertyName
|| e.PropertyName == ExtendedEntry.BorderColorProperty.PropertyName)
|| e.PropertyName == ExtendedEntry.BottomBorderColorProperty.PropertyName)
{
SetBorder(view);
}
if(e.PropertyName == ExtendedEntry.PlaceholderTextColorProperty.PropertyName)
{
SetPlaceholderTextColor(view);
}
else
{
base.OnElementPropertyChanged(sender, e);
@@ -63,13 +58,5 @@ namespace Bit.Android.Controls
{
Control.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(view.MaxLength) });
}
private void SetPlaceholderTextColor(ExtendedEntry view)
{
if(view.PlaceholderTextColor != Xamarin.Forms.Color.Default)
{
Control.SetHintTextColor(view.PlaceholderTextColor.ToAndroid());
}
}
}
}

View File

@@ -2,5 +2,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Bit.Android" android:versionCode="1" android:versionName="0.0.1" android:installLocation="auto">
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="bitwarden" android:theme="@android:style/Theme.Material.Light.DarkActionBar"></application>
<application android:label="bitwarden" android:theme="@style/BitwardenTheme"></application>
</manifest>

View File

@@ -1166,32 +1166,32 @@ namespace Bit.Android
public partial class Color
{
// aapt resource value: 0x7f0b0048
public const int abc_background_cache_hint_selector_material_dark = 2131427400;
// aapt resource value: 0x7f0b004d
public const int abc_background_cache_hint_selector_material_dark = 2131427405;
// aapt resource value: 0x7f0b0049
public const int abc_background_cache_hint_selector_material_light = 2131427401;
// aapt resource value: 0x7f0b004e
public const int abc_background_cache_hint_selector_material_light = 2131427406;
// aapt resource value: 0x7f0b004a
public const int abc_color_highlight_material = 2131427402;
// aapt resource value: 0x7f0b004f
public const int abc_color_highlight_material = 2131427407;
// aapt resource value: 0x7f0b0004
public const int abc_input_method_navigation_guard = 2131427332;
// aapt resource value: 0x7f0b004b
public const int abc_primary_text_disable_only_material_dark = 2131427403;
// aapt resource value: 0x7f0b0050
public const int abc_primary_text_disable_only_material_dark = 2131427408;
// aapt resource value: 0x7f0b004c
public const int abc_primary_text_disable_only_material_light = 2131427404;
// aapt resource value: 0x7f0b0051
public const int abc_primary_text_disable_only_material_light = 2131427409;
// aapt resource value: 0x7f0b004d
public const int abc_primary_text_material_dark = 2131427405;
// aapt resource value: 0x7f0b0052
public const int abc_primary_text_material_dark = 2131427410;
// aapt resource value: 0x7f0b004e
public const int abc_primary_text_material_light = 2131427406;
// aapt resource value: 0x7f0b0053
public const int abc_primary_text_material_light = 2131427411;
// aapt resource value: 0x7f0b004f
public const int abc_search_url_text = 2131427407;
// aapt resource value: 0x7f0b0054
public const int abc_search_url_text = 2131427412;
// aapt resource value: 0x7f0b0005
public const int abc_search_url_text_normal = 2131427333;
@@ -1202,11 +1202,14 @@ namespace Bit.Android
// aapt resource value: 0x7f0b0007
public const int abc_search_url_text_selected = 2131427335;
// aapt resource value: 0x7f0b0050
public const int abc_secondary_text_material_dark = 2131427408;
// aapt resource value: 0x7f0b0055
public const int abc_secondary_text_material_dark = 2131427413;
// aapt resource value: 0x7f0b0051
public const int abc_secondary_text_material_light = 2131427409;
// aapt resource value: 0x7f0b0056
public const int abc_secondary_text_material_light = 2131427414;
// aapt resource value: 0x7f0b004c
public const int accent = 2131427404;
// aapt resource value: 0x7f0b0008
public const int accent_material_dark = 2131427336;
@@ -1262,6 +1265,9 @@ namespace Bit.Android
// aapt resource value: 0x7f0b0003
public const int cardview_shadow_start_color = 2131427331;
// aapt resource value: 0x7f0b0049
public const int darkgray = 2131427401;
// aapt resource value: 0x7f0b003e
public const int design_fab_shadow_end_color = 2131427390;
@@ -1310,6 +1316,9 @@ namespace Bit.Android
// aapt resource value: 0x7f0b001b
public const int foreground_material_light = 2131427355;
// aapt resource value: 0x7f0b004a
public const int gray = 2131427402;
// aapt resource value: 0x7f0b001c
public const int highlighted_text_material_dark = 2131427356;
@@ -1358,6 +1367,9 @@ namespace Bit.Android
// aapt resource value: 0x7f0b002b
public const int material_grey_900 = 2131427371;
// aapt resource value: 0x7f0b004b
public const int primary = 2131427403;
// aapt resource value: 0x7f0b002c
public const int primary_dark_material_dark = 2131427372;
@@ -1406,11 +1418,11 @@ namespace Bit.Android
// aapt resource value: 0x7f0b003b
public const int switch_thumb_disabled_material_light = 2131427387;
// aapt resource value: 0x7f0b0052
public const int switch_thumb_material_dark = 2131427410;
// aapt resource value: 0x7f0b0057
public const int switch_thumb_material_dark = 2131427415;
// aapt resource value: 0x7f0b0053
public const int switch_thumb_material_light = 2131427411;
// aapt resource value: 0x7f0b0058
public const int switch_thumb_material_light = 2131427416;
// aapt resource value: 0x7f0b003c
public const int switch_thumb_normal_material_dark = 2131427388;
@@ -1418,6 +1430,9 @@ namespace Bit.Android
// aapt resource value: 0x7f0b003d
public const int switch_thumb_normal_material_light = 2131427389;
// aapt resource value: 0x7f0b0048
public const int white = 2131427400;
static Color()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
@@ -3610,6 +3625,9 @@ namespace Bit.Android
// aapt resource value: 0x7f0a015b
public const int Base_Widget_Design_TabLayout = 2131362139;
// aapt resource value: 0x7f0a0172
public const int BitwardenTheme = 2131362162;
// aapt resource value: 0x7f0a0017
public const int CardView = 2131361815;

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="BitwardenTheme" parent="android:Theme.Material.Light.DarkActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:textColorPrimary">@color/darkgray</item>
<item name="android:colorAccent">@color/accent</item>
<item name="android:windowBackground">@color/white</item>
</style>
</resources>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<color name="white">#FFFFFF</color>
<color name="darkgray">#333333</color>
<color name="gray">#738182</color>
<color name="primary">#222d32</color>
<color name="accent">#3c8dbc</color>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="BitwardenTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:textColorPrimary">@color/darkgray</item>
<item name="android:colorAccent">@color/accent</item>
<item name="android:windowBackground">@color/white</item>
</style>
</resources>