示例#1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // to return adapter view for this Fragment

            View view = inflater.Inflate(Resource.Layout.home_fragment, container, false);

            /**
             * refer the parent tag
             */
            //  homeLayout = view.FindViewById<LinearLayout>(Resource.Id.home_layout);

            LinearLayout ll_iv_1 = view.FindViewById <LinearLayout>(Resource.Id.ll_iv_1);
            LinearLayout ll_iv_2 = view.FindViewById <LinearLayout>(Resource.Id.ll_iv_2);
            LinearLayout ll_iv_3 = view.FindViewById <LinearLayout>(Resource.Id.ll_iv_3);
            LinearLayout ll_iv_4 = view.FindViewById <LinearLayout>(Resource.Id.ll_iv_4);

            listView = (ListView)view.FindViewById(Resource.Id.childList);

            Android.Graphics.Color backgroundColor = new Android.Graphics.Color(ThemeUtill.OnActivityCreateSetTheme((Activity)mContext));

            /**
             * set back ground color dynamicly here
             */
            ll_iv_1.SetBackgroundColor(backgroundColor);
            ll_iv_2.SetBackgroundColor(backgroundColor);
            ll_iv_3.SetBackgroundColor(backgroundColor);
            ll_iv_4.SetBackgroundColor(backgroundColor);
            listView.SetBackgroundColor(backgroundColor);

            return(view);
        }
示例#2
0
        internal PickerAdapter(Context context,
                               PickerCellView renderer,
                               PickerCell pickerCell,
                               ListView listView) : base()
        {
            _Context    = context;
            _Renderer   = renderer;
            _ListView   = listView;
            _PickerCell = pickerCell;
            _Parent     = pickerCell.Parent;
            _Source     = pickerCell.ItemsSource ?? new List <object?>();

            pickerCell.SelectedItems ??= new List <object?>();

            _ListView.SetBackgroundColor(pickerCell.Prompt.BackgroundColor.ToAndroid());
            _ListView.Divider       = new ColorDrawable(_PickerCell.Prompt.SeparatorColor.ToAndroid());
            _ListView.DividerHeight = 1;


            if (pickerCell.Prompt.BackgroundColor != Color.Default)
            {
                BackgroundColor = pickerCell.Prompt.BackgroundColor.ToAndroid();
            }
            // else if ( _Parent.CellPopup.BackgroundColor != Color.Default ) { BackgroundColor = _Parent.CellPopup.BackgroundColor.ToAndroid(); }
            else
            {
                BackgroundColor = Color.White.ToAndroid();
            }


            if (pickerCell.Prompt.AccentColor != Color.Default)
            {
                AccentColor = pickerCell.Prompt.AccentColor.ToAndroid();
            }
            // else if ( _Parent.CellPopup.AccentColor != Color.Default ) { AccentColor = _Parent.CellPopup.AccentColor.ToAndroid(); }
            else
            {
                BackgroundColor = Color.Accent.ToAndroid();
            }


            if (pickerCell.Prompt.TitleColor != Color.Default)
            {
                TitleTextColor = pickerCell.Prompt.TitleColor.ToAndroid();
            }
            // else if ( _Parent.CellTitleColor != Color.Default ) { TitleTextColor = _Parent.CellTitleColor.ToAndroid(); }
            else
            {
                TitleTextColor = Color.Black.ToAndroid();
            }


            if (pickerCell.Prompt.ItemColor != Color.Default)
            {
                TextColor = pickerCell.Prompt.ItemColor.ToAndroid();
            }
            // else if ( _Parent.CellTitleColor != Color.Default ) { TextColor = _Parent.CellTitleColor.ToAndroid(); }
            else
            {
                TextColor = Color.Black.ToAndroid();
            }


            if (pickerCell.Prompt.TitleFontSize > 0)
            {
                FontSize = (float)pickerCell.Prompt.TitleFontSize;
            }
            // else if ( _Parent.CellPopup.FontSize > 0 ) { FontSize = _Parent.CellPopup.FontSize; }
            else
            {
                FontSize = 12;
            }


            if (pickerCell.Prompt.ItemDescriptionColor != Color.Default)
            {
                DetailColor = pickerCell.Prompt.ItemDescriptionColor.ToAndroid();
            }
            // else if ( _Parent.CellPopup.DescriptionTextColor != Color.Default ) { DetailColor = _Parent.CellPopup.DescriptionTextColor.ToAndroid(); }

            if (pickerCell.Prompt.ItemDescriptionFontSize > 0)
            {
                DetailFontSize = (float)pickerCell.Prompt.ItemDescriptionFontSize;
            }
            // else if ( pickerCell.CellPopup.DescriptionFontSize > 0 ) { DetailFontSize = pickerCell.CellPopup.DescriptionFontSize; }
            else
            {
                DetailFontSize = 10;
            }
        }