Coder Social home page Coder Social logo

Comments (27)

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024 1

Just a note to say this hasn't fallen off the tracks yet. It is hard however to find time, and every time I go to tackle it I get overwhelmed with Xamarin Forms internal and sealed classes. I just need to make more time.

from xfx.controls.

DevAnkur avatar DevAnkur commented on July 20, 2024 1

I am not sure if this might help, but I modified the cursor color, default hint color, and text color when activated like this:

                  IntPtr intPtrtextViewClass = JNIEnv.FindClass(typeof(EditText));
		IntPtr mCursorDrawableResProperty = JNIEnv.GetFieldID(intPtrtextViewClass, "mCursorDrawableRes", "I");

//By Setting the value as 0, the color of the cursor will be same as the text color.
		JNIEnv.SetField(EditText.Handle, mCursorDrawableResProperty, 0);

		IntPtr TextInputLayoutViewClass = JNIEnv.FindClass(typeof(TextInputLayout));
		IntPtr mDefaultTextColorProperty = JNIEnv.GetFieldID(TextInputLayoutViewClass, "mDefaultTextColor", @"android/content/res/ColorStateList");
		JNIEnv.SetField(Control.Handle, mDefaultTextColorProperty, JNIEnv.ToJniHandle(new ColorStateList(new int[][] { new int[] { 0 } },
                                                                                                         new int[] { (Element.PlaceholderColor).ToAndroid() })));

		IntPtr mFocusedTextColorProperty = JNIEnv.GetFieldID(TextInputLayoutViewClass, "mFocusedTextColor", @"android/content/res/ColorStateList");
		JNIEnv.SetField(Control.Handle, mFocusedTextColorProperty, JNIEnv.ToJniHandle(new ColorStateList(new int[][] { new int[] { 0 } },
                                                                                                         new int[] { (Element.TextColor).ToAndroid() })));

from xfx.controls.

elyfran avatar elyfran commented on July 20, 2024

+1

from xfx.controls.

 avatar commented on July 20, 2024

Any progress in this bug?:(

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

from xfx.controls.

 avatar commented on July 20, 2024

Can i help you, or you wanna to handle this bug yourself? I need this functionality :(

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

I'm keen on the help for sure!

So I was originally thinking we'd use HighlightColor, but I'm wondering if we piggyback off of "Focus", and therefore have a FocusedColor and an UnfocusedColor (though I'm definitely open to suggestions).

These would set the color of the floated label and the underline (but not the placeholder). The default FocusedColor should should be Color.Accent and the default UnfocusedColor should be Color.Default.

Also keep in mind that an error will override the underline color to RED, but the floated label stays the same color for it's state.

Feel free to bounce ideas around here, or run with the implementation if you like.

FYI the EditText.Background is where you set the ColorStateList in Android for the underline color, and it's a PITA.

Also note that you don't have to touch the ComboBox as the EntryRenderer will handle it for both.

from xfx.controls.

 avatar commented on July 20, 2024

Okey i will see what can i do, if i able to get any progress i will tell you :D

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

@BryanSan did you get anywhere with this?

from xfx.controls.

 avatar commented on July 20, 2024

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

@DevAnkur does this require anything special in the app styles xml or can it be fully programmatic? I'd be interested in a PR if you have time. I can handle the iOS stuff if you want to PR the Android stuff.

Also note we need to handle the state when active vs inactive.

from xfx.controls.

DevAnkur avatar DevAnkur commented on July 20, 2024

@ChaseFlorell , sorry for late reply. For changing the placeholder color and text color, we won't require style.xml, it is fully programmatic.

I will try to work on PR over the weekend but I can't commit as I am a bit occupied with office work.

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

Whatever you can do I appreciate. I'm also tied up on other tasks and haven't been able to fully commit to this lately.

from xfx.controls.

jariwalahetal avatar jariwalahetal commented on July 20, 2024

Is there any update here?

from xfx.controls.

RudolfVonKrugstein avatar RudolfVonKrugstein commented on July 20, 2024

This would be very nice, any updates?

from xfx.controls.

samukbg avatar samukbg commented on July 20, 2024

+1

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

Still super tied up right now. If anyone wants to submit a PR, it'll be greatly appreciated. Otherwise there's going to be a delay until I can dedicate several hours to this one.

from xfx.controls.

jariwalahetal avatar jariwalahetal commented on July 20, 2024

@ChaseFlorell
I would be happy to help. Can you give me initial guidelines where I can start this?

from xfx.controls.

RudolfVonKrugstein avatar RudolfVonKrugstein commented on July 20, 2024

For me, it would already be a big help, if the color would be set to the Accent/Tint color on iOS (that is what is actually happening in Android). Because that is actually the default color I want to set it to.

I cannot get the project to compile, still working on that here.

But I think this would do the trick. In the iOS Project in FloatLabeledTextField.cs:

Line 30, add:

using Xamarin.Forms.Platform.iOS;

Line 60:
remove

FloatingLabelActiveTextColor = UIColor.Blue;

and add

FloatingLabelActiveTextColor = Xamarin.Forms.Color.Accent.ToUIColor();

If I get the project to compile, I will make a push request.

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

@RudolfVonKrugstein definitely a good stop-gap

from xfx.controls.

RudolfVonKrugstein avatar RudolfVonKrugstein commented on July 20, 2024

I added a pull request here: #32

It is not as simple as I wrote a few posts up because one has to be careful at what point the Accent color is set.
But the pull request works for me.

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

Merged, thank you @RudolfVonKrugstein .

from xfx.controls.

jariwalahetal avatar jariwalahetal commented on July 20, 2024

@ChaseFlorell Is it fixed?

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

@jariwalahetal no. The merged PR simply makes it so that the color is set to the Accent color on iOS. It is only a stop-gap until we can get the bindings wired up.

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

I have completed the iOS (read easy) work.
You can track progress in this branch
https://github.com/XamFormsExtended/Xfx.Controls/tree/issue-%236

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

I'm pretty close to being finished this story, however I'm struggling with the underline on Android.
https://github.com/XamFormsExtended/Xfx.Controls/blob/issue-%236/src/Xfx.Controls.Droid/Renderers/XfxEntryRendererDroid.cs#L187

I've asked for help on StackOverflow as I just can't figure this out.
https://stackoverflow.com/q/47688399/124069

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

Finally solved the Android debacle. Had to go pure AppCompat.

from xfx.controls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.