diff --git a/QRBee/QRBee.Android/MainActivity.cs b/QRBee/QRBee.Android/MainActivity.cs index 311727b..ca18ec9 100644 --- a/QRBee/QRBee.Android/MainActivity.cs +++ b/QRBee/QRBee.Android/MainActivity.cs @@ -14,6 +14,7 @@ namespace QRBee.Droid { protected override void OnCreate(Bundle savedInstanceState) { + base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); diff --git a/QRBee/QRBee.Android/QRBee.Android.csproj b/QRBee/QRBee.Android/QRBee.Android.csproj index 9b3039d..6db580f 100644 --- a/QRBee/QRBee.Android/QRBee.Android.csproj +++ b/QRBee/QRBee.Android/QRBee.Android.csproj @@ -67,6 +67,9 @@ 2.4.1 + + 2.4.1 + @@ -106,4 +109,9 @@ + + + + + \ No newline at end of file diff --git a/QRBee/QRBee.Android/Resources/Resource.designer.cs b/QRBee/QRBee.Android/Resources/Resource.designer.cs index da3e7d5..109fd85 100644 --- a/QRBee/QRBee.Android/Resources/Resource.designer.cs +++ b/QRBee/QRBee.Android/Resources/Resource.designer.cs @@ -10790,6 +10790,9 @@ namespace QRBee.Droid global::Xamarin.Forms.Platform.Resource.Xml.standalone_badge_gravity_bottom_start = global::QRBee.Droid.Resource.Xml.standalone_badge_gravity_bottom_start; global::Xamarin.Forms.Platform.Resource.Xml.standalone_badge_gravity_top_start = global::QRBee.Droid.Resource.Xml.standalone_badge_gravity_top_start; global::Xamarin.Forms.Platform.Resource.Xml.standalone_badge_offset = global::QRBee.Droid.Resource.Xml.standalone_badge_offset; + global::ZXing.Net.Mobile.Forms.Android.Resource.Layout.zxingscanneractivitylayout = global::QRBee.Droid.Resource.Layout.zxingscanneractivitylayout; + global::ZXing.Net.Mobile.Forms.Android.Resource.Layout.zxingscannerfragmentlayout = global::QRBee.Droid.Resource.Layout.zxingscannerfragmentlayout; + global::ZXing.Net.Mobile.Forms.Android.Resource.String.library_name = global::QRBee.Droid.Resource.String.library_name; global::ZXing.Mobile.Resource.Id.contentFrame = global::QRBee.Droid.Resource.Id.contentFrame; global::ZXing.Mobile.Resource.Layout.zxingscanneractivitylayout = global::QRBee.Droid.Resource.Layout.zxingscanneractivitylayout; global::ZXing.Mobile.Resource.Layout.zxingscannerfragmentlayout = global::QRBee.Droid.Resource.Layout.zxingscannerfragmentlayout; @@ -18984,214 +18987,217 @@ namespace QRBee.Droid public const int item_view_role_description = 2131623983; // aapt resource value: 0x7F0E0030 - public const int material_clock_display_divider = 2131623984; + public const int library_name = 2131623984; // aapt resource value: 0x7F0E0031 - public const int material_clock_toggle_content_description = 2131623985; + public const int material_clock_display_divider = 2131623985; // aapt resource value: 0x7F0E0032 - public const int material_hour_selection = 2131623986; + public const int material_clock_toggle_content_description = 2131623986; // aapt resource value: 0x7F0E0033 - public const int material_hour_suffix = 2131623987; + public const int material_hour_selection = 2131623987; // aapt resource value: 0x7F0E0034 - public const int material_minute_selection = 2131623988; + public const int material_hour_suffix = 2131623988; // aapt resource value: 0x7F0E0035 - public const int material_minute_suffix = 2131623989; + public const int material_minute_selection = 2131623989; // aapt resource value: 0x7F0E0036 - public const int material_motion_easing_accelerated = 2131623990; + public const int material_minute_suffix = 2131623990; // aapt resource value: 0x7F0E0037 - public const int material_motion_easing_decelerated = 2131623991; + public const int material_motion_easing_accelerated = 2131623991; // aapt resource value: 0x7F0E0038 - public const int material_motion_easing_emphasized = 2131623992; + public const int material_motion_easing_decelerated = 2131623992; // aapt resource value: 0x7F0E0039 - public const int material_motion_easing_linear = 2131623993; + public const int material_motion_easing_emphasized = 2131623993; // aapt resource value: 0x7F0E003A - public const int material_motion_easing_standard = 2131623994; + public const int material_motion_easing_linear = 2131623994; // aapt resource value: 0x7F0E003B - public const int material_slider_range_end = 2131623995; + public const int material_motion_easing_standard = 2131623995; // aapt resource value: 0x7F0E003C - public const int material_slider_range_start = 2131623996; + public const int material_slider_range_end = 2131623996; // aapt resource value: 0x7F0E003D - public const int material_timepicker_am = 2131623997; + public const int material_slider_range_start = 2131623997; // aapt resource value: 0x7F0E003E - public const int material_timepicker_clock_mode_description = 2131623998; + public const int material_timepicker_am = 2131623998; // aapt resource value: 0x7F0E003F - public const int material_timepicker_hour = 2131623999; + public const int material_timepicker_clock_mode_description = 2131623999; // aapt resource value: 0x7F0E0040 - public const int material_timepicker_minute = 2131624000; + public const int material_timepicker_hour = 2131624000; // aapt resource value: 0x7F0E0041 - public const int material_timepicker_pm = 2131624001; + public const int material_timepicker_minute = 2131624001; // aapt resource value: 0x7F0E0042 - public const int material_timepicker_select_time = 2131624002; + public const int material_timepicker_pm = 2131624002; // aapt resource value: 0x7F0E0043 - public const int material_timepicker_text_input_mode_description = 2131624003; + public const int material_timepicker_select_time = 2131624003; // aapt resource value: 0x7F0E0044 - public const int mtrl_badge_numberless_content_description = 2131624004; + public const int material_timepicker_text_input_mode_description = 2131624004; // aapt resource value: 0x7F0E0045 - public const int mtrl_chip_close_icon_content_description = 2131624005; + public const int mtrl_badge_numberless_content_description = 2131624005; // aapt resource value: 0x7F0E0046 - public const int mtrl_exceed_max_badge_number_content_description = 2131624006; + public const int mtrl_chip_close_icon_content_description = 2131624006; // aapt resource value: 0x7F0E0047 - public const int mtrl_exceed_max_badge_number_suffix = 2131624007; + public const int mtrl_exceed_max_badge_number_content_description = 2131624007; // aapt resource value: 0x7F0E0048 - public const int mtrl_picker_a11y_next_month = 2131624008; + public const int mtrl_exceed_max_badge_number_suffix = 2131624008; // aapt resource value: 0x7F0E0049 - public const int mtrl_picker_a11y_prev_month = 2131624009; + public const int mtrl_picker_a11y_next_month = 2131624009; // aapt resource value: 0x7F0E004A - public const int mtrl_picker_announce_current_selection = 2131624010; + public const int mtrl_picker_a11y_prev_month = 2131624010; // aapt resource value: 0x7F0E004B - public const int mtrl_picker_cancel = 2131624011; + public const int mtrl_picker_announce_current_selection = 2131624011; // aapt resource value: 0x7F0E004C - public const int mtrl_picker_confirm = 2131624012; + public const int mtrl_picker_cancel = 2131624012; // aapt resource value: 0x7F0E004D - public const int mtrl_picker_date_header_selected = 2131624013; + public const int mtrl_picker_confirm = 2131624013; // aapt resource value: 0x7F0E004E - public const int mtrl_picker_date_header_title = 2131624014; + public const int mtrl_picker_date_header_selected = 2131624014; // aapt resource value: 0x7F0E004F - public const int mtrl_picker_date_header_unselected = 2131624015; + public const int mtrl_picker_date_header_title = 2131624015; // aapt resource value: 0x7F0E0050 - public const int mtrl_picker_day_of_week_column_header = 2131624016; + public const int mtrl_picker_date_header_unselected = 2131624016; // aapt resource value: 0x7F0E0051 - public const int mtrl_picker_invalid_format = 2131624017; + public const int mtrl_picker_day_of_week_column_header = 2131624017; // aapt resource value: 0x7F0E0052 - public const int mtrl_picker_invalid_format_example = 2131624018; + public const int mtrl_picker_invalid_format = 2131624018; // aapt resource value: 0x7F0E0053 - public const int mtrl_picker_invalid_format_use = 2131624019; + public const int mtrl_picker_invalid_format_example = 2131624019; // aapt resource value: 0x7F0E0054 - public const int mtrl_picker_invalid_range = 2131624020; + public const int mtrl_picker_invalid_format_use = 2131624020; // aapt resource value: 0x7F0E0055 - public const int mtrl_picker_navigate_to_year_description = 2131624021; + public const int mtrl_picker_invalid_range = 2131624021; // aapt resource value: 0x7F0E0056 - public const int mtrl_picker_out_of_range = 2131624022; + public const int mtrl_picker_navigate_to_year_description = 2131624022; // aapt resource value: 0x7F0E0057 - public const int mtrl_picker_range_header_only_end_selected = 2131624023; + public const int mtrl_picker_out_of_range = 2131624023; // aapt resource value: 0x7F0E0058 - public const int mtrl_picker_range_header_only_start_selected = 2131624024; + public const int mtrl_picker_range_header_only_end_selected = 2131624024; // aapt resource value: 0x7F0E0059 - public const int mtrl_picker_range_header_selected = 2131624025; + public const int mtrl_picker_range_header_only_start_selected = 2131624025; // aapt resource value: 0x7F0E005A - public const int mtrl_picker_range_header_title = 2131624026; + public const int mtrl_picker_range_header_selected = 2131624026; // aapt resource value: 0x7F0E005B - public const int mtrl_picker_range_header_unselected = 2131624027; + public const int mtrl_picker_range_header_title = 2131624027; // aapt resource value: 0x7F0E005C - public const int mtrl_picker_save = 2131624028; + public const int mtrl_picker_range_header_unselected = 2131624028; // aapt resource value: 0x7F0E005D - public const int mtrl_picker_text_input_date_hint = 2131624029; + public const int mtrl_picker_save = 2131624029; // aapt resource value: 0x7F0E005E - public const int mtrl_picker_text_input_date_range_end_hint = 2131624030; + public const int mtrl_picker_text_input_date_hint = 2131624030; // aapt resource value: 0x7F0E005F - public const int mtrl_picker_text_input_date_range_start_hint = 2131624031; + public const int mtrl_picker_text_input_date_range_end_hint = 2131624031; // aapt resource value: 0x7F0E0060 - public const int mtrl_picker_text_input_day_abbr = 2131624032; + public const int mtrl_picker_text_input_date_range_start_hint = 2131624032; // aapt resource value: 0x7F0E0061 - public const int mtrl_picker_text_input_month_abbr = 2131624033; + public const int mtrl_picker_text_input_day_abbr = 2131624033; // aapt resource value: 0x7F0E0062 - public const int mtrl_picker_text_input_year_abbr = 2131624034; + public const int mtrl_picker_text_input_month_abbr = 2131624034; // aapt resource value: 0x7F0E0063 - public const int mtrl_picker_toggle_to_calendar_input_mode = 2131624035; + public const int mtrl_picker_text_input_year_abbr = 2131624035; // aapt resource value: 0x7F0E0064 - public const int mtrl_picker_toggle_to_day_selection = 2131624036; + public const int mtrl_picker_toggle_to_calendar_input_mode = 2131624036; // aapt resource value: 0x7F0E0065 - public const int mtrl_picker_toggle_to_text_input_mode = 2131624037; + public const int mtrl_picker_toggle_to_day_selection = 2131624037; // aapt resource value: 0x7F0E0066 - public const int mtrl_picker_toggle_to_year_selection = 2131624038; + public const int mtrl_picker_toggle_to_text_input_mode = 2131624038; // aapt resource value: 0x7F0E0067 - public const int nav_app_bar_navigate_up_description = 2131624039; + public const int mtrl_picker_toggle_to_year_selection = 2131624039; // aapt resource value: 0x7F0E0068 - public const int nav_app_bar_open_drawer_description = 2131624040; + public const int nav_app_bar_navigate_up_description = 2131624040; // aapt resource value: 0x7F0E0069 - public const int not_set = 2131624041; + public const int nav_app_bar_open_drawer_description = 2131624041; // aapt resource value: 0x7F0E006A - public const int overflow_tab_title = 2131624042; + public const int not_set = 2131624042; // aapt resource value: 0x7F0E006B - public const int password_toggle_content_description = 2131624043; + public const int overflow_tab_title = 2131624043; // aapt resource value: 0x7F0E006C - public const int path_password_eye = 2131624044; + public const int password_toggle_content_description = 2131624044; // aapt resource value: 0x7F0E006D - public const int path_password_eye_mask_strike_through = 2131624045; + public const int path_password_eye = 2131624045; // aapt resource value: 0x7F0E006E - public const int path_password_eye_mask_visible = 2131624046; + public const int path_password_eye_mask_strike_through = 2131624046; // aapt resource value: 0x7F0E006F - public const int path_password_strike_through = 2131624047; + public const int path_password_eye_mask_visible = 2131624047; // aapt resource value: 0x7F0E0070 - public const int preference_copied = 2131624048; + public const int path_password_strike_through = 2131624048; // aapt resource value: 0x7F0E0071 - public const int search_menu_title = 2131624049; + public const int preference_copied = 2131624049; // aapt resource value: 0x7F0E0072 - public const int status_bar_notification_info_overflow = 2131624050; + public const int search_menu_title = 2131624050; // aapt resource value: 0x7F0E0073 - public const int summary_collapsed_preference_list = 2131624051; + public const int status_bar_notification_info_overflow = 2131624051; // aapt resource value: 0x7F0E0074 - public const int v7_preference_off = 2131624052; + public const int summary_collapsed_preference_list = 2131624052; // aapt resource value: 0x7F0E0075 - public const int v7_preference_on = 2131624053; + public const int v7_preference_off = 2131624053; + + // aapt resource value: 0x7F0E0076 + public const int v7_preference_on = 2131624054; static String() { diff --git a/QRBee/QRBee.Android/Services/QRScannerService.cs b/QRBee/QRBee.Android/Services/QRScannerService.cs index 02abf55..95a000d 100644 --- a/QRBee/QRBee.Android/Services/QRScannerService.cs +++ b/QRBee/QRBee.Android/Services/QRScannerService.cs @@ -22,7 +22,8 @@ namespace QRBee.Droid.Services }; var scanResult = await scanner.Scan(optionsCustom); - return scanResult.Text; + + return scanResult != null ? scanResult.Text : "Nothing was scanned. Please try again."; } } } \ No newline at end of file diff --git a/QRBee/QRBee.iOS/QRBee.iOS.csproj b/QRBee/QRBee.iOS/QRBee.iOS.csproj index 7b73257..1d5e42a 100644 --- a/QRBee/QRBee.iOS/QRBee.iOS.csproj +++ b/QRBee/QRBee.iOS/QRBee.iOS.csproj @@ -137,6 +137,9 @@ 2.4.1 + + 2.4.1 + diff --git a/QRBee/QRBee/QRBee.csproj b/QRBee/QRBee/QRBee.csproj index 95c5bfa..2ecd9d8 100644 --- a/QRBee/QRBee/QRBee.csproj +++ b/QRBee/QRBee/QRBee.csproj @@ -8,12 +8,16 @@ - + + - - MainPage.xaml + + ClientPage.xaml + + + MerchantPage.xaml @@ -21,5 +25,11 @@ MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml + + + MSBuild:UpdateDesignTimeXaml + \ No newline at end of file diff --git a/QRBee/QRBee/ViewModels/MerchantPageViewModel.cs b/QRBee/QRBee/ViewModels/MerchantPageViewModel.cs new file mode 100644 index 0000000..65155db --- /dev/null +++ b/QRBee/QRBee/ViewModels/MerchantPageViewModel.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; +using QRBee.Views; +using Xamarin.Forms; +using ZXing; +using ZXing.Common; + +namespace QRBee.ViewModels +{ + internal class MerchantPageViewModel : BaseViewModel + { + private string _name; + private double _amount; + private string _qrCode; + + public Command GenerateQrCommand { get; } + + public MerchantPageViewModel() + { + GenerateQrCommand = new Command(OnGenerateQrClicked); + } + + public string Name + { + get => _name; + set + { + if(_name==value) + return; + _name= value; + OnPropertyChanged(nameof(Name)); + } + } + + public double Amount + { + get => _amount; + set + { + if (_amount == value) + return; + + _amount = value; + + OnPropertyChanged(nameof(Amount)); + } + } + + public string QrCode + { + get => _qrCode; + set + { + // _qrCode = $"{Amount}/{Name}"; + if (_qrCode == value) + return; + + _qrCode = value; + OnPropertyChanged(nameof(QrCode)); + } + } + + public async void OnGenerateQrClicked(object obj) + { + QrCode = $"{Name}.{Amount}.{DateTime.Now}"; + // Prefixing with `//` switches to a different navigation stack instead of pushing to the active one + // await Shell.Current.GoToAsync($"//{nameof(AboutPage)}"); + } + + } +} diff --git a/QRBee/QRBee/Views/ClientPage.xaml b/QRBee/QRBee/Views/ClientPage.xaml new file mode 100644 index 0000000..cdfc9bd --- /dev/null +++ b/QRBee/QRBee/Views/ClientPage.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + +