@Override public void onItemClick(MainEntity entity, int position) { View target; if (position == 0) { target = gridLayoutManager .findViewByPosition(position) .findViewById(R.id.list_item_header_temp_iv); } else { target = gridLayoutManager.findViewByPosition(position).findViewById(R.id.list_item_grid_temp_iv); } Rect startBounds = new Rect(); target.getGlobalVisibleRect(startBounds); if (globalOffset == null) { globalOffset = new Point(); Rect rootRect = new Rect(); rootView.getGlobalVisibleRect(rootRect, globalOffset); } startBounds.offset(-globalOffset.x, -globalOffset.y); if (this.rxBus == null) { this.rxBus = MyApplication.get().getRxBus(); } this.rxBus.postStickEvent(entity); DetailActivity.navigateToDetail(ListActivity.this, startBounds, globalOffset); overridePendingTransition(0, 0); }
@Override protected void exit() { if (this.rxBus == null) this.rxBus = MyApplication.get().getRxBus(); this.rxBus.postEvent(new FinishActEvent()); }