Exemplo n.º 1
0
        public void OnItemClick(AdapterView parent, View view, int position, long id)
        {
            ActivityInfo item = ActivityInfo.List[position];

            if (Class.FromType(typeof(Android.App.Activity)).IsAssignableFrom(item.Clazz))
            {
                StartActivity(new Intent(Context, item.Clazz));
            }
            else if (Class.FromType(typeof(IRefreshHeader)).IsAssignableFrom(item.Clazz))
            {
                try {
                    Constructor    constructor = item.Clazz.GetConstructor(Context.Class);
                    IRefreshHeader header      = (IRefreshHeader)constructor.NewInstance(Context);
                    IRefreshLayout layout      = (IRefreshLayout)View.FindViewById(Resource.Id.refreshLayout);
                    layout.SetRefreshHeader(header);
                    if (!(header is ClassicsHeader))
                    {
                        layout.SetPrimaryColorsId(Resource.Color.colorPrimary, Android.Resource.Color.White);
                    }
                    layout.AutoRefresh();
                } catch (Exception e) {
                    e.PrintStackTrace();
                }
            }
        }
Exemplo n.º 2
0
 public override void OnHeaderStartAnimator(IRefreshHeader header, int headerHeight, int extendHeight)
 {
     mHeaderStartAnimator = String.Format(Locale.China, "%s\nheight=%03d extend=%03d",
                                          FORMAT.Format(new Date()),
                                          headerHeight, extendHeight);
     updateContent();
 }
Exemplo n.º 3
0
 public override void OnHeaderReleasing(IRefreshHeader header, float percent, int offset, int headerHeight, int extendHeight)
 {
     mHeaderReleasing = String.Format(Locale.China, "%s\npercent=%.02f offset=%03d\nheight=%03d extend=%03d",
                                      FORMAT.Format(new Date()),
                                      percent, offset, headerHeight, extendHeight);
     updateContent();
 }
Exemplo n.º 4
0
 public override void OnHeaderReleasing(IRefreshHeader header, float percent, int offset, int footerHeight, int extendHeight)
 {
     _activity.mOffset = offset / 2;
     _activity.parallax.TranslationY = _activity.mOffset - _activity.mScrollY;
     _activity.mToolbar.Alpha        = 1 - Math.Min(percent, 1);
 }
 public override void OnHeaderReleasing(IRefreshHeader header, float percent, int offset, int footerHeight, int extendHeight)
 {
     _activity.appBar.TranslationY  = offset;
     _activity.toolbar.TranslationY = -offset;
 }
Exemplo n.º 6
0
 public override void OnHeaderFinish(IRefreshHeader header, bool success)
 {
     mHeaderFinish = String.Format(Locale.China, "%s - " + success, FORMAT.Format(new Date()));
     updateContent();
 }