Comments (27)
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.
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.
+1
from xfx.controls.
Any progress in this bug?:(
from xfx.controls.
from xfx.controls.
Can i help you, or you wanna to handle this bug yourself? I need this functionality :(
from xfx.controls.
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.
Okey i will see what can i do, if i able to get any progress i will tell you :D
from xfx.controls.
@BryanSan did you get anywhere with this?
from xfx.controls.
from xfx.controls.
@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.
@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.
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.
Is there any update here?
from xfx.controls.
This would be very nice, any updates?
from xfx.controls.
+1
from xfx.controls.
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.
@ChaseFlorell
I would be happy to help. Can you give me initial guidelines where I can start this?
from xfx.controls.
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.
@RudolfVonKrugstein definitely a good stop-gap
from xfx.controls.
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.
Merged, thank you @RudolfVonKrugstein .
from xfx.controls.
@ChaseFlorell Is it fixed?
from xfx.controls.
@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.
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.
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.
Finally solved the Android debacle. Had to go pure AppCompat.
from xfx.controls.
Related Issues (20)
- UWP Support HOT 1
- xfxEntry problem with Focus HOT 1
- Nuget update HOT 1
- Xfx Entry Readonly error
- Xfx ComboBox Gaps between list items
- Red Block appears behind CardView
- Completed event and ReturnCommand do not work
- How to make sorting algorithm async so it won't block the UI?
- Conflict with method PopToRoot of INavigation
- It doesn't seem the control works when in DataTemplate of repeating control. HOT 1
- xfx:entry ClearButtonVisibility
- problem with Combo : when typing digits HOT 2
- XfxCombobox =>suggestion not showing when user enter only single character HOT 3
- Show List When Xfx.Combobox clicked HOT 1
- XfxComboBox suggestion list not showing HOT 1
- xfxEntry problem with ReturnType HOT 27
- Build issue in Release mode (Linking SDK Assemblies) HOT 19
- XML documentation file missing from NuGet package
- On mainpage change I got error Object reference not set to an instance of an object HOT 11
- Maxlength is not working on XfxEntry HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xfx.controls.