├── app ├── .gitignore ├── app-release.apk ├── release │ ├── app-release.apk │ └── output.json ├── src │ ├── main │ │ ├── ic_launcher-web.png │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_action_about.png │ │ │ │ └── ic_action_share.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_action_about.png │ │ │ │ └── ic_action_share.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_action_about.png │ │ │ │ └── ic_action_share.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_action_about.png │ │ │ │ └── ic_action_share.png │ │ │ ├── drawable │ │ │ │ ├── legacy_logo_transparent.png │ │ │ │ └── ic_refresh_icon.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── layout │ │ │ │ ├── activity_update_table_demo.xml │ │ │ │ ├── legacy_activity_list.xml │ │ │ │ ├── legacy_content_list.xml │ │ │ │ ├── activity_fancy_table_view.xml │ │ │ │ └── activity_about.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── levitnudi │ │ │ └── fancytableview │ │ │ ├── SimpleLegacyTableView.java │ │ │ ├── AboutLegacyTableViewActivity.java │ │ │ ├── LegacyTableViewThemes.java │ │ │ ├── SQLiteToLegacyTableView.java │ │ │ ├── CustomLegacyTableView.java │ │ │ ├── UpdateTableDemo.java │ │ │ ├── LegacyTableViewDemoActivity.java │ │ │ └── LegacyThemesDemoActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── levitnudi │ │ │ └── fancytableview │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── levitnudi │ │ └── fancytableview │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── legacytableview ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── levitnudi │ │ │ └── legacytableview │ │ │ └── LegacyTableView.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── levitnudi │ │ │ └── legacytableview │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── levitnudi │ │ └── legacytableview │ │ └── ExampleInstrumentedTest.java ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── .idea ├── dictionaries │ └── Hi.xml ├── caches │ ├── gradle_models.ser │ └── build_file_checksums.ser ├── markdown-navigator │ └── profiles_settings.xml ├── encodings.xml ├── compiler.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── assetWizardSettings.xml ├── misc.xml └── markdown-navigator.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .nb-gradle └── private │ └── cache │ ├── app-0a2c01c04d30118d1d2982912c4327c2 │ ├── FancyTableView-d41d8cd98f00b204e9800998ecf8427e │ └── legacytableview-2a385709733625d35d48ea510ac83d97 ├── gradle.properties ├── gradlew.bat ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /legacytableview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':legacytableview' 2 | -------------------------------------------------------------------------------- /app/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/app-release.apk -------------------------------------------------------------------------------- /.idea/dictionaries/Hi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/release/app-release.apk -------------------------------------------------------------------------------- /.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /legacytableview/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LegacyTableView 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable-hdpi/ic_action_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable-hdpi/ic_action_share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable-mdpi/ic_action_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable-mdpi/ic_action_share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable-xhdpi/ic_action_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable-xhdpi/ic_action_share.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable-xxhdpi/ic_action_share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/legacy_logo_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/drawable/legacy_logo_transparent.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.nb-gradle/private/cache/app-0a2c01c04d30118d1d2982912c4327c2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/.nb-gradle/private/cache/app-0a2c01c04d30118d1d2982912c4327c2 -------------------------------------------------------------------------------- /.nb-gradle/private/cache/FancyTableView-d41d8cd98f00b204e9800998ecf8427e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/.nb-gradle/private/cache/FancyTableView-d41d8cd98f00b204e9800998ecf8427e -------------------------------------------------------------------------------- /.nb-gradle/private/cache/legacytableview-2a385709733625d35d48ea510ac83d97: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/levitnudi/LegacyTableView/HEAD/.nb-gradle/private/cache/legacytableview-2a385709733625d35d48ea510ac83d97 -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":4,"versionName":"1.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF5722 4 | #E64A19 5 | #009688 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jan 12 14:18:48 EAT 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /legacytableview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_refresh_icon.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/test/java/com/levitnudi/fancytableview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /legacytableview/src/test/java/com/levitnudi/legacytableview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.legacytableview; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1024m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | android.useAndroidX=true 19 | # Automatically convert third-party libraries to use AndroidX 20 | android.enableJetifier=true 21 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/levitnudi/fancytableview/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.levitnudi.fancytableview", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_update_table_demo.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 18 | 19 | -------------------------------------------------------------------------------- /legacytableview/src/androidTest/java/com/levitnudi/legacytableview/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.legacytableview; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.levitnudi.legacytableview.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /legacytableview/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 14 9 | targetSdkVersion 29 10 | versionCode 4 11 | versionName "1.4" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | implementation fileTree(dir: 'libs', include: ['*.jar']) 26 | /* androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 27 | exclude group: 'com.android.support', module: 'support-annotations' 28 | })*/ 29 | implementation 'androidx.appcompat:appcompat:1.2.0' 30 | //testCompile 'junit:junit:4.12' 31 | } 32 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Hi\AppData\Local\Android\sdk1/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /legacytableview/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Hi\AppData\Local\Android\sdk1/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/legacy_activity_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/legacy_content_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 19 | 20 | 21 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_fancy_table_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 22 | 23 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.2" 6 | defaultConfig { 7 | applicationId "com.levitnudi.fancytableview" 8 | minSdkVersion 16 9 | targetSdkVersion 29 10 | versionCode 4 11 | versionName "1.4" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | vectorDrawables.useSupportLibrary = true 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | zipAlignEnabled true 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | implementation fileTree(include: ['*.jar'], dir: 'libs') 26 | /* androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { 27 | exclude group: 'com.android.support', module: 'support-annotations' 28 | })*/ 29 | implementation 'com.github.levitnudi:LegacyTableView:master-SNAPSHOT' 30 | //implementation project(':legacytableview') 31 | //implementation 'com.github.levitnudi:LegacyTableView:Tag' 32 | implementation 'androidx.appcompat:appcompat:1.2.0' 33 | implementation 'com.google.android.material:material:1.2.1' 34 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1' 35 | //androidTestImplementation 'junit:junit:4.12' 36 | implementation 'com.google.android.gms:play-services-ads:19.4.0' 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LegacyTableView 3 | LegacyTableView Copyright © , Levit Nudi 4 | 5 | 6 | Version 7 | More information : 8 | This is a simple light weight android library that will help you 9 | include from simple to complex customizable tables in your project. Get data from arrays, databases, excel files etc. You can customize to suit your needs. 10 | The only limit is your imagination! 11 | \nProject source code from Github 12 | \nAbout the author (Linkedin) 13 | \nIf you like this, buy me cofee! :) 14 | UpdateTableDemo 15 | 16 | 17 | ca-app-pub-2269598660144559/8432311214 18 | ca-app-pub-2269598660144559~9621609117 19 | ca-app-pub-2269598660144559/5397285468 20 | 21 | 22 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /.idea/assetWizardSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 46 | 47 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 17 | 18 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 12 | 13 | 14 | 32 | 47 | 48 | 49 | 50 | 51 | 52 | 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/levitnudi/fancytableview/SimpleLegacyTableView.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | import android.os.Bundle; 4 | import android.view.MenuItem; 5 | 6 | import androidx.appcompat.app.ActionBar; 7 | import androidx.appcompat.app.AppCompatActivity; 8 | 9 | import com.google.android.gms.ads.AdRequest; 10 | import com.google.android.gms.ads.AdView; 11 | import com.levitnudi.legacytableview.LegacyTableView; 12 | 13 | /* 14 | * Copyright 2018 Levit Nudi 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the "License"); 17 | * you may not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * http://www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an "AS IS" BASIS, 24 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | public class SimpleLegacyTableView extends AppCompatActivity { 30 | 31 | //declare your table header labels 32 | //the title size will determine the number of content labels on each row 33 | 34 | 35 | @Override 36 | public void onBackPressed(){ 37 | super.onBackPressed(); 38 | //do something when user presses back 39 | finish(); 40 | } 41 | LegacyTableView legacyTableView; 42 | @Override 43 | protected void onCreate(Bundle savedInstanceState) { 44 | super.onCreate(savedInstanceState); 45 | setContentView(R.layout.activity_fancy_table_view); 46 | 47 | ActionBar actionBar = getSupportActionBar(); 48 | 49 | if(actionBar !=null){ 50 | actionBar.setDisplayHomeAsUpEnabled(true); 51 | actionBar.setTitle("SimpleLegacyTableView"); 52 | } 53 | 54 | //set table title labels 55 | LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email"); 56 | //set table contents as string arrays 57 | LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "john@example.com", 58 | "332312", "Kennedy F", "33", "ken@example.com" 59 | ,"42343243", "Java Lover", "28", "Jlover@example.com" 60 | ,"4288383", "Mike Tee", "22", "miket@example.com"); 61 | 62 | legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 63 | legacyTableView.setTitle(LegacyTableView.readLegacyTitle()); 64 | legacyTableView.setContent(LegacyTableView.readLegacyContent()); 65 | //if you want a smaller table, change the padding setting 66 | //legacyTableView.setTablePadding(7); 67 | //to enable users to zoom in and out: 68 | legacyTableView.setZoomEnabled(true); 69 | legacyTableView.setShowZoomControls(true); 70 | 71 | //remember to build your table as the last step 72 | legacyTableView.build(); 73 | 74 | 75 | 76 | } 77 | 78 | @Override 79 | public boolean onOptionsItemSelected(MenuItem item){ 80 | switch (item.getItemId()){ 81 | case android.R.id.home: 82 | //finish activity once user presses back button 83 | finish(); 84 | return true; 85 | 86 | } 87 | return super.onOptionsItemSelected(item); 88 | } 89 | } -------------------------------------------------------------------------------- /app/src/main/java/com/levitnudi/fancytableview/AboutLegacyTableViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.text.method.LinkMovementMethod; 6 | import android.view.MenuItem; 7 | import android.view.View; 8 | import android.widget.TextView; 9 | 10 | import androidx.appcompat.app.ActionBar; 11 | import androidx.appcompat.app.AppCompatActivity; 12 | 13 | import com.google.android.gms.ads.AdRequest; 14 | import com.google.android.gms.ads.AdView; 15 | 16 | /* 17 | * Copyright 2018 Levit Nudi 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * 23 | * http://www.apache.org/licenses/LICENSE-2.0 24 | * 25 | * Unless required by applicable law or agreed to in writing, software 26 | * distributed under the License is distributed on an "AS IS" BASIS, 27 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 28 | * See the License for the specific language governing permissions and 29 | * limitations under the License. 30 | */ 31 | public class AboutLegacyTableViewActivity extends AppCompatActivity { 32 | @Override 33 | public void onBackPressed(){ 34 | super.onBackPressed(); 35 | startActivity(new Intent(AboutLegacyTableViewActivity.this, LegacyTableViewDemoActivity.class)); 36 | finish(); 37 | } 38 | protected void onCreate(Bundle savedInstanceState) { 39 | super.onCreate(savedInstanceState); 40 | setContentView(R.layout.activity_about); 41 | 42 | ActionBar ab = getSupportActionBar(); 43 | ab.setTitle(getString(R.string.app_name)); 44 | if(ab != null) { 45 | ab.setDisplayHomeAsUpEnabled(true); 46 | 47 | } 48 | 49 | View mainContent = findViewById(R.id.main_content); 50 | if (mainContent != null) { 51 | mainContent.setAlpha(0); 52 | mainContent.animate().alpha(1).setDuration(2000); 53 | } 54 | 55 | ((TextView)findViewById(R.id.authorLinkedin)).setMovementMethod(LinkMovementMethod.getInstance()); 56 | ((TextView)findViewById(R.id.buy_me_coffee)).setMovementMethod(LinkMovementMethod.getInstance()); 57 | ((TextView)findViewById(R.id.githubURL)).setMovementMethod(LinkMovementMethod.getInstance()); 58 | ((TextView)findViewById(R.id.textFieldVersionName)).setText(BuildConfig.VERSION_NAME); 59 | 60 | overridePendingTransition(0, 0); 61 | 62 | 63 | // Load an ad into the AdMob banner view. 64 | AdView adView = findViewById(R.id.adView); 65 | AdRequest adRequest = new AdRequest.Builder() 66 | .setRequestAgent("android_studio:ad_template").build(); 67 | adView.loadAd(adRequest); 68 | 69 | } 70 | 71 | 72 | /* @Override 73 | public boolean onCreateOptionsMenu(Menu menu) { 74 | // Inflate the menu; this adds items to the action bar if it is present. 75 | getMenuInflater().inflate(R.menu.menu_main, menu); 76 | return true; 77 | }*/ 78 | 79 | @Override 80 | public boolean onOptionsItemSelected(MenuItem item) { 81 | // Handle action bar item clicks here. The action bar will 82 | // automatically handle clicks on the Home/Up button, so long 83 | // as you specify a parent activity in AndroidManifest.xml. 84 | int id = item.getItemId(); 85 | 86 | if (id == android.R.id.home) { 87 | startActivity(new Intent(AboutLegacyTableViewActivity.this, LegacyTableViewDemoActivity.class)); 88 | finish(); 89 | return true; 90 | } 91 | 92 | return super.onOptionsItemSelected(item); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 36 | 37 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/levitnudi/fancytableview/LegacyTableViewThemes.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | import android.os.Bundle; 3 | import android.view.MenuItem; 4 | 5 | import androidx.appcompat.app.ActionBar; 6 | import androidx.appcompat.app.AppCompatActivity; 7 | 8 | import com.google.android.gms.ads.AdListener; 9 | import com.google.android.gms.ads.AdRequest; 10 | import com.google.android.gms.ads.AdView; 11 | import com.google.android.gms.ads.InterstitialAd; 12 | import com.levitnudi.legacytableview.LegacyTableView; 13 | 14 | /* 15 | * Copyright 2018 Levit Nudi 16 | * 17 | * Licensed under the Apache License, Version 2.0 (the "License"); 18 | * you may not use this file except in compliance with the License. 19 | * You may obtain a copy of the License at 20 | * 21 | * http://www.apache.org/licenses/LICENSE-2.0 22 | * 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | public class LegacyTableViewThemes extends AppCompatActivity { 30 | private InterstitialAd interstitialAd; 31 | //declare your table header labels 32 | int THEME = 0; 33 | String THEME_NAME = "LegacyTableViewThemes"; 34 | 35 | //declare your table content labels [NOTE] the array size should fit all rows and columns of your table 36 | String mContent[] = new String[]{"2999010", "John Deer", "50", "john@example.com", 37 | "332312", "Kennedy F", "33", "ken@example.com" 38 | ,"42343243", "Java Lover", "28", "Jlover@example.com" 39 | ,"4288383", "Mike Tee", "22", "miket@example.com"}; 40 | 41 | 42 | @Override 43 | public void onBackPressed(){ 44 | super.onBackPressed(); 45 | //do something when user presses back 46 | finish(); 47 | } 48 | @Override 49 | protected void onCreate(Bundle savedInstanceState) { 50 | super.onCreate(savedInstanceState); 51 | setContentView(R.layout.activity_fancy_table_view); 52 | 53 | Bundle bundle = getIntent().getExtras(); 54 | 55 | if(bundle!=null){ 56 | THEME = bundle.getInt("THEME", 0); 57 | THEME_NAME = bundle.getString("NAME", null); 58 | } 59 | 60 | ActionBar actionBar = getSupportActionBar(); 61 | 62 | if(actionBar !=null){ 63 | actionBar.setDisplayHomeAsUpEnabled(true); 64 | actionBar.setTitle(THEME_NAME); 65 | } 66 | 67 | //set table title labels 68 | LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email"); 69 | //set table contents as string arrays 70 | LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "john@example.com", 71 | "332312", "Kennedy F", "33", "ken@example.com" 72 | ,"42343243", "Java Lover", "28", "Jlover@example.com" 73 | ,"4288383", "Mike Tee", "22", "miket@example.com"); 74 | 75 | 76 | LegacyTableView legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 77 | legacyTableView.setTitle(LegacyTableView.readLegacyTitle()); 78 | legacyTableView.setContent(LegacyTableView.readLegacyContent()); 79 | legacyTableView.setTheme(THEME); 80 | legacyTableView.setBottomShadowVisible(false); 81 | //if you want a smaller table, change the padding setting 82 | legacyTableView.setTablePadding(7); 83 | //to enable users to zoom in and out: 84 | legacyTableView.setZoomEnabled(true); 85 | legacyTableView.setShowZoomControls(true); 86 | 87 | //remember to build your table as the last step 88 | legacyTableView.build(); 89 | 90 | 91 | 92 | // Create the InterstitialAd and set the adUnitId (defined in values/strings.xml). 93 | interstitialAd = new InterstitialAd(this); 94 | interstitialAd.setAdUnitId(getString(R.string.interstitial_ad_unit_id)); 95 | interstitialAd.setAdListener(new AdListener() { 96 | @Override 97 | public void onAdLoaded() { 98 | interstitialAd.show(); 99 | } 100 | 101 | @Override 102 | public void onAdFailedToLoad(int errorCode) { 103 | 104 | } 105 | 106 | @Override 107 | public void onAdClosed() { 108 | // Proceed to the next level. 109 | 110 | } 111 | }); 112 | 113 | AdRequest adRequest = new AdRequest.Builder() 114 | .setRequestAgent("android_studio:ad_template").build(); 115 | interstitialAd.loadAd(adRequest); 116 | 117 | } 118 | 119 | @Override 120 | public boolean onOptionsItemSelected(MenuItem item){ 121 | switch (item.getItemId()){ 122 | case android.R.id.home: 123 | //finish activity once user presses back button 124 | finish(); 125 | return true; 126 | 127 | } 128 | return super.onOptionsItemSelected(item); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /app/src/main/java/com/levitnudi/fancytableview/SQLiteToLegacyTableView.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | import android.content.Context; 4 | import android.database.Cursor; 5 | import android.database.sqlite.SQLiteDatabase; 6 | import android.os.Bundle; 7 | import android.view.MenuItem; 8 | 9 | import androidx.appcompat.app.ActionBar; 10 | import androidx.appcompat.app.AppCompatActivity; 11 | 12 | import com.google.android.gms.ads.AdRequest; 13 | import com.google.android.gms.ads.AdView; 14 | import com.levitnudi.legacytableview.LegacyTableView; 15 | 16 | /* 17 | * Copyright 2018 Levit Nudi 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * 23 | * http://www.apache.org/licenses/LICENSE-2.0 24 | * 25 | * Unless required by applicable law or agreed to in writing, software 26 | * distributed under the License is distributed on an "AS IS" BASIS, 27 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 28 | * See the License for the specific language governing permissions and 29 | * limitations under the License. 30 | */ 31 | public class SQLiteToLegacyTableView extends AppCompatActivity { 32 | //Sqlite DB Class 33 | SQLiteDatabase db; 34 | 35 | @Override 36 | public void onBackPressed(){ 37 | super.onBackPressed(); 38 | //do something when user presses back 39 | finish(); 40 | } 41 | 42 | @Override 43 | protected void onCreate(Bundle savedInstanceState) { 44 | super.onCreate(savedInstanceState); 45 | setContentView(R.layout.activity_fancy_table_view); 46 | 47 | ActionBar actionBar = getSupportActionBar(); 48 | 49 | if(actionBar !=null){ 50 | actionBar.setDisplayHomeAsUpEnabled(true); 51 | actionBar.setTitle("SQLiteToLegacyTableView"); 52 | } 53 | 54 | //initialize database and insert dummy data 55 | initializeDatabase(); 56 | //get dummy data from database and insert in the arrays 57 | getFromDatabase(); 58 | 59 | LegacyTableView legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 60 | //once you have inserted contents and titles, you can retrieve them 61 | //using readLegacyTitle() and readLegacyContent() methods 62 | legacyTableView.setTitle(LegacyTableView.readLegacyTitle()); 63 | legacyTableView.setContent(LegacyTableView.readLegacyContent()); 64 | //if you want a smaller table, change the padding setting 65 | legacyTableView.setTablePadding(7); 66 | //to enable users to zoom in and out: 67 | legacyTableView.setZoomEnabled(true); 68 | legacyTableView.setShowZoomControls(true); 69 | //remember to build your table as the last step 70 | legacyTableView.build(); 71 | 72 | 73 | } 74 | 75 | 76 | public void initializeDatabase(){ 77 | db = openOrCreateDatabase(getString(R.string.app_name), Context.MODE_PRIVATE, null); 78 | 79 | db.execSQL("CREATE TABLE IF NOT EXISTS legacy_table(_ID INTEGER PRIMARY KEY AUTOINCREMENT," + 80 | "PERSON_ID TEXT, PERSON_NAME TEXT, PERSON_AGE TEXT, PERSON_EMAIL TEXT);"); 81 | 82 | Cursor cursor = db.rawQuery("SELECT * FROM legacy_table", null); 83 | cursor.moveToFirst(); 84 | String PERSON_ID = ""; 85 | String PERSON_NAME = ""; 86 | String PERSON_AGE = ""; 87 | String PERSON_EMAIL = ""; 88 | //insert into the dummy table if no data exists 89 | if (cursor.getCount() == 0) { 90 | for(int i = 0; i<10; i++) { 91 | PERSON_ID = "Person Name "+i; 92 | PERSON_NAME = "John Deer "+i; 93 | PERSON_AGE = "2"+i; 94 | PERSON_EMAIL = "johndeer2"+i+"@farmer.com"; 95 | //inserting our dummy data into sqlite database 96 | 97 | db.execSQL("INSERT INTO legacy_table(PERSON_ID, PERSON_NAME, PERSON_AGE, PERSON_EMAIL) VALUES('" 98 | + PERSON_ID + "' ,'" + PERSON_NAME + "','" + PERSON_AGE + "','" + PERSON_EMAIL + "' );"); 99 | } 100 | } 101 | cursor.moveToNext(); 102 | cursor.close(); 103 | } 104 | 105 | 106 | public void getFromDatabase(){ 107 | 108 | Cursor cursor = db.rawQuery("SELECT * FROM legacy_table", null); 109 | 110 | if(cursor.getCount()>0){ 111 | //use database column names or custom names for the columns 112 | /* insert your column titles using legacy insertLegacyTitle() function*/ 113 | LegacyTableView.insertLegacyTitle(cursor.getColumnName(1), cursor.getColumnName(2), 114 | cursor.getColumnName(3), cursor.getColumnName(4)); 115 | } 116 | while(cursor.moveToNext()) { 117 | //simple table content insert method for table contents 118 | LegacyTableView.insertLegacyContent(cursor.getString(1), 119 | cursor.getString(2), cursor.getString(3), cursor.getString(4)); 120 | } 121 | //remember to close your database to avoid memory leaks 122 | cursor.close(); 123 | } 124 | 125 | 126 | @Override 127 | public boolean onOptionsItemSelected(MenuItem item){ 128 | switch (item.getItemId()){ 129 | case android.R.id.home: 130 | //finish activity once user presses back button 131 | finish(); 132 | return true; 133 | 134 | } 135 | return super.onOptionsItemSelected(item); 136 | } 137 | 138 | } -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /app/src/main/java/com/levitnudi/fancytableview/CustomLegacyTableView.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | 4 | import android.os.Bundle; 5 | import android.view.MenuItem; 6 | 7 | import androidx.appcompat.app.ActionBar; 8 | import androidx.appcompat.app.AppCompatActivity; 9 | 10 | import com.google.android.gms.ads.AdRequest; 11 | import com.google.android.gms.ads.AdView; 12 | import com.levitnudi.legacytableview.LegacyTableView; 13 | import static com.levitnudi.legacytableview.LegacyTableView.BOLD; 14 | import static com.levitnudi.legacytableview.LegacyTableView.CENTER; 15 | import static com.levitnudi.legacytableview.LegacyTableView.CUSTOM; 16 | import static com.levitnudi.legacytableview.LegacyTableView.ODD; 17 | 18 | /* 19 | * Copyright 2018 Levit Nudi 20 | * 21 | * Licensed under the Apache License, Version 2.0 (the "License"); 22 | * you may not use this file except in compliance with the License. 23 | * You may obtain a copy of the License at 24 | * 25 | * http://www.apache.org/licenses/LICENSE-2.0 26 | * 27 | * Unless required by applicable law or agreed to in writing, software 28 | * distributed under the License is distributed on an "AS IS" BASIS, 29 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 30 | * See the License for the specific language governing permissions and 31 | * limitations under the License. 32 | */ 33 | public class CustomLegacyTableView extends AppCompatActivity { 34 | //declare your table header labels 35 | //the title size will determine the number of content labels on each row 36 | 37 | @Override 38 | public void onBackPressed(){ 39 | super.onBackPressed(); 40 | finish(); 41 | } 42 | 43 | @Override 44 | protected void onCreate(Bundle savedInstanceState) { 45 | super.onCreate(savedInstanceState); 46 | setContentView(R.layout.activity_fancy_table_view); 47 | 48 | ActionBar actionBar = getSupportActionBar(); 49 | 50 | if(actionBar !=null){ 51 | actionBar.setDisplayHomeAsUpEnabled(true); 52 | actionBar.setTitle("CustomLegacyTableView"); 53 | } 54 | 55 | final LegacyTableView tableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 56 | /* 57 | [OPTIONAL] default column seperator characters are (د) character 58 | default row seperator is (\n) character 59 | you may need to change if your set of data contains these characters 60 | if you don't change the seperators, any character similar in your data set 61 | will be excluded in your table. It is therefore adviseable to use least 62 | commonly used characters 63 | tableView.setColumnSeperator("'"); 64 | tableView.setRowSeperator("\n"); 65 | tableView.setLegacyColumnSeperator("'");*/ 66 | 67 | //set table title labels 68 | LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email"); 69 | //set table contents as string arrays 70 | LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "john@example.com", 71 | "332312", "Kennedy F", "33", "ken@example.com" 72 | ,"42343243", "Java Lover", "28", "Jlover@example.com" 73 | ,"4288383", "Mike Tee", "22", "miket@example.com"); 74 | //make sure to indicate custom as other features may not work with default table theme 75 | tableView.setTheme(CUSTOM); 76 | //get titles and contents 77 | tableView.setContent(LegacyTableView.readLegacyContent()); 78 | tableView.setTitle(LegacyTableView.readLegacyTitle()); 79 | tableView.setBottomShadowVisible(true); 80 | 81 | tableView.setHighlight(ODD);//highlight rows oddly or evenly 82 | //tableView.setHighlight(EVEN); 83 | tableView.setBottomShadowVisible(true); 84 | tableView.setFooterTextAlignment(CENTER); 85 | 86 | tableView.setFooterText(getString(R.string.footer_text)); 87 | tableView.setTableFooterTextSize(5); 88 | tableView.setTableFooterTextColor("#009688"); 89 | 90 | tableView.setTitleTextAlignment(CENTER); 91 | tableView.setContentTextAlignment(CENTER); 92 | tableView.setTablePadding(7);//increasing spacing will increase the table size 93 | //tableView.setBottomShadowColorTint("#ffffff"); 94 | 95 | //tableView.setBackgroundEvenColor("#FFCCBC"); 96 | //tableView.setBackgroundEvenColor("#303F9F"); 97 | tableView.setBackgroundOddColor("#FFCCBC"); 98 | //you can also declare your color values as global strings to make your work easy :) 99 | tableView.setHeaderBackgroundLinearGradientBOTTOM("#FF5722");//header background bottom color 100 | tableView.setHeaderBackgroundLinearGradientTOP("#009688");//header background top color 101 | tableView.setBorderSolidColor("#009688"); 102 | tableView.setTitleFont(BOLD); 103 | tableView.setZoomEnabled(true); 104 | tableView.setShowZoomControls(true); 105 | //by default the initial scale is 100, you 106 | // may change this depending on various screen sizes 107 | //tableView.setInitialScale(100);//default initial scale is 0 (normal size) 108 | tableView.setContentTextColor("#009688"); 109 | tableView.build(); 110 | 111 | 112 | } 113 | 114 | @Override 115 | public boolean onOptionsItemSelected(MenuItem item){ 116 | switch (item.getItemId()){ 117 | case android.R.id.home: 118 | //finish activity once user presses back button 119 | finish(); 120 | return true; 121 | 122 | } 123 | return super.onOptionsItemSelected(item); 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /app/src/main/java/com/levitnudi/fancytableview/UpdateTableDemo.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | import android.os.Bundle; 4 | import android.view.MenuItem; 5 | import android.view.View; 6 | 7 | import androidx.appcompat.app.ActionBar; 8 | import androidx.appcompat.app.AppCompatActivity; 9 | 10 | import com.google.android.gms.ads.AdRequest; 11 | import com.google.android.gms.ads.AdView; 12 | import com.google.android.material.floatingactionbutton.FloatingActionButton; 13 | import com.levitnudi.legacytableview.LegacyTableView; 14 | /* 15 | * Copyright 2018 Levit Nudi 16 | * 17 | * Licensed under the Apache License, Version 2.0 (the "License"); 18 | * you may not use this file except in compliance with the License. 19 | * You may obtain a copy of the License at 20 | * 21 | * http://www.apache.org/licenses/LICENSE-2.0 22 | * 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | 30 | //update table data, theme, fonts, colors, languages etc 31 | public class UpdateTableDemo extends AppCompatActivity { 32 | LegacyTableView legacyTableView; 33 | 34 | int updateCount = 0; 35 | 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | setContentView(R.layout.activity_update_table_demo); 40 | 41 | ActionBar actionBar = getSupportActionBar(); 42 | 43 | if(actionBar !=null){ 44 | actionBar.setDisplayHomeAsUpEnabled(true); 45 | actionBar.setTitle("Update LegacyTable"); 46 | } 47 | 48 | 49 | 50 | //set table title labels 51 | LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email"); 52 | //set table contents as string arrays 53 | LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "john@example.com", 54 | "332312", "Kennedy F", "33", "ken@example.com" 55 | ,"42343243", "Java Lover", "28", "Jlover@example.com" 56 | ,"4288383", "Mike Tee", "22", "miket@example.com"); 57 | 58 | legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 59 | legacyTableView.setTitle(LegacyTableView.readLegacyTitle()); 60 | legacyTableView.setContent(LegacyTableView.readLegacyContent()); 61 | //if you want a smaller table, change the padding setting 62 | //legacyTableView.setTablePadding(7); 63 | //to enable users to zoom in and out: 64 | legacyTableView.setZoomEnabled(true); 65 | legacyTableView.setShowZoomControls(true); 66 | 67 | //remember to build your table as the last step 68 | legacyTableView.build(); 69 | 70 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); 71 | fab.setOnClickListener(new View.OnClickListener() { 72 | @Override 73 | public void onClick(View view) { 74 | 75 | //update with incremented values (dynamic table demo) 76 | //you can choose to set totally new values here 77 | //every time you build your table, the previous values are cleared. You therefore 78 | //shouldn't miss this step (add your title and content AGAIN even if either of the two; 79 | //content or title is being updated. Below code structure should be enough to update 80 | //entire table with new values 81 | //you can choose to update theme, colors and fonts as well, however, original look and feel may not 82 | //be guaranteed in such a case. If you find a better way, please feel free to contribute. 83 | 84 | //the library supports any form of characters including chinese. Make sure that characters 85 | //used are not clashing with table constants e.g row and column splitters. In case they do, 86 | //you can always change row or column splitters e.g setRowSeperator("your_character") 87 | 88 | LegacyTableView.insertLegacyTitle("Student ID 你好!"+updateCount++, "Name Student Name 你好!"+updateCount++, "Student Age 你好!"+updateCount++, "Student Email 你好!"+updateCount++); 89 | 90 | LegacyTableView.insertLegacyContent("2999010"+updateCount++, "John Deer2 你好!"+updateCount++, "50"+updateCount++, "john@example.com"+updateCount++, 91 | "3323123"+updateCount++, "Karen J 你好!"+updateCount++, "30"+updateCount++, "karen@example.com"+updateCount++ 92 | ,"42343243"+updateCount++, "Android Lovers 你好!"+updateCount++, "28", "android@example.com"+updateCount++ 93 | ,"4288383"+updateCount++, "Levit Barry 你好!"+updateCount++, "25", "lb@example.com"+updateCount++); 94 | 95 | //don't skip this step, make sure to add your new values to your table (both title and content) 96 | legacyTableView.setTitle(LegacyTableView.readLegacyTitle()); 97 | legacyTableView.setContent(LegacyTableView.readLegacyContent()); 98 | 99 | //NOTE -: USE legacyTableView.rebuild() NOT legacyTableView.build(); to update table 100 | legacyTableView.rebuild(); 101 | } 102 | }); 103 | } 104 | 105 | @Override 106 | public boolean onOptionsItemSelected(MenuItem item) { 107 | // Handle action bar item clicks here. The action bar will 108 | // automatically handle clicks on the Home/Up button, so long 109 | // as you specify a parent activity in AndroidManifest.xml. 110 | int id = item.getItemId(); 111 | 112 | if (id == android.R.id.home) { 113 | finish(); 114 | return true; 115 | } 116 | 117 | return super.onOptionsItemSelected(item); 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /app/src/main/java/com/levitnudi/fancytableview/LegacyTableViewDemoActivity.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.view.MenuItem; 7 | import android.view.View; 8 | import android.view.Menu; 9 | import android.widget.AdapterView; 10 | import android.widget.AdapterView.OnItemClickListener; 11 | import android.widget.ArrayAdapter; 12 | import android.widget.ListView; 13 | 14 | import androidx.appcompat.app.AppCompatActivity; 15 | 16 | import com.google.android.gms.ads.AdListener; 17 | import com.google.android.gms.ads.AdRequest; 18 | import com.google.android.gms.ads.AdView; 19 | import com.google.android.gms.ads.InterstitialAd; 20 | 21 | /* 22 | * Copyright 2018 Levit Nudi 23 | * 24 | * Licensed under the Apache License, Version 2.0 (the "License"); 25 | * you may not use this file except in compliance with the License. 26 | * You may obtain a copy of the License at 27 | * 28 | * http://www.apache.org/licenses/LICENSE-2.0 29 | * 30 | * Unless required by applicable law or agreed to in writing, software 31 | * distributed under the License is distributed on an "AS IS" BASIS, 32 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 33 | * See the License for the specific language governing permissions and 34 | * limitations under the License. 35 | */ 36 | public class LegacyTableViewDemoActivity extends AppCompatActivity { 37 | ListView listView; 38 | private InterstitialAd interstitialAd; 39 | 40 | @Override 41 | public void onBackPressed(){ 42 | super.onBackPressed(); 43 | //do something when user presses back 44 | //exit with code 0 45 | System.exit(0); 46 | } 47 | 48 | @Override 49 | public void onCreate(Bundle savedInstanceState) { 50 | super.onCreate(savedInstanceState); 51 | setContentView(R.layout.legacy_activity_list); 52 | 53 | 54 | String[] legacyList = new String[] { "SimpleLegacyTableView", "CustomLegacyTableView","SQLiteToLegacyTableView", 55 | "LegacyTableViewThemes", "Update LegacyTableView"}; 56 | 57 | listView = (ListView) findViewById(R.id.listview); 58 | 59 | // Bind array strings into an adapter 60 | ArrayAdapter adapter = new ArrayAdapter<>(this, 61 | android.R.layout.simple_list_item_1, android.R.id.text1, 62 | legacyList); 63 | listView.setAdapter(adapter); 64 | 65 | // Get ListView item click 66 | listView.setOnItemClickListener(new OnItemClickListener() { 67 | public void onItemClick(AdapterView parent, View view, 68 | int position, long id) { 69 | 70 | // Get the click position and set it into a string 71 | String items = (String) listView.getItemAtPosition(position); 72 | //set intent 73 | Intent intent = new Intent(getApplicationContext(), LegacyTableViewThemes.class); 74 | switch (position){ 75 | case 0: 76 | startActivity(new Intent(getApplicationContext(), SimpleLegacyTableView.class)); 77 | return; 78 | case 1: 79 | startActivity(new Intent(getApplicationContext(), CustomLegacyTableView.class)); 80 | return; 81 | case 2: 82 | startActivity(new Intent(getApplicationContext(), SQLiteToLegacyTableView.class)); 83 | return; 84 | case 3: 85 | startActivity(new Intent(getApplicationContext(), LegacyThemesDemoActivity.class)); 86 | return; 87 | case 4://new feature for creating dynamic tables / updating data on existing table 88 | startActivity(new Intent(getApplicationContext(), UpdateTableDemo.class)); 89 | return; 90 | 91 | } 92 | 93 | } 94 | }); 95 | 96 | 97 | // Create the InterstitialAd and set the adUnitId (defined in values/strings.xml). 98 | interstitialAd = new InterstitialAd(this); 99 | interstitialAd.setAdUnitId(getString(R.string.interstitial_ad_unit_id)); 100 | interstitialAd.setAdListener(new AdListener() { 101 | @Override 102 | public void onAdLoaded() { 103 | interstitialAd.show(); 104 | } 105 | 106 | @Override 107 | public void onAdFailedToLoad(int errorCode) { 108 | 109 | } 110 | 111 | @Override 112 | public void onAdClosed() { 113 | // Proceed to the next level. 114 | 115 | } 116 | }); 117 | 118 | AdRequest adRequest = new AdRequest.Builder() 119 | .setRequestAgent("android_studio:ad_template").build(); 120 | interstitialAd.loadAd(adRequest); 121 | 122 | } 123 | 124 | 125 | @Override 126 | public boolean onCreateOptionsMenu(Menu menu) { 127 | // Inflate the menu; this adds items to the action bar if it is present. 128 | getMenuInflater().inflate(R.menu.menu_main, menu); 129 | return true; 130 | } 131 | 132 | @Override 133 | public boolean onOptionsItemSelected(MenuItem item) { 134 | // Handle action bar item clicks here. The action bar will 135 | // automatically handle clicks on the Home/Up button, so long 136 | // as you specify a parent activity in AndroidManifest.xml. 137 | int id = item.getItemId(); 138 | 139 | if (id == R.id.action_about_id) { 140 | startActivity(new Intent(LegacyTableViewDemoActivity.this, AboutLegacyTableViewActivity.class)); 141 | finish(); 142 | return true; 143 | } 144 | 145 | if (id == android.R.id.home) { 146 | ////exit application completely and kill all running tasks 147 | System.exit(0); 148 | return true; 149 | } 150 | 151 | if (id == R.id.action_share_id) { 152 | Intent sendIntent = new Intent(); 153 | Uri url = Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName()); 154 | sendIntent.setAction(Intent.ACTION_SEND); 155 | sendIntent.putExtra(Intent.EXTRA_TEXT, "Hi!, I'm using LegacyTableView library to make cool TableView projects " + 156 | "get it here "+url); 157 | sendIntent.setType("text/plain"); 158 | startActivity(sendIntent); 159 | return true; 160 | } 161 | 162 | return super.onOptionsItemSelected(item); 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 19 | 20 | 25 | 26 | 39 | 40 | 44 | 45 | 50 | 51 | 52 | 53 | 61 | 62 | 68 | 69 | 75 | 76 | 84 | 85 | 86 | 87 | 93 | 94 | 95 | 96 | 97 | 107 | 108 | 115 | 116 | 124 | 125 | 134 | 135 | 144 | 145 | 146 | 147 | 148 | 149 | 157 | 158 | -------------------------------------------------------------------------------- /app/src/main/java/com/levitnudi/fancytableview/LegacyThemesDemoActivity.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.fancytableview; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.view.MenuItem; 7 | import android.view.View; 8 | import android.widget.AdapterView; 9 | import android.widget.AdapterView.OnItemClickListener; 10 | import android.widget.ArrayAdapter; 11 | import android.widget.ListView; 12 | 13 | import androidx.appcompat.app.ActionBar; 14 | import androidx.appcompat.app.AppCompatActivity; 15 | 16 | import com.google.android.gms.ads.AdListener; 17 | import com.google.android.gms.ads.AdRequest; 18 | import com.google.android.gms.ads.AdView; 19 | import com.google.android.gms.ads.InterstitialAd; 20 | 21 | import static com.levitnudi.legacytableview.LegacyTableView.DESKTOP; 22 | import static com.levitnudi.legacytableview.LegacyTableView.ECOKENYA; 23 | import static com.levitnudi.legacytableview.LegacyTableView.GOLDALINE; 24 | import static com.levitnudi.legacytableview.LegacyTableView.LAVICI; 25 | import static com.levitnudi.legacytableview.LegacyTableView.LEVICI; 26 | import static com.levitnudi.legacytableview.LegacyTableView.MAASAI; 27 | import static com.levitnudi.legacytableview.LegacyTableView.MESH; 28 | import static com.levitnudi.legacytableview.LegacyTableView.OCEAN; 29 | import static com.levitnudi.legacytableview.LegacyTableView.ORIO; 30 | import static com.levitnudi.legacytableview.LegacyTableView.SKELETON; 31 | 32 | /* 33 | * Copyright 2018 Levit Nudi 34 | * 35 | * Licensed under the Apache License, Version 2.0 (the "License"); 36 | * you may not use this file except in compliance with the License. 37 | * You may obtain a copy of the License at 38 | * 39 | * http://www.apache.org/licenses/LICENSE-2.0 40 | * 41 | * Unless required by applicable law or agreed to in writing, software 42 | * distributed under the License is distributed on an "AS IS" BASIS, 43 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44 | * See the License for the specific language governing permissions and 45 | * limitations under the License. 46 | */ 47 | public class LegacyThemesDemoActivity extends AppCompatActivity { 48 | ListView listView; 49 | private InterstitialAd interstitialAd; 50 | 51 | @Override 52 | public void onBackPressed(){ 53 | super.onBackPressed(); 54 | //do something when user presses back 55 | finish(); 56 | } 57 | 58 | @Override 59 | public void onCreate(Bundle savedInstanceState) { 60 | super.onCreate(savedInstanceState); 61 | setContentView(R.layout.legacy_activity_list); 62 | 63 | ActionBar actionBar = getSupportActionBar(); 64 | 65 | if(actionBar !=null){ 66 | actionBar.setDisplayHomeAsUpEnabled(true); 67 | actionBar.setTitle("LegacyThemesDemoActivity"); 68 | } 69 | 70 | 71 | String[] legacyList = new String[] { "OCEAN", "LAVICI", "GOLDALINE", 72 | "ECOKENYA", "DESKTOP", "MAASAI", 73 | "LEVICI", "ORIO", "SKELETON", "MESH"}; 74 | 75 | listView = (ListView) findViewById(R.id.listview); 76 | 77 | // Bind array strings into an adapter 78 | ArrayAdapter adapter = new ArrayAdapter<>(this, 79 | android.R.layout.simple_list_item_1, android.R.id.text1, 80 | legacyList); 81 | listView.setAdapter(adapter); 82 | 83 | // Get ListView item click 84 | listView.setOnItemClickListener(new OnItemClickListener() { 85 | public void onItemClick(AdapterView parent, View view, 86 | int position, long id) { 87 | 88 | // Get the click position and set it into a string 89 | String items = (String) listView.getItemAtPosition(position); 90 | //set intent 91 | Intent intent = new Intent(getApplicationContext(), LegacyTableViewThemes.class); 92 | switch (position){ 93 | case 0: 94 | intent.putExtra("THEME", OCEAN); 95 | intent.putExtra("NAME", "OCEAN"); 96 | startActivity(intent); 97 | return; 98 | case 1: 99 | intent.putExtra("THEME", LAVICI); 100 | intent.putExtra("NAME", "LAVICI"); 101 | startActivity(intent); 102 | return; 103 | case 2: 104 | intent.putExtra("THEME", GOLDALINE); 105 | intent.putExtra("NAME", "GOLDALINE"); 106 | startActivity(intent); 107 | return; 108 | case 3: 109 | intent.putExtra("THEME", ECOKENYA); 110 | intent.putExtra("NAME", "ECOKENYA"); 111 | startActivity(intent); 112 | return; 113 | case 4: 114 | intent.putExtra("THEME", DESKTOP); 115 | intent.putExtra("NAME", "DESKTOP"); 116 | startActivity(intent); 117 | return; 118 | case 5: 119 | intent.putExtra("THEME", MAASAI); 120 | intent.putExtra("NAME", "MAASAI"); 121 | startActivity(intent); 122 | return; 123 | case 6: 124 | intent.putExtra("THEME", LEVICI); 125 | intent.putExtra("NAME", "LEVICI"); 126 | startActivity(intent); 127 | return; 128 | case 7: 129 | intent.putExtra("THEME", ORIO); 130 | intent.putExtra("NAME", "ORIO"); 131 | startActivity(intent); 132 | return; 133 | case 8: 134 | intent.putExtra("THEME", SKELETON); 135 | intent.putExtra("NAME", "SKELETON"); 136 | startActivity(intent); 137 | return; 138 | case 9: 139 | intent.putExtra("THEME", MESH); 140 | intent.putExtra("NAME", "MESH"); 141 | startActivity(intent); 142 | return; 143 | default: 144 | intent.putExtra("THEME", OCEAN); 145 | intent.putExtra("NAME", "OCEAN"); 146 | startActivity(intent); 147 | return; 148 | } 149 | 150 | } 151 | }); 152 | 153 | 154 | // Create the InterstitialAd and set the adUnitId (defined in values/strings.xml). 155 | interstitialAd = new InterstitialAd(this); 156 | interstitialAd.setAdUnitId(getString(R.string.interstitial_ad_unit_id)); 157 | interstitialAd.setAdListener(new AdListener() { 158 | @Override 159 | public void onAdLoaded() { 160 | interstitialAd.show(); 161 | } 162 | 163 | @Override 164 | public void onAdFailedToLoad(int errorCode) { 165 | 166 | } 167 | 168 | @Override 169 | public void onAdClosed() { 170 | // Proceed to the next level. 171 | 172 | } 173 | }); 174 | 175 | AdRequest adRequest = new AdRequest.Builder() 176 | .setRequestAgent("android_studio:ad_template").build(); 177 | interstitialAd.loadAd(adRequest); 178 | 179 | } 180 | 181 | 182 | @Override 183 | public boolean onOptionsItemSelected(MenuItem item) { 184 | // Handle action bar item clicks here. The action bar will 185 | // automatically handle clicks on the Home/Up button, so long 186 | // as you specify a parent activity in AndroidManifest.xml. 187 | int id = item.getItemId(); 188 | 189 | if (id == android.R.id.home) { 190 | finish(); 191 | return true; 192 | } 193 | 194 | return super.onOptionsItemSelected(item); 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LegacyTableView 2 | simple light weight android library for displaying tabulated data 3 | 4 | This is a simple android library that will help you include tables in your projects using a few lines of code. 5 | Follow very simple examples in the sample LegcyTableView project. Write data dynamically, translate into different languages, 6 | update themes, colors, fonts etc... 7 | 8 | 9 | 10 | Application Demo 11 | 12 | 13 | # Examples 14 | This project covers the following examples 15 | 1. Simple display of data 16 | 2. Custom controls for the LegacyTableView 17 | 3. Adding data from database (SQLite) 18 | 4. Using different LegacyTableViewThemes 19 | 20 | [](https://play.google.com/store/apps/details?id=com.levitnudi.fancytableview) 21 | 22 | 23 | 24 | 25 | # Get started... 26 | 27 | Add jitpack.io to your root gradle file 28 | 29 | ```gradle 30 | allprojects { 31 | repositories { 32 | ... 33 | maven { url 'https://jitpack.io' } 34 | } 35 | } 36 | 37 | 38 | ``` 39 | 40 | 41 | Add this to your dependencies method in build.gradle file 42 | 43 | 44 | ```gradle 45 | dependencies { 46 | implementation 'com.github.levitnudi:LegacyTableView:1.4' 47 | 48 | } 49 | 50 | 51 | } 52 | 53 | 54 | ``` 55 | 56 | 57 | 58 | 59 | 60 | Add the following lines... 61 | 62 | 1. In your xml layout add: 63 | 64 | 65 | ```xml 66 | 70 | 71 | 72 | ``` 73 | 74 | 2. In your activity add: 75 | 76 | ```java 77 | //set table title labels 78 | LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email"); 79 | //set table contents as string arrays 80 | LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "john@example.com", 81 | "332312", "Kennedy F", "33", "ken@example.com" 82 | ,"42343243", "Java Lover", "28", "Jlover@example.com" 83 | ,"4288383", "Mike Tee", "22", "miket@example.com"); 84 | 85 | LegacyTableView legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 86 | legacyTableView.setTitle(LegacyTableView.readLegacyTitle()); 87 | legacyTableView.setContent(LegacyTableView.readLegacyContent()); 88 | 89 | //depending on the phone screen size default table scale is 100 90 | //you can change it using this method 91 | //legacyTableView.setInitialScale(100);//default initialScale is zero (0) 92 | 93 | //if you want a smaller table, change the padding setting 94 | legacyTableView.setTablePadding(7); 95 | 96 | //to enable users to zoom in and out: 97 | legacyTableView.setZoomEnabled(true); 98 | legacyTableView.setShowZoomControls(true); 99 | 100 | //remember to build your table as the last step 101 | legacyTableView.build(); 102 | 103 | 104 | ``` 105 | 106 | 107 | 108 | 3. Using Themes: 109 | 110 | ```java 111 | //set table title labels 112 | LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email"); 113 | //set table contents as string arrays 114 | LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "john@example.com", 115 | "332312", "Kennedy F", "33", "ken@example.com" 116 | ,"42343243", "Java Lover", "28", "Jlover@example.com" 117 | ,"4288383", "Mike Tee", "22", "miket@example.com"); 118 | 119 | LegacyTableView legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 120 | legacyTableView.setTitle(LegacyTableView.readLegacyTitle()); 121 | legacyTableView.setContent(LegacyTableView.readLegacyContent()); 122 | 123 | //Add your preferred theme like this: 124 | legacyTableView.setTheme(GOLDALINE); 125 | 126 | /* 127 | Explore available themes 128 | OCEAN 129 | LAVICI 130 | GOLDALINE 131 | ECOKENYA 132 | DESKTOP 133 | MAASAI 134 | LEVICI 135 | ORIO 136 | SKELETON 137 | MESH*/ 138 | 139 | //depending on the phone screen size default table scale is 100 140 | //you can change it using this method 141 | //legacyTableView.setInitialScale(100);//default initialScale is zero (0) 142 | 143 | //if you want a smaller table, change the padding setting 144 | legacyTableView.setTablePadding(7); 145 | 146 | //to enable users to zoom in and out: 147 | legacyTableView.setZoomEnabled(true); 148 | legacyTableView.setShowZoomControls(true); 149 | 150 | //remember to build your table as the last step 151 | legacyTableView.build(); 152 | 153 | 154 | ``` 155 | 156 | 157 | 4. Display from database: 158 | 159 | 160 | ```java 161 | public void getFromDatabase(){//execute this method to fetch from database 162 | 163 | Cursor cursor = db.rawQuery("SELECT * FROM legacy_table", null); 164 | 165 | if(cursor.getCount()>0){ 166 | //use database column names or custom names for the columns 167 | /* insert your column titles using legacy insertLegacyTitle() function*/ 168 | LegacyTableView.insertLegacyTitle(cursor.getColumnName(1), cursor.getColumnName(2), 169 | cursor.getColumnName(3), cursor.getColumnName(4)); 170 | } 171 | while(cursor.moveToNext()) { 172 | //simple table content insert method for table contents 173 | LegacyTableView.insertLegacyContent(cursor.getString(1), 174 | cursor.getString(2), cursor.getString(3), cursor.getString(4)); 175 | } 176 | //remember to close your database to avoid memory leaks 177 | cursor.close(); 178 | } 179 | 180 | //then do this to display it on the table 181 | LegacyTableView legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 182 | //once you have inserted contents and titles, you can retrieve them 183 | //using readLegacyTitle() and readLegacyContent() methods 184 | legacyTableView.setTitle(LegacyTableView.readLegacyTitle()); 185 | legacyTableView.setContent(LegacyTableView.readLegacyContent()); 186 | 187 | //remember to build your table as the last step 188 | legacyTableView.build(); 189 | 190 | 191 | ``` 192 | 193 | 194 | 4. Using custom controls: 195 | 196 | 197 | ```java 198 | final LegacyTableView tableView = (LegacyTableView)findViewById(R.id.legacy_table_view); 199 | /* 200 | [OPTIONAL] default column seperator characters are (د) character 201 | default row seperator is (\n) character 202 | you may need to change if your set of data contains these characters 203 | if you don't change the seperators, any character similar in your data set 204 | will be excluded in your table. It is therefore adviseable to use least 205 | commonly used characters 206 | tableView.setColumnSeperator("'"); 207 | tableView.setRowSeperator("\n"); 208 | tableView.setLegacyColumnSeperator("'");*/ 209 | 210 | //set table title labels 211 | LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email"); 212 | //set table contents as string arrays 213 | LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "john@example.com", 214 | "332312", "Kennedy F", "33", "ken@example.com" 215 | ,"42343243", "Java Lover", "28", "Jlover@example.com" 216 | ,"4288383", "Mike Tee", "22", "miket@example.com"); 217 | //make sure to indicate custom as other features may not work with default table theme 218 | tableView.setTheme(CUSTOM); 219 | //get titles and contents 220 | tableView.setContent(LegacyTableView.readLegacyContent()); 221 | tableView.setTitle(LegacyTableView.readLegacyTitle()); 222 | tableView.setBottomShadowVisible(true); 223 | 224 | tableView.setHighlight(ODD);//highlight rows oddly or evenly 225 | //tableView.setHighlight(EVEN); 226 | tableView.setBottomShadowVisible(true); 227 | tableView.setFooterTextAlignment(CENTER); 228 | 229 | tableView.setFooterText(getString(R.string.footer_text)); 230 | tableView.setTableFooterTextSize(5); 231 | tableView.setTableFooterTextColor("#009688"); 232 | 233 | tableView.setTitleTextAlignment(CENTER); 234 | tableView.setContentTextAlignment(CENTER); 235 | tableView.setTablePadding(20);//increasing spacing will increase the table size 236 | //tableView.setBottomShadowColorTint("#ffffff"); 237 | 238 | //tableView.setBackgroundEvenColor("#FFCCBC"); 239 | //tableView.setBackgroundEvenColor("#303F9F"); 240 | tableView.setBackgroundOddColor("#FFCCBC"); 241 | //you can also declare your color values as global strings to make your work easy :) 242 | tableView.setHeaderBackgroundLinearGradientBOTTOM("#FF5722");//header background bottom color 243 | tableView.setHeaderBackgroundLinearGradientTOP("#009688");//header background top color 244 | tableView.setBorderSolidColor("#009688"); 245 | tableView.setTitleFont(BOLD); 246 | tableView.setZoomEnabled(true); 247 | tableView.setShowZoomControls(true); 248 | //by default the initial scale is 0, you 249 | // may change this depending on initiale scale preferences 250 | //tableView.setInitialScale(100);//default initialScale is zero (0) 251 | tableView.setContentTextColor("#009688"); 252 | tableView.build(); 253 | 254 | 255 | ``` 256 | 257 | 258 | ``` 259 | Copyright 2018 Levit Nudi 260 | 261 | Licensed under the Apache License, Version 2.0 (the "License"); 262 | you may not use this file except in compliance with the License. 263 | You may obtain a copy of the License at 264 | 265 | http://www.apache.org/licenses/LICENSE-2.0 266 | 267 | Unless required by applicable law or agreed to in writing, software 268 | distributed under the License is distributed on an "AS IS" BASIS, 269 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 270 | See the License for the specific language governing permissions and 271 | limitations under the License. 272 | 273 | 274 | ``` 275 | 276 | # Author : Levit Nudi [![LinkedIn](http://www.fftimes.com/sites/all/modules/socialmedia/icons/levelten/glossy/32x32/linkedin.png)](https://www.linkedin.com/in/levitnudi/) 277 | 278 | [![LinkedIn](https://www.newsforpublic.com/wp-content/uploads/2015/08/buy-me-a-coffee.png)](https://www.paypal.com/donate/?cmd=_s-xclick&hosted_button_id=6QKNS4V5Y3XWJ) 279 | -------------------------------------------------------------------------------- /legacytableview/src/main/java/com/levitnudi/legacytableview/LegacyTableView.java: -------------------------------------------------------------------------------- 1 | package com.levitnudi.legacytableview; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.webkit.WebView; 6 | import java.util.LinkedList; 7 | import java.util.List; 8 | 9 | /* 10 | * Copyright 2018 Levit Nudi 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | * 24 | * To get started, familiarize with the variables and methods used herein 25 | * it is easy to customize the variables to suit your own common words 26 | * Check webview documentation to understand various methods that can be implemented 27 | * You will need to understand HTML and CSS to modify and make this library even better 28 | * Feel free to share your eureka! moments :) 29 | * levitnudi@gmail.com 30 | */ 31 | public class LegacyTableView extends WebView { 32 | List tableContent = new LinkedList<>(); 33 | private static String COLUMN_SEPERATOR = "د"; 34 | private static String LEGACY_COLUMN_SEPERATOR = "د"; 35 | private static String ROW_SEPERATOR = "\n"; 36 | private static String[] TABLE_DATA_CONTENT = new String[]{""}; 37 | private static String[] TABLE_COLUMN_TITLE = new String[]{""}; 38 | private static String TABLE_CONTENT_STRINGS = ""; 39 | private static String TABLE_TITLE_STRINGS = ""; 40 | private static String TABLE_FOOTER = ""; 41 | public static int INITIAL_SIZE = 0; 42 | public String TABLE_BOX_SHADOW = "#888888"; 43 | private static String TABLE_BORDER_SOLID = "#07214f"; 44 | private static String TABLE_BACKGROUND_ODD = "#ffffff"; 45 | private static String TABLE_BACKGROUND_EVEN = "#a6d3ed"; 46 | private static String TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#629edb"; 47 | private static String TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#003f7f"; 48 | private static String TABLE_CONTENT_TEXT_COLOR = "#020101"; 49 | private static String PLAIN_WHITE_COLOR = "#ffffff"; 50 | private static String TRANSPARENT_COLOR = "#00000000"; 51 | private static String TABLE_FOOTER_TEXT_COLOR = "#020101"; 52 | 53 | private static String TABLE_TITLE_FONT = "bold"; 54 | private static String TABLE_CONTENT_FONT = "normal"; 55 | private static String TABLE_TITLE_FONT_FAMILY = "Arial"; 56 | private static String TABLE_CONTENT_FONT_FAMILY = "Arial"; 57 | private static String TABLE_TITLE_TEXT_ALIGNMENT = "left"; 58 | private static String TABLE_CONTENT_TEXT_ALIGNMENT = "left"; 59 | private static String TABLE_FOOTER_ALIGNEMT = "center"; 60 | private static String TABLE_TITLE_TEXT_COLOR = "#ffffff"; 61 | private static String TABLE_FOOTER_FONT_FAMILY = "Arial"; 62 | private static int TABLE_FOOTER_TEXT_SIZE = 5; 63 | private static String TABLE_FOOTER_FONT = "Arial"; 64 | private static int TABLE_PADDING = 30; 65 | private static int TABLE_TITLE_TEXT_SIZE = 20; 66 | private static int TABLE_CONTENT_TEXT_SIZE = 16; 67 | 68 | 69 | private static boolean SHOW_BOX_SHADOW = false; 70 | private static int TABLE_THEME = 0; 71 | private static int TABLE_HighlightAlternate = 3; 72 | 73 | 74 | //public static class Theme{ 75 | public static int OCEAN = 0; 76 | public static int LAVICI = 1; 77 | public static int GOLDALINE = 2; 78 | public static int ECOKENYA = 3; 79 | public static int DESKTOP = 4; 80 | public static int MAASAI = 5; 81 | public static int LEVICI = 6; 82 | public static int ORIO = 7; 83 | public static int SKELETON = 8; 84 | public static int MESH = 9; 85 | public static int CUSTOM = 10; 86 | //} 87 | 88 | public LegacyTableView(Context context) { 89 | super(context); 90 | initView(context); 91 | } 92 | 93 | public LegacyTableView(Context context, AttributeSet attrs) { 94 | super(context, attrs); 95 | initView(context); 96 | } 97 | 98 | private void initView(Context context){ 99 | resetVariables(); 100 | this.getSettings().setJavaScriptEnabled(true) ; 101 | this.getSettings().setUseWideViewPort(true); 102 | this.getSettings().setLoadWithOverviewMode(true); 103 | this.setInitialScale(INITIAL_SIZE); 104 | } 105 | 106 | 107 | 108 | public void setZoomEnabled(boolean zoomEnabled){ 109 | this.getSettings().setSupportZoom(true); 110 | } 111 | 112 | public void setShowZoomControls(boolean zoomEnabled) { 113 | this.getSettings().setBuiltInZoomControls(true); 114 | } 115 | 116 | 117 | public static int getInitialTableSize() { 118 | return INITIAL_SIZE; 119 | } 120 | 121 | public void setTheme(int theme){ 122 | this.TABLE_THEME = theme; 123 | } 124 | 125 | 126 | //public static class HighlightAlternate{ 127 | public static int ODD = 0; 128 | public static int EVEN = 1; 129 | public static int DEFAULT = 2; 130 | //} 131 | 132 | //public static class Font{ 133 | public static int NORMAL = 0; 134 | public static int BOLD = 1; 135 | //} 136 | 137 | //public static class Alignment{ 138 | public static int LEFT = 0; 139 | public static int RIGHT = 1; 140 | public static int CENTER = 2; 141 | //} 142 | 143 | /* public static class FontFamily{ 144 | public static int ARIAL = 0; 145 | public static int HELEVITICA = 1; 146 | public static int TIMES_NEW_ROMAN = 2; 147 | public static int IMPACT = 3; 148 | public static int COURIER_NEW = 4; 149 | public static int GEORGIA = 5; 150 | public static int BOOKMAN = 6; 151 | public static int COMIC_SANS_NEW = 7; 152 | }*/ 153 | 154 | 155 | 156 | public void build(){ 157 | /* deprecated code 158 | initializeTheme(); 159 | contrasts(); 160 | configure(); 161 | BuildTable(); 162 | String completeHtmlData = new LegacyDataHelper().generateLegacyData(); 163 | this.loadData(completeHtmlData, "text/html", "UTF-8"); 164 | //clear data 165 | this.TABLE_CONTENT_STRINGS = ""; 166 | this.TABLE_TITLE_STRINGS = ""; 167 | this.tableContent.clear();*/ 168 | 169 | initializeTheme(); 170 | contrasts(); 171 | configure(); 172 | BuildTable(); 173 | String completeHtmlData = new LegacyDataHelper().generateLegacyData(); 174 | //reloads with loadDataWithBaseUrl (don't use this line on build as it may not load some css data) :- ONLY FOR REBUILDS 175 | this.loadDataWithBaseURL(null,completeHtmlData,"text/html", "UTF-8", null); 176 | //clear data 177 | this.TABLE_CONTENT_STRINGS = ""; 178 | this.TABLE_TITLE_STRINGS = ""; 179 | this.tableContent.clear(); 180 | } 181 | @Deprecated 182 | public void rebuild(){ 183 | initializeTheme(); 184 | contrasts(); 185 | configure(); 186 | BuildTable(); 187 | String completeHtmlData = new LegacyDataHelper().generateLegacyData(); 188 | //reloads with loadDataWithBaseUrl (don't use this line on build as it may not load some css data) :- ONLY FOR REBUILDS 189 | this.loadDataWithBaseURL(null,completeHtmlData,"text/html", "UTF-8", null); 190 | //clear data 191 | this.TABLE_CONTENT_STRINGS = ""; 192 | this.TABLE_TITLE_STRINGS = ""; 193 | this.tableContent.clear(); 194 | } 195 | 196 | 197 | public void setHighlight(int tableHighlightAlternate){ 198 | this.TABLE_HighlightAlternate = tableHighlightAlternate; 199 | } 200 | 201 | 202 | 203 | private void contrasts(){ 204 | switch (TABLE_HighlightAlternate){ 205 | case 0: 206 | TABLE_BACKGROUND_EVEN = PLAIN_WHITE_COLOR; 207 | return; 208 | case 1: 209 | TABLE_BACKGROUND_ODD = PLAIN_WHITE_COLOR; 210 | return; 211 | case 2: 212 | TABLE_BACKGROUND_EVEN = PLAIN_WHITE_COLOR; 213 | TABLE_BACKGROUND_ODD = PLAIN_WHITE_COLOR; 214 | return; 215 | default: 216 | TABLE_BACKGROUND_EVEN = PLAIN_WHITE_COLOR; 217 | TABLE_BACKGROUND_ODD = PLAIN_WHITE_COLOR; 218 | return; 219 | 220 | } 221 | 222 | } 223 | 224 | private void configure(){ 225 | if(!SHOW_BOX_SHADOW){ 226 | TABLE_BOX_SHADOW = TRANSPARENT_COLOR; 227 | } 228 | } 229 | 230 | 231 | public void setBottomShadowVisible(boolean shadow){ 232 | 233 | this.SHOW_BOX_SHADOW = shadow; 234 | } 235 | 236 | 237 | private void initializeTheme(){ 238 | switch (TABLE_THEME) { 239 | case 0://OCEAN 240 | //TABLE_BOX_SHADOW = "#888888"; 241 | TABLE_BORDER_SOLID = "#0288D1"; 242 | TABLE_BACKGROUND_ODD = "#BBDEFB"; 243 | TABLE_BACKGROUND_EVEN = "#BBDEFB"; 244 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#0288D1"; 245 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#03A9F4"; 246 | return; 247 | case 1://LAVICI 248 | //TABLE_BOX_SHADOW = "#888888"; 249 | TABLE_BORDER_SOLID = "#E91E63"; 250 | TABLE_BACKGROUND_ODD = "#F8BBD0"; 251 | TABLE_BACKGROUND_EVEN = "#F8BBD0"; 252 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#C2185B"; 253 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#E91E63"; 254 | return; 255 | case 2://GOLD 256 | //TABLE_BOX_SHADOW = "#888888"; 257 | TABLE_BORDER_SOLID = "#FFA000"; 258 | TABLE_BACKGROUND_ODD = "#FFECB3"; 259 | TABLE_BACKGROUND_EVEN = "#FFECB3"; 260 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#FFA000"; 261 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#FFC107"; 262 | return; 263 | case 3://ECOKENYA 264 | //TABLE_BOX_SHADOW = "#888888"; 265 | TABLE_BORDER_SOLID = "#388E3C"; 266 | TABLE_BACKGROUND_ODD = "#C8E6C9"; 267 | TABLE_BACKGROUND_EVEN = "#C8E6C9"; 268 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#388E3C"; 269 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#4CAF50"; 270 | return; 271 | case 4://DESKTOP 272 | //TABLE_BOX_SHADOW = "#888888"; 273 | TABLE_BORDER_SOLID = "#455A64"; 274 | TABLE_BACKGROUND_ODD = "#CFD8DC"; 275 | TABLE_BACKGROUND_EVEN = "#CFD8DC"; 276 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#455A64"; 277 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#607D8B"; 278 | return; 279 | case 5://MAASAI 280 | //TABLE_BOX_SHADOW = "#888888"; 281 | TABLE_BORDER_SOLID = "#D32F2F"; 282 | TABLE_BACKGROUND_ODD = "#FFCDD2"; 283 | TABLE_BACKGROUND_EVEN = "#FFCDD2"; 284 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#D32F2F"; 285 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#F44336"; 286 | return; 287 | case 6://LEVICI 288 | //TABLE_BOX_SHADOW = "#888888"; 289 | TABLE_BORDER_SOLID = "#212121"; 290 | TABLE_BACKGROUND_ODD = "#ffffff"; 291 | TABLE_BACKGROUND_EVEN = "#ffffff"; 292 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#212121"; 293 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#212121"; 294 | TABLE_TITLE_TEXT_COLOR = "#ffffff"; 295 | return; 296 | case 7://ORIO 297 | //TABLE_BOX_SHADOW = "#888888"; 298 | TABLE_BORDER_SOLID = "#5D4037"; 299 | TABLE_BACKGROUND_ODD = "#D7CCC8"; 300 | TABLE_BACKGROUND_EVEN = "#D7CCC8"; 301 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#5D4037"; 302 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#795548"; 303 | return; 304 | case 8://SKELETON 305 | TABLE_BOX_SHADOW = TRANSPARENT_COLOR; 306 | TABLE_BORDER_SOLID = "#ffffff"; 307 | TABLE_BACKGROUND_ODD = "#ffffff"; 308 | TABLE_BACKGROUND_EVEN = "#ffffff"; 309 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#ffffff"; 310 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#ffffff"; 311 | TABLE_TITLE_TEXT_COLOR = "#0000"; 312 | return; 313 | case 9://MESH 314 | //TABLE_BOX_SHADOW = "#888888"; 315 | TABLE_BORDER_SOLID = "#212121"; 316 | TABLE_BACKGROUND_ODD = "#ffffff"; 317 | TABLE_BACKGROUND_EVEN = "#ffffff"; 318 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#ffffff"; 319 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#ffffff"; 320 | TABLE_TITLE_TEXT_COLOR = "#212121"; 321 | return; 322 | case 10: 323 | //YOUR CUSTOM ATTRIBUTES INSTEAD 324 | return; 325 | default: 326 | //TABLE_BOX_SHADOW = "#888888"; 327 | TABLE_BORDER_SOLID = "#07214f"; 328 | TABLE_BACKGROUND_ODD = "#ffffff"; 329 | TABLE_BACKGROUND_EVEN = "#a6d3ed"; 330 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#629edb"; 331 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#003f7f"; 332 | return; 333 | 334 | } 335 | } 336 | 337 | 338 | private void BuildTable() { 339 | //if(TABLE_COLUMN_TITLE!=null) 340 | tableContent.add(resolveTableTitle(TABLE_COLUMN_TITLE)); 341 | 342 | StringBuffer buffer=new StringBuffer(); 343 | String[] array = resolveTableData(TABLE_DATA_CONTENT).split(ROW_SEPERATOR); 344 | //while(c.moveToNext()) 345 | for(int i=0; i(); 531 | COLUMN_SEPERATOR = "د"; 532 | LEGACY_COLUMN_SEPERATOR = "د"; 533 | ROW_SEPERATOR = "\n"; 534 | TABLE_DATA_CONTENT = new String[]{""}; 535 | TABLE_COLUMN_TITLE = new String[]{""}; 536 | TABLE_FOOTER = ""; 537 | INITIAL_SIZE = 100; 538 | TABLE_BOX_SHADOW = "#888888"; 539 | TABLE_BORDER_SOLID = "#07214f"; 540 | TABLE_BACKGROUND_ODD = "#ffffff"; 541 | TABLE_BACKGROUND_EVEN = "#a6d3ed"; 542 | TABLE_BACKGROUND_LINEAR_GRADIENT_TOP= "#629edb"; 543 | TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = "#003f7f"; 544 | TABLE_CONTENT_TEXT_COLOR = "#020101"; 545 | PLAIN_WHITE_COLOR = "#ffffff"; 546 | TRANSPARENT_COLOR = "#00000000"; 547 | TABLE_FOOTER_TEXT_COLOR = "#020101"; 548 | 549 | TABLE_TITLE_FONT = "bold"; 550 | TABLE_CONTENT_FONT = "normal"; 551 | TABLE_TITLE_FONT_FAMILY = "Arial"; 552 | TABLE_CONTENT_FONT_FAMILY = "Arial"; 553 | TABLE_TITLE_TEXT_ALIGNMENT = "left"; 554 | TABLE_CONTENT_TEXT_ALIGNMENT = "left"; 555 | TABLE_FOOTER_ALIGNEMT = "center"; 556 | TABLE_TITLE_TEXT_COLOR = "#ffffff"; 557 | TABLE_FOOTER_FONT_FAMILY = "Arial"; 558 | TABLE_FOOTER_TEXT_SIZE = 5; 559 | TABLE_FOOTER_FONT = "Arial"; 560 | TABLE_PADDING = 30; 561 | TABLE_TITLE_TEXT_SIZE = 20; 562 | TABLE_CONTENT_TEXT_SIZE = 16; 563 | 564 | boolean SHOW_BOX_SHADOW = false; 565 | TABLE_THEME = 0; 566 | TABLE_HighlightAlternate = 3; 567 | 568 | //public static class Theme{ 569 | OCEAN = 0; 570 | LAVICI = 1; 571 | GOLDALINE = 2; 572 | ECOKENYA = 3; 573 | DESKTOP = 4; 574 | MAASAI = 5; 575 | LEVICI = 6; 576 | ORIO = 7; 577 | SKELETON = 8; 578 | MESH = 9; 579 | } 580 | 581 | /*public void setContentFontFamily(int contentFont){ 582 | switch (contentFont){ 583 | case 0: 584 | this.TABLE_CONTENT_FONT_FAMILY = "Arial"; 585 | return; 586 | case 1: 587 | this.TABLE_CONTENT_FONT_FAMILY = "Helevitica"; 588 | return; 589 | case 2: 590 | this.TABLE_CONTENT_FONT_FAMILY = "Times New Roman"; 591 | return; 592 | case 3: 593 | this.TABLE_CONTENT_FONT_FAMILY = "Impact"; 594 | return; 595 | case 4: 596 | this.TABLE_CONTENT_FONT_FAMILY = "Courier"; 597 | return; 598 | case 5: 599 | this.TABLE_CONTENT_FONT_FAMILY = "Georgia"; 600 | return; 601 | case 6: 602 | this.TABLE_CONTENT_FONT_FAMILY = "Bookman"; 603 | return; 604 | case 7: 605 | this.TABLE_CONTENT_FONT_FAMILY = "Comic Sans MS New"; 606 | return; 607 | default: 608 | this.TABLE_CONTENT_FONT_FAMILY = "Arial"; 609 | return; 610 | } 611 | }*/ 612 | 613 | /*public void setTitleFontFamily(int conteFont){ 614 | switch (conteFont){ 615 | case 0: 616 | this.TABLE_TITLE_FONT_FAMILY = "Arial Header"; 617 | return; 618 | case 1: 619 | this.TABLE_TITLE_FONT_FAMILY = "Helevitica"; 620 | return; 621 | case 2: 622 | this.TABLE_TITLE_FONT_FAMILY = "Times New Roman"; 623 | return; 624 | case 3: 625 | this.TABLE_TITLE_FONT_FAMILY = "Impact"; 626 | return; 627 | case 4: 628 | this.TABLE_TITLE_FONT_FAMILY = "Courier"; 629 | return; 630 | case 5: 631 | this.TABLE_TITLE_FONT_FAMILY = "Georgia"; 632 | return; 633 | case 6: 634 | this.TABLE_TITLE_FONT_FAMILY = "Bookman"; 635 | return; 636 | case 7: 637 | this.TABLE_TITLE_FONT_FAMILY = "Comic Sans MS New"; 638 | return; 639 | default: 640 | this.TABLE_TITLE_FONT_FAMILY = "Arial"; 641 | return; 642 | } 643 | }*/ 644 | 645 | /*public void setFooterFontFamily(int conteFont){ 646 | switch (conteFont){ 647 | case 0: 648 | this.TABLE_FOOTER_FONT_FAMILY = "Arial"; 649 | return; 650 | case 1: 651 | this.TABLE_FOOTER_FONT_FAMILY = "Helevitica"; 652 | return; 653 | case 2: 654 | this.TABLE_FOOTER_FONT_FAMILY = "Times New Roman"; 655 | return; 656 | case 3: 657 | this.TABLE_FOOTER_FONT_FAMILY = "Impact"; 658 | return; 659 | case 4: 660 | this.TABLE_FOOTER_FONT_FAMILY = "Courier"; 661 | return; 662 | case 5: 663 | this.TABLE_FOOTER_FONT_FAMILY = "Georgia"; 664 | return; 665 | case 6: 666 | this.TABLE_FOOTER_FONT_FAMILY = "Bookman"; 667 | return; 668 | case 7: 669 | this.TABLE_FOOTER_FONT_FAMILY = "Comic Sans MS New"; 670 | return; 671 | default: 672 | this.TABLE_FOOTER_FONT_FAMILY = "Arial"; 673 | return; 674 | } 675 | }*/ 676 | 677 | 678 | public void setTitleTextAlignment(int textAlignment){ 679 | switch (textAlignment){ 680 | case 0: 681 | this.TABLE_TITLE_TEXT_ALIGNMENT = "left"; 682 | return; 683 | case 1: 684 | this.TABLE_TITLE_TEXT_ALIGNMENT = "right"; 685 | return; 686 | case 2: 687 | this.TABLE_TITLE_TEXT_ALIGNMENT = "center"; 688 | return; 689 | default: 690 | this.TABLE_TITLE_TEXT_ALIGNMENT = "left"; 691 | return; 692 | } 693 | } 694 | 695 | public void setContentTextAlignment(int textAlignment){ 696 | switch (textAlignment){ 697 | case 0: 698 | this.TABLE_CONTENT_TEXT_ALIGNMENT = "left"; 699 | return; 700 | case 1: 701 | this.TABLE_CONTENT_TEXT_ALIGNMENT = "right"; 702 | return; 703 | case 2: 704 | this.TABLE_CONTENT_TEXT_ALIGNMENT = "center"; 705 | return; 706 | default: 707 | this.TABLE_CONTENT_TEXT_ALIGNMENT = "left"; 708 | return; 709 | } 710 | } 711 | 712 | 713 | public void setFooterTextAlignment(int textAlignment){ 714 | switch (textAlignment){ 715 | case 0: 716 | this.TABLE_FOOTER_ALIGNEMT = "left"; 717 | return; 718 | case 1: 719 | this.TABLE_FOOTER_ALIGNEMT = "right"; 720 | return; 721 | case 2: 722 | this.TABLE_FOOTER_ALIGNEMT = "center"; 723 | return; 724 | default: 725 | this.TABLE_FOOTER_ALIGNEMT = "center"; 726 | return; 727 | } 728 | } 729 | 730 | 731 | /*public void setFooterTextSize(int footer){ 732 | this.TABLE_FOOTER_TEXT_SIZE = footer; 733 | }*/ 734 | 735 | public void setTitleTextSize(int titleTextSize){ 736 | this.TABLE_TITLE_TEXT_SIZE = titleTextSize; 737 | } 738 | 739 | public void setTitleTextColor(String titleTextColor){ 740 | this.TABLE_TITLE_TEXT_COLOR = titleTextColor; 741 | } 742 | 743 | 744 | public void setContentTextSize(int contentTextSize){ 745 | this.TABLE_CONTENT_TEXT_SIZE = contentTextSize; 746 | } 747 | 748 | public void setTablePadding(int padding){ 749 | this.TABLE_PADDING = padding; 750 | } 751 | 752 | public void setTableFooterTextColor(String color){ 753 | this.TABLE_FOOTER_TEXT_COLOR = color; 754 | } 755 | 756 | 757 | public void setFooterTextColor(String color){ 758 | this.TABLE_FOOTER_TEXT_COLOR = color; 759 | } 760 | 761 | public void setTableFooterTextSize(int size){ 762 | this.TABLE_FOOTER_TEXT_SIZE = size; 763 | } 764 | 765 | 766 | 767 | 768 | public void setBottomShadowColorTint(String tableBoxShadow){ 769 | this.TABLE_BOX_SHADOW = tableBoxShadow; 770 | } 771 | 772 | public void setBorderSolidColor(String borderSolidColor){ 773 | this.TABLE_BORDER_SOLID = borderSolidColor; 774 | } 775 | 776 | public void setBackgroundOddColor(String backgroundOddColor){ 777 | this.TABLE_BACKGROUND_ODD = backgroundOddColor; 778 | } 779 | 780 | public void setBackgroundEvenColor(String backgroundEvenColor){ 781 | this.TABLE_BACKGROUND_EVEN = backgroundEvenColor; 782 | } 783 | 784 | public void setHeaderBackgroundLinearGradientTOP(String backgroundLinearGradient){ 785 | this.TABLE_BACKGROUND_LINEAR_GRADIENT_TOP = backgroundLinearGradient; 786 | } 787 | 788 | public void setHeaderBackgroundLinearGradientBOTTOM(String backgroundLinearGradient){ 789 | this.TABLE_BACKGROUND_LINEAR_GRADIENT_BOTTOM = backgroundLinearGradient; 790 | } 791 | 792 | public void setContentTextColor(String tableTextColor){ 793 | this.TABLE_CONTENT_TEXT_COLOR = tableTextColor; 794 | } 795 | 796 | 797 | /* private static String TABLE_TITLE_FONT = "bold"; 798 | private static String TABLE_CONTENT_FONT = "normal"; 799 | private static String TABLE_TITLE_FONT_FAMILY = "Arial"; 800 | private static String TABLE_CONTENT_FONT_FAMILY = "Arial"; 801 | private static String TABLE_TITLE_TEXT_ALIGNMENT = "left"; 802 | private static String TABLE_TABLE_CONTENT_TEXT_ALIGNEMT = "left"; 803 | private static String TABLE_TITLE_TEXT_COLOR = "#ffffff"; 804 | private static int TABLE_PADDING = 7; 805 | private static int TABLE_TITLE_TEXT_SIZE = 15; 806 | private static int TABLE_CONTENT_TEXT_SIZE = 12;*/ 807 | 808 | 809 | /* public void setTableColumnCount(int tableColumnCount){ 810 | this.COLUMN_COUNT = tableColumnCount; 811 | } 812 | */ 813 | 814 | public class LegacyDataHelper{ 815 | StringBuffer html; 816 | 817 | public String generateLegacyData(){ 818 | 819 | String[] tableArray = null; 820 | html = new StringBuffer(""+getLegacyStyle()+"" + ""); 821 | 822 | for(String data : tableContent) 823 | { 824 | tableArray = data.split(COLUMN_SEPERATOR); 825 | html.append(""); 826 | for (int i = 0; i < tableArray.length; i++) { 827 | html.append(""); 828 | 829 | } 830 | html.append(""); 831 | } 832 | html.append("" + "
" + tableArray[i] + "
" + "


" + 834 | ""+TABLE_FOOTER+"
"); 839 | 840 | return html.toString(); 841 | } 842 | 843 | private String getLegacyStyle(){ 844 | String cssString; 845 | cssString = ""; 942 | return cssString; 943 | } 944 | } 945 | } --------------------------------------------------------------------------------