-
Notifications
You must be signed in to change notification settings - Fork 530
Open
Description
in your code, autoSelectView=true
in the method onLoadFinish() in Class ForecastFragment
updateEmptyView();
if ( data.getCount() > 0 ) {
mRecyclerView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
// Since we know we're going to get items, we keep the listener around until
// we see Children.
if (mRecyclerView.getChildCount() > 0) {
mRecyclerView.getViewTreeObserver().removeOnPreDrawListener(this);
int itemPosition = mForecastAdapter.getSelectedItemPosition();
if ( RecyclerView.NO_POSITION == itemPosition ) itemPosition = 0;
RecyclerView.ViewHolder vh = mRecyclerView.findViewHolderForAdapterPosition(itemPosition);
if ( null != vh && mAutoSelectView ) {
mForecastAdapter.selectView( vh );
}
return true;
}
return false;
}
});
}
app will invoke onClick() method and jump to DetailActivity, is that right in logic?
Metadata
Metadata
Assignees
Labels
No labels