use of me.henrytao.recyclerview.holder.HeaderHolder in project smooth-app-bar-layout by henrytao-me.
the class SmoothQuickReturnActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_smooth_quick_return);
ButterKnife.bind(this);
setSupportActionBar(vToolbar);
vToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mAdapter = new DynamicAdapter<>(Utils.getSampleData());
RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {
@Override
public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return null;
}
@Override
public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
}
};
vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
vRecyclerView.setAdapter(adapter);
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
return false;
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
}
});
itemTouchHelper.attachToRecyclerView(vRecyclerView);
}
use of me.henrytao.recyclerview.holder.HeaderHolder in project smooth-app-bar-layout by henrytao-me.
the class SmoothScrollActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_smooth_scroll);
ButterKnife.bind(this);
setSupportActionBar(vToolbar);
vToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mAdapter = new DynamicAdapter<>(Utils.getSampleData());
RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {
@Override
public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return null;
}
@Override
public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
}
};
vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
vRecyclerView.setAdapter(adapter);
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
return false;
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
}
});
itemTouchHelper.attachToRecyclerView(vRecyclerView);
}
use of me.henrytao.recyclerview.holder.HeaderHolder in project smooth-app-bar-layout by henrytao-me.
the class SmoothScrollExitUntilCollapsedActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_smooth_scroll_exit_until_collapsed);
ButterKnife.bind(this);
setSupportActionBar(vToolbar);
vToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mAdapter = new DynamicAdapter<>(Utils.getSampleData());
RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {
@Override
public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return null;
}
@Override
public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
}
};
vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
vRecyclerView.setAdapter(adapter);
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
return false;
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
}
});
itemTouchHelper.attachToRecyclerView(vRecyclerView);
}
use of me.henrytao.recyclerview.holder.HeaderHolder in project smooth-app-bar-layout by henrytao-me.
the class SmoothScrollParallaxActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_smooth_scroll_parallax);
ButterKnife.bind(this);
// This is important for making activity under status_bar. It also can be done theme.
ResourceUtils.enableTranslucentStatus(this);
setSupportActionBar(vToolbar);
vToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mAdapter = new DynamicAdapter<>(Utils.getSampleData());
RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {
@Override
public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return null;
}
@Override
public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing_with_fit_system_windows);
}
};
vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
vRecyclerView.setAdapter(adapter);
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
return false;
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
}
});
itemTouchHelper.attachToRecyclerView(vRecyclerView);
}
use of me.henrytao.recyclerview.holder.HeaderHolder in project smooth-app-bar-layout by henrytao-me.
the class SmoothScrollEnterAlwaysActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_smooth_scroll_enter_always);
ButterKnife.bind(this);
setSupportActionBar(vToolbar);
vToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mAdapter = new DynamicAdapter<>(Utils.getSampleData());
RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {
@Override
public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return null;
}
@Override
public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
}
};
vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
vRecyclerView.setAdapter(adapter);
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
return false;
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
}
});
itemTouchHelper.attachToRecyclerView(vRecyclerView);
}
Aggregations