Skip to content

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.

License

Notifications You must be signed in to change notification settings

BharathVishal/TextFileViewer-for-Android

Repository files navigation

Text File Viewer for Android Release

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:

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

Step 2. Add the dependency

	dependencies {
  	    implementation 'com.github.BharathVishal:TextFileViewerAndroid:1.4.1'
	}
  

 

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

 

Screenshots :

Screenshot 1 Screenshot 2

 

Year developed :

2023

 

SDK Info :

Min SDK : 22 | Target SDK : 35 | Gradle : 8.6.0 | Kotlin | Jetpack Compose

 

Android Studio Version :

Android Studio Koala Feature Drop | 2024.1.2

 

License :

Apache License 2.0  

 

Android is a trademark of Google LLC.

   

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

Thank you. 🙂

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published