I am having a word file which contain some text I am getting that text in array list base on lines.
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();
}
}
}
When I am displaying it using RecyclerView
it is either displaying in horizontal format or vertical format. But I want display it in paragraph format.
listView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL, true));
madapter = new testingAdapter(testing.this,surah1);
listView.setAdapter(madapter);
Actually what i want is when ever user click on the line i want to change that hole line color and also if user want to share he can share it. so thats the reason i am changing text file to array list. if any one is having any idea please help me out.
example: In this image i am displaying that text by web view. but i want to display it base on lines so that when ever i click on line i can change that line color and share it.