Search in sources :

Example 6 with LinearDividerItemDecoration

use of com.hippo.easyrecyclerview.LinearDividerItemDecoration in project EhViewer by seven332.

the class DirExplorer method init.

private void init(Context context) {
    mAdapter = new DirAdapter();
    setAdapter(mAdapter);
    setLayoutManager(new LinearLayoutManager(context));
    LinearDividerItemDecoration decoration = new LinearDividerItemDecoration(LinearDividerItemDecoration.VERTICAL, getResources().getColor(R.color.divider), LayoutUtils.dp2pix(context, 1));
    decoration.setShowLastDivider(true);
    addItemDecoration(decoration);
    setSelector(Ripple.generateRippleDrawable(context, false));
    setOnItemClickListener(this);
    mCurrentFile = Environment.getExternalStorageDirectory();
    if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) || mCurrentFile == null) {
        mCurrentFile = new File("/");
    }
    updateFileList();
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) LinearDividerItemDecoration(com.hippo.easyrecyclerview.LinearDividerItemDecoration) File(java.io.File)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)6 LinearDividerItemDecoration (com.hippo.easyrecyclerview.LinearDividerItemDecoration)6 EasyRecyclerView (com.hippo.easyrecyclerview.EasyRecyclerView)4 SuppressLint (android.annotation.SuppressLint)3 Context (android.content.Context)3 RecyclerView (android.support.v7.widget.RecyclerView)3 Nullable (android.support.annotation.Nullable)2 AlertDialog (android.support.v7.app.AlertDialog)2 SpannableStringBuilder (android.text.SpannableStringBuilder)2 LayoutInflater (android.view.LayoutInflater)2 View (android.view.View)2 TextView (android.widget.TextView)2 Resources (android.content.res.Resources)1 Drawable (android.graphics.drawable.Drawable)1 FloatingActionButton (android.support.design.widget.FloatingActionButton)1 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 SpannableString (android.text.SpannableString)1 ViewGroup (android.view.ViewGroup)1 ImageView (android.widget.ImageView)1 FavListUrlBuilder (com.hippo.ehviewer.client.data.FavListUrlBuilder)1