Android: Add dividers between game directories

This commit is contained in:
Connor McLaughlin 2021-03-06 14:43:33 +10:00
parent 7b45df0cc2
commit b188c908c0
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,7 @@ import androidx.fragment.app.ListFragment;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceScreen;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.adapter.FragmentStateAdapter;
@ -207,6 +208,8 @@ public class GameDirectoriesActivity extends AppCompatActivity {
mRecyclerView = findViewById(R.id.recycler_view);
mRecyclerView.setAdapter(mDirectoryListAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.addItemDecoration(new DividerItemDecoration(mRecyclerView.getContext(),
DividerItemDecoration.VERTICAL));
findViewById(R.id.fab).setOnClickListener((v) -> startAddGameDirectory());
}