Color change

Hi,

I need to deploy night and day reading on my application and I have some problem on changing text color for the "Drop down", the lines where we are entering data, and on the PDFviewer control, where I need the PDF to inverse background white to black, and inverse text from black to white 

Thank you in advance!

Nicolas

6 Replies

NI Nicolas November 10, 2017 06:45 AM UTC

N.B. For the drop down, if I try to edit via a custom editor, and use spinner, I cannot use SetTextColor, only setbackgroundcolor

protected override void OnEditorCreated(DataFormItem dataFormItem, View editor)

{

     if (dataFormItem.Name.Equals("EmailType"))

          {

          (editor as Spinner).SetTextColor(GlobalVar.GNightDayColorInv);

          }

     base.OnEditorCreated(dataFormItem, editor);

}



JN Jayaleshwari N Syncfusion Team November 10, 2017 12:20 PM UTC

Hi Nicolas, 
 
Thanks for contacting Syncfusion Support. 

Regarding DataForm Query,  
 
We have analyzed your query “Change text color of spinner item”. You can change the text color by editing the spinner item style and assign to Spinner.Adapter. 
 
// Editing Spinner style 
<?xml version="1.0" encoding="utf-8"?> 
<TextView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center_vertical" 
    android:textSize="16dp" 
    android:textColor="@android:color/holo_green_dark" 
    android:paddingLeft="5dp" 
    android:paddingRight="5dp" 
    android:paddingBottom="10dp" 
    android:paddingTop="10dp" /> 
 
 
 
 
protected override void OnEditorCreated(DataFormItem dataFormItem, View editor) 
{ 
    if (dataFormItem.Name.Equals("")) 
    { 
        var dropDownItem = dataFormItem as DataFormDropDownItem; 
        var spinner = editor as Spinner; 
        spinner.Adapter = new ArrayAdapter( 
                                this.DataForm.Context, 
                                Resource.Layout.Spinner_item, 
                                dropDownItem.ItemsSource); 
    } 
    base.OnEditorCreated(dataFormItem, editor); 
} 
 
 
 
Please let us know, if you need further assistant on this. 
 
Regarding PDFViewer Query, 
 
At present we do not have support for inverting the color of the PDF document in the PDF viewer Xamarin.Android. We have logged a feature request for this implementation.
We do not have immediate plan to implement this feature. This feature implementation will be available in any of our upcoming release.  
 
 
Regards, 
 
Jayaleshwari N. 
 



NI Nicolas November 12, 2017 05:22 PM UTC

Hi, the color is working great! Thank you! There is only two missing item:

- I need to be able to change the color the lines under the numeric / text fields, so the user know exactly where are the fields

- Additionally, I need to change the background color of the dropdown list when dropdown is selected

Thank you in advance!

Nicolas



JN Jayaleshwari N Syncfusion Team November 13, 2017 11:29 AM UTC

Hi Nicolas, 
 
Thanks for the update. 
 
Please find the details about the queries. 
 
Queries 
Details 
 I need to be able to change the color the lines under the numeric / text fields, so the user know exactly where are the fields 
You can change the lines under the numeric or text field by setting BackgroundTintList for editor. 
 
protected override void OnEditorCreated(DataFormItem dataFormItem, View editor) 
{ 
    base.OnEditorCreated(dataFormItem, editor); 
 
    if (dataFormItem.Editor.Equals("Text") || dataFormItem.Editor.Equals("Numeric")) 
        editor.BackgroundTintList = ColorStateList.ValueOf(Color.Green); 
} 
 
 
Additionally, I need to change the background color of the dropdown list when dropdown is selected 
You can change the background color of drop down list by setting Background color for SelectedView in custom renderer. 
 
 
dataForm.RegisterEditor("DropDownEditor", new DataFormDropDownEditorExt(dataForm)); 
dataForm.RegisterEditor("Ocuupation", "DropDownEditor"); 
 
 
public class DataFormDropDownEditorExt : DataFormDropDownEditor 
{ 
    public DataFormDropDownEditorExt(Syncfusion.Android.DataForm.SfDataForm dataForm) : base(dataForm) 
    { 
    } 
    protected override void OnCommitValue(Spinner view) 
    { 
        base.OnCommitValue(view); 
        var dataFormItem = (view.Parent as DataFormItemView).DataFormItem; 
        if (view.SelectedView != null) 
            view.SelectedView.SetBackgroundColor(Color.Yellow);         
    }    
} 
 
You can change the drop down list background color by editing spinner style. 
 
android:background="@android:color/holo_green_light" 
 
 
 
Please let us know if you need further assistant on this. 
 
Regards, 
 
Jayaleshwari N. 



NI Nicolas November 13, 2017 04:31 PM UTC

That's great!!! Thank you! Great support as always

Nicolas



JN Jayaleshwari N Syncfusion Team November 14, 2017 04:29 AM UTC

Hi Nicolas, 
Thanks for the update. 
Please let us know if you need further assistant on this. 
Regards, 
Jayaleshwari N. 


Loader.
Up arrow icon