/android-timetable-core

A timetable designed for planning employees to projects.

Primary LanguageJavaApache License 2.0Apache-2.0

API

android-timetable-core

A timetable designed for planning employees to projects.

Click here to download the demo APK
Demo gif

Requests and tips are welcome, please open an issue for your questions.

Installation

Clone the repository into /your_project/android-timetable-core and add it to your project by adding it to your settings.gradle: include ':app', ':android-timetable-core'

Then, add it as a dependency in your build.gradle: implementation project(':android-timetable-core')

Benefits

  • You only need the name of the plan, the person's name, and a start & end date.
  • No need for multi-dimensional arrays
  • No need to calculate the X,Y / row,colum
  • Pannable in X and Y
  • Optimized for best performance
  • Multiple items are merged in a single row.

Usage

###1. Include the layout in your XML

<com.greasemonk.timetable.TimeTable android:id="@+id/time_table"
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"/>

###2. Implement your class with IGridItem (or extend AbstractGridItem )

Refer to the Demo Activity and Demo PlanItem class for detailed instructions.

public class EmployeePlanItem implements IGridItem
{
	private String employeeName, projectName;
	private TimeRange timeRange;
	
	public EmployeePlanItem() {}
	
	public EmployeePlanItem(String employeeName, String projectName, Date planStart, Date planEnd)
	{
		this.employeeName = employeeName;
		this.projectName = projectName;
		this.timeRange = new TimeRange(planStart, planEnd);
	}
	
	@Override
	public TimeRange getTimeRange()
	{
		return timeRange;
	}
	
	@Override
	public String getName()
	{
		return projectName;
	}
	
	@Override
	public String getPersonName()
	{
		return employeeName;
	}
}

###3. Fill the table with data

timeTable = (TimeTable) findViewById(R.id.time_table);
timeTable.setItems(generateSamplePlanData());

Dependencies

FastAdapter by Mike Penz. Used to display the rows.

License

		Copyright 2021 GreaseMonk

	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.