static public void Initilize(AndroidEngine engine) { engine.Add( AndroidInfos.AttributeLink <View, int>("min_width", (s, a) => s.SetMinimumWidth(a), s => s.MinimumWidth), AndroidInfos.AttributeLink <View, int>("min_height", (s, a) => s.SetMinimumHeight(a), s => s.MinimumHeight), AndroidInfos.AttributeLink <View, bool>("keep_screen_on", (s, a) => s.KeepScreenOn = a, s => s.KeepScreenOn) ); }
static public void Initilize(AndroidEngine engine) { engine.Add( AndroidInstancers.Simple("Text", r => new TextView(r)), AndroidInstancers.Variation <TextView>("Label", "Text", v => v.TextSize = 12.0f), AndroidInstancers.Variation <TextView>("Header", "Text", v => v.TextSize = 24.0f), AndroidInstancers.Variation <TextView>("Title", "Text", v => v.TextSize = 32.0f), AndroidInfos.AttributeLink <TextView, string>("text", (t, s) => t.Text = s, s => s.Text), AndroidInfos.AttributeLink <TextView, string>("value", (t, s) => t.Text = s, s => s.Text) ); }
static public void Initilize(AndroidEngine engine) { engine.Add( AndroidInfos.Children <ViewGroup, View>(p => p.RemoveAllViews(), (p, c) => { p.AddView(c); p.Invalidate(); p.RequestLayout(); }), AndroidInfos.AttributeValueLayout <ViewGroup.LayoutParams, string>("width", (r, p, v) => p.Width = r.ParseMeasurement(v)), AndroidInfos.AttributeValueLayout <ViewGroup.LayoutParams, string>("height", (r, p, v) => p.Height = r.ParseMeasurement(v)), AndroidInfos.AttributeValueLayout <LinearLayout.LayoutParams, float>("weight", (r, p, v) => p.Weight = v), AndroidInfos.AttributeValueLayout <LinearLayout.LayoutParams, GravityFlags>("gravity", (r, p, v) => p.Gravity = v) ); }
static public void Initilize(AndroidEngine engine) { engine.Add( AndroidInstancers.Simple("Button", r => new Button(r)), AndroidInfos.AttributeFunction <Button>("action", (s, a) => s.Click += a.GetEventHandler()), AndroidInfos.AttributeFunction <Button>("down", (s, a) => s.Touch += delegate(object v, View.TouchEventArgs e) { if (e.Event.Action == MotionEventActions.Down) { a.Execute(); e.Handled = true; } }), AndroidInfos.AttributeFunction <Button>("up", (s, a) => s.Touch += delegate(object v, View.TouchEventArgs e) { if (e.Event.Action == MotionEventActions.Up) { a.Execute(); e.Handled = true; } }) ); }
static public void Initilize(AndroidEngine engine) { engine.Add( AndroidInstancers.Simple("HorizontalLayout", r => new LinearLayout(r) { Orientation = Orientation.Horizontal }), AndroidInstancers.Simple("VerticalLayout", r => new LinearLayout(r) { Orientation = Orientation.Vertical }), AndroidInstancers.Simple("ScrollLayout", r => new ScrollView(r)), AndroidInstancers.Simple("GridLayout", r => new GridLayout(r)), AndroidInfos.AttributeLink <GridLayout, int>("number_columns", (g, i) => g.ColumnCount = i, g => g.ColumnCount), AndroidInstancers.Simple("TableLayout", r => new TableLayout(r)), AndroidInstancers.Simple("TableRow", r => new TableRow(r)) ); }
static public void Initilize(AndroidEngine engine) { engine.Add( AndroidInstancers.Simple("TextField", r => { EditText v = new EditText(r); v.TextSize = 12.0f; v.ImeOptions |= Android.Views.InputMethods.ImeAction.Done; v.ImeOptions |= (Android.Views.InputMethods.ImeAction)(Android.Views.InputMethods.ImeFlags.NoExtractUi); v.ImeOptions |= (Android.Views.InputMethods.ImeAction)(Android.Views.InputMethods.ImeFlags.NoFullscreen); return v; }), AndroidInstancers.Variation<EditText>("StringField", "TextField", v => { v.SetSelectAllOnFocus(true); v.InputType = Android.Text.InputTypes.TextVariationShortMessage; }), AndroidInstancers.Variation<EditText>("IntField", "StringField", v => v.InputType = Android.Text.InputTypes.ClassNumber), AndroidInstancers.Variation<EditText>("FloatField", "StringField", v => v.InputType = Android.Text.InputTypes.ClassNumber | Android.Text.InputTypes.NumberFlagDecimal) ); }