Esempio n. 1
0
        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)
                );
        }
Esempio n. 2
0
        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)
                );
        }
Esempio n. 3
0
        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)
                );
        }
Esempio n. 4
0
        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;
                                                                                                                               }
                                                        })
                );
        }
Esempio n. 5
0
        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))
                );
        }