Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6770b82
Update Library to Android Level 30
omarb1989 Jul 21, 2021
a8a1ced
add LongClick on Sticker
omarb1989 Jul 31, 2021
a00a357
change package name
omarb1989 Aug 2, 2021
eb35b93
change App version
omarb1989 Aug 2, 2021
5300435
change App version
omarb1989 Aug 2, 2021
aea1c98
Update README.md
omarb1989 Aug 2, 2021
75f5c8b
apply a default timetable colors
omarb1989 Aug 3, 2021
32ec9ce
Add more TimetableView attributes to support Material Design
omarb1989 Aug 4, 2021
9b021e6
set right version to release 1.0.4
omarb1989 Aug 4, 2021
4539418
Merge remote-tracking branch 'origin/master'
omarb1989 Aug 4, 2021
eb78748
Update README.md
omarb1989 Aug 4, 2021
77dcae5
Update README.md
omarb1989 Aug 4, 2021
de4c584
add attribute 'color_side_header_text'
omarb1989 Aug 4, 2021
fe29ae9
Merge remote-tracking branch 'origin/master'
omarb1989 Aug 4, 2021
b3cc379
Update README.md
omarb1989 Aug 4, 2021
732da9c
Update README.md
omarb1989 Aug 4, 2021
9840ffd
Update README.md
omarb1989 Aug 4, 2021
8246a50
add attribute 'border_width'
omarb1989 Aug 4, 2021
f6498d6
Merge remote-tracking branch 'origin/master'
omarb1989 Aug 4, 2021
fb4254c
Update README.md
omarb1989 Aug 4, 2021
f172cd0
add Labels 'AM' and 'PM' to table timeline
omarb1989 Aug 5, 2021
0d8fadd
Merge remote-tracking branch 'origin/master'
omarb1989 Aug 5, 2021
41b297c
Update README.md
omarb1989 Aug 5, 2021
d220a41
Update README.md
omarb1989 Aug 5, 2021
77ce907
Update README.md
omarb1989 Aug 5, 2021
a39f320
Update README.md
omarb1989 Aug 5, 2021
595048e
from fx2 to fx3 and update android Studio to ArcticFox
omarb1989 Aug 24, 2021
11b7207
add id to Schedule model class
omarb1989 Aug 24, 2021
ca36d56
Update README.md
omarb1989 Aug 24, 2021
0d0564e
BugHotFix: fix _id in Schedule model class
omarb1989 Aug 27, 2021
73911da
BugHotFix: fix _id in Schedule model class
omarb1989 Aug 27, 2021
d2e32c7
Merge remote-tracking branch 'origin/master'
omarb1989 Aug 27, 2021
ada0036
Update README.md
omarb1989 Aug 27, 2021
159c8f9
Fix Gradle errors and upgrade AGP to 8.5.2 and maven-publish plugin
omarb1989 Aug 1, 2026
2cfed54
Add full RTL (Arabic) support to TimetableView library
omarb1989 Aug 1, 2026
85175b8
Bump version to 1.0.4-fx6 with RTL support
omarb1989 Aug 1, 2026
d42faee
Fix JitPack JDK configuration and artifactId
omarb1989 Aug 1, 2026
45972bf
Bump version to 1.0.4-fx7
omarb1989 Aug 1, 2026
f468075
Fix sticker positioning and layout bounds alignment, bump version to …
omarb1989 Aug 1, 2026
ddb81c4
Fix TableRow layout direction to keep Time column on right in Arabic …
omarb1989 Aug 1, 2026
3d588aa
Position Time column on far right in RTL mode, bump version to 1.0.4-…
omarb1989 Aug 1, 2026
3f5e2a0
Fix RTL auto-detection before view attachment and onAttachedToWindow,…
omarb1989 Aug 1, 2026
8f844a9
RTL fix: physically insert Time column as last child in TableRow, bum…
omarb1989 Aug 1, 2026
14029ec
Add debug logging + bump to 1.0.4-fx13
omarb1989 Aug 1, 2026
66df567
Force LTR on TableLayout+TableRow to prevent Android auto-mirroring R…
omarb1989 Aug 1, 2026
1745c55
Fix sticker offset: use stickerBox.getWidth() in calCellWidth, bump t…
omarb1989 Aug 1, 2026
f85d820
Fix RTL sticker offset: use ALIGN_PARENT_LEFT + absolute leftMargin i…
omarb1989 Aug 1, 2026
68e87d5
Update README.md dependency version to 1.0.4-fx16
omarb1989 Aug 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
65 changes: 56 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# TimetableView
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![API](https://img.shields.io/badge/API-19%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=19)
[![](https://jitpack.io/v/tlaabs/TimetableView.svg)](https://jitpack.io/#tlaabs/TimetableView)
[![](https://jitpack.io/v/omarb1989/TimetableView.svg)](https://jitpack.io/#omarb1989/TimetableView)

Android Library that creates simple time table.

![dark](https://user-images.githubusercontent.com/9026030/128323499-f8562b86-8f18-4cc3-a6b5-3165b03ad88b.jpg)
![light](https://user-images.githubusercontent.com/9026030/128323528-678ceab1-4dd8-40e1-a09b-e66b98ed0343.jpg)

![img0](https://postfiles.pstatic.net/MjAxOTAxMjdfMTUz/MDAxNTQ4NTcyNTU5NTk4.M9hWyDvljjkoBDW-naLrTRqRAXUM8WRUyZXptTLKbs8g.b0FN12d8Cmxp5OWZqlQcusL_mJYNKgx6a_XLe_1ALOog.JPEG.tlaabs/Screenshot_Air.jpg?type=w773)
![img1](https://user-images.githubusercontent.com/8165219/62833150-b88d3180-bc74-11e9-9b20-02a0ad03e778.jpg)


## How to import
Expand All @@ -23,7 +23,7 @@ allprojects {
Add the dependency
```gradle
dependencies {
implementation 'com.github.tlaabs:TimetableView:1.0.3-fx1'
implementation 'com.github.omarb1989:TimetableView:1.0.4-fx16'
}
```

Expand All @@ -36,7 +36,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"

### TimetableView in layout
```xml
<com.github.tlaabs.timetableview.TimetableView
<com.github.omarb1989.timetableview.TimetableView
android:id="@+id/timetable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -57,6 +57,41 @@ app:header_highlight_color="@color/highlight" // sets header highlight color (de
app:header_highlight_image="@drawable/ic_kitty" // set header highlight image src
app:header_highlight_image_size="36dp" // set header highlight image width,height(square)
app:header_highlight_type="image" // set header highlight type - color/image (default : color)
app:color_surface="#ffffff" // set default color of table boxes
app:color_borders="#F3F3F3" // set color for the table borders
app:side_color_text="#000000" //set color text of the first column of hours
app:color_side="#F48FB1" // set color of the first column of hours
app:color_side_header_text="#FFE082" // set color text of the header and the first column of hours
app:border_width="light" // set table border width: noWidth, light, normal, thick, extra thick
app:force_rtl="true" // force RTL layout mode (true/false, default: auto-detect from layout direction)
```

### RTL & Arabic Language Support
`TimetableView` fully supports Right-to-Left (RTL) layout direction and Arabic language.
- **Auto-detection**: Automatically mirrors the timetable layout (time column on the right, day columns flowing right-to-left) when the device or layout direction is set to RTL.
- **Arabic Strings**: Built-in Arabic resources for AM/PM (`ص` / `م`) and default Arabic day headers (`الأحد`, `الإثنين`, `الثلاثاء`, `الأربعاء`, `الخميس`).

**Force RTL via XML:**
```xml
<com.github.omarb1989.timetableview.TimetableView
android:id="@+id/timetable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:force_rtl="true" />
```

**Force RTL Programmatically:**
```java
timetable.setRTL(true); // Enable RTL mode
timetable.setRTL(false); // Enable LTR mode
timetable.setRTL(null); // Revert to system auto-detection
```

**Or using Builder:**
```java
TimetableView timetable = new TimetableView.Builder(context)
.setForceRTL(true)
.build();
```

### Change header title
Expand All @@ -73,7 +108,7 @@ First, write a string-array as below on values/strings.xml.
```
Then, apply that to timetable attribute.
```xml
<com.github.tlaabs.timetableview.TimetableView
<omarb1989.timetableview.TimetableView
android:id="@+id/timetable"
android:layout_width="match_parent"
android:layout_height="0dp"
Expand All @@ -93,7 +128,18 @@ timetable.setOnStickerSelectEventListener(new TimetableView.OnStickerSelectedLis
}
});
```
### OnStickerSelectedLongClickListener
OnStickerSelectedLongClickListener is invoked when Long clicked by user.

idx is used to edit or delete.
```java
timetable.setOnStickerSelectEventListener(new TimetableView.OnStickerSelectedLongClickListener() {
@Override
public void OnStickerSelectedLongClick(int idx, ArrayList<Schedule> schedules) {

}
});
```
### Add schdule
```java
ArrayList<Schedule> schedules = new ArrayList<Schedule>();
Expand All @@ -103,6 +149,7 @@ schedule.setClassPlace("IT-601"); // sets place
schedule.setProfessorName("Won Kim"); // sets professor
schedule.setStartTime(new Time(10,0)); // sets the beginning of class time (hour,minute)
schedule.setEndTime(new Time(13,30)); // sets the end of class time (hour,minute)
int uniqueId = schedule.get_id();// you can use it later on wherever you get schedule object to identify it
schedules.add(schedule);
//.. add one or more schedules
timetable.add(schedules);
Expand All @@ -123,7 +170,7 @@ timetable.removeAll(); // remove all items
### Highlight header
**1.Color type(Default)**
```xml
<com.github.tlaabs.timetableview.TimetableView
<omarb1989.timetableview.TimetableView
android:id="@+id/timetable"
android:layout_width="match_parent"
android:layout_height="0dp"
Expand All @@ -132,7 +179,7 @@ timetable.removeAll(); // remove all items
```
**2.Image type**
```xml
<com.github.tlaabs.timetableview.TimetableView
<omarb1989.timetableview.TimetableView
android:id="@+id/timetable"
android:layout_width="match_parent"
android:layout_height="0dp"
Expand All @@ -155,7 +202,7 @@ timetable.load(json); // restore

# License
```xml
Copyright 2019 tlaabs
Copyright 2019 tlaabs, forked and updated by omarb1989

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
34 changes: 21 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
namespace 'com.github.omarb1989.timetableviewdemo'
compileSdk 35

defaultConfig {
applicationId "com.github.tlaabs.timetableviewdemo"
minSdkVersion 19
targetSdkVersion 28
versionCode 4
versionName "1.0.3-fx1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
applicationId "com.github.omarb1989.timetableviewdemo"
minSdk 19
targetSdk 35
versionCode 6
versionName "1.0.4"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation project(':timetableview')
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.github.tlaabs.timetableviewdemo;
package com.github.omarb1989.timetableviewdemo;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -19,7 +19,7 @@ public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();

assertEquals("com.github.devsim.timetableviewdemo", appContext.getPackageName());
}
Expand Down
11 changes: 7 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.tlaabs.timetableviewdemo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand All @@ -9,14 +8,18 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.github.tlaabs.timetableviewdemo.MainActivity">
<activity
android:name="com.github.omarb1989.timetableviewdemo.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.github.tlaabs.timetableviewdemo.EditActivity"></activity>
<activity
android:name="com.github.omarb1989.timetableviewdemo.EditActivity"
android:exported="false" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.github.tlaabs.timetableviewdemo;
package com.github.omarb1989.timetableviewdemo;

import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
Expand All @@ -13,8 +13,8 @@
import android.widget.TextView;
import android.widget.TimePicker;

import com.github.tlaabs.timetableview.Schedule;
import com.github.tlaabs.timetableview.Time;
import com.github.omarb1989.timetableview.Schedule;
import com.github.omarb1989.timetableview.Time;

import java.util.ArrayList;

Expand Down Expand Up @@ -128,35 +128,33 @@ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {

@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.submit_btn:
if(mode == MainActivity.REQUEST_ADD){
inputDataProcessing();
Intent i = new Intent();
ArrayList<Schedule> schedules = new ArrayList<Schedule>();
//you can add more schedules to ArrayList
schedules.add(schedule);
i.putExtra("schedules",schedules);
setResult(RESULT_OK_ADD,i);
finish();
}
else if(mode == MainActivity.REQUEST_EDIT){
inputDataProcessing();
Intent i = new Intent();
ArrayList<Schedule> schedules = new ArrayList<Schedule>();
schedules.add(schedule);
i.putExtra("idx",editIdx);
i.putExtra("schedules",schedules);
setResult(RESULT_OK_EDIT,i);
finish();
}
break;
case R.id.delete_btn:
int id = v.getId();
if (id == R.id.submit_btn) {
if(mode == MainActivity.REQUEST_ADD){
inputDataProcessing();
Intent i = new Intent();
ArrayList<Schedule> schedules = new ArrayList<Schedule>();
//you can add more schedules to ArrayList
schedules.add(schedule);
i.putExtra("schedules",schedules);
setResult(RESULT_OK_ADD,i);
finish();
}
else if(mode == MainActivity.REQUEST_EDIT){
inputDataProcessing();
Intent i = new Intent();
ArrayList<Schedule> schedules = new ArrayList<Schedule>();
schedules.add(schedule);
i.putExtra("idx",editIdx);
setResult(RESULT_OK_DELETE, i);
i.putExtra("schedules",schedules);
setResult(RESULT_OK_EDIT,i);
finish();
break;
}
} else if (id == R.id.delete_btn) {
Intent i = new Intent();
i.putExtra("idx",editIdx);
setResult(RESULT_OK_DELETE, i);
finish();
}
}

Expand Down
Loading