mirror of
https://github.com/bitwarden/mobile
synced 2025-12-20 02:03:49 +00:00
new icons for ios. new renderers for editor, picker, table view. android style changes.
This commit is contained in:
@@ -196,6 +196,8 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controls\ExtendedEditorRenderer.cs" />
|
||||
<Compile Include="Controls\ExtendedPickerRenderer.cs" />
|
||||
<Compile Include="Controls\ExtendedEntryRenderer.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Services\ClipboardService.cs" />
|
||||
|
||||
48
src/Android/Controls/ExtendedEditorRenderer.cs
Normal file
48
src/Android/Controls/ExtendedEditorRenderer.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Bit.Android.Controls;
|
||||
using Bit.App.Controls;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(ExtendedEditor), typeof(ExtendedEditorRenderer))]
|
||||
namespace Bit.Android.Controls
|
||||
{
|
||||
public class ExtendedEditorRenderer : EditorRenderer
|
||||
{
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Editor> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
var view = (ExtendedEditor)Element;
|
||||
|
||||
SetBorder(view);
|
||||
}
|
||||
|
||||
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
var view = (ExtendedEditor)Element;
|
||||
|
||||
if(e.PropertyName == ExtendedEditor.HasBorderProperty.PropertyName)
|
||||
{
|
||||
SetBorder(view);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnElementPropertyChanged(sender, e);
|
||||
if(e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
|
||||
{
|
||||
Control.SetBackgroundColor(view.BackgroundColor.ToAndroid());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetBorder(ExtendedEditor view)
|
||||
{
|
||||
if(!view.HasBorder)
|
||||
{
|
||||
Control.SetBackgroundColor(global::Android.Graphics.Color.Transparent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,14 @@ namespace Bit.Android.Controls
|
||||
|
||||
private void SetBorder(ExtendedEntry view)
|
||||
{
|
||||
//Not suported on Android
|
||||
if(!view.HasBorder)
|
||||
{
|
||||
Control.SetBackgroundColor(global::Android.Graphics.Color.Transparent);
|
||||
}
|
||||
else
|
||||
{
|
||||
Control.SetBackgroundColor(view.BottomBorderColor.ToAndroid());
|
||||
}
|
||||
}
|
||||
|
||||
private void SetMaxLength(ExtendedEntry view)
|
||||
|
||||
48
src/Android/Controls/ExtendedPickerRenderer.cs
Normal file
48
src/Android/Controls/ExtendedPickerRenderer.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Bit.Android.Controls;
|
||||
using Bit.App.Controls;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(ExtendedPicker), typeof(ExtendedPickerRenderer))]
|
||||
namespace Bit.Android.Controls
|
||||
{
|
||||
public class ExtendedPickerRenderer : PickerRenderer
|
||||
{
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
|
||||
var view = (ExtendedPicker)Element;
|
||||
|
||||
SetBorder(view);
|
||||
}
|
||||
|
||||
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
var view = (ExtendedPicker)Element;
|
||||
|
||||
if(e.PropertyName == ExtendedPicker.HasBorderProperty.PropertyName)
|
||||
{
|
||||
SetBorder(view);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnElementPropertyChanged(sender, e);
|
||||
if(e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
|
||||
{
|
||||
Control.SetBackgroundColor(view.BackgroundColor.ToAndroid());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetBorder(ExtendedPicker view)
|
||||
{
|
||||
if(!view.HasBorder)
|
||||
{
|
||||
Control.SetBackgroundColor(global::Android.Graphics.Color.Transparent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
src/Android/Resources/Resource.Designer.cs
generated
51
src/Android/Resources/Resource.Designer.cs
generated
@@ -1166,32 +1166,32 @@ namespace Bit.Android
|
||||
public partial class Color
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f0b004d
|
||||
public const int abc_background_cache_hint_selector_material_dark = 2131427405;
|
||||
|
||||
// aapt resource value: 0x7f0b004e
|
||||
public const int abc_background_cache_hint_selector_material_light = 2131427406;
|
||||
public const int abc_background_cache_hint_selector_material_dark = 2131427406;
|
||||
|
||||
// aapt resource value: 0x7f0b004f
|
||||
public const int abc_color_highlight_material = 2131427407;
|
||||
public const int abc_background_cache_hint_selector_material_light = 2131427407;
|
||||
|
||||
// aapt resource value: 0x7f0b0050
|
||||
public const int abc_color_highlight_material = 2131427408;
|
||||
|
||||
// aapt resource value: 0x7f0b0004
|
||||
public const int abc_input_method_navigation_guard = 2131427332;
|
||||
|
||||
// aapt resource value: 0x7f0b0050
|
||||
public const int abc_primary_text_disable_only_material_dark = 2131427408;
|
||||
|
||||
// aapt resource value: 0x7f0b0051
|
||||
public const int abc_primary_text_disable_only_material_light = 2131427409;
|
||||
public const int abc_primary_text_disable_only_material_dark = 2131427409;
|
||||
|
||||
// aapt resource value: 0x7f0b0052
|
||||
public const int abc_primary_text_material_dark = 2131427410;
|
||||
public const int abc_primary_text_disable_only_material_light = 2131427410;
|
||||
|
||||
// aapt resource value: 0x7f0b0053
|
||||
public const int abc_primary_text_material_light = 2131427411;
|
||||
public const int abc_primary_text_material_dark = 2131427411;
|
||||
|
||||
// aapt resource value: 0x7f0b0054
|
||||
public const int abc_search_url_text = 2131427412;
|
||||
public const int abc_primary_text_material_light = 2131427412;
|
||||
|
||||
// aapt resource value: 0x7f0b0055
|
||||
public const int abc_search_url_text = 2131427413;
|
||||
|
||||
// aapt resource value: 0x7f0b0005
|
||||
public const int abc_search_url_text_normal = 2131427333;
|
||||
@@ -1202,14 +1202,14 @@ namespace Bit.Android
|
||||
// aapt resource value: 0x7f0b0007
|
||||
public const int abc_search_url_text_selected = 2131427335;
|
||||
|
||||
// aapt resource value: 0x7f0b0055
|
||||
public const int abc_secondary_text_material_dark = 2131427413;
|
||||
|
||||
// aapt resource value: 0x7f0b0056
|
||||
public const int abc_secondary_text_material_light = 2131427414;
|
||||
public const int abc_secondary_text_material_dark = 2131427414;
|
||||
|
||||
// aapt resource value: 0x7f0b004c
|
||||
public const int accent = 2131427404;
|
||||
// aapt resource value: 0x7f0b0057
|
||||
public const int abc_secondary_text_material_light = 2131427415;
|
||||
|
||||
// aapt resource value: 0x7f0b004d
|
||||
public const int accent = 2131427405;
|
||||
|
||||
// aapt resource value: 0x7f0b0008
|
||||
public const int accent_material_dark = 2131427336;
|
||||
@@ -1331,6 +1331,9 @@ namespace Bit.Android
|
||||
// aapt resource value: 0x7f0b001f
|
||||
public const int hint_foreground_material_light = 2131427359;
|
||||
|
||||
// aapt resource value: 0x7f0b004b
|
||||
public const int lightgray = 2131427403;
|
||||
|
||||
// aapt resource value: 0x7f0b0020
|
||||
public const int material_blue_grey_800 = 2131427360;
|
||||
|
||||
@@ -1367,8 +1370,8 @@ 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: 0x7f0b004c
|
||||
public const int primary = 2131427404;
|
||||
|
||||
// aapt resource value: 0x7f0b002c
|
||||
public const int primary_dark_material_dark = 2131427372;
|
||||
@@ -1418,11 +1421,11 @@ namespace Bit.Android
|
||||
// aapt resource value: 0x7f0b003b
|
||||
public const int switch_thumb_disabled_material_light = 2131427387;
|
||||
|
||||
// aapt resource value: 0x7f0b0057
|
||||
public const int switch_thumb_material_dark = 2131427415;
|
||||
|
||||
// aapt resource value: 0x7f0b0058
|
||||
public const int switch_thumb_material_light = 2131427416;
|
||||
public const int switch_thumb_material_dark = 2131427416;
|
||||
|
||||
// aapt resource value: 0x7f0b0059
|
||||
public const int switch_thumb_material_light = 2131427417;
|
||||
|
||||
// aapt resource value: 0x7f0b003c
|
||||
public const int switch_thumb_normal_material_dark = 2131427388;
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
<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>
|
||||
<item name="android:windowBackground">@color/lightgray</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="darkgray">#333333</color>
|
||||
<color name="gray">#738182</color>
|
||||
<color name="lightgray">#ecf0f5</color>
|
||||
<color name="primary">#222d32</color>
|
||||
<color name="accent">#3c8dbc</color>
|
||||
</resources>
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
<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>
|
||||
<item name="android:windowBackground">@color/lightgray</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user