Skip to content

Commit

Permalink
Update the settings
Browse files Browse the repository at this point in the history
  • Loading branch information
burgyl committed Aug 28, 2020
1 parent 00e50cf commit 7b4c0ee
Show file tree
Hide file tree
Showing 26 changed files with 265 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Self Updating App
An Android Application to allow students of the HEIA-FR easily access their schedule.
# HEIA-FR Schedule
An Android application to allow HEIA-FR students easy access to their schedule.

Students can also check which rooms are available at a certain time.

## Requirements
Android KitKat (4.4) and above.

## Licenses & Credits
## Licenses
- [Apache HttpComponents](https://hc.apache.org/) by [The Apache Software Foundation](http://www.apache.org/), licensed under the Apache 2.0 license
- [jsoup](https://jsoup.org/) by [Jonathan Hedley](https://jhy.io/), licensed under the MIT license
- [Moshi](https://github.com/square/moshi) by [Square Open Source](https://square.github.io/), licensed under the Apache 2.0 license
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "ch.lburgy.heiafrschedule"
minSdkVersion 18
targetSdkVersion 29
versionCode 1
versionName "1.0.0"
versionCode 2
versionName "1.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);

if (savedInstanceState == null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
SelfUpdate.checkUpdate(this, "https://api.github.com/repos/burgyl/HEIA-FR-Horaires/releases/latest");
SelfUpdate.checkUpdate(this, "https://api.github.com/repos/burgyl/HEIA-FR-Schedule/releases/latest");

MyDatabase myDatabase = MyDatabase.getInstance(this);
lessonDao = myDatabase.getLessonDao();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
Expand Down Expand Up @@ -170,6 +171,69 @@ public boolean onPreferenceClick(Preference preference) {
}
});

findPreference(getString(R.string.settings_key_see_github)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/burgyl/HEIA-FR-Schedule"));
startActivity(browserIntent);
return true;
}
});

findPreference(getString(R.string.settings_key_license_httpcomponents)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://hc.apache.org/"));
startActivity(browserIntent);
return true;
}
});

findPreference(getString(R.string.settings_key_license_jsoup)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://jsoup.org/"));
startActivity(browserIntent);
return true;
}
});

findPreference(getString(R.string.settings_key_license_moshi)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/square/moshi"));
startActivity(browserIntent);
return true;
}
});

findPreference(getString(R.string.settings_key_license_okhttp)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/square/okhttp"));
startActivity(browserIntent);
return true;
}
});

findPreference(getString(R.string.settings_key_license_okio)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/square/okio"));
startActivity(browserIntent);
return true;
}
});

findPreference(getString(R.string.settings_key_license_selfupdatingapp)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/burgyl/SelfUpdatingApp"));
startActivity(browserIntent);
return true;
}
});

new Thread(new Runnable() {
@Override
public void run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected void onCreate(Bundle savedInstanceState) {
launchHomeScreen();

if (savedInstanceState == null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
SelfUpdate.checkUpdate(this, "https://api.github.com/repos/burgyl/HEIA-FR-Horaires/releases/latest");
SelfUpdate.checkUpdate(this, "https://api.github.com/repos/burgyl/HEIA-FR-Schedule/releases/latest");

httpBasicClient = new HttpBasicClient(this);
myDatabase = MyDatabase.getInstance(this);
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_github.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#000000"
android:alpha="0.8">
<group android:scaleX="0.72"
android:scaleY="0.72"
android:translateX="-6"
android:translateY="-5.25">
<path
android:pathData="M25,10c-8.3,0 -15,6.7 -15,15 0,6.6 4.3,12.2 10.3,14.2 0.8,0.1 1,-0.3 1,-0.7v-2.6c-4.2,0.9 -5.1,-2 -5.1,-2 -0.7,-1.7 -1.7,-2.2 -1.7,-2.2 -1.4,-0.9 0.1,-0.9 0.1,-0.9 1.5,0.1 2.3,1.5 2.3,1.5 1.3,2.3 3.5,1.6 4.4,1.2 0.1,-1 0.5,-1.6 1,-2 -3.3,-0.4 -6.8,-1.7 -6.8,-7.4 0,-1.6 0.6,-3 1.5,-4 -0.2,-0.4 -0.7,-1.9 0.1,-4 0,0 1.3,-0.4 4.1,1.5 1.2,-0.3 2.5,-0.5 3.8,-0.5 1.3,0 2.6,0.2 3.8,0.5 2.9,-1.9 4.1,-1.5 4.1,-1.5 0.8,2.1 0.3,3.6 0.1,4 1,1 1.5,2.4 1.5,4 0,5.8 -3.5,7 -6.8,7.4 0.5,0.5 1,1.4 1,2.8v4.1c0,0.4 0.3,0.9 1,0.7 6,-2 10.2,-7.6 10.2,-14.2C40,16.7 33.3,10 25,10z"
android:fillColor="#181616"
android:fillType="evenOdd"/>
</group>
</vector>
Binary file added app/src/main/res/drawable-hdpi/ic_github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-night-anydpi/ic_github.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<group android:scaleX="0.72"
android:scaleY="0.72"
android:translateX="-6"
android:translateY="-5.25">
<path
android:pathData="M25,10c-8.3,0 -15,6.7 -15,15 0,6.6 4.3,12.2 10.3,14.2 0.8,0.1 1,-0.3 1,-0.7v-2.6c-4.2,0.9 -5.1,-2 -5.1,-2 -0.7,-1.7 -1.7,-2.2 -1.7,-2.2 -1.4,-0.9 0.1,-0.9 0.1,-0.9 1.5,0.1 2.3,1.5 2.3,1.5 1.3,2.3 3.5,1.6 4.4,1.2 0.1,-1 0.5,-1.6 1,-2 -3.3,-0.4 -6.8,-1.7 -6.8,-7.4 0,-1.6 0.6,-3 1.5,-4 -0.2,-0.4 -0.7,-1.9 0.1,-4 0,0 1.3,-0.4 4.1,1.5 1.2,-0.3 2.5,-0.5 3.8,-0.5 1.3,0 2.6,0.2 3.8,0.5 2.9,-1.9 4.1,-1.5 4.1,-1.5 0.8,2.1 0.3,3.6 0.1,4 1,1 1.5,2.4 1.5,4 0,5.8 -3.5,7 -6.8,7.4 0.5,0.5 1,1.4 1,2.8v4.1c0,0.4 0.3,0.9 1,0.7 6,-2 10.2,-7.6 10.2,-14.2C40,16.7 33.3,10 25,10z"
android:fillColor="#181616"
android:fillType="evenOdd"/>
</group>
</vector>
Binary file added app/src/main/res/drawable-night-hdpi/ic_github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-night-mdpi/ic_github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-night-xhdpi/ic_github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-night-xxhdpi/ic_github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions app/src/main/res/drawable-night/ic_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF">
<path
android:fillColor="@android:color/white"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable-night/ic_school.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF">
<path
android:fillColor="@android:color/white"
android:pathData="M5,13.18v4L12,21l7,-3.82v-4L12,17l-7,-3.82zM12,3L1,9l11,6 9,-4.91V17h2V9L12,3z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable-night/ic_theme.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,15.31L23.31,12 20,8.69V4h-4.69L12,0.69 8.69,4H4v4.69L0.69,12 4,15.31V20h4.69L12,23.31 15.31,20H20v-4.69zM12,18V6c3.31,0 6,2.69 6,6s-2.69,6 -6,6z"/>
</vector>
Binary file added app/src/main/res/drawable-xhdpi/ic_github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/ic_github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#000000">
<path
android:fillColor="@android:color/white"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_school.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#000000">
<path
android:fillColor="@android:color/white"
android:pathData="M5,13.18v4L12,21l7,-3.82v-4L12,17l-7,-3.82zM12,3L1,9l11,6 9,-4.91V17h2V9L12,3z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_theme.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,15.31L23.31,12 20,8.69V4h-4.69L12,0.69 8.69,4H4v4.69L0.69,12 4,15.31V20h4.69L12,23.31 15.31,20H20v-4.69zM12,18V6c3.31,0 6,2.69 6,6s-2.69,6 -6,6z"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@
<string name="warning_first_search">Da dies das erste Mal ist, dass Sie einen Raum finden wollen, muss die Anwendung alle Unterrichte aller Räume aus dem Internet abrufen, was bis zu 2 oder 3 Minuten dauern kann.</string>
<string name="dialog_downloading_title">Das Update herunterladen …</string>
<string name="dialog_update_title">Möchten Sie die Anwendung aktualisieren ?</string>
<string name="license_selfupdatingapp_description">von Lucas Bürgy, lizenziert unter der GNU GPL v3.0-Lizenz</string>
<string name="license_okio_description">von Square Open Source, lizenziert unter der Apache 2.0-Lizenz</string>
<string name="license_okhttp_description">von Square Open Source, lizenziert unter der Apache 2.0-Lizenz</string>
<string name="license_moshi_description">von Square Open Source, lizenziert unter der Apache 2.0-Lizenz</string>
<string name="license_jsoup_description">von Jonathan Hedley, lizenziert unter der MIT-Lizenz</string>
<string name="license_httpcomponents_description">von The Apache Software Foundation, lizenziert unter der Apache 2.0-Lizenz</string>
<string name="about_header">Über</string>
<string name="licenses_header">Lizenzen</string>
<string name="see_github_title">Siehe das Projekt auf GitHub</string>
</resources>
9 changes: 9 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@
<string name="warning_first_search">Etant donné que c\'est la première fois que vous voulez trouver une salle, l\'application doit obtenir tous les cours de toutes les salles à partir d\'Internet, ce qui peut prendre jusqu\'à 2 ou 3 minutes.</string>
<string name="dialog_update_title">Voulez-vous mettre à jour l\'application ?</string>
<string name="dialog_downloading_title">Téléchargement de la mise à jour …</string>
<string name="see_github_title">Voir le projet sur GitHub</string>
<string name="about_header">À propos</string>
<string name="licenses_header">Licenses</string>
<string name="license_selfupdatingapp_description">par Lucas Bürgy, sous license GNU GPL v3.0</string>
<string name="license_okio_description">par Square Open Source, sous license Apache 2.0</string>
<string name="license_okhttp_description">par Square Open Source, sous license Apache 2.0</string>
<string name="license_moshi_description">par Square Open Source, sous license Apache 2.0</string>
<string name="license_jsoup_description">par Jonathan Hedley, sous license MIT</string>
<string name="license_httpcomponents_description">par The Apache Software Foundation, sous license Apache 2.0</string>
</resources>
9 changes: 9 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@
<string name="warning_first_search">Poiché è la prima volta che si desidera trovare una stanza, l\'applicazione deve recuperare tutte le lezioni di tutte le stanze da Internet, che può richiedere fino a 2 o 3 minuti.</string>
<string name="dialog_update_title">Vuole aggiornare l\'applicazione ?</string>
<string name="dialog_downloading_title">Il download del aggiornamento …</string>
<string name="license_httpcomponents_description">di The Apache Software Foundation, con licenza Apache 2.0</string>
<string name="license_jsoup_description">di Jonathan Hedley, con licenza MIT</string>
<string name="license_moshi_description">di Square Open Source, con licenza Apache 2.0</string>
<string name="license_okhttp_description">di Square Open Source, con licenza Apache 2.0</string>
<string name="license_okio_description">di Square Open Source, con licenza Apache 2.0</string>
<string name="license_selfupdatingapp_description">di Lucas Bürgy, con licenza GNU GPL v3.0</string>
<string name="about_header">About</string>
<string name="licenses_header">Licenze</string>
<string name="see_github_title">Vedi il progetto su GitHub</string>
</resources>
26 changes: 26 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,21 @@
<string name="display_header">Display</string>
<string name="infos_header">Informations</string>
<string name="datas_header">Datas</string>
<string name="about_header">About</string>
<string name="licenses_header">Licenses</string>

<!-- Settings keys -->
<string name="settings_key_theme_9" translatable="false">theme_9</string>
<string name="settings_key_theme_10" translatable="false">theme_10</string>
<string name="settings_key_class" translatable="false">class</string>
<string name="settings_key_delete_datas" translatable="false">delete_datas</string>
<string name="settings_key_see_github" translatable="false">github</string>
<string name="settings_key_license_httpcomponents" translatable="false">license_httpcomponents</string>
<string name="settings_key_license_jsoup" translatable="false">license_jsoup</string>
<string name="settings_key_license_moshi" translatable="false">license_moshi</string>
<string name="settings_key_license_okhttp" translatable="false">license_okhttp</string>
<string name="settings_key_license_okio" translatable="false">license_okio</string>
<string name="settings_key_license_selfupdatingapp" translatable="false">license_selfupdatingapp</string>

<!-- Display Settings -->
<string name="theme_title">Theme</string>
Expand All @@ -64,6 +73,23 @@
<string name="datas_deleted">The local datas have been deleted</string>
<string name="classes_refreshed">The class list has been refreshed</string>

<!-- About Settings -->
<string name="see_github_title">See the project on GitHub</string>

<!-- Licenses Settings -->
<string name="license_httpcomponents_title" translatable="false">Apache HttpComponents</string>
<string name="license_httpcomponents_description">by The Apache Software Foundation, licensed under the Apache 2.0 license</string>
<string name="license_jsoup_title" translatable="false">jsoup</string>
<string name="license_jsoup_description">by Jonathan Hedley, licensed under the MIT license</string>
<string name="license_moshi_title" translatable="false">Moshi</string>
<string name="license_moshi_description">by Square Open Source, licensed under the Apache 2.0 license</string>
<string name="license_okhttp_title" translatable="false">OkHttp</string>
<string name="license_okhttp_description">by Square Open Source, licensed under the Apache 2.0 license</string>
<string name="license_okio_title" translatable="false">Okio</string>
<string name="license_okio_description">by Square Open Source, licensed under the Apache 2.0 license</string>
<string name="license_selfupdatingapp_title" translatable="false">Self Updating App</string>
<string name="license_selfupdatingapp_description">by Lucas Bürgy, licensed under the GNU GPL v3.0 license</string>

<!-- selfupdate -->
<string name="dialog_update_title">Do you want to update the app ?</string>
<string name="dialog_downloading_title">Downloading the update …</string>
Expand Down
Loading

0 comments on commit 7b4c0ee

Please sign in to comment.