An open API service indexing awesome lists of open source software.

https://github.com/bharathvishal/textfileviewer-for-android

A Text viewer for Android written in Kotlin. Allows viewing of .txt, .html, .xml, .css, .csv, .json file types. Makes use of JetPack Compose's LazyColumn and fully implemented in Jetpack compose using Material You 3.0 dynamic theming.
https://github.com/bharathvishal/textfileviewer-for-android

android android-app android-application android-development android-library androidlibs csv-viewer dependency htmlviewer java jetpack-compose kotlin lazycolumn library materialdesign3 materialyou textviewer xmlviewer

Last synced: about 1 month ago
JSON representation

A Text viewer for Android written in Kotlin. Allows viewing of .txt, .html, .xml, .css, .csv, .json file types. Makes use of JetPack Compose's LazyColumn and fully implemented in Jetpack compose using Material You 3.0 dynamic theming.

Awesome Lists containing this project

README

          

# Text File Viewer for Android [![Release](https://jitpack.io/v/BharathVishal/TextFileViewerAndroid.svg)](https://jitpack.io/#BharathVishal/TextFileViewerAndroid)

A Text viewer for Android written in Kotlin. Allows viewing of .txt, .html, .xml, .css and .csv file types. Makes use of JetPack Compose's LazyColumn and fully implemented in Jetpack compose using Material You 3.0 dynamic theming.

 
### Adding Dependency:

*Step 1*. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```


*Step 2*. Add the dependency

```gradle
dependencies {
implementation 'com.github.BharathVishal:TextFileViewerAndroid:1.4.6'
}

```

 

### Usage:

*1*. To launch the Text viewer with a given Content Uri/File path:
```
TextReaderModule().setContext(mContext).setFileUri(uri).launchTextViewer()

TextReaderModule().setContext(mContext).useFilePath().setFilePath(path).launchTextViewer()
```
 

*2*. To launch the Document picker intent. This launches the document chooser intent and then dislays the selected text file using the built-in Text Viewer.
```
TextReaderModule().setContext(mContext).launchTextViewerWithFileChooser()
```
 
- To display line length
```
TextReaderModule().shouldShowLineLength(true).setFileUri(uri).launchTextViewer()
```

- To display line number
```
TextReaderModule().shouldShowLineNumber(true).setFileUri(uri).launchTextViewer()
```

- To use File path instead of Content Uri
```
TextReaderModule().useFilePath().setFilePath(path).launchTextViewer()
```

- To use Content Uri instead of File path
```
TextReaderModule().setFileUri(uri).launchTextViewer()
```

 

### Features :
- Allows viewing of .txt, .html, .xml, .css and .csv types.
- Clean and light weight implementation.
- Supports night mode.
- Has options to toggle line number and line length.
- Loads file using content Uri or File scheme.
- Uses coroutines to load the file asynchronously.
- Implemented using Jetpack Compose.
- Material You 3.0 design with dynamic theming.

 
### Preview :
![Preview](https://github.com/BharathVishal/TextFileViewerforAndroid/blob/main/PreviewGif/PreviewGif.gif)

 
### Screenshots :
![Screenshot 1](https://github.com/BharathVishal/TextFileViewerAndroid/blob/main/Screenshots/1.png?s=20)
![Screenshot 2](https://github.com/BharathVishal/TextFileViewerAndroid/blob/main/Screenshots/2.png?s=20)

 
#### Year developed :
2023

 

#### SDK Info :
Min SDK : 23 | Target SDK : 36 | Gradle : 9.4.1 | Kotlin | Jetpack Compose

 

#### Android Studio Version :
Android Studio Panda 4 | 2025.3.4 Patch 1

 

#### License :
[Apache License 2.0](https://github.com/BharathVishal/TextFileViewerAndroid/blob/main/LICENSE)
 

 
####
Android is a trademark of Google LLC.

 
 

© 2023-2026. Developed by Bharath Vishal G (https://github.com/BharathVishal).

Thank you. :slightly_smiling_face: