Skip to content
Permalink
Browse files

migrated to android x and changed all java files to kotlin

  • Loading branch information...
FirzenYogesh committed Aug 15, 2019
1 parent cac42cb commit eb3a16ff309ad6299f14f7e3a65586754c71b201
@@ -1,17 +1,18 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = '1.0.7'
version = '3.0.3'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.2'

defaultConfig {
//applicationId "yogesh.firzen.mukkiasevaigal"
minSdkVersion 14
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
@@ -71,19 +72,20 @@ install {

dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'commons-io:commons-io:2.5'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation "androidx.core:core-ktx:1.0.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
/*task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
@@ -92,14 +94,15 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
//options.encoding = 'UTF-8'
}
}*/
artifacts {
archives javadocJar
/*archives javadocJar*/
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
File propFile = "${System.properties['user.home']}${File.separator}development${File.separator}bintray${File.separator}MukkiyaSevaigal.properties" as File
properties.load(propFile.newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
@@ -122,3 +125,6 @@ allprojects {
jcenter()
}
}
repositories {
mavenCentral()
}

This file was deleted.

@@ -0,0 +1,70 @@
package yogesh.firzen.mukkiasevaigal

import android.content.Context
import android.database.DatabaseErrorHandler
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import android.os.Build
import androidx.annotation.RequiresApi

import java.io.File

/**
* Created by user on 10-05-2016.
*/
@RequiresApi(Build.VERSION_CODES.HONEYCOMB)
class D {

private val db: DB? = null


private inner class DB : SQLiteOpenHelper {

private constructor(context: Context, db: String) : super(context, db, null, 1, null) {}

private constructor(context: Context, db: String, handler: DatabaseErrorHandler) : super(context, db, null, 1, handler) {}

private constructor(context: Context, db: String, ver: Int) : super(context, db, null, ver, null) {}

private constructor(context: Context, db: String, ver: Int, handler: DatabaseErrorHandler) : super(context, db, null, ver, handler) {}

private constructor(context: Context, db: String, factory: SQLiteDatabase.CursorFactory) : super(context, db, factory, 1, null) {}

private constructor(context: Context, db: String, factory: SQLiteDatabase.CursorFactory, handler: DatabaseErrorHandler) : super(context, db, factory, 1, handler) {}

private constructor(context: Context, db: String, factory: SQLiteDatabase.CursorFactory, ver: Int) : super(context, db, factory, ver, null) {}

private constructor(context: Context, db: String, factory: SQLiteDatabase.CursorFactory, ver: Int, handler: DatabaseErrorHandler) : super(context, db, factory, ver, handler) {}

private constructor(context: Context, db: File) : super(context, db.absolutePath, null, 1, null) {}

private constructor(context: Context, db: File, handler: DatabaseErrorHandler) : super(context, db.absolutePath, null, 1, handler) {}

private constructor(context: Context, db: File, ver: Int) : super(context, db.absolutePath, null, ver, null) {}

private constructor(context: Context, db: File, ver: Int, handler: DatabaseErrorHandler) : super(context, db.absolutePath, null, ver, handler) {}

private constructor(context: Context, db: File, factory: SQLiteDatabase.CursorFactory) : super(context, db.absolutePath, factory, 1, null) {}

private constructor(context: Context, db: File, factory: SQLiteDatabase.CursorFactory, handler: DatabaseErrorHandler) : super(context, db.absolutePath, factory, 1, handler) {}

private constructor(context: Context, db: File, factory: SQLiteDatabase.CursorFactory, ver: Int) : super(context, db.absolutePath, factory, ver, null) {}

private constructor(context: Context, db: File, factory: SQLiteDatabase.CursorFactory, ver: Int, handler: DatabaseErrorHandler) : super(context, db.absolutePath, factory, ver, handler) {}

override fun onCreate(db: SQLiteDatabase) {

}

override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {

}
}

companion object {

fun createDB(context: Context, name: String) {
//db =
}
}
}
@@ -0,0 +1,128 @@
package yogesh.firzen.mukkiasevaigal

import java.io.File

/**
* File Utils
*/
object F {

fun getExtension(file: File): String {
return getExtension(file.absolutePath);
}

fun getExtension(filename: String): String {
val afterDot: String = filename.substringAfterLast(".")
return if (afterDot.contains(File.pathSeparator)) {
""
} else {
afterDot
}
}

/**
* Check whether the file is an image or not
*
* @param filename file path
* @return Returns true if the file is an Image
*/
fun isImage(filename: String): Boolean {
val ext = getExtension(filename).toLowerCase()
val extensions = arrayOf("jpg", "jpeg", "png", "bmp", "gif", "ai", "ico", "ps", "svg", "psd", "tif", "tiff")
return extensions.contains(ext)
}

/**
* Check whether the file is an image or not
*
* @param file file
* @return Returns true if the file is an Image
*/
fun isImage(file: File): Boolean {
return isImage(file.absolutePath)
}

/**
* Check whether the file is a video or not
*
* @param filename file path
* @return Returns true if the file is an Video
*/
fun isVideo(filename: String): Boolean {
val ext = getExtension(filename).toLowerCase()
val extensions = arrayOf("swf", "rm", "ogg", "h264", "mkv", "avi", "mp4", "wmw", "3gp", "3g2", "webm", "flv", "vob", "mng", "mov", "qt", "m4v", "mpg", "mpeg", "ts")
return extensions.contains(ext)
}

/**
* Check whether the file is a video or not
*
* @param file file
* @return Returns true if the file is an Video
*/
fun isVideo(file: File): Boolean {
return isVideo(file.absolutePath)
}

/**
* Check whether the file is a audio or not
*
* @param filename file
* @return Returns true if the file is an Audio
*/
fun isAudio(filename: String): Boolean {
val ext = getExtension(filename).toLowerCase()
val extensions = arrayOf("aif", "cda", "wpl", "flac", "mp3", "mid", "midi", "xmf", "mxmf", "rtttl", "rtx", "ota", "imy", "ogg", "wav", "ts", "aac", "mp4", "m4a", "3gp")
return extensions.contains(ext)
}

/**
* Check whether the file is a audio or not
*
* @param file file
* @return Returns true if the file is an Audio
*/
fun isAudio(file: File): Boolean {
return isAudio(file.absolutePath)
}

fun isDocument(filename: String): Boolean {
val ext = getExtension(filename).toLowerCase()
val extensions = arrayOf("doc", "docx", "odt", "pdf", "rtf", "tex", "txt", "wks", "wps", "wpd")
return extensions.contains(ext)
}

fun isDocument(file: File): Boolean {
return isDocument(file.absolutePath)
}

fun isSpreadsheet(filename: String): Boolean {
val ext = getExtension(filename).toLowerCase()
val extensions = arrayOf("xlr", "xls", "xlsx", "ods")
return extensions.contains(ext)
}

fun isSpreadsheet(file: File): Boolean {
return isSpreadsheet(file.absolutePath)
}

fun isPresentation(filename: String): Boolean {
val ext = getExtension(filename).toLowerCase()
val extensions = arrayOf("key", "odp", "pps", "ppt", "pptx")
return extensions.contains(ext)
}

fun isPresentation(file: File): Boolean {
return isPresentation(file.absolutePath)
}

fun isCompressed(filename: String): Boolean {
val ext = getExtension(filename).toLowerCase()
val extensions = arrayOf("7z", "arj", "deb", "pkg", "rar", "rpm", "tar.gz", "z", "zip")
return extensions.contains(ext)
}

fun isCompressed(file: File): Boolean {
return isCompressed(file.absolutePath)
}
}

0 comments on commit eb3a16f

Please sign in to comment.
You can’t perform that action at this time.