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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.2.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

 

Screenshots :

Screenshot 1 Screenshot 2

 

Year developed :

2023

 

SDK Info :

Min SDK : 22 | Target SDK : 34 | Gradle : 8.2.0 | Kotlin | Jetpack Compose

 

Android Studio Version :

Android Studio Hedgehog | 2023.1.1

 

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.

License:Apache License 2.0


Languages

Language:Kotlin 97.1%Language:Java 2.9%