本文整理汇总了C#中RelativeLayout.SetBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:C# RelativeLayout.SetBackgroundColor方法的具体用法?C# RelativeLayout.SetBackgroundColor怎么用?C# RelativeLayout.SetBackgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RelativeLayout
的用法示例。
在下文中一共展示了RelativeLayout.SetBackgroundColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
RelativeLayout mediarelativelayout =new RelativeLayout(nn_activity);
var mediarelativelayoutparam=new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent,RelativeLayout.LayoutParams.MatchParent);
mediarelativelayout.LayoutParameters = mediarelativelayoutparam;
mediarelativelayout.SetBackgroundColor (Color.White);
Button playbut = new Button (nn_activity);
RelativeLayout.LayoutParams playbutparam=new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent,RelativeLayout.LayoutParams.MatchParent);
playbut.Alpha = 0;
playbutparam.AddRule(LayoutRules.CenterInParent);
playbut.LayoutParameters = playbutparam;
playbut.Click -=OntouchVideoView;
playbut.Click += OntouchVideoView;
mediarelativelayout.AddView (playbut);
textureview = new TextureView (nn_activity);
textureview.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
textureview.Rotation = 90;
textureview.SurfaceTextureListener = this;
mediarelativelayout.AddView (textureview);
return mediarelativelayout;
}
示例2: AddSpinner
public void AddSpinner(ViewGroup rootview,string loadingtext)
{
loading = true;
if(loadingcontainer==null||(loadingcontainer!=null&&!loadingcontainer.IsShown)){
loadingcontainer = new RelativeLayout (nn_activity);
loadingcontainer.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
loadingcontainer.SetBackgroundColor (Color.White);
var detailcontainer = new LinearLayout (nn_activity);
detailcontainer.Orientation = Orientation.Vertical;
RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams ((int)TapUtil.dptodx (100), RelativeLayout.LayoutParams.WrapContent);
param.AddRule (LayoutRules.CenterInParent);
detailcontainer.LayoutParameters = param;
LinearLayout.LayoutParams linearlayoutparm = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
linearlayoutparm.Gravity = GravityFlags.CenterHorizontal;
ProgressBar progressbar = new ProgressBar (nn_activity);
progressbar.LayoutParameters = linearlayoutparm;
TextView tectview = new TextView (nn_activity);
tectview.LayoutParameters = linearlayoutparm;
tectview.Text = loadingtext;
tectview.Gravity = GravityFlags.CenterHorizontal;
detailcontainer.AddView (progressbar);
detailcontainer.AddView (tectview);
loadingcontainer.AddView (detailcontainer);
rootview.AddView (loadingcontainer);
}
}
示例3: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
if (null != savedInstanceState)
_colorRes = savedInstanceState.GetInt("_colorRes");
var color = Resources.GetColor(_colorRes);
var v = new RelativeLayout(Activity);
v.SetBackgroundColor(color);
return v;
}
示例4: OnCreateView
//@Override
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
if (savedInstanceState != null)
mColorRes = savedInstanceState.GetInt("mColorRes");
Color color = Resources.GetColor(mColorRes);
// construct the RelativeLayout
RelativeLayout v = new RelativeLayout(this.Activity);
v.SetBackgroundColor(color);
return v;
}
示例5: OnCreateView
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;
}
MediaController = new MediaController( Rock.Mobile.PlatformSpecific.Android.Core.Context );
RelativeLayout view = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
view.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
view.SetBackgroundColor( Android.Graphics.Color.Black );
view.SetOnTouchListener( this );
VideoPlayer = new VideoView( Activity );
VideoPlayer.SetMediaController( MediaController );
VideoPlayer.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent );
( (RelativeLayout.LayoutParams)VideoPlayer.LayoutParameters ).AddRule( LayoutRules.CenterInParent );
( ( view as RelativeLayout ) ).AddView( VideoPlayer );
VideoPlayer.SetOnPreparedListener( this );
VideoPlayer.SetOnErrorListener( this );
ProgressBar = new ProgressBar( Rock.Mobile.PlatformSpecific.Android.Core.Context );
ProgressBar.Indeterminate = true;
ProgressBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) );
ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent );
( (RelativeLayout.LayoutParams)ProgressBar.LayoutParameters ).AddRule( LayoutRules.CenterInParent );
view.AddView( ProgressBar );
ProgressBar.BringToFront();
ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { TryPlayMedia( ); } );
return view;
}
示例6: Initialize
void Initialize ()
{
var metrics = Resources.DisplayMetrics;
widthInDp = ((int)metrics.WidthPixels);
heightInDp = ((int)metrics.HeightPixels);
Configuration.setWidthPixel (widthInDp);
Configuration.setHeigthPixel (heightInDp);
adsImagesPath.Add ("images/ad1.jpg");
adsImagesPath.Add ("images/ad2.jpg");
adsImagesPath.Add ("images/ad3.jpg");
_leyendaMap = new ImageView(context);
_leyendaMapBack = new ImageView(context);
int w = Configuration.getWidth (25);
int h = Configuration.getHeight (45);
_leyendaMap.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/atras.png"), w, h, true));
_leyendaMap.SetPadding (w, 0, 0, 0);
_leyendaMap.Click += delegate {
showLeyenda ();
};
leyendaLayout = new RelativeLayout (context);
leyendaLayout.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(500),Configuration.getHeight(1136-85));
leyendaLayout.SetBackgroundColor (Color.White);
leyendaLayout.SetX (Configuration.getWidth (640));
leyendaLayout.Click += delegate {
showLeyenda();
};
_leyendaImage = new ImageView (context);
//_leyendaImage.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (500), -1);
_leyendaImage.SetImageBitmap(Bitmap.CreateScaledBitmap(getBitmapFromAsset("images/leyenda.png"),Configuration.getWidth (500),Configuration.getWidth(500),true));
//_leyendaImage.SetX (Configuration.getWidth (141));
_leyendaImage.SetY (Configuration.getHeight (125));
_leyendaImage.SetBackgroundColor (Color.Black);
_leyendaMapBack.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/adelante.png"), w, h, true));
//_leyendaMapBack.Rotation = 180;
_leyendaMapBack.SetPadding (w, 0, 0, 0);
_leyendaMapBack.SetX (Configuration.getWidth (445));
_leyendaMapBack.SetY (Configuration.getHeight (40));
_leyendaMapBack.Click += delegate {
showLeyenda ();
};
TextView tituloLeyenda = new TextView (context);
tituloLeyenda.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (125));
tituloLeyenda.Gravity = GravityFlags.Center;
tituloLeyenda.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
tituloLeyenda.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
tituloLeyenda.Text = "LEYENDA";
leyendaLayout.AddView (tituloLeyenda);
leyendaLayout.AddView (_leyendaImage);
leyendaLayout.AddView (_leyendaMapBack);
loadIcons ();
//loadMapas ();
ini ();
//iniNotifList ();
this.AddView (_mainLayout);
}
示例7: OnCreateView
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;
}
FadeOutFrame = Activity.FindViewById<FrameLayout>(Resource.Id.fadeOutView) as FrameLayout;
FadeOutFrame.Alpha = 0.0f;
//The navbar should basically be a background with logo and a springboard reveal button in the upper left.
Navbar = inflater.Inflate(Resource.Layout.navbar, container, false) as RelativeLayout;
Navbar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TopNavToolbar_BackgroundColor ) );
// create the springboard reveal button
CreateSpringboardButton( Navbar );
DropShadowXOffset = 15;
DropShadowView = Activity.FindViewById<FrameLayout>(Resource.Id.dropShadowView) as FrameLayout;
InputViewChecker = new InputChecker( Rock.Mobile.PlatformSpecific.Android.Core.Context );
InputViewChecker.NavParent = this;
if ( _ActiveTaskFrame != null )
{
_ActiveTaskFrame.AddView( InputViewChecker );
}
return Navbar;
}
示例8: RefreshTable
void RefreshTable()
{
table.RemoveAllViews ();
TableRow.LayoutParams lpRow = new TableRow.LayoutParams ();
lpRow.Height = TableLayout.LayoutParams.WrapContent;
lpRow.Width = TableLayout.LayoutParams.WrapContent;
lpRow.Gravity = GravityFlags.Center;
//header
TableRow trHeader = new TableRow (Activity);
TextView tvHDrug = (TextView)layoutInflater.Inflate(Resource.Layout.DrugInfoDrugItem, null);
//tvHDrug.SetTextAppearance (Activity, Resource.Style.text_header_large);
tvHDrug.Text = "Препараты";
tvHDrug.LayoutParameters = lpRow;
((TableRow.LayoutParams)tvHDrug.LayoutParameters).SetMargins (0, 0, ToDIP(1) , 0);
tvHDrug.SetBackgroundColor (Android.Graphics.Color.White);
trHeader.AddView (tvHDrug);
int i = 0;
TableRow.LayoutParams lpValue = new TableRow.LayoutParams ();
lpValue.Height = TableLayout.LayoutParams.WrapContent;
lpValue.Width = TableLayout.LayoutParams.WrapContent;
lpValue.Gravity = GravityFlags.Center;
lpValue.SetMargins (ToDIP(1), ToDIP(1), ToDIP(1), ToDIP(1));
foreach (var drug in drugs) {
i++;
TableRow trRow = new TableRow (Activity);
TextView tvDrug = (TextView)layoutInflater.Inflate(Resource.Layout.DrugInfoDrugItem, null);
tvDrug.Gravity = GravityFlags.CenterVertical;
tvDrug.SetTextAppearance (Activity, Resource.Style.text_row_large);
tvDrug.Text = string.Format(@"{0}: {1}", i, drug.fullName);
tvDrug.LayoutParameters = lpRow;
tvDrug.SetBackgroundColor (Android.Graphics.Color.White);
trRow.AddView (tvDrug);
foreach (var info in infos) {
if (trHeader.Parent == null) {
TextView tvHInfo = (TextView)layoutInflater.Inflate(Resource.Layout.DrugInfoValueHeader, null);
tvHInfo.Text = info.name;
tvHInfo.SetBackgroundColor (Android.Graphics.Color.White);
trHeader.AddView (tvHInfo);
}
RelativeLayout rlValue = new RelativeLayout(Activity);
rlValue.SetGravity (GravityFlags.Center);
rlValue.SetMinimumHeight (ToDIP(64));
rlValue.SetMinimumWidth (ToDIP(64));
rlValue.LayoutParameters = lpValue;
rlValue.SetTag (Resource.String.IDinfo, info.id);
rlValue.SetTag (Resource.String.IDdrug, drug.id);
// rlValue.SetTag (Resource.String.IDattendance, attendace.id);
string value = AttendanceResultManager.GetResultValue (newAttendanceResults, info.id, drug.id);
if (info.valueType == @"number") {
RelativeLayout.LayoutParams nlpValue = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.MatchParent);
nlpValue.AddRule (LayoutRules.CenterInParent);
nlpValue.SetMargins (ToDIP(1), ToDIP(1), ToDIP(1), ToDIP(1));
EditText evValue = new EditText (Activity) { LayoutParameters = nlpValue };
evValue.SetMinimumWidth (ToDIP(64));
evValue.SetMaxWidth (ToDIP(64));
evValue.InputType = Android.Text.InputTypes.ClassNumber;
evValue.Text = value.Equals (@"N") ? string.Empty : value;
rlValue.AddView (evValue);
evValue.AfterTextChanged += NumberValue_AfterTextChanged;
}
if (info.valueType == @"decimal") {
RelativeLayout.LayoutParams dlpValue = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.MatchParent);
dlpValue.AddRule (LayoutRules.CenterInParent);
dlpValue.SetMargins (ToDIP(1), ToDIP(1), ToDIP(1), ToDIP(1));
EditText evValue = new EditText (Activity) { LayoutParameters = dlpValue };
evValue.SetMinimumWidth (ToDIP(64));
evValue.SetMaxWidth (ToDIP(64));
evValue.InputType = Android.Text.InputTypes.NumberFlagDecimal;
evValue.Text = value.Equals (@"N") ? string.Empty : value;
rlValue.AddView (evValue);
evValue.AfterTextChanged += DecimalValue_AfterTextChanged;
}
if (info.valueType == @"boolean") {
rlValue.Click += Rl_Click;
TextView tvValue = new TextView (Activity);
tvValue.Gravity = GravityFlags.Center;
if (string.IsNullOrEmpty (value) || value.Equals (@"N")) {
tvValue.SetTextAppearance (Activity, Resource.Style.text_danger);
rlValue.SetBackgroundColor (Android.Graphics.Color.LightPink);
} else {
tvValue.SetTextAppearance (Activity, Resource.Style.text_success);
rlValue.SetBackgroundColor (Android.Graphics.Color.LightGreen);
//.........这里部分代码省略.........
示例9: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
rootview = new RelativeLayout (nn_activity);
rootview.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
rootview.SetBackgroundColor (Resources.GetColor(Resource.Color.soarnix_bg_gray));
rootview.Id = TapUtil.generateViewId ();
//list to show event history
historyeventlist = new ListView (nn_activity);
historyeventlist.LayoutParameters= new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
historyeventlist.Id = TapUtil.generateViewId ();
adapter = new EventHistoryListAdapter (nn_activity,historylist);
historyeventlist.Adapter = adapter;
//add a relative layout to rootview to show no result event
nohistorylayout=new RelativeLayout(nn_activity);
nohistorylayout.LayoutParameters= new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
nohistorylayout.SetBackgroundResource(Resource.Color.soarnix_bg_gray);
nohistorylayout.Visibility = ViewStates.Gone;
nohistorytext = new TextView (nn_activity);
nohistorytext.Text = HistoryScreenData.NoRecordMessage;
nohistorytext.Gravity = GravityFlags.Center;
RelativeLayout.LayoutParams nohistorytextparam=new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent);
nohistorytextparam.AddRule (LayoutRules.CenterInParent);
nohistorytextparam.SetMargins (TapUtil.dptodx (10), 0, TapUtil.dptodx (10), 0);
nohistorytext.LayoutParameters = nohistorytextparam;
nohistorylayout.AddView (nohistorytext);
rootview.AddView (historyeventlist);
rootview.AddView (nohistorylayout);
return rootview;
}
示例10: AddSpinner
public void AddSpinner(string text)
{
if(loadingcontainer==null||(loadingcontainer!=null&&!loadingcontainer.IsShown)){
loadingcontainer = new RelativeLayout (this);
loadingcontainer.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
loadingcontainer.SetBackgroundColor(Color.White);
var detailcontainer = new LinearLayout (this);
detailcontainer.Orientation = Orientation.Vertical;
RelativeLayout.LayoutParams param=new RelativeLayout.LayoutParams((int)TapUtil.dptodx(100), RelativeLayout.LayoutParams.WrapContent);
param.AddRule (LayoutRules.CenterInParent);
detailcontainer.LayoutParameters = param;
LinearLayout.LayoutParams linearlayoutparm=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
linearlayoutparm.Gravity=GravityFlags.CenterHorizontal;
ProgressBar progressbar = new ProgressBar (this);
progressbar.LayoutParameters = linearlayoutparm;
TextView tectview = new TextView (this);
tectview.Tag="spinner.text";
tectview.LayoutParameters = linearlayoutparm;
tectview.Text =text;
tectview.Gravity = GravityFlags.CenterHorizontal;
detailcontainer.AddView (progressbar);
detailcontainer.AddView (tectview);
loadingcontainer.AddView (detailcontainer);
rootlayout.AddView (loadingcontainer);
}else if (loadingcontainer!=null&&loadingcontainer.IsShown){
TextView textview=(TextView)loadingcontainer.FindViewWithTag ("spinner.text");
if(textview!=null){
textview.Text = text;
}
}
}
示例11: RefreshTable
//.........这里部分代码省略.........
v.SetMinimumHeight (72);
v.SetMinimumWidth (68);
v.Rotation = -90;
// v.SetBackgroundResource (Resource.Style.text_row);
// v.SetB
// v.Text = info.infoID.ToString();
// v.Text = GetInfo(info.infoID).name;
// v.SetHorizontallyScrolling (false);
v.Text = info.name;
v.LayoutParameters = p;
r.AddView (v);
TableLayout tl = new TableLayout (Activity);
if (header.Parent == null) {
tl.AddView (header);
}
tl.Id = info.id;
foreach (var drug in drugs) {
TableRow rr = new TableRow (Activity);
rr.Id = drug.id;
TextView vv = new TextView (Activity);
vv.Gravity = GravityFlags.Center;
vv.SetMinimumHeight (42);
vv.SetMinimumWidth (76);
// vv.Text = drugInfo.drugID.ToString();
// vv.Text = GetDrug(drugInfo.drugID).fullName;
vv.Text = drug.fullName;
vv.LayoutParameters = p;
rr.AddView (vv);
foreach (var attendace in drugInfo.attendaces) {
RelativeLayout rl = new RelativeLayout(Activity);
rl.SetGravity (GravityFlags.Center);
rl.SetMinimumHeight (68);
rl.SetMinimumWidth (68);
rl.LayoutParameters = p;
rl.Id = attendace.id;
rl.Click += (object sender, EventArgs e) => {
RelativeLayout rlAttendace = (RelativeLayout) sender;
TableRow trDrug = (TableRow) rl.Parent;
TableLayout trInfo = (TableLayout) rl.Parent.Parent;
string message = string.Format(@"Click to RL.id:{0}, P,id:{1}, PP.id:{2}", rlAttendace.Id, trDrug.Id, trInfo.Id);
Toast.MakeText(Activity, message, ToastLength.Short).Show();
FragmentTransaction trans = FragmentManager.BeginTransaction ();
DrugInfoValueDialog drugInfoValueDialog = new DrugInfoValueDialog ();
Bundle args = new Bundle();
args.PutInt(DrugInfoValueDialog.ATTENDANCE_ID, rlAttendace.Id);
args.PutInt(DrugInfoValueDialog.DRUG_ID, trDrug.Id);
args.PutInt(DrugInfoValueDialog.INFO_ID, trInfo.Id);
// args.PutString(DrugInfoValueDialog.VALUE, GetDrugInfoValue(drugInfo.attendaces[rlAttendace.Id - 1].results, trInfo.Id, trDrug.Id));
drugInfoValueDialog.Arguments = args;
drugInfoValueDialog.AfterSave += DrugInfoValueDialog_AfterSave;
drugInfoValueDialog.Show (trans, "dialog fragment");
Log.Info ("ifSignInButton", "Click");
};
// string value = GetDrugInfoValue (attendace.results, info.id, drug.id);
if (string.IsNullOrEmpty (value)) {
ImageView iv = new ImageView (Activity);
iv.SetImageResource (Resource.Drawable.ic_add_circle_white_24dp);
rl.SetBackgroundColor (Android.Graphics.Color.LightPink);
// rl.SetBackgroundResource(Resource.Style.alert_success);
rl.AddView (iv);
} else {
TextView vvv = new TextView (Activity);
vvv.Gravity = GravityFlags.Center;
vvv.Text = value;
vvv.SetTextAppearance (Activity, Resource.Style.text_success);
// vvv.SetTextSize (ComplexUnitType.Sp, 24);
// vvv.SetTextColor(Android.Graphics.Color.Argb);
rl.SetBackgroundColor (Android.Graphics.Color.LightGreen);
rl.AddView (vvv);
}
rr.AddView (rl);
}
// for (int i = 0; i < 2; i++) { // Values
// ImageView iv = new ImageView (Activity);
// iv.SetImageResource (Resource.Drawable.ic_add_circle_white_24dp);
// rr.AddView (iv);
// }
tl.AddView (rr);
}
r.AddView (tl);
table.AddView (r);
}
}
示例12: ini
async Task ini(){
mainLayout = new RelativeLayout (this);
_progresD = new ProgressDialog (this);
_progresD.SetCancelable (false);
_progresD.SetMessage ("Wait please..");
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
mainLayout.SetBackgroundColor(Color.ParseColor("#ffffff"));
mainLayoutIndice = new RelativeLayout (this);
mainLayoutIndice.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
mainLayoutIndice.SetBackgroundColor(Color.ParseColor("#ffffff"));
mainLayoutPages = new RelativeLayout (this);
mainLayoutPages.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
mainLayoutPages.SetBackgroundColor(Color.ParseColor("#ffffff"));
viewPager = new ViewPager (this);
viewPagerIni = new ViewPager (this);
/* layoutPanelScroll = new LinearLayout (this);
layoutPanelScroll.LayoutParameters = new LinearLayout.LayoutParams (-1,-2);
layoutPanelScroll.SetBackgroundColor(Color.ParseColor("#ffffff"));
layoutPanelScroll.Orientation = Orientation.Vertical;
*/
/* scrollVertical = new VerticalScrollView (this);
scrollVertical.setOnScrollViewListener (this);
scrollVertical.LayoutParameters = new ViewGroup.LayoutParams (-1, -1);
scrollVertical.SetX (0); scrollVertical.SetY (0);
scrollVertical.AddView (layoutPanelScroll);*/
//mainLayoutIndice.AddView (scrollVertical);
mainLayoutIndice.SetX (0); mainLayoutIndice.SetY (0);
mainLayout.AddView (mainLayoutIndice);
//mainLayout.AddView (scrollVertical);
//var vm = this.ViewModel as LOViewModel;
await vm.InitLoad();
loadLOsInCircle(0);
viewPagerIni.SetOnPageChangeListener (new MyPageChangeListener (this,listFront));
viewPager.SetOnPageChangeListener (new MyPageChangeListenerPager (this, listFrontPager));
vm.PropertyChanged += Vm_PropertyChanged;
}
示例13: ini
private void ini(){
mainLayout = new RelativeLayout (context);
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
mainLayout.SetBackgroundColor(Color.ParseColor("#ffffff"));
linearContainer = new LinearLayout (context);
linearImageLO = new LinearLayout (context);
linearTextLO = new LinearLayout (context);
linearLike = new LinearLayout (context);
linearUsers = new LinearLayout (context);
txtAuthor = new TextView (context);
txtChapter= new TextView (context);
txtNameLO = new TextView (context);
txtLike = new TextView (context);
txtAuthor.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
txtChapter.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
txtNameLO.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
txtLike.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
imgHeart= new ImageView (context);
commentList = new ListView (context);
linearContainer.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
linearImageLO.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(372));
linearTextLO.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(250));
linearLike.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(120), Configuration.getHeight(80));
linearUsers.LayoutParameters = new LinearLayout.LayoutParams (-1,-2);
linearTextLO.Orientation = Orientation.Vertical;
linearTextLO.SetGravity(GravityFlags.Right);
linearLike.Orientation = Orientation.Vertical;
linearLike.SetGravity (GravityFlags.Center);
linearUsers.Orientation = Orientation.Horizontal;
linearUsers.SetGravity (GravityFlags.Center);
linearContainer.Orientation = Orientation.Vertical;
//linearContainer.SetGravity (GravityFlags.Center);
//Drawable d = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondounidad.png"), 480, 640, true));
//linearImageLO.SetBackgroundDrawable (d);
imgHeart.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/like.png"), Configuration.getWidth(43), Configuration.getHeight(43), true));
txtAuthor.Text = "Author : David Spencer";
txtChapter.Text = "Flora y Fauna";
txtNameLO.Text = "Camino Inca";
txtLike.Text = "10";
//txtChapter.SetMaxWidth (Configuration.getWidth (580));
//txtChapter.Ellipsize = TextUtils.TruncateAt.End;
//txtChapter.SetMaxLines(1);
txtAuthor.SetTextColor (Color.ParseColor("#ffffff"));
txtChapter.SetTextColor (Color.ParseColor("#ffffff"));
txtNameLO.SetTextColor (Color.ParseColor("#ffffff"));
txtLike.SetTextColor (Color.ParseColor("#ffffff"));
txtNameLO.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtChapter.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (50));
txtAuthor.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtNameLO.Typeface = Typeface.DefaultBold;
txtAuthor.Gravity = GravityFlags.Right;
txtChapter.Gravity = GravityFlags.Right;
txtNameLO.Gravity = GravityFlags.Right;
txtLike.Gravity = GravityFlags.Center;
linearTextLO.AddView (txtNameLO);
linearTextLO.AddView (txtChapter);
linearTextLO.AddView (txtAuthor);
linearTextLO.SetPadding (0, 0, Configuration.getWidth (30), 0);
linearLike.AddView (imgHeart);
linearLike.AddView (txtLike);
_mCommentData = new List<CommentDataRow> ();
/*
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
*/
// commentList.Adapter = new CommentListViewAdapter (context, _mCommentData);
//.........这里部分代码省略.........
示例14: ini
public void ini(){
Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/1header.png"));
header = new LinearLayout(context);
header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125));
header.Orientation = Orientation.Horizontal;
header.SetGravity (GravityFlags.Center);
header.SetBackgroundDrawable (dr);
titulo_header = new TextView (context);
titulo_header.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(550), -1);
titulo_header.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
titulo_header.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
titulo_header.SetTextColor (Color.White);
titulo_header.Gravity = GravityFlags.Center;
//titulo_header.TextAlignment = TextAlignment.Center;
placesInfoLayout = new LinearLayout (context);
placesInfoLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
int space = Configuration.getWidth (30);
placesInfoLayout.SetPadding(space,space,space,space);
placesInfoLayout.Orientation = Orientation.Vertical;
_mainLayout = new RelativeLayout (context);
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
_mainLayout.AddView (header);
mapImage = new ScaleImageView (context, null);
mapImage.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
mapSpace = new LinearLayout (context);
mapSpace.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
mapSpace.SetY (Configuration.getHeight (125));
mapSpace.SetGravity (GravityFlags.Left);
mapSpace.SetBackgroundColor (Color.ParseColor ("#DFC6BB"));
//HUILLCA-----------------------------------------
mapSpaceMarker = new RelativeLayout (context);
mapSpaceMarker.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
mapSpaceMarker.SetY (Configuration.getHeight (125));
mapSpaceMarker.SetGravity (GravityFlags.Left);
mapSpaceMarker.SetBackgroundColor (Color.Transparent);
iconMarker = new ImageIconMap (context);
iconMarker.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (60), Configuration.getWidth (60));
int w = Configuration.getWidth (70);
int h = Configuration.getWidth (70);
iconMarker.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/iconmap12.png"), w, h, true));
iconMarker.SetX (-100);
iconMarker.SetY (-100);
mapSpaceMarker.AddView (iconMarker);
var fadeIn = new AlphaAnimation(0, 1);
fadeIn.Interpolator = new AccelerateInterpolator();
fadeIn.Duration = 1000;
fadeOut = new AlphaAnimation(1, 0);
fadeOut.Interpolator = new DecelerateInterpolator();
fadeOut.Duration = 3000;
fadeOut.AnimationEnd += (s, e) =>
{
/*ThreadPool.QueueUserWorkItem(state =>
{
Thread.Sleep(2000); //wait 2 sec
//RunOnUiThread(() => iconMarker.StartAnimation(fadeOut));
});*/
iconMarker.StartAnimation(fadeIn);
iconMarker.Visibility = ViewStates.Invisible;
};
//-------------------------------------------------------
mapSpace.AddView (mapImage);
placeSpace = new VerticalScrollView (context);
placeSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
placeSpace.SetY (Configuration.getHeight (125)+Configuration.getWidth(640));
placeSpace.SetBackgroundColor (Color.White);
placesContainer = new LinearLayout (context);
placesContainer.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
placesContainer.Orientation = Orientation.Vertical;
_mainLayout.AddView (mapSpace);
_mainLayout.AddView (mapSpaceMarker);//HUILLCA
_mainLayout.AddView (placeSpace);
_publicidadLayout = new LinearLayout (context);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable drp = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (drp);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
//.........这里部分代码省略.........
示例15: ini
async Task ini(){
_mainLayout = new RelativeLayout (this);
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
_mainLayout.SetBackgroundColor(Color.ParseColor("#ffffff"));
mainLayoutIndice = new RelativeLayout (this);
mainLayoutIndice.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
mainLayoutIndice.SetBackgroundColor(Color.ParseColor("#ffffff"));
mainLayoutPages = new RelativeLayout (this);
mainLayoutPages.LayoutParameters = new RelativeLayout.LayoutParams (-1,Configuration.getWidth(1136-85));
mainLayoutPages.SetBackgroundColor(Color.ParseColor("#ffffff"));
viewPager = new ViewPager (this);
viewPagerIni = new ViewPager (this);
/* layoutPanelScroll = new LinearLayout (this);
layoutPanelScroll.LayoutParameters = new LinearLayout.LayoutParams (-1,-2);
layoutPanelScroll.SetBackgroundColor(Color.ParseColor("#ffffff"));
layoutPanelScroll.Orientation = Orientation.Vertical;
*/
/* scrollVertical = new VerticalScrollView (this);
scrollVertical.setOnScrollViewListener (this);
scrollVertical.LayoutParameters = new ViewGroup.LayoutParams (-1, -1);
scrollVertical.SetX (0); scrollVertical.SetY (0);
scrollVertical.AddView (layoutPanelScroll);*/
//mainLayoutIndice.AddView (scrollVertical);
mainLayoutIndice.SetX (0); mainLayoutIndice.SetY (0);
_mainLayout.AddView (mainLayoutIndice);
//mainLayout.AddView (scrollVertical);
//var vm = this.ViewModel as LOViewModel;
await vm.InitLoad();
//loadLOsInCircle(0);
LoadPagesDataSource();
viewPagerIni.SetOnPageChangeListener (new MyPageChangeListener (this,listFront));
viewPager.SetOnPageChangeListener (new MyPageChangeListenerPager (this, listFrontPager));
vm.PropertyChanged += Vm_PropertyChanged;
}