本文整理汇总了C#中LinearLayout.RemoveView方法的典型用法代码示例。如果您正苦于以下问题:C# LinearLayout.RemoveView方法的具体用法?C# LinearLayout.RemoveView怎么用?C# LinearLayout.RemoveView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinearLayout
的用法示例。
在下文中一共展示了LinearLayout.RemoveView方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImageZoom
//-----------clicking on images -> image on fullscreen---------//
protected void ImageZoom(ImageView imageView, string Tag, LinearLayout fullScreen, LinearLayout downScreen, Button takeIt)
{
imageView.Click += ((object sender, System.EventArgs e) => {
Log.Info(Tag, "isImageFitToScreen: " + isImageFitToScreen.ToString());
if (isImageFitToScreen) {
downScreen.RemoveView(imageView);
imageView.SetMaxHeight (1500);
imageView.SetMaxWidth (1500);
fullScreen.AddView(imageView);
fullScreen.AddView(takeIt);
Log.Info(Tag, "maximize");
canBeSelected = true;
isImageFitToScreen = false;
} else {
fullScreen.RemoveView(takeIt);
fullScreen.RemoveView(imageView);
imageView.SetMaxHeight (450);
imageView.SetMaxWidth (450);
downScreen.AddView(imageView);
Log.Info(Tag, "minimize");
canBeSelected = false;
isImageFitToScreen = true;
}
});
}
示例2: OnCreate
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
/************************************************|
* DECLARING VARIABLES |
* for global class use |
* |
*************************************************/
Log.Info (Tag, "Choosing Phase began");
SetContentView(Resource.Layout.NewJourneySpecificPreferences);
//--------Layout Variables---------//
// Images - Interests - New Journey
firstImage = (ImageView)FindViewById (Resource.Id.imageView1);
secondImage = (ImageView)FindViewById (Resource.Id.imageView2);
thirdImage = (ImageView)FindViewById (Resource.Id.imageView3);
fourthImage = (ImageView)FindViewById (Resource.Id.imageView4);
// Buttons - Moodboard
takeItFirst = (Button)FindViewById (Resource.Id.takeItFirst);
takeItSecond = (Button) FindViewById (Resource.Id.takeItSecond);
takeItThird = (Button)FindViewById (Resource.Id.takeItThird);
takeItFourth = (Button)FindViewById (Resource.Id.takeItFourth);
// Buttons - Transitions
nextButton = (Button) FindViewById (Resource.Id.nextButton);
backButton = (Button)FindViewById (Resource.Id.backButton);
nextButtonExplanation = (Button)FindViewById (Resource.Id.nextButtonChoosing);
backButtonExplanation = (Button)FindViewById (Resource.Id.backButtonChoosing);
// Layout - Special Preference - New Journey
layoutFirstImage = (LinearLayout)FindViewById (Resource.Id.layoutFirstImage);
layoutSecondImage = (LinearLayout)FindViewById (Resource.Id.layoutSecondImage);
layoutThirdImage = (LinearLayout)FindViewById (Resource.Id.layoutThirdImage);
layoutFourthImage = (LinearLayout)FindViewById (Resource.Id.layoutFourthImage);
fullScreen = (LinearLayout)FindViewById (Resource.Id.fullScreenLayout);
// Flipper - Specific Preferences - New Journey
flipper = (ViewFlipper) FindViewById (Resource.Id.viewFlipper1);
//-----------Method Variables---------//
// bools
isImageFitToScreen = true;
isSelected = true;
canBeSelected = false;
// ints
imagesSelected = 0;
// Remove Like Buttons from View (o t in Fullscreen View)
fullScreen.RemoveView (takeItFirst);
fullScreen.RemoveView (takeItSecond);
fullScreen.RemoveView (takeItThird);
fullScreen.RemoveView (takeItFourth);
nextButtonExplanation.Click += delegate {
flipper.ShowNext();
};
backButton.Click += delegate {
flipper.ShowPrevious();
};
/************************************************|
* INVOKING METHODS |
* |
* |
*************************************************/
// Zoom Methods - Interests
ImageZoom (firstImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
ImageZoom (secondImage, Tag, fullScreen, layoutSecondImage, takeItSecond);
ImageZoom (thirdImage, Tag, fullScreen, layoutThirdImage, takeItThird);
ImageZoom (fourthImage, Tag, fullScreen, layoutFourthImage, takeItFourth);
// Like Methods - Interests
clickingImage (firstImage, takeItFirst, fullScreen, layoutFirstImage);
clickingImage (secondImage, takeItSecond, fullScreen, layoutSecondImage);
clickingImage (thirdImage, takeItThird, fullScreen, layoutThirdImage);
clickingImage (fourthImage, takeItFourth, fullScreen, layoutFourthImage);
// Transition Methods
Transition (nextButton);
Transition (backButtonExplanation);
}
示例3: clickingImage
//----------image is clicked and color filter is set---------//
private void clickingImage(ImageView imageView, Button takeIt, LinearLayout fullScreen, LinearLayout downScreen)
{
// TODO: If one image is zoomed in multiple times, this function is also executed this amount of times.
// This function should only be executed one time no matter what.
takeIt.Click += ((object sender, System.EventArgs e) => {
Log.Info(Tag, "takeIt Button: " + takeIt.ToString());
if(isSelected && canBeSelected) {
if(imagesSelected < 1) {
imagesSelected += 1;
}
if (takeIt == takeItFirst) {
imageView.SetImageResource(Resource.Drawable.InDieBerge_confirmed);
}
if (takeIt == takeItSecond) {
imageView.SetImageResource(Resource.Drawable.InDenBusch_confirmed);
}
if (takeIt == takeItThird) {
imageView.SetImageResource(Resource.Drawable.InDieCity_confirmed);
}
if (takeIt == takeItFourth) {
imageView.SetImageResource(Resource.Drawable.AnDenStrand_confirmed);
}
Log.Info(Tag, "Images Selected: " + imagesSelected.ToString());
if(choosenImage != imageView) {
choosenImage = imageView;
} else {
choosenImage = null;
}
definingTag(imageView, true);
isSelected = false;
fullScreen.RemoveView(takeIt);
fullScreen.RemoveView(imageView);
imageView.SetMaxHeight (450);
imageView.SetMaxWidth (450);
downScreen.AddView(imageView);
Log.Info(Tag, "minimize");
canBeSelected = false;
isImageFitToScreen = true;
} else if (!isSelected && canBeSelected){
if(imagesSelected > 0) {
imagesSelected -= 1;
}
if (takeIt == takeItFirst) {
imageView.SetImageResource(Resource.Drawable.InDieBerge);
}
if (takeIt == takeItSecond) {
imageView.SetImageResource(Resource.Drawable.InDenBusch);
}
if (takeIt == takeItThird) {
imageView.SetImageResource(Resource.Drawable.InDieCity);
}
if (takeIt == takeItFourth) {
imageView.SetImageResource(Resource.Drawable.AnDenStrand);
}
Log.Info(Tag, "Images Selected: " + imagesSelected.ToString());
definingTag(imageView, false);
isSelected = true;
}
if (choosenImage != null) {
Log.Info(Tag, "choosenImage: " + choosenImage.ToString());
} else {
Log.Info(Tag, "choosen Image: null");
}
Log.Info(Tag, "isSelected: " + isSelected.ToString());
});
}
示例4: initUnidades
public void initUnidades(int indexCurso, int indexUnidad)
{
var textFormat = Android.Util.ComplexUnitType.Px;
_spaceUnidades.RemoveAllViews ();
_listLinearUnidades.Clear ();
_listIconMap.Clear ();
_listIconVerMap.Clear ();
int numUnidades = _listUnidades.Count;
for (int i = 0; i < numUnidades; i++)
{
LinearLayoutLO linearUnidad = new LinearLayoutLO (context);
linearUnidad.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
linearUnidad.Orientation = Orientation.Vertical;
linearUnidad.SetGravity (Android.Views.GravityFlags.CenterVertical);
linearUnidad.index = i;
linearUnidad.SetPadding (Configuration.getWidth(100), Configuration.getWidth (25),0, Configuration.getWidth (25));
//linearUnidad.SetX (100);
if (indexCurso == 0) {//Para que solo afecte a las Rutas
linearUnidad.SetPadding (Configuration.getWidth(100), Configuration.getWidth (25),0, Configuration.getWidth (-25));
}
TextView titleUnidad = new TextView(context);
titleUnidad.SetTextSize (textFormat,Configuration.getHeight(42));
titleUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2);
if (indexCurso == 2) {
if (indexUnidad == 3) {
linearUnidad.Orientation = Orientation.Horizontal;
ImageIconMap icon = new ImageIconMap (context);
icon.index = i;
icon.SetImageBitmap(iconPlay);
icon.SetX (Configuration.getWidth (60));
linearUnidad.AddView (icon);
_listIconMap.Add (icon);
}
}
if (indexCurso == 3) {
titleUnidad.SetTextSize (textFormat,Configuration.getHeight(55));
}
RelativeLayout linearContenido = new RelativeLayout (context);
linearContenido.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
linearContenido.SetGravity (Android.Views.GravityFlags.Center);
//TextView titleUnidad = new TextView(context);
//titleUnidad.Text = _listUnidades [i].Title;
titleUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Title);
titleUnidad.SetTextColor(Color.ParseColor (Configuration.ListaColores [i % 6]));
titleUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
TextView descriptionUnidad = new TextView(context);
descriptionUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2);
//descriptionUnidad.Text = _listUnidades [i].Description;
descriptionUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Description);
//descriptionUnidad.Text = _listUnidades [i].Description;
descriptionUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
descriptionUnidad.SetTextSize (textFormat,Configuration.getHeight(28));
//Linkify.AddLinks (descriptionUnidad, MatchOptions.All);
//Huillca
if (indexCurso == 1 && indexUnidad!=6) {//Para que no afecte a las Rutas ni a los precios
//Linkify.AddLinks(descriptionUnidad,Patterns.Phone,"tel:");
//(084) 21-1122 --------modelo de telefono
//984-820715 ----modelo celular
Linkify.AddLinks(descriptionUnidad,Java.Util.Regex.Pattern.Compile("\\W\\d+\\W\\s\\d+\\W\\d+"),"tel:");
Linkify.AddLinks(descriptionUnidad,Java.Util.Regex.Pattern.Compile("\\d+\\W\\d+"),"tel:");
Linkify.AddLinks(descriptionUnidad,Patterns.EmailAddress,"email:");
Linkify.AddLinks(descriptionUnidad,Patterns.WebUrl,"http://");
}
//descriptionUnidad.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance;
//descriptionUnidad.LinksClickable = true;
//descriptionUnidad.SetTextIsSelectable (true);
LinearLayout linearContenidoIn = new LinearLayout (context);
linearContenidoIn.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
linearContenidoIn.Orientation = Orientation.Vertical;
//linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);
linearContenidoIn.AddView (titleUnidad);
linearContenidoIn.AddView (descriptionUnidad);
linearContenido.AddView (linearContenidoIn);
if (indexCurso == 2) {
linearContenidoIn.RemoveView (descriptionUnidad);
ImageView imgUnidad = new ImageView (context);
Picasso.With (context).Load (_listUnidades[i].ImageUrl).Resize(Configuration.getWidth(440),Configuration.getHeight(440)).Placeholder(context.Resources.GetDrawable (Resource.Drawable.progress_animation)).CenterInside().Into (imgUnidad);
linearContenidoIn.AddView (imgUnidad);
linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);
//.........这里部分代码省略.........
示例5: initUnidades
//.........这里部分代码省略.........
}
//titleUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
TextView descriptionUnidad = new TextView(context);
descriptionUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2);
//descriptionUnidad.Text = _listUnidades [i].Description;
descriptionUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Description);
//descriptionUnidad.Text = _listUnidades [i].Description;
//descriptionUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
descriptionUnidad.SetTextSize (textFormat,Configuration.getHeight(28));
descriptionUnidad.SetTextColor(Color.ParseColor("#616161"));
Linkify.AddLinks (descriptionUnidad, MatchOptions.All);
//descriptionUnidad.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance;
//descriptionUnidad.LinksClickable = true;
//descriptionUnidad.SetTextIsSelectable (true);
LinearLayout linearContenidoIn = new LinearLayout (context);
linearContenidoIn.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
linearContenidoIn.Orientation = Orientation.Vertical;
//linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);
linearContenidoIn.AddView (titleUnidad);
linearContenidoIn.AddView (descriptionUnidad);
linearContenido.AddView (linearContenidoIn);
/*if (indexCurso == 2) {
linearContenidoIn.RemoveView (descriptionUnidad);
ImageView imgUnidad = new ImageView (context);
Picasso.With (context).Load (_listUnidades[i].ImageUrl).Resize(Configuration.getWidth(440),Configuration.getHeight(440)).Placeholder(context.Resources.GetDrawable (Resource.Drawable.progress_animation)).CenterInside().Into (imgUnidad);
linearContenidoIn.AddView (imgUnidad);
linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);
linearUnidad.SetPadding (0, Configuration.getWidth (25),0, Configuration.getWidth (25));
} */
linearUnidad.AddView (linearContenido);
if (indexCurso == 3) {
if (indexUnidad != 4) {//Antes era 3, ahora no es necesario eso
/*ImageView info = new ImageView (context);
info.Tag = i;
info.SetImageBitmap (iconInfo);
info.SetX (Configuration.getWidth(450));
info.SetY (Configuration.getHeight (10));*/
ImageView favorit_ = new ImageView(context);
favorit_.Tag = i;
favorit_.SetX(Configuration.getWidth(450));
favorit_.SetY(Configuration.getHeight(50));
favorit_.Click += delegate {
funcFavoritos(favorit_,indexCurso,indexUnidad);
};
//Colocando icono de Favoritos
if(!isFavoritos){
int id_auto = 0;
示例6: startPlaying
private void startPlaying()
{
var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater;
//View view = inflater.Inflate (Resource.Id.incomingVideo,null,false);
View _container = inflater.Inflate (Resource.Layout.IncomingCall, null, false);
//_container.SetBackgroundResource (view);
LinearLayout _lay = new LinearLayout (this);
SurfaceView _tv = new SurfaceView (this);
//_tv = _container.FindViewById<SurfaceView> (Resource.Id.incomingVideo);
_tv = _container.FindViewById<SurfaceView> (Resource.Id.incomingVideo);
_lay.RemoveView (_tv);
_lay.AddView (_tv);
//View view = inflater.Inflate(Resource.Layout.IncomingCall,null);
play ("test.mp4");
/*var notificationService = (NotificationManager) GetSystemService(NotificationService);
var notification = new Notification(Resource.Drawable.Icon, "Music started",
Java.Lang.JavaSystem.CurrentTimeMillis());
notification.Flags = NotificationFlags.NoClear;
var notificationIntent = PendingIntent.GetActivity(this, 0, new Intent(this, typeof(CallActivity)), 0);
notificationService.Notify (VideoPlayingNotification, notification);*/
}
示例7: ImageZoom
//-----------clicking on images -> image on fullscreen---------//
protected void ImageZoom(ImageView imageView, string Tag, LinearLayout fullScreen, LinearLayout downScreen, Button takeIt)
{
imageView.Click += ((object sender, System.EventArgs e) => {
if(phase == 1) {
Log.Info(Tag, "isImageFitToScreen: " + isImageFitToScreen.ToString());
if (isImageFitToScreen) {
downScreen.RemoveView(imageView);
imageView.SetMaxHeight (1500);
imageView.SetMaxWidth (1500);
fullScreen.AddView(imageView);
fullScreen.AddView(takeIt);
Log.Info(Tag, "maximize");
clickingImage(imageView, takeIt);
isImageFitToScreen = false;
} else {
fullScreen.RemoveView(takeIt);
fullScreen.RemoveView(imageView);
imageView.SetMaxHeight (450);
imageView.SetMaxWidth (450);
downScreen.AddView(imageView);
Log.Info(Tag, "minimize");
isImageFitToScreen = true;
isSelected = true;
}
}
if(phase == 2) {
if(isImageChoosen) {
if (imageView == firstPersonImage) {
imageView.SetImageResource(Resource.Drawable.test_test);
}
else if (imageView == secondPersonImage) {
}
else if (imageView == thirdPersonImage) {
}
else if (imageView == fourthPersonImage) {
}
isImageChoosen = false;
if(imagesSelected < 1) {
imagesSelected += 1;
phase = 3;
}
Log.Info(Tag, "Image Choosen" + imagesSelected.ToString());
definingTag(imageView, true);
} else {
if (imageView == firstPersonImage) {
imageView.SetImageResource(Resource.Drawable.test);
}
else if (imageView == secondPersonImage) {
}
else if (imageView == thirdPersonImage) {
}
else if (imageView == fourthPersonImage) {
}
if(imagesSelected > 0) {
imagesSelected -= 1;
phase = 2;
}
isImageChoosen = true;
Log.Info(Tag, "Image De-Choosen" + imagesSelected.ToString());
}
}
});
}
示例8: OnCreate
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
Log.Warn (Tag, "OnCreate");
/************************************************|
* DECLARING VARIABLES |
* for global class use |
* |
*************************************************/
Log.Info (Tag, "Choosing Phase began");
SetContentView(Resource.Layout.NewJourney);
//--------Layout Variables---------//
// Images - Interests - New Journey
firstImage = (ImageView)FindViewById (Resource.Id.imageView1);
secondImage = (ImageView)FindViewById (Resource.Id.imageView2);
thirdImage = (ImageView)FindViewById (Resource.Id.imageView3);
fourthImage = (ImageView)FindViewById (Resource.Id.imageView4);
// Images - Person Count Symbols
firstPersonImage = (ImageView) FindViewById (Resource.Id.imageView5);
secondPersonImage = (ImageView)FindViewById (Resource.Id.imageView6);
thirdPersonImage = (ImageView)FindViewById (Resource.Id.imageView7);
fourthPersonImage = (ImageView)FindViewById (Resource.Id.imageView8);
// Layout - Special Preference - New Journey
layoutFirstImage = (LinearLayout)FindViewById (Resource.Id.layoutFirstImage);
layoutSecondImage = (LinearLayout)FindViewById (Resource.Id.layoutSecondImage);
layoutThirdImage = (LinearLayout)FindViewById (Resource.Id.layoutThirdImage);
layoutFourthImage = (LinearLayout)FindViewById (Resource.Id.layoutFourthImage);
fullScreen = (LinearLayout)FindViewById (Resource.Id.fullScreenLayout);
mainPreferences = (LinearLayout)FindViewById (Resource.Id.MainPreferences);
imageChoosingExplanation = (LinearLayout)FindViewById (Resource.Id.ImageChoosingExplanation);
// Buttons - Moodboard
takeItFirst = (Button)FindViewById (Resource.Id.takeItFirst);
takeItSecond = (Button) FindViewById (Resource.Id.takeItSecond);
takeItThird = (Button)FindViewById (Resource.Id.takeItThird);
takeItFourth = (Button)FindViewById (Resource.Id.takeItFourth);
// Buttons - Back Buttons
backButtonMoodboard = (Button)FindViewById (Resource.Id.backButton);
backButtonExplanation = (Button)FindViewById (Resource.Id.backButtonChoosing);
backButtonDateStart = (Button)FindViewById (Resource.Id.backButtonDateStart);
backButtonDateEnd = (Button)FindViewById (Resource.Id.backButtonDateEnd);
backButtonPersonCount = (Button)FindViewById (Resource.Id.backButtonPersonCount);
// Buttons - Next Buttons
nextButtonMoodboard = (Button) FindViewById (Resource.Id.nextButton);
nextButtonChoosing = (Button)FindViewById (Resource.Id.nextButtonChoosing);
nextButtonDateStart = (Button)FindViewById (Resource.Id.nextButtonDateStart);
nextButtonDateEnd = (Button)FindViewById (Resource.Id.nextButtonDateEnd);
nextButtonPersonCount = (Button)FindViewById (Resource.Id.nextButtonPersonCount);
// Remove Like Buttons from View (o t in Fullscreen View)
fullScreen.RemoveView (takeItFirst);
fullScreen.RemoveView (takeItSecond);
fullScreen.RemoveView (takeItThird);
fullScreen.RemoveView (takeItFourth);
// Flipper - Main Preferences Main
flipper = (ViewFlipper) FindViewById (Resource.Id.viewFlipper1);
// Date Picker
dateStart = (DatePicker)FindViewById (Resource.Id.DatePickerStart);
dateEnd = (DatePicker)FindViewById (Resource.Id.DatePickerEnd);
//-----------Method Variables---------//
// bools
isImageFitToScreen = true;
isImageChoosen = true;
isSelected = true;
// ints
imagesSelected = 0;
phase = 1;
/************************************************|
* INVOKING METHODS |
* |
* |
*************************************************/
nextButtonChoosing.Click += delegate {
flipper.ShowNext();
};
// Only for testing
// ONLY FOR TESTING - DELETED WHEN RELEASED
//-----------Database is created---------//
createDatabase(dbPath);
// Phase Handler
next (Tag, nextButtonMoodboard);
next (Tag, nextButtonPersonCount);
next (Tag, nextButtonDateStart);
next (Tag, nextButtonDateEnd);
back (backButtonMoodboard);
back (backButtonExplanation);
back (backButtonDateStart);
//.........这里部分代码省略.........