mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 09:58:27 +03:00
navbar for extension. Added splash image as well
This commit is contained in:
parent
8c1ac478a2
commit
437b565f8e
5 changed files with 38 additions and 12 deletions
|
@ -48,12 +48,10 @@ namespace Bit.iOS.Extension
|
||||||
private const string UTTypeAppExtensionFillWebViewAction = "org.appextension.fill-webview-action";
|
private const string UTTypeAppExtensionFillWebViewAction = "org.appextension.fill-webview-action";
|
||||||
private const string UTTypeAppExtensionFillBrowserAction = "org.appextension.fill-browser-action";
|
private const string UTTypeAppExtensionFillBrowserAction = "org.appextension.fill-browser-action";
|
||||||
|
|
||||||
|
private UIImageView _splashImageView;
|
||||||
|
|
||||||
public ActionViewController() : base("ActionViewController", null)
|
public ActionViewController() : base("ActionViewController", null)
|
||||||
{
|
{
|
||||||
if(!Resolver.IsSet)
|
|
||||||
{
|
|
||||||
SetIoc();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ProviderType { get; set; }
|
public string ProviderType { get; set; }
|
||||||
|
@ -98,6 +96,25 @@ namespace Bit.iOS.Extension
|
||||||
|
|
||||||
public override void LoadView()
|
public override void LoadView()
|
||||||
{
|
{
|
||||||
|
View = new UIView(UIScreen.MainScreen.Bounds)
|
||||||
|
{
|
||||||
|
BackgroundColor = new UIColor(0.93f, 0.94f, 0.96f, 1.0f),
|
||||||
|
};
|
||||||
|
|
||||||
|
_splashImageView = new UIImageView(new UIImage("Icon.png"));
|
||||||
|
|
||||||
|
View.AddSubview(_splashImageView);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ViewDidAppear(bool animated)
|
||||||
|
{
|
||||||
|
base.ViewDidAppear(animated);
|
||||||
|
|
||||||
|
if(!Resolver.IsSet)
|
||||||
|
{
|
||||||
|
SetIoc();
|
||||||
|
}
|
||||||
|
|
||||||
foreach(var item in ExtensionContext.InputItems)
|
foreach(var item in ExtensionContext.InputItems)
|
||||||
{
|
{
|
||||||
var processed = false;
|
var processed = false;
|
||||||
|
@ -121,11 +138,22 @@ namespace Bit.iOS.Extension
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
View = new UIView(new CGRect(x: 0.0, y: 0, width: 320.0, height: 200.0));
|
var navBar = new UINavigationBar(new CGRect(0, 0, View.Frame.Size.Width, 44))
|
||||||
var button = new UIButton(new CGRect(x: 10.0, y: 50.0, width: 200.0, height: 30.0));
|
{
|
||||||
|
BackgroundColor = new UIColor(0.24f, 0.55f, 0.74f, 1.0f),
|
||||||
|
TintColor = UIColor.White
|
||||||
|
};
|
||||||
|
|
||||||
|
var button = new UIButton(new CGRect(x: 10.0, y: 50.0, width: View.Frame.Size.Width - 100, height: 30.0))
|
||||||
|
{
|
||||||
|
BackgroundColor = UIColor.Black,
|
||||||
|
TintColor = UIColor.White
|
||||||
|
};
|
||||||
button.SetTitle("Done", UIControlState.Normal);
|
button.SetTitle("Done", UIControlState.Normal);
|
||||||
button.TouchUpInside += Button_TouchUpInside;
|
button.TouchUpInside += Button_TouchUpInside;
|
||||||
View.AddSubview(button);
|
|
||||||
|
_splashImageView.RemoveFromSuperview();
|
||||||
|
View.AddSubviews(navBar, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_TouchUpInside(object sender, EventArgs e)
|
private void Button_TouchUpInside(object sender, EventArgs e)
|
||||||
|
@ -171,11 +199,6 @@ namespace Bit.iOS.Extension
|
||||||
ExtensionContext.CompleteRequest(returningItems, null);
|
ExtensionContext.CompleteRequest(returningItems, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ViewDidLoad()
|
|
||||||
{
|
|
||||||
base.ViewDidLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool ProcessItemProvider(NSItemProvider itemProvider, string type, Action<NSDictionary> action)
|
private bool ProcessItemProvider(NSItemProvider itemProvider, string type, Action<NSDictionary> action)
|
||||||
{
|
{
|
||||||
if(!itemProvider.HasItemConformingTo(type))
|
if(!itemProvider.HasItemConformingTo(type))
|
||||||
|
|
BIN
src/iOS.Extension/Resources/Icon.png
Normal file
BIN
src/iOS.Extension/Resources/Icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
BIN
src/iOS.Extension/Resources/Icon@2x.png
Normal file
BIN
src/iOS.Extension/Resources/Icon@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
BIN
src/iOS.Extension/Resources/Icon@3x.png
Normal file
BIN
src/iOS.Extension/Resources/Icon@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
|
@ -137,6 +137,9 @@
|
||||||
<Content Include="extension.js">
|
<Content Include="extension.js">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<BundleResource Include="Resources\Icon.png" />
|
||||||
|
<BundleResource Include="Resources\Icon%402x.png" />
|
||||||
|
<BundleResource Include="Resources\Icon%403x.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\App\App.csproj">
|
<ProjectReference Include="..\App\App.csproj">
|
||||||
|
|
Loading…
Reference in a new issue