-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default setup uses white fragment with white fingerprint icon #51
Comments
Hi @ChaseFlorell, I'm the friendly issue checker. |
Well I took a stab at tinting your image and it seems to work. For anyone else... public class CustomFingerprintDialogFragment : FingerprintDialogFragment
{
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var view=base.OnCreateView(inflater, container, savedInstanceState);
var image = view.FindViewById<ImageView>(Resource.Id.fingerprint_imgFingerprint);
image.SetColorFilter(Color.ParseColor("#000000")); // black
return view;
}
} |
See the documentation: https://github.com/smstuebe/xamarin-fingerprint#configuration public class MyCustomDialogFragment : FingerprintDialogFragment
{
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var view = base.OnCreateView(inflater, container, savedInstanceState);
var image = view.FindViewById<ImageView>(Resource.Id.fingerprint_imgFingerprint);
image.SetImageResource(Resource.Drawable.fingerprint_black);
return view;
}
} Unfortunately, the fragment is calling I'll change the code, so you will be able to set a tint for the icon in the next release. |
That would be pretty cool @smstuebe. For now my workaround will do just fine. |
Sure? have you tested a negative try where the icon turns red and then back to white? I'd be suprised, if it turns back to black. Btw: don't close it. It contains a new feature request ^^ |
ah, you are right. If I scan the correct finger, it goes green then disappears (thats what I tested). When I use the incorrect finger, it goes red then goes white. |
Not sure I can submit a PR, but here's my thought. private async Task AnimateFailedTryAsync()
{
if (_icon == null)
return;
var originalColorFilter = _icon.ColorFilter;
_icon.SetColorFilter(NegativeColor);
var shake = ObjectAnimator.OfFloat(_icon, "translationX", -10f, 10f);
shake.SetDuration(500);
shake.SetInterpolator(new CycleInterpolator(5));
await shake.StartAsync();
_icon.SetColorFilter(originalColorFilter);
} |
I'll make it completely customizable like NegativeColor. Or better: I may add a styling mechanism, so you don't have to create a custom just class for styling. |
Hey guys, was this fixed? |
oupsi, no. I'll move it to Milestone 1.4.6. |
As of now there is a way that I can apply my own FingerprintCustomDialog.axml? |
@smstuebe any update on this? |
-> 1.4.6 |
@smstuebe is there any way to customize the text color of "Cancel" button? It is taking native color right now. Kind regards |
You can do this =>
|
Hello! How can I change tooltip text color in the dialog? |
@bogadev get reference to the widget in the onCreateView override then customise it as you want |
Thank you for the answer! Could you please give an example? Because Im really stuck at this point |
I could do with some examples on this. I can only seem to find the background property to update. Not text color. |
I found how to change background color, that was pretty simple, but text color changing looks really complicated. If you could help, I would be very grateful |
@bogadev @georgeharnwell @foehammer88 @ruisilva450 @marualderete So I finally got the time to upload my implementation that allows me use my custom xml layout, reference widgets from the layout in my extended FingerprintDialogFragment => "ZetagikCustomFingerprintDialogFragment" and even change the dialog type to "BottomSheetDialog". Hope this answers the questions related to customisations and @smstuebe accepts my PR since it modifies only the sample project and can serve as a guide for others too hopefully. |
That is NICE! Thank you! |
@alvynfash you are just... wizard. |
When I create a default setup using a light theme, the baked in fragment shows a white background with a white fingerprint icon. I'd like the ability to tint the icon to a different color if possible.
I know we can create a custom Fragment, but I'm not sure how that works within your plugin. I'd like to keep everything else exactly as it is (white background, black text), but simply color the icon something different so that it is visible.
Steps to reproduce
Follow initial setup and use the following theme in your android app ``Theme.AppCompat.Light.NoActionBar
Test
Expected behavior
Fingerprint image should be visible on the dialog fragment
Actual behavior
Fingerprint image is the same color as the background (white).
Configuration
Version of the Plugin: 1.4.2
Platform: Android 7.1
Device: Google Pixel XL
The text was updated successfully, but these errors were encountered: