本文整理汇总了C#中EditText.SetSingleLine方法的典型用法代码示例。如果您正苦于以下问题:C# EditText.SetSingleLine方法的具体用法?C# EditText.SetSingleLine怎么用?C# EditText.SetSingleLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EditText
的用法示例。
在下文中一共展示了EditText.SetSingleLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Prompt
public override void Prompt(string message, Action<PromptResult> promptResult, string title, string okText, string cancelText, string hint, int lines) {
Droid.RequestMainThread(() => {
var txt = new EditText(Forms.Context) {
Hint = hint
};
if (lines > 1) {
txt.SetLines(lines);
txt.SetSingleLine(false);
txt.ImeOptions = ImeAction.Next;
}
new AlertDialog
.Builder(Forms.Context)
.SetMessage(message)
.SetTitle(title)
.SetView(txt)
.SetPositiveButton(okText, (o, e) =>
promptResult(new PromptResult {
Ok = true,
Text = txt.Text
})
)
.SetNegativeButton(cancelText, (o, e) =>
promptResult(new PromptResult {
Ok = false,
Text = txt.Text
})
)
.Show();
});
}
示例2: AddTeamDialog
static Dialog AddTeamDialog (ICommand yesAction)
{
var activity = Mvx.Resolve<IMvxAndroidCurrentTopActivity> ().Activity;
var builder = new AlertDialog.Builder(activity);
var editText = new EditText (activity);
editText.SetSingleLine ();
builder.SetView (editText)
.SetCancelable (true)
.SetTitle (StringResources.TeamName);
builder.SetPositiveButton (StringResources.Add, new EventHandler<DialogClickEventArgs> ((s, e) => {
if (yesAction.CanExecute (editText.Text)) {
yesAction.Execute (editText.Text);
}
})).SetNegativeButton (StringResources.Cancel, (EventHandler<DialogClickEventArgs>)null);
return builder.Create ();
}
示例3: setItemLogin
public void setItemLogin(){
var txtFormat = Android.Util.ComplexUnitType.Px;
linearButtonLogin = new LinearLayout (this);
linearEditTextLogin = new LinearLayout (this);
linearTextLogin = new LinearLayout (this);
etxtUser = new EditText (this);
etxtPassword = new EditText (this);
btnLoginInto = new ImageButton (this);
txtLogin_a = new TextView (this);
txtLogin_b = new TextView (this);
txtInicioSesion = new TextView (this);
linearButtonLogin.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearEditTextLogin.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearTextLogin.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
etxtUser.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtPassword.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
linearButtonLogin.Orientation = Orientation.Horizontal;
linearButtonLogin.SetGravity (GravityFlags.Center);
linearEditTextLogin.Orientation = Orientation.Vertical;
linearEditTextLogin.SetGravity (GravityFlags.Center);
linearTextLogin.Orientation = Orientation.Vertical;
linearTextLogin.SetGravity (GravityFlags.Center);
etxtUser.Hint = " Usuario";
etxtUser.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtPassword.Hint = " Contraseña";
etxtPassword.InputType = Android.Text.InputTypes.TextVariationPassword | Android.Text.InputTypes.ClassText;
etxtPassword.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
txtLogin_a.Text = "FORGOT PASSWORD?";
txtLogin_a.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtLogin_b.Text = " CHANGE";
txtLogin_b.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtLogin_a.SetTextSize (txtFormat,Configuration.getHeight(30));
txtLogin_b.SetTextSize (txtFormat, Configuration.getHeight (30));
txtInicioSesion.Text = "Iniciar Sesión";
txtInicioSesion.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtInicioSesion.SetTextColor (Color.ParseColor("#ffffff"));
txtInicioSesion.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (36));
btnLoginInto.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/otherlogin.png"),Configuration.getWidth (242), Configuration.getHeight (78),true));
etxtUser.SetTextColor (Color.ParseColor ("#ffffff"));
etxtPassword.SetTextColor (Color.ParseColor ("#ffffff"));
btnLoginInto.Click += delegate {
_dialog.Show();
var com = ((LoginViewModel)this.DataContext).LoginCommand;
com.Execute(null);
//AlertDialog.Builder popupBuilder = new AlertDialog.Builder(this);
};
initButtonColor (btnLoginInto);
etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
etxtPassword.TransformationMethod = Android.Text.Method.PasswordTransformationMethod.Instance;
txtLogin_a.SetTextColor (Color.ParseColor ("#ffffff"));
txtLogin_b.SetTextColor (Color.ParseColor ("#00c6ff"));
Drawable drawableEditText = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cajatexto.png"), Configuration.getWidth(507), Configuration.getHeight(80), true));
etxtUser.SetBackgroundDrawable (drawableEditText);
etxtPassword.SetBackgroundDrawable (drawableEditText);
etxtUser.SetSingleLine (true);
etxtPassword.SetSingleLine (true);
LinearLayout space = new LinearLayout (this);
space.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
linearTextLogin.AddView (txtLogin_a);
linearTextLogin.AddView (txtLogin_b);
//.........这里部分代码省略.........
示例4: basesList_ItemClick
void basesList_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
if (e.Position < _manager.Infobases.Length)
{
InfobaseManager.Infobase currentInfobase = _manager.Infobases[e.Position];
foreach (var infobase in _manager.Infobases)
if (infobase != currentInfobase)
infobase.IsActive = false;
var settings = new Settings(_prefs, Activity.Resources.Configuration.Locale.Language, currentInfobase);
_resultCallback(settings);
}
else
using (var builder = new AlertDialog.Builder(Activity))
{
builder.SetTitle(D.CREATE_NEW_INFOBASE);
var ll = new LinearLayout(Activity) { Orientation = Orientation.Vertical };
ll.SetPadding(10, 5, 10, 5);
builder.SetView(ll);
ll.AddView(new TextView(Activity) { Text = D.INFOBASE_NAME });
var editName = new EditText(Activity);
editName.SetSingleLine();
ll.AddView(editName);
ll.AddView(new TextView(Activity) { Text = D.URL });
var editUrl = new EditText(Activity) { Text = "http://" };
editUrl.SetSingleLine();
ll.AddView(editUrl);
ll.AddView(new TextView(Activity) { Text = D.APPLICATION });
var editApplication = new EditText(Activity) { Text = "app" };
editApplication.SetSingleLine();
ll.AddView(editApplication);
ll.AddView(new TextView(Activity) { Text = D.FTP_PORT });
var editFtpPort = new EditText(Activity) { Text = "21" };
editFtpPort.SetSingleLine();
ll.AddView(editFtpPort);
builder.SetPositiveButton(D.OK, (s, args) =>
{
_manager.CreateInfobase(editName.Text, editUrl.Text
, editApplication.Text, editFtpPort.Text);
LoadList();
});
builder.SetNegativeButton(D.CANCEL, (s, args) => { });
builder.Show();
}
}
示例5: OpenCustomerCodeMenu
void OpenCustomerCodeMenu(object sender, EventArgs e)
{
using (var builder = new AlertDialog.Builder(Activity))
{
builder.SetTitle(D.ENTER_CUSTOMER_CODE);
using (var ll = new LinearLayout(Activity) { Orientation = Orientation.Vertical })
{
ll.SetPadding(10, 5, 10, 5);
builder.SetView(ll);
using (var editName = new EditText(Activity))
{
editName.Id = 0;
editName.Hint = D.CUSTOMER_CODE;
editName.SetSingleLine();
ll.AddView(editName);
}
using (var editPassword = new EditText(Activity))
{
editPassword.Id = 1;
editPassword.Hint = D.PASSWORD;
editPassword.SetSingleLine();
ll.AddView(editPassword);
}
}
builder.SetPositiveButton(D.OK, DownloadInfobases);
builder.SetNegativeButton(D.CANCEL, (s, args) => { });
builder.Show();
}
}
示例6: basesList_ItemLongClick
void basesList_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
{
if (e.Position < _manager.Infobases.Length)
using (var builder = new AlertDialog.Builder(Activity))
{
var infobase = _manager.Infobases[e.Position];
builder.SetTitle(infobase.Name);
var ll = new LinearLayout(Activity) { Orientation = Orientation.Vertical };
ll.SetPadding(10, 5, 10, 5);
builder.SetView(ll);
ll.AddView(new TextView(Activity) { Text = D.URL });
var editUrl = new EditText(Activity) { Text = infobase.BaseUrl };
editUrl.SetSingleLine();
ll.AddView(editUrl);
ll.AddView(new TextView(Activity) { Text = D.APPLICATION });
var editApplication = new EditText(Activity) { Text = infobase.ApplicationString };
editApplication.SetSingleLine();
ll.AddView(editApplication);
ll.AddView(new TextView(Activity) { Text = D.FTP_PORT });
var editFtpPort = new EditText(Activity) { Text = infobase.FtpPort };
editFtpPort.SetSingleLine();
ll.AddView(editFtpPort);
builder.SetPositiveButton(D.OK, (s, args) =>
{
infobase.BaseUrl = editUrl.Text;
infobase.ApplicationString = editApplication.Text;
infobase.FtpPort = editFtpPort.Text;
_manager.SaveInfobases();
LoadList();
});
builder.SetNegativeButton(D.CANCEL, (s, args) => { });
builder.SetNeutralButton(D.DELETE, (s, args) => DeleteInfobase(e.Position));
builder.Show();
}
}
示例7: OnCreateView
//.........这里部分代码省略.........
// }
// else{
// LoginManager.Instance.LogInWithReadPermissions(this, permissions);
// }
};
toobaritemtwitter = new ToolBarButton (nn_activity,itemscontainer,Resource.Drawable.ic_twitter_70X70);
toobaritemtwitter.Click+= (object sender, EventArgs e) => {
if(this.eventcard.eventinfo.representative_needed.Equals("N")){
socialshareandroid.Twitter (RaffleDetailDate.c_twitterAPIKey, RaffleDetailDate.c_twitterSecret, String.Format(RaffleDetailDate.c_twitterMessageTemplate_WithLink,eventcard.eventinfo.organization), eventcard.eventinfo.sell_ticket_url);
}
else{
socialshareandroid.Twitter (RaffleDetailDate.c_twitterAPIKey, RaffleDetailDate.c_twitterSecret,String.Format(RaffleDetailDate.c_twitterMessageTemplate_NoLink,eventcard.eventinfo.organization),RaffleDetailDate.Tap5050WebPageLink);
}
};
toobaritemsms = new ToolBarButton (nn_activity,itemscontainer,Resource.Drawable.ic_sms_70X70);
toobaritemsms.Click+= (object sender, EventArgs e) => {
(nn_activity as HomeScreen).ShowContactListPicker(eventcard,eventcard.eventinfo.organization,eventcard.eventinfo.buy_ticket_url,eventcard.eventinfo.location_name);
};
toobaritememail = new ToolBarButton (nn_activity,itemscontainer,Resource.Drawable.ic_email_70X70);
toobaritememail.Click+= (object sender, EventArgs e) => {
(nn_activity as HomeScreen).ShowEmailListPicker(eventcard,eventcard.eventinfo.organization,eventcard.eventinfo.buy_ticket_url,eventcard.eventinfo.location_name);
};
TextView sendinvitationhint = (TextView)view.FindViewById (Resource.Id.raffledetail_sendinvitationhint_textview);
sendinvitationhint.Text = RaffleDetailDate.contactDescriptionText;
sendinviationedittext = (EditText)view.FindViewById (Resource.Id.raffledetail_sendinvitation_edittext);
sendinviationedittext.Hint = RaffleDetailDate.ContactTextFieldPlaceholder;
sendinviationedittext.SetSingleLine ();
sendinvitationbutton = (Button)view.FindViewById (Resource.Id.raffledetail_sendinvitation_button);
sendinvitationbutton.Text = RaffleDetailDate.SentContactBtnTitle;
sendinvitationbutton.Click+= (object sender, EventArgs e) => {
string destination=sendinviationedittext.Text;
//check if it is a canada phone
if(FormatManager.chechinput(destination,FormatManager.FormatOption.Phone)){
string contactsstring="To:\n"+"<"+destination+">";
List<string> destinationlist=new List<string>();
destinationlist.Add(destination);
string sendmessagestring="";
if (eventcard.eventinfo.representative_needed.Equals("N")) {
sendmessagestring = String.Format (RaffleDetailDate.c_smsMessageTemplate_WithLink, eventcard.eventinfo.organization, eventcard.eventinfo.buy_ticket_url, eventcard.eventinfo.location_name);
} else {
sendmessagestring = String.Format (RaffleDetailDate.c_smsMessageTemplate_NoLink, eventcard.eventinfo.organization,RaffleDetailDate.Tap5050WebPageLink);
}
//for API>4.4 call system default app to send message
if (global::Android.OS.Build.VERSION.SdkInt >= global::Android.OS.BuildVersionCodes.Kitkat)
{
SocialShareAndroid.Sms(sendmessagestring,destinationlist.ToArray());
}
else
{
(nn_activity as HomeScreen).ShowSMSFragment(eventcard,sendmessagestring, contactsstring,destinationlist);
}
}
示例8: RenamePresentation
public void RenamePresentation(Presentation presentation)
{
Activity activity = this.context as Activity;
// Per Dialog den Namen der neuen Presentation abfragen
AlertDialog.Builder dialog = new AlertDialog.Builder(activity);
dialog.SetTitle(activity.GetText(Resource.String.DlgRenamePresentationTitle));
dialog.SetMessage(activity.GetText(Resource.String.DlgRenamePresentationText));
dialog.SetCancelable(true);
EditText etName = new EditText(activity);
etName.SetSingleLine(true);
dialog.SetView(etName);
dialog.SetPositiveButton(activity.GetText(Resource.String.DlgRenamePresentationErstellen), delegate {
string name = etName.Text.Trim();
if (String.IsNullOrEmpty(name))
{
// Fehlermeldung anzeigen
((BaseActivity)activity).ShowErrorMsg(activity.GetText(Resource.String.DlgPresentationErrorNoName));
}
try
{
presentationsHelper = new PresentationsHelper(this.context);
}
catch (Exception)
{
((BaseActivity)activity).ShowErrorMsg(activity.GetText(Resource.String.ErrorNoExternalStorage));
}
presentationsHelper.Rename(presentation.PresentationUID, name);
ListView lvSlides = activity.FindViewById<ListView>(Resource.Id.lvSlides);
foreach (Presentation p in (((SlidesAdapter)lvSlides.Adapter).GetData))
{
if (p.PresentationUID == presentation.PresentationUID)
{
p.Name = name;
break;
}
}
// Liste aktualisieren
if (this.context.GetType() == typeof(EditActivity))
{
EditActivity editActivity = this.context as EditActivity;
editActivity.LoadSlidesList();
}
});
dialog.SetNegativeButton(activity.GetText(Resource.String.Cancel), delegate { });
dialog.Show();
}
示例9: LoadGoogleIO2012Presentation
public void LoadGoogleIO2012Presentation(View viewEditDetail, Presentation presentation)
{
// Präsentations Content laden und anzeigen
etContent = (EditText)viewEditDetail.FindViewById(Resource.Id.etContent);
etContent.SetSingleLine(false);
etTitle = (EditText)viewEditDetail.FindViewById(Resource.Id.etTitle);
etTitle2 = (EditText)viewEditDetail.FindViewById(Resource.Id.etTitle2);
etSubTitle = (EditText)viewEditDetail.FindViewById(Resource.Id.etSubTitle);
tbtnAnimation = (ToggleButton)viewEditDetail.FindViewById(Resource.Id.tbtnAnimation);
tbtnAreas = (ToggleButton)viewEditDetail.FindViewById(Resource.Id.tbtnAreas);
tbtnTouch = (ToggleButton)viewEditDetail.FindViewById(Resource.Id.tbtnTouch);
etName = (EditText)viewEditDetail.FindViewById(Resource.Id.etName);
etCompany = (EditText)viewEditDetail.FindViewById(Resource.Id.etCompany);
etGooglePlus = (EditText)viewEditDetail.FindViewById(Resource.Id.etGooglePlus);
etTwitter = (EditText)viewEditDetail.FindViewById(Resource.Id.etTwitter);
etWebsite = (EditText)viewEditDetail.FindViewById(Resource.Id.etWebsite);
etGithub = (EditText)viewEditDetail.FindViewById(Resource.Id.etGithub);
etContent.Text = LoadContent(presentation.PresentationUID);
// Die Anzeige zurücksetzen
etTitle.Text = String.Empty;
etTitle2.Text = String.Empty;
etSubTitle.Text = String.Empty;
tbtnAnimation.Checked = false;
tbtnAreas.Checked = false;
tbtnTouch.Checked = false;
etName.Text = String.Empty;
etCompany.Text = String.Empty;
etGooglePlus.Text = String.Empty;
etTwitter.Text = String.Empty;
etWebsite.Text = String.Empty;
etGithub.Text = String.Empty;
// Konfiguration laden und anzeigen
GoogleIO2012Config config = LoadConfig(presentation.PresentationUID);
if (config != null)
{
if (config.settings != null)
{
GoogleIO2012ConfigSettings settings = config.settings;
etTitle.Text = settings.title;
if (settings.title.Contains("<br />"))
{
int nIndex = settings.title.IndexOf("<br />", StringComparison.InvariantCulture);
etTitle.Text = settings.title.Substring(0, nIndex).Trim();
etTitle2.Text = settings.title.Substring(nIndex+6, settings.title.Length-nIndex-6).Trim();
}
etSubTitle.Text = settings.subtitle;
tbtnAnimation.Checked = settings.useBuilds;
tbtnAreas.Checked = settings.enableSlideAreas;
tbtnTouch.Checked = settings.enableTouch;
}
if (config.presenters != null && config.presenters.Count > 0)
{
// Das UI unterstützt derzeit nur einen Presenter
GoogleIO2012ConfigPresenters presenter = config.presenters.FirstOrDefault();
if (presenter != null)
{
etName.Text = presenter.name;
etCompany.Text = presenter.company;
etGooglePlus.Text = presenter.gplus;
etTwitter.Text = presenter.twitter;
etWebsite.Text = presenter.www;
etGithub.Text = presenter.github;
}
}
}
}
示例10: CreatePresentation
public void CreatePresentation(Presentation presentation)
{
Activity activity = this.context as Activity;
// Per Dialog den Namen der neuen Presentation abfragen
AlertDialog.Builder dialog = new AlertDialog.Builder(activity);
dialog.SetTitle(activity.GetText(Resource.String.DlgNewPresentationTitle));
dialog.SetMessage(activity.GetText(Resource.String.DlgNewPresentationText));
dialog.SetCancelable(true);
EditText etName = new EditText(activity);
etName.SetSingleLine(true);
dialog.SetView(etName);
dialog.SetPositiveButton(activity.GetText(Resource.String.DlgNewPresentationErstellen), delegate {
string name = etName.Text.Trim();
Guid newPresentationUID;
if (String.IsNullOrEmpty(name))
{
// Fehlermeldung anzeigen
((BaseActivity)activity).ShowErrorMsg(activity.GetText(Resource.String.DlgPresentationErrorNoName));
}
// Gibt es die Präsentation schon?
if (!presentationsHelper.Exists(name))
{
// Präsentation erstellen
if (presentationsHelper.CreateNew(presentation.PresentationUID, out newPresentationUID, name) != PresentationsHelper.ErrorCode.OK)
{
// Fehlermeldung anzeigen
((BaseActivity)activity).ShowErrorMsg(activity.GetText(Resource.String.DlgNewPresentationError));
}
}
else
{
// Fehlermeldung anzeigen
((BaseActivity)activity).ShowErrorMsg(activity.GetText(Resource.String.DlgPresentationErrorPraesExists));
}
// Präsentation laden
if (this.context.GetType() == typeof(EditActivity))
{
EditActivity editActivity = this.context as EditActivity;
presentation.PresentationUID = newPresentationUID;
editActivity.FragEditDetail.LoadPresentation(presentation);
editActivity.HidePresentationSelection();
}
});
dialog.SetNegativeButton(activity.GetText(Resource.String.Cancel), delegate { });
dialog.Show();
}
示例11: init
public void init(){
mainLayout = new RelativeLayout (this);
txtRegister = new TextView (this);
etxtEmail = new EditText (this);
etxtUser = new EditText (this);
etxtPassword = new EditText (this);
btnCreateAccount = new ImageButton (this);
linearButtonRegister = new LinearLayout (this);
linearRegister = new LinearLayout (this);
linearButtonRegister.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearRegister.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearButtonRegister.Orientation = Orientation.Horizontal;
linearRegister.Orientation = Orientation.Vertical;
linearButtonRegister.SetGravity (GravityFlags.Center);
linearRegister.SetGravity (GravityFlags.Center);
etxtUser.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtPassword.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtEmail.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
Drawable drawableBackground = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cfondo.png"), 768, 1024, true));
mainLayout.SetBackgroundDrawable (drawableBackground);
txtRegister.Text = "Registro";
txtRegister.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtUser.Hint =" Nombre de usuario";
etxtUser.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtEmail.Hint = " Dirección de correo";
etxtEmail.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtPassword.Hint =" Contraseña";
etxtPassword.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
Drawable drawableEditText = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cajatexto.png"), Configuration.getWidth (507), Configuration.getHeight (80), true));
etxtUser.SetBackgroundDrawable (drawableEditText);
etxtPassword.SetBackgroundDrawable (drawableEditText);
etxtEmail.SetBackgroundDrawable (drawableEditText);
etxtUser.SetTextColor (Color.ParseColor ("#ffffff"));
etxtUser.SetSingleLine (true);
etxtPassword.SetTextColor (Color.ParseColor ("#ffffff"));
etxtPassword.SetSingleLine (true);
etxtEmail.SetTextColor (Color.ParseColor ("#ffffff"));
etxtEmail.SetSingleLine (true);
txtRegister.SetTextColor (Color.ParseColor("#ffffff"));
txtRegister.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (40));
etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
etxtPassword.TransformationMethod = Android.Text.Method.PasswordTransformationMethod.Instance;
btnCreateAccount.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/crearcuenta.png"), Configuration.getWidth (507), Configuration.getHeight (80), true));
btnCreateAccount.Alpha = 255;
//btn.SetAlpha(255);
btnCreateAccount.SetBackgroundColor(Color.Transparent);
LinearLayout space = new LinearLayout (this);
space.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
LinearLayout space2 = new LinearLayout (this);
space2.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
linearRegister.AddView (etxtUser);
linearRegister.AddView (space);
linearRegister.AddView (etxtEmail);
linearRegister.AddView (space2);
linearRegister.AddView (etxtPassword);
linearButtonRegister.AddView (btnCreateAccount);
txtRegister.SetX (Configuration.getWidth(72)); txtRegister.SetY (Configuration.getHeight(535));
linearRegister.SetX (0); linearRegister.SetY (Configuration.getHeight(592));
linearButtonRegister.SetX (0); linearButtonRegister.SetY (Configuration.getHeight(975));
mainLayout.AddView (txtRegister);
mainLayout.AddView (linearRegister);
mainLayout.AddView (linearButtonRegister);
//string ndef = "None" ;
//string foto = "http://www.clinicatorielli.com/img/icons/no-user.png";
EditText lastName = new EditText (this);
lastName.Text = "None";
EditText url = new EditText (this);
url.Text = "http://www.clinicatorielli.com/img/icons/no-user.png";
//.........这里部分代码省略.........
示例12: AddRowToLayout
void AddRowToLayout(SearchRow item)
{
var row = new LinearLayout(context) { Orientation = Orientation.Horizontal };
row.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent);
row.WeightSum = 1;
row.SetMinimumHeight(PixelConverter.DpToPixels(30));
LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MatchParent, 0.5f);
LinearLayout.LayoutParams f = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
var entryHolder = new LinearLayout(context);
entryHolder.Orientation = Orientation.Horizontal;
entryHolder.SetHorizontalGravity(GravityFlags.Right);
entryHolder.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
entryHolder.ShowDividers = ShowDividers.Middle;
entryHolder.DividerPadding = 20;
entryHolder.SetPadding(PixelConverter.DpToPixels(10), 0, 0, 0);
switch (item.RowType)
{
case SearchRowTypes.Heading:
row.AddView(Heading(item));
break;
case SearchRowTypes.SearchTerms:
EditText searchfield = new EditText(context);
searchfield.LayoutParameters = f;
searchfield.Hint = string.Format("Search {0}:", this.category.Value);
searchfield.SetTextSize(Android.Util.ComplexUnitType.Px, rowHeight * 0.40f);
searchfield.SetPadding((int)(rowHeight * 0.1), (int)(rowHeight * 0.15), (int)(rowHeight * 0.1), (int)(rowHeight * 0.15));
searchfield.SetSingleLine(true);
searchfield.InputType = InputTypes.ClassText;
row.AddView(searchfield);
searchfield.TextChanged += (object sender, TextChangedEventArgs e) =>
{
AddSearchItem(item.QueryPrefix, e.Text.ToString());
};
break;
case SearchRowTypes.PriceDoubleEntry:
row.AddView(Title(item));
EditText minPricefield = new EditText(context);
minPricefield.LayoutParameters = p;
minPricefield.Hint = "min";
minPricefield.SetTextSize(Android.Util.ComplexUnitType.Px, rowHeight * 0.40f);
minPricefield.SetPadding((int)(rowHeight * 0.1), (int)(rowHeight * 0.15), (int)(rowHeight * 0.1), (int)(rowHeight * 0.15));
minPricefield.SetSingleLine(true);
minPricefield.InputType = InputTypes.ClassNumber;
entryHolder.AddView(minPricefield);
EditText maxPricefield = new EditText(context);
maxPricefield.LayoutParameters = p;
maxPricefield.Hint = "max";
maxPricefield.SetTextSize(Android.Util.ComplexUnitType.Px, rowHeight * 0.40f);
maxPricefield.SetPadding((int)(rowHeight * 0.1), (int)(rowHeight * 0.15), (int)(rowHeight * 0.1), (int)(rowHeight * 0.15));
maxPricefield.SetSingleLine(true);
maxPricefield.InputType = InputTypes.ClassNumber;
entryHolder.AddView(maxPricefield);
minPricefield.TextChanged += (object sender, TextChangedEventArgs e) =>
{
//TODO: Get this text masking to work correctly
//string text = minPricefield.Text;
//if (text.Length > 0 && text.Substring(0, 1) == "$")
// minPricefield.Text = text;
//else
// minPricefield.Text = "$" + text;
AddSearchItem(item.QueryPrefix, e.Text.ToString());
};
maxPricefield.TextChanged += (object sender, TextChangedEventArgs e) =>
{
//string text = maxPricefield.Text;
//if (text.Length > 0 && text.Substring(0, 1) == "$")
// maxPricefield.SetText(text, null);
//else
// maxPricefield.Text = "$" + text;
AddSearchItem(item.SecondQueryPrefix, e.Text.ToString());
};
row.AddView(entryHolder);
break;
case SearchRowTypes.DoubleEntry:
row.AddView(Title(item));
EditText minfield = new EditText(context);
minfield.LayoutParameters = p;
minfield.Hint = "min";
minfield.SetTextSize(Android.Util.ComplexUnitType.Px, rowHeight * 0.40f);
minfield.SetPadding((int)(rowHeight * 0.1), (int)(rowHeight * 0.15), (int)(rowHeight * 0.1), (int)(rowHeight * 0.15));
minfield.SetSingleLine(true);
minfield.InputType = InputTypes.ClassNumber;
entryHolder.AddView(minfield);
//.........这里部分代码省略.........
示例13: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
view = (RelativeLayout)inflater.Inflate (Resource.Layout.raffledetail, container, false);
bodypanel=(RelativeLayout)view.FindViewById (Resource.Id.raffledetail_bodypanel_relativelayout);
invitecard=(RelativeLayout)view.FindViewById (Resource.Id.raffledetail_invitationpanel_relativelayout);
scrollcontainer=(ScrollView)view.FindViewById (Resource.Id.raffledetail_scrollcontainer_scrollview);
LinearLayout sociallayout = (LinearLayout)invitecard.FindViewById (Resource.Id.raffledetail_socialbar_linearlayout);
sociallayout.SetGravity (GravityFlags.Center);
LinearLayout itemscontainer = new LinearLayout (nn_activity);
LinearLayout.LayoutParams param = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent,LinearLayout.LayoutParams.WrapContent);
param.Gravity = GravityFlags.CenterHorizontal;
itemscontainer.LayoutParameters = param;
itemscontainer.Orientation = Orientation.Horizontal;
toobaritemfacebook = new ToolBarButton (nn_activity,itemscontainer,Resource.Drawable.ic_facebook_70X70);
toobaritemfacebook.Click+= (object sender, EventArgs e) => {
ShowPostToFacebook();
};
toobaritemtwitter = new ToolBarButton (nn_activity,itemscontainer,Resource.Drawable.ic_twitter_70X70);
toobaritemtwitter.Click+= (object sender, EventArgs e) => {
if(this.eventcard.eventinfo.representative_needed.Equals("N")){
socialshareandroid.Twitter (RaffleDetailDate.c_twitterAPIKey, RaffleDetailDate.c_twitterSecret, String.Format(RaffleDetailDate.c_twitterMessageTemplate_WithLink,eventcard.eventinfo.organization), eventcard.eventinfo.sell_ticket_url);
}
else{
socialshareandroid.Twitter (RaffleDetailDate.c_twitterAPIKey, RaffleDetailDate.c_twitterSecret,String.Format(RaffleDetailDate.c_twitterMessageTemplate_NoLink,eventcard.eventinfo.organization),RaffleDetailDate.Tap5050WebPageLink);
}
};
toobaritemsms = new ToolBarButton (nn_activity,itemscontainer,Resource.Drawable.ic_sms_70X70);
toobaritemsms.Click+= (object sender, EventArgs e) => {
(nn_activity as HomeScreen).ShowContactListPicker(eventcard,eventcard.eventinfo.organization,eventcard.eventinfo.buy_ticket_url,eventcard.eventinfo.location_name);
};
toobaritememail = new ToolBarButton (nn_activity,itemscontainer,Resource.Drawable.ic_email_70X70);
toobaritememail.Click+= (object sender, EventArgs e) => {
(nn_activity as HomeScreen).ShowEmailListPicker(eventcard,eventcard.eventinfo.organization,eventcard.eventinfo.buy_ticket_url,eventcard.eventinfo.location_name);
};
itemscontainer.AddView (toobaritemfacebook);
itemscontainer.AddView (toobaritemtwitter);
itemscontainer.AddView (toobaritemsms);
itemscontainer.AddView (toobaritememail);
sociallayout.AddView (itemscontainer);
TextView sendinvitationhint = (TextView)invitecard.FindViewById (Resource.Id.raffledetail_sendinvitationhint_textview);
sendinvitationhint.Text = RaffleDetailDate.contactDescriptionText;
invitationedittext = (EditText)invitecard.FindViewById (Resource.Id.raffledetail_sendinvitation_edittext);
invitationedittext.Hint = RaffleDetailDate.ContactTextFieldPlaceholder;
invitationedittext.SetSingleLine ();
sendinvitationbutton=(Button)invitecard.FindViewById (Resource.Id.raffledetail_sendinvitation_button);
sendinvitationbutton.Click+= (object sender, EventArgs e) =>{
string destination=invitationedittext.Text;
//check if it is a canada phone
if(FormatManager.chechinput(destination,FormatManager.FormatOption.Phone)){
string contactsstring="To:\n"+"<"+destination+">";
List<string> destinationlist=new List<string>();
destinationlist.Add(destination);
string sendmessagestring="";
if (String.IsNullOrEmpty(eventcard.eventinfo.share_sms_body))
{
if (eventcard.eventinfo.representative_needed.Equals("N"))
{
sendmessagestring = String.Format(RaffleDetailDate.c_smsMessageTemplate_WithLink, eventcard.eventinfo.organization, eventcard.eventinfo.buy_ticket_url, eventcard.eventinfo.location_name);
}
else
{
sendmessagestring = String.Format(RaffleDetailDate.c_smsMessageTemplate_NoLink, eventcard.eventinfo.organization, RaffleDetailDate.Tap5050WebPageLink);
}
}
else {
sendmessagestring = SharingString.Format(eventcard.eventinfo.share_sms_body, eventcard.eventinfo);
}
//for API>4.4 call system default app to send message
if (global::Android.OS.Build.VERSION.SdkInt >= global::Android.OS.BuildVersionCodes.Kitkat)
{
SocialShareAndroid.Sms(sendmessagestring,destinationlist.ToArray());
}
else
{
(nn_activity as HomeScreen).ShowSMSFragment(eventcard,sendmessagestring, contactsstring,destinationlist);
}
}
else if(FormatManager.chechinput(destination,FormatManager.FormatOption.Email)){
List<string> destinationlist=new List<string>();
destinationlist.Add(destination);
if (String.IsNullOrEmpty(eventcard.eventinfo.share_email_body) && String.IsNullOrEmpty(eventcard.eventinfo.share_email_subject))
{
if (eventcard.eventinfo.representative_needed.Equals("N"))
{
//.........这里部分代码省略.........
示例14: OnCreateDialogView
protected override View OnCreateDialogView()
{
var layout = new LinearLayout(_context) {Orientation = Orientation.Vertical};
layout.SetPadding(10, 10, 10, 10);
layout.SetBackgroundColor(Color.Black);
_serverUrl = new TextView(_context) {Text = "Server url:"};
_serverUrl.SetTextColor(Color.White);
_serverUrl.SetPadding(0, 8, 0, 3);
_serverUrlBox = new EditText(_context);
_serverUrlBox.SetSingleLine(true);
_userKey = new TextView(_context) {Text = "User key:"};
_userKey.SetTextColor(Color.White);
_userKeyBox = new EditText(_context);
_userKeyBox.SetSingleLine(true);
layout.AddView(_serverUrl);
layout.AddView(_serverUrlBox);
layout.AddView(_userKey);
layout.AddView(_userKeyBox);
return layout;
}
示例15: ConfigureInput
private void ConfigureInput(EditText input, InputType type)
{
input.InputType = GetInputTypes(type);
var text = input.Text;
if (!string.IsNullOrEmpty(text))
input.SetSelection(text.Length);
input.SetSingleLine(true);
}