我有一个包含一些文本的word文件,我正在基于行在数组列表中获取该文本。
BufferedReader reader = null;
try {
reader = new BufferedReader(
new InputStreamReader(getAssets().open("surah1.txt"), "UTF-8"));
// do reading, usually loop until end of file reading
String mLine;
while ((mLine = reader.readLine())!= null ) {
surah1.add(mLine);
//process line
}
Log.i("TAG", "onCreateView: " + surah1);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (reader != null){
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
当我使用RecyclerView
显示它时,它是以水平格式或垂直格式显示的。但是我想以段落格式显示它。
listView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL, true));
madapter = new testingAdapter(testing.this,surah1);
listView.setAdapter(madapter);
实际上,我想要的是,当用户单击线条时,我想更改孔线的颜色,如果用户要共享,他也可以共享。因此,这就是我将文本文件更改为数组列表的原因。如果有人有任何想法,请帮助我。
i want it to be like this but getting this when RecyclerView is in vertical format