Skip to content

Commit

Permalink
Experimental development (11) (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Oct 7, 2023
1 parent 5108185 commit d4a51d9
Show file tree
Hide file tree
Showing 47 changed files with 470 additions and 329 deletions.
18 changes: 10 additions & 8 deletions projects/GKvX/GEDKeeperX.Android/GEDKeeperX.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2612" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0" />
<PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.5" />
</ItemGroup>
Expand Down
16 changes: 12 additions & 4 deletions projects/GKvX/GEDKeeperX.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
using GKUI;
using Xamarin.Forms;

namespace GEDKeeperX.Droid
{
[Activity(Label = "GEDKeeperX", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity, IPlatformSpecifics
{
protected override void OnCreate(Bundle savedInstanceState)
{
Expand All @@ -14,15 +16,21 @@ protected override void OnCreate(Bundle savedInstanceState)

base.OnCreate(savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
//Xamarin.Essentials.Platform.Init(this, savedInstanceState);
LoadApplication(new GKUI.App());
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
LoadApplication(new GKUI.App(this));
}

public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults)
{
//Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);

base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}

void IPlatformSpecifics.CloseApplication()
{
var activity = (Activity)Forms.Context;
activity.FinishAffinity();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.GEDKeeperX">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
<application android:label="GEDKeeperX.Android"></application>
</manifest>
6 changes: 3 additions & 3 deletions projects/GKvX/GEDKeeperX.UWP/GEDKeeperX.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2612" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.14" />
</ItemGroup>
Expand Down
14 changes: 11 additions & 3 deletions projects/GKvX/GEDKeeperX.UWP/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
namespace GEDKeeperX.UWP
using GKUI;
using Xamarin.Forms;

namespace GEDKeeperX.UWP
{
public sealed partial class MainPage
public sealed partial class MainPage : IPlatformSpecifics
{
public MainPage()
{
InitializeComponent();

LoadApplication(new GKUI.App());
LoadApplication(new GKUI.App(this));
}

void IPlatformSpecifics.CloseApplication()
{
Application.Current.Quit();
}
}
}
13 changes: 10 additions & 3 deletions projects/GKvX/GEDKeeperX.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Foundation;
using System.Threading;
using Foundation;
using GKUI;
using UIKit;

namespace GEDKeeperX.iOS
Expand All @@ -7,7 +9,7 @@ namespace GEDKeeperX.iOS
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate, IPlatformSpecifics
{
//
// This method is invoked when the application has loaded and is ready to run. In this
Expand All @@ -19,9 +21,14 @@ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsAppli
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new GKUI.App());
LoadApplication(new GKUI.App(this));

return base.FinishedLaunching(app, options);
}

void IPlatformSpecifics.CloseApplication()
{
Thread.CurrentThread.Abort();
}
}
}
6 changes: 3 additions & 3 deletions projects/GKvX/GEDKeeperX.iOS/GEDKeeperX.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2612" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion projects/GKvX/GEDKeeperX/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ResourceDictionary>

<Style x:Key="dlgBtn" TargetType="Button">
<Setter Property="HeightRequest" Value="32" />
<!--Setter Property="HeightRequest" Value="32" /-->
<Setter Property="WidthRequest" Value="120" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="HorizontalOptions" Value="Center" />
Expand Down
6 changes: 2 additions & 4 deletions projects/GKvX/GEDKeeperX/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,21 @@
using GKUI.Platform;
using Xamarin.Essentials;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using static Xamarin.Essentials.Permissions;

namespace GKUI
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class App : Application
{
public App()
public App(IPlatformSpecifics platformSpecifics)
{
InitializeComponent();

Xamarin.Forms.DataGrid.DataGridComponent.Init();
FlowListView.Init();

LangMan.DefInit();
XFAppHost.Startup(null);
XFAppHost.Startup(platformSpecifics, null);

MainPage = new MainPage();
}
Expand Down
12 changes: 12 additions & 0 deletions projects/GKvX/GEDKeeperX/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Reflection;
using GKCore;
using Xamarin.Forms.Xaml;

[assembly: AssemblyTitle("GEDKeeperX")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyProduct(GKData.APP_TITLE)]
[assembly: AssemblyCopyright(GKData.APP_COPYRIGHT)]
[assembly: AssemblyVersion(GKData.APP_VERSION_3X)]
[assembly: AssemblyCulture("")]

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
4 changes: 2 additions & 2 deletions projects/GKvX/GEDKeeperX/GEDKeeperX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
<ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />

<PackageReference Include="Xamarin.Forms" Version="5.0.0.2612" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />

<PackageReference Include="SkiaSharp.Views.Forms" Version="2.80.2" />
Expand Down
1 change: 0 additions & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Components/ArborViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using SkiaSharp;
using SkiaSharp.Views.Forms;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace GKUI.Components
{
Expand Down
11 changes: 0 additions & 11 deletions projects/GKvX/GEDKeeperX/GKUI/Components/GKComboItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,5 @@ public GKComboItem(string text, T tag) : base(text, tag)
public GKComboItem(string text, T tag, IImage image) : base(text, tag, image)
{
}

/*public static IEnumerable<GKComboItem> Convert(IEnumerable<string> items)
{
var result = new List<GKComboItem>();
foreach (var item in items) {
result.Add(new GKComboItem(item));
}
return result;
}*/
}
}
6 changes: 1 addition & 5 deletions projects/GKvX/GEDKeeperX/GKUI/Components/GKListView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,7 @@ public GKListView()

public void Activate()
{
try {
Focus();
} catch {
// why is an exception thrown here?
}
Focus();
}

public void BeginUpdate()
Expand Down
9 changes: 5 additions & 4 deletions projects/GKvX/GEDKeeperX/GKUI/Components/GKSheetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class GKSheetList : ContentView, ISheetList
private readonly Button fBtnCut;
private readonly Button fBtnPaste;
private readonly GKListView fList;
private readonly StackLayout fToolBar;

private EnumSet<SheetButton> fButtons;
private ISheetModel fListModel;
Expand Down Expand Up @@ -122,7 +123,7 @@ public GKSheetList()
fList.HorizontalOptions = LayoutOptions.FillAndExpand;
//fList.MouseDoubleClick += List_DoubleClick;

var toolbar = new StackLayout() {
fToolBar = new StackLayout() {
Orientation = StackOrientation.Vertical,
Spacing = 4,
Children = { fBtnAdd, fBtnEdit, fBtnDelete, fBtnLinkJump, fBtnMoveUp, fBtnMoveDown, fBtnCopy, fBtnCut, fBtnPaste },
Expand All @@ -132,7 +133,7 @@ public GKSheetList()
Content = new StackLayout() {
Orientation = StackOrientation.Horizontal,
Spacing = 4,
Children = { fList, toolbar }
Children = { fList, fToolBar }
};

Buttons = EnumSet<SheetButton>.Create(SheetButton.lbAdd, SheetButton.lbEdit, SheetButton.lbDelete);
Expand Down Expand Up @@ -174,7 +175,7 @@ private void UpdateButtons()
fBtnCopy.IsVisible = fButtons.Contains(SheetButton.lbCopy);
fBtnCut.IsVisible = fButtons.Contains(SheetButton.lbCut);
fBtnPaste.IsVisible = fButtons.Contains(SheetButton.lbPaste);
//fToolBar.Enabled = !fButtons.IsEmpty();
fToolBar.IsEnabled = !fButtons.IsEmpty();
} else {
EnumSet<RecordAction> allowedActions = fListModel.AllowedActions;
fBtnAdd.IsVisible = allowedActions.Contains(RecordAction.raAdd);
Expand All @@ -186,7 +187,7 @@ private void UpdateButtons()
fBtnCopy.IsVisible = allowedActions.Contains(RecordAction.raCopy);
fBtnCut.IsVisible = allowedActions.Contains(RecordAction.raCut);
fBtnPaste.IsVisible = allowedActions.Contains(RecordAction.raPaste);
//fToolBar.Visible = !allowedActions.IsEmpty();
fToolBar.IsEnabled = !allowedActions.IsEmpty();
}
}

Expand Down
2 changes: 0 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Components/HyperView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
using BSLib;
using GKCore.Design.Controls;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace GKUI.Components
{
Expand All @@ -30,7 +29,6 @@ namespace GKUI.Components
/// <summary>
///
/// </summary>
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HyperView : ContentView, IHyperView
{
private readonly StringList fLines;
Expand Down
2 changes: 0 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
using GKCore;
using GKCore.Options;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace GKUI.Forms
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class AboutPage : ContentPage
{
public AboutPage()
Expand Down
4 changes: 2 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@

<StackLayout Spacing="8" Orientation="Horizontal">
<Label HorizontalOptions="FillAndExpand" />
<Button x:Name="btnAccept" ImageSource="{plat:ImageResourceExt Resources.btn_accept.gif}" Clicked="AcceptClickHandler" />
<Button x:Name="btnCancel" ImageSource="{plat:ImageResourceExt Resources.btn_cancel.gif}" Clicked="CancelClickHandler" />
<Button x:Name="btnAccept" Style="{StaticResource dlgBtn}" ImageSource="{plat:ImageResourceExt Resources.btn_accept.gif}" Clicked="AcceptClickHandler" />
<Button x:Name="btnCancel" Style="{StaticResource dlgBtn}" ImageSource="{plat:ImageResourceExt Resources.btn_cancel.gif}" Clicked="CancelClickHandler" />
</StackLayout>

</StackLayout>
Expand Down
2 changes: 0 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
using GKCore.Interfaces;
using GKCore.Lists;
using GKCore.Types;
using Xamarin.Forms.Xaml;

namespace GKUI.Forms
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public sealed partial class AddressEditDlg : CommonDialog<IAddressEditDlg, AddressEditDlgController>, IAddressEditDlg
{
public GDMAddress Address
Expand Down
11 changes: 10 additions & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Forms/BaseWinSDI.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,19 @@
<ToolbarItem x:Name="miOrganizer" Text="Organizer" Order="Secondary" Priority="1" IconImageSource="{plat:ImageResourceExt Resources.btn_organizer.gif}" Clicked="miOrganizer_Click" />
</ContentPage.ToolbarItems>

<StackLayout VerticalOptions="FillAndExpand">
<StackLayout VerticalOptions="FillAndExpand" Spacing="0" Padding="0">
<ProgressBar x:Name="progressBar" IsVisible="false" VerticalOptions="Start" />

<xp:TabViewControl x:Name="tabsRecords" VerticalOptions="FillAndExpand" />

<StackLayout x:Name="StatusBar" Orientation="Horizontal" Spacing="1" HorizontalOptions="FillAndExpand" VerticalOptions="End" Padding="1">
<Label x:Name="panStatusText" Text="-" HorizontalOptions="FillAndExpand" />
<Image x:Name="panStatusShieldImage" HeightRequest="18" WidthRequest="18" HorizontalOptions="End">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="StatusBar_MouseDoubleClick" NumberOfTapsRequired="2" />
</Image.GestureRecognizers>
</Image>
</StackLayout>
</StackLayout>

</forms:CommonWindow>
Loading

0 comments on commit d4a51d9

Please sign in to comment.