// public MessagePrimaryListItem(Context context) : base(context) { SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color)); Orientation = Orientation.Vertical; Thumbnail = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Thumbnail.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); Thumbnail.SetScaleType(ImageView.ScaleType.CenterCrop); AddView(Thumbnail); Title = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Title.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); Title.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Bold), TypefaceStyle.Normal); Title.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Large_FontSize); Title.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor)); ((LinearLayout.LayoutParams)Title.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); ((LinearLayout.LayoutParams)Title.LayoutParameters).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); AddView(Title); DateRange = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); DateRange.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); DateRange.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Regular), TypefaceStyle.Normal); DateRange.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize); DateRange.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_PlaceholderTextColor)); ((LinearLayout.LayoutParams)DateRange.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(-4); ((LinearLayout.LayoutParams)DateRange.LayoutParameters).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); AddView(DateRange); Desc = new TextView(Rock.Mobile.PlatformSpecific.Android.Core.Context); Desc.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); Desc.SetTypeface(Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont(ControlStylingConfig.Font_Light), TypefaceStyle.Normal); Desc.SetTextSize(Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize); Desc.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.Label_TextColor)); ((LinearLayout.LayoutParams)Desc.LayoutParameters).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); ((LinearLayout.LayoutParams)Desc.LayoutParameters).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); ((LinearLayout.LayoutParams)Desc.LayoutParameters).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); ((LinearLayout.LayoutParams)Desc.LayoutParameters).BottomMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx(15); AddView(Desc); }
public DoubleNewsListItem( Context context ) : base(context) { Orientation = Orientation.Horizontal; SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); LeftLayout = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); LeftLayout.LayoutParameters = new LinearLayout.LayoutParams( LayoutParams.WrapContent, LayoutParams.WrapContent ); AddView( LeftLayout ); LeftImage = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); LeftImage.LayoutParameters = new LinearLayout.LayoutParams( NavbarFragment.GetContainerDisplayWidth( ) / 2, LayoutParams.WrapContent ); ( (LinearLayout.LayoutParams)LeftImage.LayoutParameters ).Gravity = GravityFlags.CenterVertical; LeftImage.SetScaleType( ImageView.ScaleType.CenterCrop ); LeftLayout.AddView( LeftImage ); LeftButton = new Button( Rock.Mobile.PlatformSpecific.Android.Core.Context ); LeftButton.LayoutParameters = LeftImage.LayoutParameters; LeftButton.Background = null; LeftButton.Click += (object sender, EventArgs e ) => { // notify our parent that the image index was clicked ParentAdapter.RowItemClicked( LeftImageIndex ); }; LeftLayout.AddView( LeftButton ); RightLayout = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); RightLayout.LayoutParameters = new LinearLayout.LayoutParams( LayoutParams.WrapContent, LayoutParams.WrapContent ); AddView( RightLayout ); RightImage = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); RightImage.LayoutParameters = new LinearLayout.LayoutParams( NavbarFragment.GetContainerDisplayWidth( ) / 2, LayoutParams.WrapContent ); ( (LinearLayout.LayoutParams)RightImage.LayoutParameters ).Gravity = GravityFlags.CenterVertical; RightImage.SetScaleType( ImageView.ScaleType.CenterCrop ); RightLayout.AddView( RightImage ); RightButton = new Button( Rock.Mobile.PlatformSpecific.Android.Core.Context ); RightButton.LayoutParameters = RightImage.LayoutParameters; RightButton.Background = null; RightButton.Click += (object sender, EventArgs e ) => { // notify our parent that the image index was clicked ParentAdapter.RowItemClicked( LeftImageIndex + 1 ); }; RightLayout.AddView( RightButton ); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.News_Details, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); // set the banner ImageBanner = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView( Activity ); ( (LinearLayout)view ).AddView( ImageBanner, 0 ); int width = NavbarFragment.GetCurrentContainerDisplayWidth( ); int height = (int)System.Math.Ceiling( width * PrivateNewsConfig.NewsBannerAspectRatio ); ImageBanner.LayoutParameters = new LinearLayout.LayoutParams( width, height ); TextView title = view.FindViewById<TextView>( Resource.Id.news_details_title ); title.Text = NewsItem.Title.ToUpper( ); title.SetSingleLine( ); title.Ellipsize = Android.Text.TextUtils.TruncateAt.End; title.SetMaxLines( 1 ); title.SetHorizontallyScrolling( true ); ControlStyling.StyleUILabel( title, ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize ); // set the description TextView description = view.FindViewById<TextView>( Resource.Id.news_details_details ); description.Text = NewsItem.Description; description.MovementMethod = new ScrollingMovementMethod(); ControlStyling.StyleUILabel( description, ControlStylingConfig.Font_Light, ControlStylingConfig.Small_FontSize ); // if we're in developer mode, add the start / end times for this promotion if ( App.Shared.Network.RockGeneralData.Instance.Data.DeveloperModeEnabled == true ) { // if we're in developer mode, add the start / end times for this promotion if ( App.Shared.Network.RockGeneralData.Instance.Data.DeveloperModeEnabled == true ) { description.Text += NewsItem.GetDeveloperInfo( ); } } Button launchUrlButton = view.FindViewById<Button>(Resource.Id.news_details_launch_url); launchUrlButton.Click += (object sender, EventArgs e) => { // move to the next page... ParentTask.OnClick( this, launchUrlButton.Id ); }; ControlStyling.StyleButton( launchUrlButton, NewsStrings.LearnMore, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize ); // hide the button if there's no reference URL. if ( string.IsNullOrEmpty( NewsItem.ReferenceURL ) == true ) { launchUrlButton.Visibility = ViewStates.Gone; } else { launchUrlButton.Visibility = ViewStates.Visible; } return view; }
// public MessagePrimaryListItem( Context context ) : base( context ) { SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) ); Orientation = Orientation.Vertical; Thumbnail = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Thumbnail.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent ); Thumbnail.SetScaleType( ImageView.ScaleType.CenterCrop ); AddView( Thumbnail ); Title = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Title.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); Title.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Bold ), TypefaceStyle.Normal ); Title.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Large_FontSize ); Title.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.Label_TextColor ) ); ( (LinearLayout.LayoutParams)Title.LayoutParameters ).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); ( (LinearLayout.LayoutParams)Title.LayoutParameters ).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); AddView( Title ); DateRange = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); DateRange.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); DateRange.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal ); DateRange.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize ); DateRange.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); ( (LinearLayout.LayoutParams)DateRange.LayoutParameters ).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( -4 ); ( (LinearLayout.LayoutParams)DateRange.LayoutParameters ).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); AddView( DateRange ); Desc = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Desc.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); Desc.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Light ), TypefaceStyle.Normal ); Desc.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize ); Desc.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.Label_TextColor ) ); ( (LinearLayout.LayoutParams)Desc.LayoutParameters ).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); ( (LinearLayout.LayoutParams)Desc.LayoutParameters ).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); ( (LinearLayout.LayoutParams)Desc.LayoutParameters ).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); ( (LinearLayout.LayoutParams)Desc.LayoutParameters ).BottomMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); AddView( Desc ); }
public SeriesListItem( Context context ) : base( context ) { Orientation = Orientation.Vertical; SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); LinearLayout contentLayout = new LinearLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); contentLayout.Orientation = Orientation.Horizontal; contentLayout.LayoutParameters = new LinearLayout.LayoutParams( LayoutParams.WrapContent, LayoutParams.WrapContent ); AddView( contentLayout ); Thumbnail = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Thumbnail.LayoutParameters = new LinearLayout.LayoutParams( (int)Rock.Mobile.Graphics.Util.UnitToPx( PrivateNoteConfig.Series_Main_CellWidth ), (int)Rock.Mobile.Graphics.Util.UnitToPx( PrivateNoteConfig.Series_Main_CellHeight ) ); ( (LinearLayout.LayoutParams)Thumbnail.LayoutParameters ).Gravity = GravityFlags.CenterVertical; Thumbnail.SetScaleType( ImageView.ScaleType.CenterCrop ); contentLayout.AddView( Thumbnail ); TitleLayout = new LinearLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); TitleLayout.Orientation = Orientation.Vertical; TitleLayout.LayoutParameters = new LinearLayout.LayoutParams( LayoutParams.WrapContent, LayoutParams.WrapContent ); ( (LinearLayout.LayoutParams)TitleLayout.LayoutParameters ).Gravity = GravityFlags.CenterVertical; ( (LinearLayout.LayoutParams)TitleLayout.LayoutParameters ).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 8 ); ( (LinearLayout.LayoutParams)TitleLayout.LayoutParameters ).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); ( (LinearLayout.LayoutParams)TitleLayout.LayoutParameters ).BottomMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 15 ); contentLayout.AddView( TitleLayout ); Title = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Title.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); Title.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Bold ), TypefaceStyle.Normal ); Title.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Medium_FontSize ); Title.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_ActiveTextColor ) ); Title.SetSingleLine( ); Title.Ellipsize = Android.Text.TextUtils.TruncateAt.End; TitleLayout.AddView( Title ); DateRange = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); DateRange.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); DateRange.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal ); DateRange.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize ); DateRange.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); ( (LinearLayout.LayoutParams)DateRange.LayoutParameters ).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( -4 ); TitleLayout.AddView( DateRange ); // fill the remaining space with a dummy view, and that will align our chevron to the right View dummyView = new View( Rock.Mobile.PlatformSpecific.Android.Core.Context ); dummyView.LayoutParameters = new LinearLayout.LayoutParams( 0, 0 ); ( (LinearLayout.LayoutParams)dummyView.LayoutParameters ).Weight = 1; contentLayout.AddView( dummyView ); Chevron = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Chevron.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); ( (LinearLayout.LayoutParams)Chevron.LayoutParameters ).Gravity = GravityFlags.CenterVertical | GravityFlags.Right; Typeface fontFace = Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( PrivateControlStylingConfig.Icon_Font_Secondary ); Chevron.SetTypeface( fontFace, TypefaceStyle.Normal ); Chevron.SetTextSize( Android.Util.ComplexUnitType.Dip, PrivateNoteConfig.Series_Table_IconSize ); Chevron.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); Chevron.Text = PrivateNoteConfig.Series_Table_Navigate_Icon; contentLayout.AddView( Chevron ); // add our own custom seperator at the bottom Seperator = new View( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Seperator.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, 0 ); Seperator.LayoutParameters.Height = (int)Rock.Mobile.Graphics.Util.UnitToPx( 1 ); Seperator.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) ); AddView( Seperator ); }
public SeriesPrimaryListItem( Context context ) : base( context ) { SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) ); Orientation = Orientation.Vertical; /*Header = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Header.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); Header.Text = MessagesStrings.Series_TopBanner; Header.SetTypeface( Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal ); Header.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Medium_FontSize ); Header.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); ( (LinearLayout.LayoutParams)Header.LayoutParameters ).Gravity = GravityFlags.Center; AddView( Header );*/ Billboard = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Billboard.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent ); Billboard.SetScaleType( ImageView.ScaleType.CenterCrop ); AddView( Billboard ); Title = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Title.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); Title.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Bold ), TypefaceStyle.Normal ); Title.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Large_FontSize ); Title.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_ActiveTextColor ) ); ( (LinearLayout.LayoutParams)Title.LayoutParameters ).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 5 ); ( (LinearLayout.LayoutParams)Title.LayoutParameters ).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 8 ); AddView( Title ); DetailsLayout = new LinearLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); DetailsLayout.Orientation = Orientation.Horizontal; DetailsLayout.LayoutParameters = new LinearLayout.LayoutParams( LayoutParams.WrapContent, LayoutParams.WrapContent ); ( (LinearLayout.LayoutParams)DetailsLayout.LayoutParameters ).Gravity = GravityFlags.CenterVertical; ( (LinearLayout.LayoutParams)DetailsLayout.LayoutParameters ).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( -4 ); ( (LinearLayout.LayoutParams)DetailsLayout.LayoutParameters ).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 8 ); ( (LinearLayout.LayoutParams)DetailsLayout.LayoutParameters ).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 8 ); ( (LinearLayout.LayoutParams)DetailsLayout.LayoutParameters ).BottomMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( 5 ); AddView( DetailsLayout ); Date = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Date.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); Date.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal ); Date.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize ); Date.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); DetailsLayout.AddView( Date ); // fill the remaining space with a dummy view, and that will align our speaker to the right View dummyView = new View( Rock.Mobile.PlatformSpecific.Android.Core.Context ); dummyView.LayoutParameters = new LinearLayout.LayoutParams( 0, 0 ); ( (LinearLayout.LayoutParams)dummyView.LayoutParameters ).Weight = 1; DetailsLayout.AddView( dummyView ); Speaker = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Speaker.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); Speaker.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal ); Speaker.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize ); Speaker.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); DetailsLayout.AddView( Speaker ); // setup the buttons ButtonLayout = new LinearLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); ButtonLayout.Orientation = Orientation.Horizontal; ButtonLayout.LayoutParameters = new LinearLayout.LayoutParams( LayoutParams.MatchParent, LayoutParams.WrapContent ); AddView( ButtonLayout ); // Watch Button WatchButton = new BorderedActionButton(); WatchButton.AddToView( ButtonLayout ); ( (LinearLayout.LayoutParams)WatchButton.Layout.LayoutParameters ).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( -5 ); ( (LinearLayout.LayoutParams)WatchButton.Layout.LayoutParameters ).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( -1 ); ( (LinearLayout.LayoutParams)WatchButton.Layout.LayoutParameters ).Weight = 1; WatchButton.Layout.BorderWidth = 1; WatchButton.Layout.SetBorderColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) ); WatchButton.Layout.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) ); WatchButton.Icon.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( PrivateControlStylingConfig.Icon_Font_Secondary ), TypefaceStyle.Normal ); WatchButton.Icon.SetTextSize( Android.Util.ComplexUnitType.Dip, PrivateNoteConfig.Series_Table_IconSize ); WatchButton.Icon.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); WatchButton.Icon.Text = PrivateNoteConfig.Series_Table_Watch_Icon; WatchButton.Label.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal ); WatchButton.Label.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize ); WatchButton.Label.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); WatchButton.Label.Text = MessagesStrings.Series_Table_Watch; WatchButton.Button.Click += (object sender, EventArgs e ) => { ParentAdapter.WatchButtonClicked( ); }; // // TakeNotes Button TakeNotesButton = new BorderedActionButton(); TakeNotesButton.AddToView( ButtonLayout ); ( (LinearLayout.LayoutParams)TakeNotesButton.Layout.LayoutParameters ).LeftMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( -2 ); ( (LinearLayout.LayoutParams)TakeNotesButton.Layout.LayoutParameters ).RightMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( -5 ); ( (LinearLayout.LayoutParams)TakeNotesButton.Layout.LayoutParameters ).Weight = 1; TakeNotesButton.Layout.BorderWidth = 1; TakeNotesButton.Layout.SetBorderColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) ); TakeNotesButton.Layout.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) ); TakeNotesButton.Icon.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( PrivateControlStylingConfig.Icon_Font_Secondary ), TypefaceStyle.Normal ); TakeNotesButton.Icon.SetTextSize( Android.Util.ComplexUnitType.Dip, PrivateNoteConfig.Series_Table_IconSize ); TakeNotesButton.Icon.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); TakeNotesButton.Icon.Text = PrivateNoteConfig.Series_Table_TakeNotes_Icon; TakeNotesButton.Label.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal ); TakeNotesButton.Label.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize ); TakeNotesButton.Label.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); TakeNotesButton.Label.Text = MessagesStrings.Series_Table_TakeNotes; TakeNotesButton.Button.Click += (object sender, EventArgs e ) => { ParentAdapter.TakeNotesButtonClicked( ); }; // Footer = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Footer.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent ); ( (LinearLayout.LayoutParams)Footer.LayoutParameters ).TopMargin = (int)Rock.Mobile.Graphics.Util.UnitToPx( -5 ); Footer.Text = MessagesStrings.Series_Table_PreviousMessages; Footer.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal ); Footer.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize ); Footer.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) ); Footer.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.Table_Footer_Color ) ); Footer.Gravity = GravityFlags.Center; AddView( Footer ); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return(null); } // at this point our properties should be set. View view = inflater.Inflate(Resource.Layout.News_Details, container, false); view.SetOnTouchListener(this); view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor)); // set the banner RelativeLayout headerImageLayout = view.FindViewById <RelativeLayout>(Resource.Id.news_details_header_image_layout); ImageBanner = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView(Activity); headerImageLayout.AddView(ImageBanner, 0); int width = NavbarFragment.GetCurrentContainerDisplayWidth( ); int height = (int)System.Math.Ceiling(width * PrivateNewsConfig.NewsMainAspectRatio); ImageBanner.LayoutParameters = new RelativeLayout.LayoutParams(width, height); // set the button Button headerButton = view.FindViewById <Button>(Resource.Id.news_details_header_image_button); headerButton.LayoutParameters = new RelativeLayout.LayoutParams(width, height); headerButton.Click += (object sender, EventArgs e) => { if (string.IsNullOrWhiteSpace(ReferenceURL) == false) { ParentTask.OnClick(this, headerButton.Id); } }; TextView title = view.FindViewById <TextView>(Resource.Id.news_details_title); title.Text = Title?.ToUpper( ); title.SetSingleLine( ); title.Ellipsize = Android.Text.TextUtils.TruncateAt.End; title.SetMaxLines(1); title.SetHorizontallyScrolling(true); ControlStyling.StyleUILabel(title, ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize); // set the description TextView description = view.FindViewById <TextView>(Resource.Id.news_details_details); description.Text = Description; description.MovementMethod = new ScrollingMovementMethod(); ControlStyling.StyleUILabel(description, ControlStylingConfig.Font_Light, ControlStylingConfig.Small_FontSize); // if we're in developer mode, add the start / end times for this promotion if (MobileApp.Shared.Network.RockLaunchData.Instance.Data.DeveloperModeEnabled == true) { // if we're in developer mode, add the start / end times for this promotion if (MobileApp.Shared.Network.RockLaunchData.Instance.Data.DeveloperModeEnabled == true) { description.Text += DeveloperInfo; } } Button launchUrlButton = view.FindViewById <Button>(Resource.Id.news_details_launch_url); launchUrlButton.Click += (object sender, EventArgs e) => { // move to the next page... ParentTask.OnClick(this, launchUrlButton.Id); }; ControlStyling.StyleButton(launchUrlButton, NewsStrings.LearnMore, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize); // hide the button if there's no reference URL. if (string.IsNullOrWhiteSpace(ReferenceURL) == true) { launchUrlButton.Visibility = ViewStates.Gone; } else { launchUrlButton.Visibility = ViewStates.Visible; } return(view); }
public PrimaryListItem( Context context ) : base(context) { SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) ); Orientation = Android.Widget.Orientation.Vertical; Billboard = new Rock.Mobile.PlatformSpecific.Android.Graphics.AspectScaledImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Billboard.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent ); Billboard.SetScaleType( ImageView.ScaleType.CenterCrop ); AddView( Billboard ); Title = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); Title.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); Title.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Bold ), TypefaceStyle.Normal ); Title.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Large_FontSize ); Title.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_ActiveTextColor ) ); Title.Text = ConnectStrings.Main_Connect_Header; ( (LinearLayout.LayoutParams)Title.LayoutParameters ).TopMargin = 5; ( (LinearLayout.LayoutParams)Title.LayoutParameters ).LeftMargin = 25; ( (LinearLayout.LayoutParams)Title.LayoutParameters ).BottomMargin = 5; AddView( Title ); }