simple light weight android library for displaying tabulated data

Overview

LegacyTableView

simple light weight android library for displaying tabulated data

This is a simple android library that will help you include tables in your projects using a few lines of code. Follow very simple examples in the sample LegcyTableView project. Write data dynamically, translate into different languages, update themes, colors, fonts etc...

Application Demo

Examples

This project covers the following examples

  1. Simple display of data
  2. Custom controls for the LegacyTableView
  3. Adding data from database (SQLite)
  4. Using different LegacyTableViewThemes

Get started...

Add jitpack.io to your root gradle file

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

Add this to your dependencies method in build.gradle file

      dependencies {
                   implementation 'com.github.levitnudi:LegacyTableView:1.4'
   		
   }


                } 
     

Add the following lines...

  1. In your xml layout add:
       <com.levitnudi.legacytableview.LegacyTableView
       android:id="@+id/legacy_table_view"
       android:layout_width="match_parent"
       android:layout_height="match_parent"/>
     
  1. In your activity add:
        //set table title labels
      LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email");
      //set table contents as string arrays
      LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "[email protected]",
              "332312", "Kennedy F", "33", "[email protected]"
              ,"42343243", "Java Lover", "28", "[email protected]"
              ,"4288383", "Mike Tee", "22", "[email protected]");

      LegacyTableView legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view);
      legacyTableView.setTitle(LegacyTableView.readLegacyTitle());
      legacyTableView.setContent(LegacyTableView.readLegacyContent());
      
      //depending on the phone screen size default table scale is 100
      //you can change it using this method
      //legacyTableView.setInitialScale(100);//default initialScale is zero (0)
      
      //if you want a smaller table, change the padding setting
      legacyTableView.setTablePadding(7);
      
      //to enable users to zoom in and out:
      legacyTableView.setZoomEnabled(true);
      legacyTableView.setShowZoomControls(true);

      //remember to build your table as the last step
      legacyTableView.build();
    
  1. Using Themes:
        //set table title labels
      LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email");
      //set table contents as string arrays
      LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "[email protected]",
              "332312", "Kennedy F", "33", "[email protected]"
              ,"42343243", "Java Lover", "28", "[email protected]"
              ,"4288383", "Mike Tee", "22", "[email protected]");

      LegacyTableView legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view);
      legacyTableView.setTitle(LegacyTableView.readLegacyTitle());
      legacyTableView.setContent(LegacyTableView.readLegacyContent());
      
      //Add your preferred theme like this:
      legacyTableView.setTheme(GOLDALINE);
      
      /*
      Explore available themes
      OCEAN
      LAVICI
      GOLDALINE
      ECOKENYA
      DESKTOP
      MAASAI
      LEVICI
      ORIO
      SKELETON
      MESH*/
      
      //depending on the phone screen size default table scale is 100
      //you can change it using this method
      //legacyTableView.setInitialScale(100);//default initialScale is zero (0)
      
      //if you want a smaller table, change the padding setting
      legacyTableView.setTablePadding(7);
      
      //to enable users to zoom in and out:
      legacyTableView.setZoomEnabled(true);
      legacyTableView.setShowZoomControls(true);

      //remember to build your table as the last step
      legacyTableView.build();
    
  1. Display from database:
     public void getFromDatabase(){//execute this method to fetch from database

     Cursor cursor =  db.rawQuery("SELECT * FROM legacy_table", null);

     if(cursor.getCount()>0){
            //use database column names or custom names for the columns
            /* insert your column titles using legacy insertLegacyTitle() function*/
            LegacyTableView.insertLegacyTitle(cursor.getColumnName(1), cursor.getColumnName(2),
                    cursor.getColumnName(3), cursor.getColumnName(4));
     }
     while(cursor.moveToNext()) {
         //simple table content insert method for table contents
         LegacyTableView.insertLegacyContent(cursor.getString(1),
                 cursor.getString(2), cursor.getString(3), cursor.getString(4));
     }
     //remember to close your database to avoid memory leaks
     cursor.close();
 }
 
 //then do this to display it on the table
  LegacyTableView legacyTableView = (LegacyTableView)findViewById(R.id.legacy_table_view);
     //once you have inserted contents and titles, you can retrieve them
     //using readLegacyTitle() and readLegacyContent() methods
     legacyTableView.setTitle(LegacyTableView.readLegacyTitle());
     legacyTableView.setContent(LegacyTableView.readLegacyContent());

     //remember to build your table as the last step
     legacyTableView.build();
   
  1. Using custom controls:
        final LegacyTableView tableView = (LegacyTableView)findViewById(R.id.legacy_table_view);
     /*
     [OPTIONAL] default column seperator characters are (د) character
     default row seperator is (\n) character
     you may need to change if your set of data contains these characters
     if you don't change the seperators, any character similar in your data set
     will be excluded in your table. It is therefore adviseable to use least
     commonly used characters
     tableView.setColumnSeperator("'");
     tableView.setRowSeperator("\n");
     tableView.setLegacyColumnSeperator("'");*/

     //set table title labels
     LegacyTableView.insertLegacyTitle("Id", "Name", "Age", "Email");
     //set table contents as string arrays
     LegacyTableView.insertLegacyContent("2999010", "John Deer", "50", "[email protected]",
             "332312", "Kennedy F", "33", "[email protected]"
             ,"42343243", "Java Lover", "28", "[email protected]"
             ,"4288383", "Mike Tee", "22", "[email protected]");
     //make sure to indicate custom as other features may not work with default table theme
     tableView.setTheme(CUSTOM);
     //get titles and contents
     tableView.setContent(LegacyTableView.readLegacyContent());
     tableView.setTitle(LegacyTableView.readLegacyTitle());
     tableView.setBottomShadowVisible(true);

     tableView.setHighlight(ODD);//highlight rows oddly or evenly
     //tableView.setHighlight(EVEN);
     tableView.setBottomShadowVisible(true);
     tableView.setFooterTextAlignment(CENTER);

     tableView.setFooterText(getString(R.string.footer_text));
     tableView.setTableFooterTextSize(5);
     tableView.setTableFooterTextColor("#009688");

     tableView.setTitleTextAlignment(CENTER);
     tableView.setContentTextAlignment(CENTER);
     tableView.setTablePadding(20);//increasing spacing will increase the table size
     //tableView.setBottomShadowColorTint("#ffffff");

     //tableView.setBackgroundEvenColor("#FFCCBC");
     //tableView.setBackgroundEvenColor("#303F9F");
     tableView.setBackgroundOddColor("#FFCCBC");
     //you can also declare your color values as global strings to make your work easy :)
     tableView.setHeaderBackgroundLinearGradientBOTTOM("#FF5722");//header background bottom color
     tableView.setHeaderBackgroundLinearGradientTOP("#009688");//header background top color
     tableView.setBorderSolidColor("#009688");
     tableView.setTitleFont(BOLD);
     tableView.setZoomEnabled(true);
     tableView.setShowZoomControls(true);
     //by default the initial scale is 0, you
     // may change this depending on initiale scale preferences
     //tableView.setInitialScale(100);//default initialScale is zero (0)
     tableView.setContentTextColor("#009688");
     tableView.build();
   
        Copyright 2018 Levit Nudi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
     

Author : Levit Nudi LinkedIn

LinkedIn

You might also like...
This library offers a simple method to add a small badge icon to your ActionBar-MenuItem
This library offers a simple method to add a small badge icon to your ActionBar-MenuItem

Android-ActionItemBadge ActionItemBadge is a library which offers a simple and easy to use method to add a badge to your action item! Screenshots Incl

A simple library to let you sign (or draw lines) smoothly with your finger into a view and save it.
A simple library to let you sign (or draw lines) smoothly with your finger into a view and save it.

FingerSignView Introduction FingerSignView is a simple library that lets you finger, or draw lines, smoothly with your finger into a View and save it

A new canvas drawing library for Android. Aims to be the Fabric.js for Android. Supports text, images, and hand/stylus drawing input. The library has a website and API docs, check it out

FabricView - A new canvas drawing library for Android. The library was born as part of a project in SD Hacks (www.sdhacks.io) on October 3rd. It is cu

Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Android library providing bread crumbs to the support library fragments.

Hansel And Gretel Android library providing bread crumbs for compatibility fragments. Usage For a working implementation of this project see the sampl

Simple Visualizer from mic input for Android.
Simple Visualizer from mic input for Android.

Voice Recording Visualizer Simple Visualizer from mic input for Android. Usage @Override protected void onCreate(Bundle savedInstanceState) {

Snake View is a simple and animated linear chart for Android.
Snake View is a simple and animated linear chart for Android.

Snake View Snake library is a simple and animation line chart for Android. Latest Version How to use Configuring your project dependencies Add the lib

Horizon - Simple visual equaliser for Android
Horizon - Simple visual equaliser for Android

Horizon - Simple visual equaliser for Android This project aims to provide pretty cool equaliser for any Android audio project. Made in [Yalantis] (ht

[] A simple way to
[] A simple way to "badge" any given Android view at runtime without having to cater for it in layout

Android ViewBadger A simple way to "badge" any given Android view at runtime without having to cater for it in layout. Note: If your aim is to replica

Comments
  • Select Row from Table

    Select Row from Table

    Hello there, Thanks. This is very nice and Useful Library. I have been implemented in project, i would like to ask that is there any option for selecting particular row data/OnClick event for table rows. if not than it will be possible to Enhance it in this library.

    opened by SGL-IGiS 1
Releases(1.4)
Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Rizki Maulana 118 Dec 14, 2022
Custom UI control for android which is showing data as a segments and a value inside them.

Segmented Bar View for Android Custom UI control for android which is showing data as a segments and a value inside them. Screenshots Install From rep

GSPD 354 Nov 10, 2022
Compose app with dummy data which serves as a playground to try out new things in the Android world.

Music Event Manager Compose app with dummy data which serves as a playground to try out new things in the Android world. Description The app primarily

Igor Tepavac 4 Apr 4, 2022
Implementation of the fragment with the ability to display indeterminate progress indicator when you are waiting for the initial data.

Android-ProgressFragment Implementation of the fragment with the ability to display indeterminate progress indicator when you are waiting for the init

Evgeny Shishkin 813 Nov 11, 2022
This project created just for help developer who want to and ability of read VISA, UNION PAY, HUMO, ATTO and some other cards data read.

If you enjoy my content, please consider supporting what I do. Thank you. By me a Coffee To get a Git project into your build: Step 1. Add the JitPack

Fozilbek Imomov 1 Oct 15, 2022
Android Library to implement simple touch/tap/swipe gestures

SimpleFingerGestures An android library to implement simple 1 or 2 finger gestures easily Example Library The library is inside the libSFG folder Samp

Arnav Gupta 315 Dec 21, 2022
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.

Note: we are not actively responding to issues right now. If you find a bug, please submit a PR. Android Sliding Up Panel This library provides a simp

Umano: News Read To You 9.4k Dec 31, 2022
A simple library to add Emoji support to your Android Application

Emoji A library to add Emoji support to your Android app. Emojis can be picked in a PopupWindow. In order to edit and display text with Emojis this li

Niklas Baudy 1.4k Jan 4, 2023
An Android library containing a simple TableView and an advanced SortableTableView providing a lot of customisation possibilities to fit all needs.

SortableTableView for Android An Android library providing a TableView and a SortableTableView. Minimum SDK-Version: 11 | Compile SDK-Version: 25 | La

Ingo Schwarz 1.1k Dec 5, 2022
Simple and powerful library to emulate iOS's "3D Touch" preview functionality on Android.

Android 3D Touch - PeekView iOS uses 3D Touch as a way to "peek" into full content, such as emails, pictures, web searches, etc. While they have dedic

Luke Klinker 502 Dec 29, 2022