Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7b26045
Update project structure
SimonIT Sep 10, 2020
9f607c8
Build on github actions
SimonIT Sep 25, 2020
6769215
Add strings by guessing for working build
SimonIT Sep 25, 2020
7bc62e5
Use Notification.Builder for creating notifications
SimonIT Sep 27, 2020
5745e5d
Cache gradle and upload debug apk
SimonIT Sep 28, 2020
5ecac3b
Bump joda-time from 1.6.2 to 2.10.8 in /ChBoSync_AndroidStudioProject
dependabot-preview[bot] Oct 26, 2020
8554b4b
Update android gradle plugin
SimonIT Nov 26, 2020
a23c836
Bump joda-time from 2.10.8 to 2.10.10 in /ChBoSync_AndroidStudioProject
dependabot-preview[bot] Feb 8, 2021
9a60d52
Bump gradle from 4.1.1 to 4.1.3 in /ChBoSync_AndroidStudioProject
dependabot-preview[bot] Mar 19, 2021
29ef5a8
Upgrade to GitHub-native Dependabot
dependabot-preview[bot] Apr 29, 2021
a953deb
Remove dependabot ignores
SimonIT May 16, 2021
2fac38c
Bump gradle from 4.1.3 to 7.0.0 in /ChBoSync_AndroidStudioProject (#13)
dependabot[bot] Aug 4, 2021
d158e17
Bump joda-time from 2.10.10 to 2.10.12 in /ChBoSync_AndroidStudioProj…
dependabot[bot] Oct 18, 2021
ac3a45d
Bump gradle from 7.0.0 to 7.0.4 in /ChBoSync_AndroidStudioProject
dependabot[bot] Dec 9, 2021
c1b5cc4
Bump joda-time from 2.10.12 to 2.10.13 in /ChBoSync_AndroidStudioProject
dependabot[bot] Oct 27, 2021
ba8e94b
Bump joda-time from 2.10.13 to 2.10.14 in /ChBoSync_AndroidStudioProject
dependabot[bot] Mar 21, 2022
e23d765
Bump joda-time from 2.10.14 to 2.12.1 in /ChBoSync_AndroidStudioProject
dependabot[bot] Nov 1, 2022
e6d93ec
Bump joda-time from 2.12.1 to 2.12.2 in /ChBoSync_AndroidStudioProject
dependabot[bot] Dec 2, 2022
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
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/ChBoSync_AndroidStudioProject"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
30 changes: 30 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build app

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Setup Android build environment
uses: android-actions/setup-android@v2
- name: Build
working-directory: ./ChBoSync_AndroidStudioProject
run: ./gradlew build
14 changes: 14 additions & 0 deletions ChBoSync_AndroidStudioProject/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
18 changes: 0 additions & 18 deletions ChBoSync_AndroidStudioProject/ChBoSync_AndroidStudioProject.iml

This file was deleted.

1 change: 1 addition & 0 deletions ChBoSync_AndroidStudioProject/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
17 changes: 11 additions & 6 deletions ChBoSync_AndroidStudioProject/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 18
buildToolsVersion "26.0.1"
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "de.chbosync.android.syncmlclient"
minSdkVersion 15
targetSdkVersion 18
targetSdkVersion 30
versionCode 13
versionName "1.5 (xx 2018)"
}

buildTypes {
Expand All @@ -20,10 +22,13 @@ android {
// "This may happen particularly when migrating from Eclipse to Android Studio."
lintOptions {
disable "ResourceType"
abortOnError false
}

useLibrary 'org.apache.http.legacy'
}

dependencies {
compile 'joda-time:joda-time:1.6.2'
//implementation 'joda-time:joda-time:1.6.2'
}
//compile 'joda-time:joda-time:1.6.2'
implementation 'joda-time:joda-time:2.12.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.chbosync.android.syncmlclient"
android:versionCode="13"
android:versionName="1.5 (xx 2018)"
android:installLocation="auto" >


<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="18" />
<!-- API-Level 15 is Android version 4.0.3/4.0.4 -->
android:installLocation="auto">

<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ public class AndroidDisplayManager implements DisplayManager {
/** The tag to be written into log messages*/
private static final String TAG = "AndroidDisplayManager";
/** Reference object for the native alert dialogs*/
private Hashtable<Integer, Object> holdingDialogs = new Hashtable<Integer, Object>();
private final Hashtable<Integer, Object> holdingDialogs = new Hashtable<>();
/** Reference object for the custom alert dialogs*/
private Hashtable<Integer, AlertDialog> pendingAlerts = new Hashtable<Integer, AlertDialog>();
private final Hashtable<Integer, AlertDialog> pendingAlerts = new Hashtable<>();
/** Reference the runnable to be executed after a specific dialog is dismissed*/
private Hashtable dismissRunnable = new Hashtable<Integer, Runnable>();
private final Hashtable<Integer, Runnable> dismissRunnable = new Hashtable<>();
/** References the native alert dialog with a db sequence-like progression*/
private static int incrementalId;
/** Holds the last message shown by the showMessage method. Used for test purpose */
Expand Down Expand Up @@ -125,7 +125,8 @@ public void showScreen(Screen screen, int screenId) throws Exception {
public void showScreen(Context context, int screenId, Bundle extras) throws Exception {
Intent intent = null;
switch (screenId) {
case Controller.CONFIGURATION_SCREEN_ID: {
case Controller.CONFIGURATION_SCREEN_ID:
case Controller.ADVANCED_SETTINGS_SCREEN_ID: {
intent = new Intent(context, AndroidSettingsScreen.class);
break;
}
Expand All @@ -137,10 +138,6 @@ public void showScreen(Context context, int screenId, Bundle extras) throws Exce
intent = new Intent(context, AndroidAboutScreen.class);
break;
}
case Controller.ADVANCED_SETTINGS_SCREEN_ID: {
intent = new Intent(context, AndroidSettingsScreen.class);
break;
}
case Controller.DEV_SETTINGS_SCREEN_ID: {
intent = new Intent(context, AndroidDevSettingsScreen.class);
break;
Expand Down Expand Up @@ -219,8 +216,7 @@ public Dialog createDialog(int id) {
AlertDialog.Builder result = (AlertDialog.Builder) dialog;
return result.create();
} else if (dialog instanceof Dialog) {
Dialog result = (Dialog) dialog;
return result;
return (Dialog) dialog;
} else {
if (Log.isLoggable(Log.DEBUG)) {
Log.debug(TAG, "Unknown dialog id: " + id);
Expand Down Expand Up @@ -297,14 +293,14 @@ public void dismissProgressDialog(Screen screen, int id) {

public void setProgressDialogMaxValue(int dialogId, int value) {
Object dialog = holdingDialogs.get(dialogId);
if(dialog != null && dialog instanceof ProgressDialog) {
if(dialog instanceof ProgressDialog) {
((ProgressDialog)dialog).setMax(value);
}
}

public void setProgressDialogProgressValue(int dialogId, int value) {
Object dialog = holdingDialogs.get(dialogId);
if(dialog != null && dialog instanceof ProgressDialog) {
if(dialog instanceof ProgressDialog) {
((ProgressDialog)dialog).setProgress(value);
}
}
Expand Down Expand Up @@ -512,9 +508,9 @@ public String readAndResetLastMessage() {
*/
class NotifyRunnable extends Thread implements Runnable {

private String message;
private int time;
private Activity activity;
private final String message;
private final int time;
private final Activity activity;

/**
* Constructor
Expand Down Expand Up @@ -688,8 +684,11 @@ public void showNotification(NotificationData notificationData) {
icon = 0;
break;
}
Notification notification = new Notification(icon, tickerText, when);
notification.flags = Notification.DEFAULT_LIGHTS | Notification.FLAG_AUTO_CANCEL;
Notification.Builder notification = new Notification.Builder(context);
notification.setAutoCancel(true);
notification.setSmallIcon(icon);
notification.setTicker(tickerText);
notification.setWhen(when);

CharSequence contentTitle = notificationData.getTitle();
CharSequence contentText = notificationData.getMessage();
Expand All @@ -706,20 +705,22 @@ public void showNotification(NotificationData notificationData) {
notificationIntent.addCategory("android.intent.category.LAUNCHER");
}
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
notification.setContentTitle(contentTitle);
notification.setContentText(contentText);
notification.setContentIntent(contentIntent);

//finally, launches the notification
notificationManager.notify(notificationData.getId(), notification);
notificationManager.notify(notificationData.getId(), notification.getNotification());
}

/**
* Listener for user click events. This can be referenced both as a click
* listener for the DialogInterface and view. When the click event happens
* this listener runs the related Runnable option.
*/
private class OnButtonListener implements DialogInterface.OnClickListener, OnClickListener {
private static class OnButtonListener implements DialogInterface.OnClickListener, OnClickListener {

private Runnable action;
private final Runnable action;

public OnButtonListener(Runnable action) {
this.action = action;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ public class AndroidHomeScreenController extends HomeScreenController {

protected Context context;

private AndroidDisplayManager dm;
private final AndroidDisplayManager dm;

private boolean syncAll = false;

protected AutoSyncServiceHandler autoSyncServiceHandler;

private NotificationManager notificationManager;
private final NotificationManager notificationManager;

public AndroidHomeScreenController(Context context, Controller controller, HomeScreen homeScreen, NetworkStatus networkStatus) {
super(controller, homeScreen, networkStatus);
Expand Down Expand Up @@ -167,7 +167,10 @@ private void showSyncNotification() {

long when = System.currentTimeMillis();

Notification notification = new Notification(icon, tickerText, when);
Notification.Builder notification = new Notification.Builder(context);
notification.setSmallIcon(icon);
notification.setTicker(tickerText);
notification.setWhen(when);

CharSequence contentTitle = context.getString(R.string.app_name);
CharSequence contentText = context.getString(R.string.notification_sync_in_progress_message);
Expand All @@ -178,10 +181,14 @@ private void showSyncNotification() {
notificationIntent.addCategory("android.intent.category.LAUNCHER");

PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);

notification.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;
notificationManager.notify(AUTO_SYNC_NOTIFICATION_ID, notification);
notification.setContentTitle(contentTitle);
notification.setContentText(contentText);
notification.setContentIntent(contentIntent);

notification.setOngoing(true);
Notification n = notification.getNotification();
n.flags |= Notification.FLAG_NO_CLEAR;
notificationManager.notify(AUTO_SYNC_NOTIFICATION_ID, n);
}

private void hideSyncNotification() {
Expand Down Expand Up @@ -244,11 +251,7 @@ public void syncAllSources(String syncMode, int retryCount) {
}

public boolean isFirstSyncDialogDisplayed() {
if (dm.isAlertPending(DisplayManager.FIRST_SYNC_DIALOG_ID)) {
return true;
} else {
return false;
}
return dm.isAlertPending(DisplayManager.FIRST_SYNC_DIALOG_ID);
}

public boolean getSyncAll() {
Expand Down Expand Up @@ -320,7 +323,7 @@ public synchronized void continueSynchronizationAfterFirstSyncDialog(String sync
super.continueSynchronizationAfterFirstSyncDialog(syncType, filteredSources,
refresh, direction, delay, fromOutside, continueSyncFromDialog);
} else {
AppSyncSource first = (AppSyncSource)filteredSources.get(0);
AppSyncSource first = filteredSources.get(0);
if(filteredSources.size() > 1) {
this.syncAll = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,7 @@
<string name="write_permission_label">Tasquid Permission</string>
<string name="write_permission_desc">create new tasks, edit existing tasks</string>

<!-- TODO -->
<string name="pref_sync_summ">Preferences for synchronization</string>
<string name="pref_sync">Synchronization preference</string>
</resources>
12 changes: 9 additions & 3 deletions ChBoSync_AndroidStudioProject/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
buildscript {

repositories {
jcenter()
gradlePluginPortal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:7.0.4'
}
}
allprojects {
repositories {
jcenter()
gradlePluginPortal()
google()
}
}

dependencies {

}

task clean(type: Delete) {
delete rootProject.buildDir
}
3 changes: 3 additions & 0 deletions ChBoSync_AndroidStudioProject/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
Binary file modified ChBoSync_AndroidStudioProject/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun Sep 03 20:43:08 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
Loading