Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/1.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Amab committed Jan 21, 2017
2 parents c29b55b + 9433c64 commit 63e3807
Show file tree
Hide file tree
Showing 22 changed files with 422 additions and 28 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.idea
.gradle
build
gradlew
gradlew.bat
import-summary.txt
local.properties
/SWADroid/SWADroid-SWADroid.iml
/SWADroid.iml
app/lint.xml
/SWADroid/google-services.json
keystore.properties
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: android
jdk:
- oraclejdk8
android:
components:
- tools
- tools
- platform-tools
- build-tools-25.0.2
- android-25
- extra-android-m2repository
- extra-android-support
- extra-google-m2repository
- extra-google-google_play_services
script:
- "./gradlew build connectedCheck"
before_install:
- chmod +x gradlew
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ Android client for e-learning platform [![SWADroid](https://openswad.org/logo/sw
- Code: `git clone https://github.com/Amab/SWADroid.git`
- Issue tracker: https://github.com/Amab/SWADroid/issues

[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/c/c8/Farm-Fresh_twitter_1.png)](http://twitter.com/SWADroid)[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/4/4d/Farm-Fresh_facebook.png)](https://www.facebook.com/SWADroid)[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/b/ba/Google_plus_32.png)](https://plus.google.com/115615684349730524355/posts)[![SWADroid](https://s.w.org/about/images/logos/wordpress-logo-32-blue.png)](http://swadroid.wordpress.com)
[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/c/c8/Farm-Fresh_twitter_1.png)](http://twitter.com/SWADroid)[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/4/4d/Farm-Fresh_facebook.png)](https://www.facebook.com/SWADroid)[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/b/ba/Google_plus_32.png)](https://plus.google.com/115615684349730524355/posts)[![SWADroid](https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Telegram_Messenger.png/35px-Telegram_Messenger.png?uselang=es)](https://telegram.me/swadroid)[![SWADroid](https://s.w.org/about/images/logos/wordpress-logo-32-blue.png)](http://swadroid.wordpress.com)

CI Status
---------

|Branch|CI status|
|------|---------|
|develop|[![Build Status](https://travis-ci.org/Amab/SWADroid.svg?branch=develop)](https://travis-ci.org/Amab/SWADroid)|
|master|[![Build Status](https://travis-ci.org/Amab/SWADroid.svg?branch=master)](https://travis-ci.org/Amab/SWADroid)|

Copyright and License
---------------------
Expand All @@ -17,7 +25,7 @@ Copyright (C) 2010, Juan Miguel Boyero Corral

[![Copyright and License](https://img.shields.io/badge/license-GPLv3-green.svg?style=flat)](http://www.gnu.org/licenses/gpl.html) SWADroid client is free software; you can redistribute it and/or modify it under the same terms as [GPLv3](http://www.gnu.org/licenses/gpl.html) license.

[![Copyright and License](https://img.shields.io/badge/license-LGPLv3-green.svg?style=flat)](http://www.gnu.org/licenses/lgpl.html) SWADroid uses [Android DataFrameWork](http://code.google.com/p/androiddataframework/) library developed by [Javier Pérez Pacheco](http://www.javielinux.com/quiensoy.php) and licensed under [LGPLv3](http://www.gnu.org/licenses/lgpl.html).
[![Copyright and License](https://img.shields.io/badge/license-LGPLv3-green.svg?style=flat)](http://www.gnu.org/licenses/lgpl.html) SWADroid uses [Android DataFrameWork](http://code.google.com/p/androiddataframework/) library developed by Javier Pérez Pacheco and licensed under [LGPLv3](http://www.gnu.org/licenses/lgpl.html).

[![Copyright and License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](http://www.opensource.org/licenses/mit-license.php) SWADroid uses [ksoap2-android](https://github.com/simpligility/ksoap2-android) library developed by [Manfred Moser](https://github.com/mosabua) and licensed under [MIT](http://www.opensource.org/licenses/mit-license.php).

Expand Down Expand Up @@ -49,4 +57,4 @@ Contributing

SWADroid is an open source project. I encourage contributions.

The Github team has also been kind enough to write up some great [documentation](http://help.github.com/pull-requests/) on working with pull requests. Contributions should be performed on [topic branches](http://progit.org/book/ch3-4.html) in your personal forks - just issue your pull requests from there.
The Github team has also been kind enough to write up some great [documentation](https://help.github.com/articles/about-pull-requests/) on working with pull requests. Contributions should be performed on [topic branches](http://progit.org/book/ch3-4.html) in your personal forks - just issue your pull requests from there.
40 changes: 33 additions & 7 deletions SWADroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,30 @@ ext {
git = org.ajoberstar.grgit.Grgit.open()
gitVersionCode = git.tag.list().size()
gitVersionName = "${git.describe()}"

travisBuild = System.getenv("TRAVIS") == "true"
}

android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
compileSdkVersion 25
buildToolsVersion "25.0.2"

dexOptions {
maxProcessCount=2
javaMaxHeapSize "2g"
}

lintOptions {
abortOnError false
}

defaultConfig {
applicationId "es.ugr.swad.swadroid"
versionCode gitVersionCode
versionName gitVersionName

minSdkVersion 9
targetSdkVersion 24
targetSdkVersion 25

android.applicationVariants.all { variant ->
def appName
Expand Down Expand Up @@ -52,14 +58,34 @@ android {
debug {
versionNameSuffix '-DEBUG'
}

buildTypes.each {
it.buildConfigField "String", "SWAD_APP_KEY", getBuildConfigField("SWAD_APP_KEY")
it.buildConfigField "String", "ANALYTICS_API_KEY", getBuildConfigField("ANALYTICS_API_KEY")
}
}
}

//return a BuildConfigField from a properties file.
def getBuildConfigField(String property){
def value

if(travisBuild) {
value = "\"" + System.getenv(property) + "\""
} else {
Properties properties = new Properties()
properties.load(new FileInputStream("keystore.properties"))
value = "\"" + properties.getProperty(property) + "\""
}

return value
}

dependencies {
compile 'com.android.support:support-v4:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.android.gms:play-services-analytics:10.0.1'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.2'
compile 'commons-io:commons-io:2.5'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
Expand Down
1 change: 0 additions & 1 deletion SWADroid/src/main/java/es/ugr/swad/swadroid/.gitignore

This file was deleted.

35 changes: 35 additions & 0 deletions SWADroid/src/main/java/es/ugr/swad/swadroid/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* This file is part of SWADroid.
*
* Copyright (C) 2010 Juan Miguel Boyero Corral <juanmi1982@gmail.com>
*
* SWADroid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SWADroid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SWADroid. If not, see <http://www.gnu.org/licenses/>.
*/
package es.ugr.swad.swadroid;

/**
* Application settings.
*
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
*/
public class Config {
/**
* SWAD application key
*/
public static final String SWAD_APP_KEY = BuildConfig.SWAD_APP_KEY;
/**
* Google Analytics application key
*/
public static final String ANALYTICS_API_KEY = BuildConfig.ANALYTICS_API_KEY;
}
6 changes: 4 additions & 2 deletions SWADroid/src/main/java/es/ugr/swad/swadroid/SWADMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected void onResume() {
}

//If today is the user birthday, show birthday message
if((Login.getLoggedUser() != null)
if((Login.getLoggedUser() != null) && (Login.getLoggedUser().getUserBirthday() != null)
&& DateTimeUtils.isBirthday(Login.getLoggedUser().getUserBirthday())) {

showBirthdayMessage();
Expand Down Expand Up @@ -292,7 +292,9 @@ private void upgradeApp(int lastVersion, int currentVersion) throws NoSuchAlgori
Preferences.upgradeCredentials();

Preferences.setSyncTime(String.valueOf(Constants.DEFAULT_SYNC_TIME));
} else if(lastVersion < 57) {
}

if(lastVersion < 57) {
//Reconfigure automatic synchronization
SyncUtils.removePeriodicSync(Constants.AUTHORITY, Bundle.EMPTY, this);
if(!Preferences.getSyncTime().equals("0") && Preferences.isSyncEnabled()) {
Expand Down
4 changes: 3 additions & 1 deletion SWADroid/src/main/java/es/ugr/swad/swadroid/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import java.util.Hashtable;
import java.util.Locale;

import es.ugr.swad.swadroid.Constants;

/**
* User data.
*
Expand Down Expand Up @@ -256,7 +258,7 @@ public Calendar getUserBirthday() {
* @param userBirthday User birthday.
*/
private void setUserBirthday(String userBirthday) throws ParseException {
if((userBirthday != null) && !userBirthday.equals("00000000")) {
if((userBirthday != null) && !userBirthday.equals(Constants.NULL_VALUE) && !userBirthday.equals("00000000")) {
this.userBirthday = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd", Locale.getDefault());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void refreshScreen() {
hideSwipeProgress();

//If today is the user birthday, show birthday message
if((Login.getLoggedUser() != null)
if((Login.getLoggedUser() != null) && (Login.getLoggedUser().getUserBirthday() != null)
&& DateTimeUtils.isBirthday(Login.getLoggedUser().getUserBirthday())) {
mBirthdayTextView.setText(getString(R.string.birthdayMsg).replace(
Constants.USERNAME_TEMPLATE, Login.getLoggedUser().getUserFirstname()));
Expand Down Expand Up @@ -475,7 +475,7 @@ protected void requestService() throws Exception {
*/
@Override
protected void connect() {
Toast.makeText(this, R.string.notificationsProgressDescription, Toast.LENGTH_SHORT).show();
//Toast.makeText(this, R.string.notificationsProgressDescription, Toast.LENGTH_SHORT).show();

startConnection();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ protected void onCreate(Bundle savedInstanceState) {

setContentView(R.layout.continuous_scan);

getSupportActionBar().hide();

try {
//Initialize database
dbHelper = new DataBaseHelper(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import com.nostra13.universalimageloader.core.ImageLoader;

import es.ugr.swad.swadroid.Constants;
import es.ugr.swad.swadroid.R;
import es.ugr.swad.swadroid.database.DataBaseHelper;
import es.ugr.swad.swadroid.gui.ImageFactory;
Expand Down Expand Up @@ -110,6 +111,19 @@ public void bindView(View view, Context context, Cursor cursor) {
String userPhoto = cursor.getString(cursor.getColumnIndex("photoPath"));
boolean present = Utils.parseIntBool(cursor.getInt(cursor.getColumnIndex("present")));

// Replace NULL value for strings returned by the webservice with the empty string
if (userSurname1.equals(Constants.NULL_VALUE))
userSurname1 = "";

if (userSurname2.equals(Constants.NULL_VALUE))
userSurname2 = "";

if (userFirstname.equals(Constants.NULL_VALUE))
userFirstname = "";

if (userID.equals(Constants.NULL_VALUE))
userID = "";

final ViewHolder holder = (ViewHolder) view.getTag();
view.setTag(holder);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public class Preferences {
* Google Plus preference name
*/
public static final String GOOGLEPLUSPREF = "googlePlusPref";
/**
* Telegram preference name
*/
public static final String TELEGRAMPREF = "telegramPref";
/**
* Blog preference name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public class PreferencesActivity extends PreferenceActivity implements OnPrefere
* Google Plus preference
*/
private static Preference googlePlusPref;
/**
* Telegram preference
*/
private static Preference telegramPref;
/**
* Blog preference
*/
Expand Down Expand Up @@ -188,6 +192,7 @@ protected void onCreate(Bundle savedInstanceState) {
twitterPref = findPreference(Preferences.TWITTERPREF);
facebookPref = findPreference(Preferences.FACEBOOKPREF);
googlePlusPref = findPreference(Preferences.GOOGLEPLUSPREF);
telegramPref = findPreference(Preferences.TELEGRAMPREF);
blogPref = findPreference(Preferences.BLOGPREF);
sharePref = findPreference(Preferences.SHAREPREF);
syncTimePref = findPreference(Preferences.SYNCTIMEPREF);
Expand All @@ -200,6 +205,7 @@ protected void onCreate(Bundle savedInstanceState) {
twitterPref.setOnPreferenceChangeListener(this);
facebookPref.setOnPreferenceChangeListener(this);
googlePlusPref.setOnPreferenceChangeListener(this);
telegramPref.setOnPreferenceChangeListener(this);
blogPref.setOnPreferenceChangeListener(this);
sharePref.setOnPreferenceChangeListener(this);
syncEnablePref.setOnPreferenceChangeListener(this);
Expand Down Expand Up @@ -272,6 +278,18 @@ public boolean onPreferenceClick(Preference preference) {
return true;
}
});
telegramPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
/**
* Called when a preference is selected.
* @param preference Preference selected.
*/
public boolean onPreferenceClick(Preference preference) {
Intent urlIntent = new Intent(Intent.ACTION_VIEW);
urlIntent.setData(Uri.parse(getString(R.string.telegramURL)));
startActivity(urlIntent);
return true;
}
});
blogPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
/**
* Called when a preference is selected.
Expand Down
5 changes: 5 additions & 0 deletions SWADroid/src/main/res/raw-es/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
</head>

<body bgcolor="white">
<h4>1.5.1 (2017-01-21)</h4>
<ul>
<lh class="fix">[CORRECCIONES]</lh>
<li type="disc">Corregido error unparseable date: &quot;anyType{}&quot;(at offset 0)</li>
</ul>
<h4>1.5.0 (2016-09-01)</h4>
<ul>
<lh class="new">[NOVEDADES]</lh>
Expand Down
5 changes: 5 additions & 0 deletions SWADroid/src/main/res/raw/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
</head>

<body bgcolor="white">
<h4>1.5.1 (2017-01-21)</h4>
<ul>
<lh class="fix">[FIXES]</lh>
<li type="disc">Fixed unparseable date: &quot;anyType{}&quot;(at offset 0) error</li>
</ul>
<h4>1.5.0 (2016-09-01)</h4>
<ul>
<lh class="new">[NEW]</lh>
Expand Down
4 changes: 0 additions & 4 deletions SWADroid/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@
<string name="shareBodyMsg">Estoy usando #SWADroid en mi Android para acceder a la
plataforma de teleformación SWAD.\nObtenlo gratis aquí:
https://play.google.com/store/apps/details?id=es.ugr.swad.swadroid</string>
<string name="twitterTitle">Twitter</string>
<string name="facebookTitle">Facebook</string>
<string name="googlePlusTitle">Google+</string>
<string name="blogTitle">Blog</string>
<string name="marketTitle">Google Play</string>
<string name="prefCatSyncTitle">Sincronización</string>
<string name="prefSyncTimeTitle">Frecuencia de sincronización</string>
<string name="prefSyncTimeSummary">Frecuencia de sincronización de las notificaciones</string>
Expand Down
10 changes: 6 additions & 4 deletions SWADroid/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@
<string name="twitterURL" translatable="false">https://twitter.com/#!/SWADroid</string>
<string name="facebookURL" translatable="false">https://www.facebook.com/SWADroid</string>
<string name="googlePlusURL" translatable="false">http://goo.gl/kuezQ</string>
<string name="telegramURL" translatable="false">https://telegram.me/swadroid</string>
<string name="blogURL" translatable="false">http://swadroid.wordpress.com</string>
<string name="twitterUser" translatable="false">\@SWADroid</string>
<string name="twitterTitle">Twitter</string>
<string name="facebookTitle">Facebook</string>
<string name="googlePlusTitle">Google+</string>
<string name="twitterTitle" translatable="false">Twitter</string>
<string name="facebookTitle" translatable="false">Facebook</string>
<string name="googlePlusTitle" translatable="false">Google+</string>
<string name="telegramTitle" translatable="false">Telegram</string>
<string name="marketTitle" translatable="false">Google Play</string>
<string name="blogTitle">Blog</string>
<string name="marketTitle">Google Play</string>
<string name="prefCatSyncTitle">Synchronization</string>
<string name="prefSyncTimeTitle">Synchronization frecuency</string>
<string name="prefSyncTimeSummary">Synchronization frecuency of notifications</string>
Expand Down
5 changes: 5 additions & 0 deletions SWADroid/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
android:key="googlePlusPref"
android:summary="@string/googlePlusURL"
android:title="@string/googlePlusTitle" />
<Preference
android:defaultValue=""
android:key="telegramPref"
android:summary="@string/telegramURL"
android:title="@string/telegramTitle" />
</PreferenceCategory>

</PreferenceScreen>
Loading

0 comments on commit 63e3807

Please sign in to comment.