Skip to content

Commit

Permalink
Added possibility to show or hide password on login form
Browse files Browse the repository at this point in the history
  • Loading branch information
YBTopaz8 committed Jun 18, 2023
1 parent b98ba75 commit c7c0ef6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
14 changes: 7 additions & 7 deletions FlowHub.Main/Views/Mobile/Expenditures/ManageExpendituresM.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@
<ImageButton IsVisible="False" IsEnabled="False" Source="{AppThemeBinding Dark=add_btn_d.png, Light=add_btn_l.png}" Command="{Binding DropCollectionCommand}"
VerticalOptions="Start" HorizontalOptions="Center" Margin="0,0,10,0" Grid.Column="2"/>
</Grid>

<CollectionView x:Name="ColView" IsVisible="true" ItemsSource="{Binding ExpendituresList}"
<CollectionView x:Name="ColView" IsVisible="true" ItemsSource="{Binding ExpendituresList}"
HorizontalOptions="Center">
<CollectionView.EmptyView>
<ContentView>
Expand All @@ -175,8 +175,8 @@
</CollectionView.EmptyView>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:ExpendituresModel">
<ScrollView Margin="5,1.3">
<VerticalStackLayout HorizontalOptions="Center">
<ScrollView Margin="0,2">
<VerticalStackLayout HorizontalOptions="Center"> <!--set to fill and expand for it to take the whole width of the screen-->
<SwipeView >
<SwipeView.LeftItems>
<SwipeItem
Expand All @@ -195,10 +195,10 @@
BackgroundColor="{AppThemeBinding Dark={StaticResource BackGroundDark}, Light={StaticResource BackGroundLight}}"/>
</SwipeView.RightItems>

<Border Padding="10" HeightRequest="83" HorizontalOptions="Center"
MinimumWidthRequest="370" MaximumWidthRequest="400">
<Border Padding="10" HeightRequest="83"
MinimumWidthRequest="370">

<VerticalStackLayout>
<VerticalStackLayout HorizontalOptions="FillAndExpand">
<Label HorizontalOptions="Center" Text="{Binding DateSpent, StringFormat='{0:MMMM dd, yyyy}'}"/>
<VerticalStackLayout>
<Label Margin="3,0" Text="{Binding Reason, StringFormat='Reason: {0}'}"/>
Expand Down
18 changes: 9 additions & 9 deletions FlowHub.Main/Views/Mobile/LoginM.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,24 @@
<!--Section for Login begins below-->
<VerticalStackLayout x:Name="LoginForm" Margin="25">

<input:FormView SubmitCommand="{Binding GoToHomePageFromLoginCommand}" Spacing="25">
<input:FormView SubmitCommand="{Binding GoToHomePageFromLoginCommand}" Spacing="25" >
<Label Text="User does not exist!" x:Name="NoUserFoundText" HorizontalOptions="Center" TextColor="Red"
FontAttributes="Bold" FontSize="23" IsVisible="{Binding ErrorMessageVisible}" />
<ActivityIndicator IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}"/>

<material:TextField Title="Email" Text="{Binding CurrentUser.Email}" AllowClear="True" Icon="{AppThemeBinding Dark=email_icon_d.png, Light=email_icon_l.png}">
<material:TextField Title="Email" Text="{Binding CurrentUser.Email}" AllowClear="True"
IsTextPredictionEnabled="True"
Icon="{AppThemeBinding Dark=email_icon_d.png, Light=email_icon_l.png}">
<material:TextField.Validations>
<validation:RequiredValidation/>
</material:TextField.Validations>
</material:TextField>

<material:TextField Title="Password" Text="{Binding CurrentUser.Password}" Icon="{AppThemeBinding Dark= password_d.png, Light=password_l.png}" IsPassword="True">
<material:TextField Title="Password" Text="{Binding CurrentUser.Password}"
Icon="{AppThemeBinding Dark= password_d.png, Light=password_l.png}" IsPassword="True">
<material:TextField.Attachments>
<material:TextFieldPasswordShowHideAttachment/>
</material:TextField.Attachments>
<material:TextField.Validations>
<validation:RequiredValidation/>
</material:TextField.Validations>
Expand All @@ -132,13 +138,7 @@

<ImageButton Source="{AppThemeBinding Dark=login_online_d, Light=login_online_l}"
Clicked="LoginOnlineBtn_Clicked" x:Name="LoginButton" input:FormView.IsSubmitButton="True"/>
<Button Text="Login" BackgroundColor="DarkSlateBlue" FontAttributes="Bold"
FontSize="20" IsVisible="false"
TextColor="White" input:FormView.IsSubmitButton="True"/>

<Button Text="Login Online" BackgroundColor="BlueViolet" FontAttributes="Bold"
FontSize="20" IsVisible="false" Clicked="LoginOnlineBtn_Clicked"
TextColor="White" input:FormView.IsSubmitButton="True"/>

</input:FormView>

Expand Down
14 changes: 14 additions & 0 deletions FlowHub.Main/Views/UpSertExpendituresPopUp.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ public UpSertExpendituresPopUp(UpSertExpenditureVM vm)
this.BindingContext = vm;
viewModel.PageLoadedCommand.Execute(null);

#if ANDROID
var mainDisplayInfo = DeviceDisplay.MainDisplayInfo;
var orientation = mainDisplayInfo.Orientation;
var width = mainDisplayInfo.Width;
var height = mainDisplayInfo.Height;
var density = mainDisplayInfo.Density;
var smallestWidth = Math.Min(width, height) * density;
var popupWidth = smallestWidth * 0.115;

var popupHeight = (smallestWidth * 0.13) > 401 ? 350 : smallestWidth * 0.13;
Size = new Size(popupWidth, popupHeight);
#elif WINDOWS
this.Size = new Size(400, 400);
#endif
viewModel.PropertyChanged += ViewModel_PropertyChanged;
}

Expand Down

0 comments on commit c7c0ef6

Please sign in to comment.