├── .gitignore ├── .travis.yml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── fabric.properties ├── google-services.json ├── libs │ └── gcm.jar ├── proguard-rules.pro ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ ├── integreat.html │ │ ├── jquery-2.1.4.min.js │ │ └── style.css │ │ ├── java │ │ └── augsburg │ │ │ └── se │ │ │ └── alltagsguide │ │ │ ├── BaseApplication.java │ │ │ ├── MainModule.java │ │ │ ├── ServicesModule.java │ │ │ ├── common │ │ │ ├── Author.java │ │ │ ├── AvailableLanguage.java │ │ │ ├── Event.java │ │ │ ├── EventCategory.java │ │ │ ├── EventLocation.java │ │ │ ├── EventPage.java │ │ │ ├── EventTag.java │ │ │ ├── Language.java │ │ │ ├── Location.java │ │ │ ├── Page.java │ │ │ └── UpdateTime.java │ │ │ ├── event │ │ │ ├── EventActivity.java │ │ │ ├── EventOverviewFragment.java │ │ │ └── EventPageAdapter.java │ │ │ ├── gcm │ │ │ ├── GCMCommand.java │ │ │ ├── GCMIntentService.java │ │ │ ├── GCMRedirectedBroadcastReceiver.java │ │ │ ├── ServerUtilities.java │ │ │ └── command │ │ │ │ ├── AnnouncementCommand.java │ │ │ │ └── TestCommand.java │ │ │ ├── navigation │ │ │ └── NavigationAdapter.java │ │ │ ├── network │ │ │ ├── DisclaimersLoader.java │ │ │ ├── EventPageLoader.java │ │ │ ├── EventPagesLoader.java │ │ │ ├── LanguageLoader.java │ │ │ ├── LocationLoader.java │ │ │ ├── NetworkService.java │ │ │ ├── NetworkServiceMock.java │ │ │ ├── PageLoader.java │ │ │ └── PagesLoader.java │ │ │ ├── overview │ │ │ └── OverviewActivity.java │ │ │ ├── page │ │ │ ├── PageActivity.java │ │ │ ├── PageAdapter.java │ │ │ └── PageOverviewFragment.java │ │ │ ├── persistence │ │ │ ├── CacheHelper.java │ │ │ ├── DatabaseCache.java │ │ │ ├── DatabaseInfo.java │ │ │ └── resources │ │ │ │ ├── AvailableLanguageResource.java │ │ │ │ ├── DisclaimerResource.java │ │ │ │ ├── EventCategoryResource.java │ │ │ │ ├── EventPageResource.java │ │ │ │ ├── EventTagResource.java │ │ │ │ ├── LanguageResource.java │ │ │ │ ├── LocationResource.java │ │ │ │ ├── PageResource.java │ │ │ │ ├── PersistableNetworkResource.java │ │ │ │ └── PersistableResource.java │ │ │ ├── serialization │ │ │ ├── EventPageSerializer.java │ │ │ ├── LanguageSerializer.java │ │ │ ├── LocationSerializer.java │ │ │ └── PageSerializer.java │ │ │ ├── settings │ │ │ ├── PrefFragment.java │ │ │ └── SettingsActivity.java │ │ │ ├── start │ │ │ ├── LanguageAdapter.java │ │ │ ├── LanguageFragment.java │ │ │ ├── LocationAdapter.java │ │ │ ├── LocationFragment.java │ │ │ └── WelcomeActivity.java │ │ │ └── utilities │ │ │ ├── AsyncLoader.java │ │ │ ├── BaseListFragment.java │ │ │ ├── BasicLoader.java │ │ │ ├── ColorManager.java │ │ │ ├── CommonUtilities.java │ │ │ ├── FileHelper.java │ │ │ ├── FontStyle.java │ │ │ ├── Helper.java │ │ │ ├── LoadingType.java │ │ │ ├── Newer.java │ │ │ ├── Objects.java │ │ │ ├── PrefUtilities.java │ │ │ ├── broadcast │ │ │ ├── NetworkChangeEvent.java │ │ │ └── NetworkChangeReceiver.java │ │ │ └── ui │ │ │ ├── BaseActivity.java │ │ │ ├── BaseAdapter.java │ │ │ ├── BaseFragment.java │ │ │ ├── BasePageWebViewLanguageActivity.java │ │ │ ├── BitmapColorTransformation.java │ │ │ ├── BitmapInvertTransformation.java │ │ │ ├── EmptyRecyclerView.java │ │ │ ├── LanguageItemAdapter.java │ │ │ ├── MyLinearLayoutManager.java │ │ │ └── MyWebViewClient.java │ │ └── res │ │ ├── drawable-hdpi │ │ ├── icon_language_loading.png │ │ ├── icon_language_loading_error.png │ │ ├── icon_location_loading.png │ │ ├── icon_location_loading_error.png │ │ ├── no_events_found.png │ │ ├── no_languages_found.png │ │ ├── no_locations_found.png │ │ └── no_pages_found.png │ │ ├── drawable-ldpi │ │ ├── icon_language_loading.png │ │ ├── icon_language_loading_error.png │ │ ├── icon_location_loading.png │ │ ├── icon_location_loading_error.png │ │ ├── no_events_found.png │ │ ├── no_languages_found.png │ │ ├── no_locations_found.png │ │ └── no_pages_found.png │ │ ├── drawable-mdpi │ │ ├── icon_language_loading.png │ │ ├── icon_language_loading_error.png │ │ ├── icon_location_loading.png │ │ ├── icon_location_loading_error.png │ │ ├── no_events_found.png │ │ ├── no_languages_found.png │ │ ├── no_locations_found.png │ │ └── no_pages_found.png │ │ ├── drawable-nodpi │ │ ├── brandenburger_tor.jpg │ │ └── circle_background.png │ │ ├── drawable-tvdpi │ │ ├── no_events_found.png │ │ ├── no_locations_found.png │ │ └── no_pages_found.png │ │ ├── drawable-xhdpi │ │ ├── icon_language_loading.png │ │ ├── icon_language_loading_error.png │ │ ├── icon_location_loading.png │ │ ├── icon_location_loading_error.png │ │ ├── no_events_found.png │ │ ├── no_languages_found.png │ │ ├── no_locations_found.png │ │ └── no_pages_found.png │ │ ├── drawable-xxhdpi │ │ ├── icon_language_loading.png │ │ ├── icon_language_loading_error.png │ │ ├── icon_location_loading.png │ │ ├── icon_location_loading_error.png │ │ ├── no_events_found.png │ │ ├── no_languages_found.png │ │ ├── no_locations_found.png │ │ └── no_pages_found.png │ │ ├── drawable-xxxhdpi │ │ ├── no_events_found.png │ │ ├── no_languages_found.png │ │ ├── no_locations_found.png │ │ └── no_pages_found.png │ │ ├── layout-land │ │ ├── page_event_item.xml │ │ └── page_item.xml │ │ ├── layout │ │ ├── activity_event.xml │ │ ├── activity_overview.xml │ │ ├── activity_page.xml │ │ ├── activity_settings.xml │ │ ├── activity_welcome.xml │ │ ├── category_item.xml │ │ ├── dialog_language_item.xml │ │ ├── events_empty_view.xml │ │ ├── fragment_event_pages.xml │ │ ├── fragment_language.xml │ │ ├── fragment_location.xml │ │ ├── fragment_pages.xml │ │ ├── language_item_view.xml │ │ ├── languages_empty_view.xml │ │ ├── location_item_view.xml │ │ ├── locations_empty_view.xml │ │ ├── navigation_empty_view.xml │ │ ├── navigation_header_view.xml │ │ ├── navigation_item.xml │ │ ├── page_event_item.xml │ │ ├── page_item.xml │ │ ├── pages_empty_view.xml │ │ └── tag_item.xml │ │ ├── menu │ │ ├── menu_welcome.xml │ │ └── overview.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-de │ │ └── strings.xml │ │ ├── values-fa │ │ └── strings.xml │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-land │ │ └── integers.xml │ │ ├── values-v19 │ │ └── styles.xml │ │ ├── values │ │ ├── arrays.xml │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── integers.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── preferences.xml └── version.properties ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── license.txt └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/android,eclipse,intellij,netbeans,gradle,java,maven 2 | 3 | ### Android ### 4 | # Built application files 5 | *.apk 6 | *.ap_ 7 | 8 | # Files for the Dalvik VM 9 | *.dex 10 | 11 | # Java class files 12 | *.class 13 | 14 | # Generated files 15 | bin/ 16 | gen/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio Navigation editor temp files 32 | .navigation/ 33 | 34 | ### Android Patch ### 35 | gen-external-apklibs 36 | 37 | 38 | ### Eclipse ### 39 | *.pydevproject 40 | .metadata 41 | .gradle 42 | bin/ 43 | tmp/ 44 | *.tmp 45 | *.bak 46 | *.swp 47 | *~.nib 48 | local.properties 49 | .settings/ 50 | .loadpath 51 | 52 | # Eclipse Core 53 | .project 54 | 55 | # External tool builders 56 | .externalToolBuilders/ 57 | 58 | # Locally stored "Eclipse launch configurations" 59 | *.launch 60 | 61 | # CDT-specific 62 | .cproject 63 | 64 | # JDT-specific (Eclipse Java Development Tools) 65 | .classpath 66 | 67 | # Java annotation processor (APT) 68 | .factorypath 69 | 70 | # PDT-specific 71 | .buildpath 72 | 73 | # sbteclipse plugin 74 | .target 75 | 76 | # TeXlipse plugin 77 | .texlipse 78 | 79 | 80 | ### Intellij ### 81 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 82 | 83 | *.iml 84 | 85 | ## Directory-based project format: 86 | .idea/ 87 | # if you remove the above rule, at least ignore the following: 88 | 89 | # User-specific stuff: 90 | # .idea/workspace.xml 91 | # .idea/tasks.xml 92 | # .idea/dictionaries 93 | 94 | # Sensitive or high-churn files: 95 | # .idea/dataSources.ids 96 | # .idea/dataSources.xml 97 | # .idea/sqlDataSources.xml 98 | # .idea/dynamic.xml 99 | # .idea/uiDesigner.xml 100 | 101 | # Gradle: 102 | # .idea/gradle.xml 103 | # .idea/libraries 104 | 105 | # Mongo Explorer plugin: 106 | # .idea/mongoSettings.xml 107 | 108 | ## File-based project format: 109 | *.ipr 110 | *.iws 111 | 112 | ## Plugin-specific files: 113 | 114 | # IntelliJ 115 | /out/ 116 | 117 | # mpeltonen/sbt-idea plugin 118 | .idea_modules/ 119 | 120 | # JIRA plugin 121 | atlassian-ide-plugin.xml 122 | 123 | # Crashlytics plugin (for Android Studio and IntelliJ) 124 | com_crashlytics_export_strings.xml 125 | crashlytics.properties 126 | crashlytics-build.properties 127 | 128 | 129 | ### NetBeans ### 130 | nbproject/private/ 131 | build/ 132 | nbbuild/ 133 | dist/ 134 | nbdist/ 135 | nbactions.xml 136 | nb-configuration.xml 137 | .nb-gradle/ 138 | 139 | 140 | ### Gradle ### 141 | .gradle 142 | build/ 143 | 144 | # Ignore Gradle GUI config 145 | gradle-app.setting 146 | 147 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 148 | !gradle-wrapper.jar 149 | 150 | 151 | ### Java ### 152 | *.class 153 | 154 | # Mobile Tools for Java (J2ME) 155 | .mtj.tmp/ 156 | 157 | # Package Files # 158 | *.war 159 | *.ear 160 | 161 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 162 | hs_err_pid* 163 | 164 | 165 | ### Maven ### 166 | target/ 167 | pom.xml.tag 168 | pom.xml.releaseBackup 169 | pom.xml.versionsBackup 170 | pom.xml.next 171 | release.properties 172 | dependency-reduced-pom.xml 173 | buildNumber.properties 174 | .mvn/timing.properties 175 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | android: 3 | components: 4 | - tools 5 | - platform-tools 6 | - android-23 7 | - build-tools-23.0.2 8 | - extra 9 | 10 | jdk: oraclejdk7 11 | 12 | notifications: 13 | email: false 14 | 15 | sudo: false 16 | 17 | before_script: 18 | - chmod +x gradlew 19 | 20 | script: 21 | - ./gradlew clean build 22 | 23 | before_cache: 24 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 25 | cache: 26 | directories: 27 | - $HOME/.gradle/caches/ 28 | - $HOME/.gradle/wrapper/ 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/Integreat/app-android.svg?branch=master)](https://travis-ci.org/Integreat/app-android) 2 | [![BuddyBuild](https://dashboard.buddybuild.com/api/statusImage?appID=56ac36b536e4870100da4adb&branch=master&build=latest)](https://dashboard.buddybuild.com/apps/56ac36b536e4870100da4adb/build/latest) 3 | 4 | # Integreat 5 | ###### ehemals Refguide+ 6 | 7 | Der mobile Alltagsguide für Flüchtlinge. 8 | Einfach. Digital. Kostenlos. 9 | 10 | www.integreat-app.de 11 | 12 | 13 | ## Collaboration 14 | Feel free to check out the [issues](https://github.com/Integreat/app/issues), fork this repository and send in some pull requests. 15 | 16 | ## License 17 | The source code is licensed under the Lesser General Public License (LGPL) v3 18 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/fabric.properties: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of Integreat. 3 | # 4 | # Integreat is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # Integreat is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with Integreat. If not, see . 16 | # 17 | 18 | #Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public. 19 | #Wed Sep 30 00:56:18 PDT 2015 20 | apiSecret=d68d280c2620a7762e74f2890e54a9284e75bab6e48c4b4b4565817e1a6108f3 21 | -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_id": "integreat-1173", 4 | "project_number": "298364599882", 5 | "name": "Integreat" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:298364599882:android:d40d3b04b3cc30ce", 11 | "client_id": "android:augsburg.se.alltagsguide", 12 | "client_type": 1, 13 | "android_client_info": { 14 | "package_name": "augsburg.se.alltagsguide" 15 | } 16 | }, 17 | "oauth_client": [], 18 | "api_key": [], 19 | "services": { 20 | "analytics_service": { 21 | "status": 1 22 | }, 23 | "cloud_messaging_service": { 24 | "status": 1, 25 | "apns_config": [] 26 | }, 27 | "appinvite_service": { 28 | "status": 1, 29 | "other_platform_oauth_client": [] 30 | }, 31 | "google_signin_service": { 32 | "status": 1 33 | }, 34 | "ads_service": { 35 | "status": 1 36 | } 37 | } 38 | }, 39 | { 40 | "client_info": { 41 | "mobilesdk_app_id": "1:298364599882:android:9ce64071aff92d6e", 42 | "client_id": "android:tuerantuer.app.integreat", 43 | "client_type": 1, 44 | "android_client_info": { 45 | "package_name": "tuerantuer.app.integreat" 46 | } 47 | }, 48 | "oauth_client": [], 49 | "api_key": [], 50 | "services": { 51 | "analytics_service": { 52 | "status": 2, 53 | "analytics_property": { 54 | "tracking_id": "UA-73579165-1" 55 | } 56 | }, 57 | "cloud_messaging_service": { 58 | "status": 1, 59 | "apns_config": [] 60 | }, 61 | "appinvite_service": { 62 | "status": 1, 63 | "other_platform_oauth_client": [] 64 | }, 65 | "google_signin_service": { 66 | "status": 1 67 | }, 68 | "ads_service": { 69 | "status": 1 70 | } 71 | } 72 | } 73 | ], 74 | "client_info": [], 75 | "ARTIFACT_VERSION": "1" 76 | } -------------------------------------------------------------------------------- /app/libs/gcm.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/libs/gcm.jar -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Daniel-L\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/assets/integreat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 47 | 48 | 49 | 50 |
51 | 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/BaseApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide; 19 | 20 | import android.app.Application; 21 | import android.app.Instrumentation; 22 | import android.content.Context; 23 | import android.support.annotation.NonNull; 24 | import android.support.multidex.MultiDex; 25 | 26 | import com.crashlytics.android.Crashlytics; 27 | import com.google.android.gms.analytics.GoogleAnalytics; 28 | import com.google.android.gms.analytics.Logger; 29 | import com.google.android.gms.analytics.Tracker; 30 | import com.google.inject.Injector; 31 | import com.liulishuo.filedownloader.FileDownloader; 32 | 33 | import io.fabric.sdk.android.Fabric; 34 | import roboguice.RoboGuice; 35 | 36 | /** 37 | * Created by Daniel-L on 16.08.2015. 38 | */ 39 | public class BaseApplication extends Application { 40 | /** 41 | * The injector which can inject objects later on 42 | */ 43 | private static Injector injector; 44 | private Tracker mTracker; 45 | 46 | public BaseApplication() { 47 | super(); 48 | } 49 | 50 | public BaseApplication(Instrumentation instrumentation) { 51 | super(); 52 | attachBaseContext(instrumentation.getTargetContext()); 53 | } 54 | 55 | @Override 56 | public void onCreate() { 57 | super.onCreate(); 58 | Fabric.with(this, new Crashlytics()); 59 | RoboGuice.setUseAnnotationDatabases(false); 60 | injector = RoboGuice.getOrCreateBaseApplicationInjector(this, RoboGuice.DEFAULT_STAGE, 61 | RoboGuice.newDefaultRoboModule(this), new MainModule()); 62 | GoogleAnalytics.getInstance(this).getLogger() 63 | .setLogLevel(Logger.LogLevel.VERBOSE); 64 | FileDownloader.init(this); 65 | } 66 | 67 | /** 68 | * Gets the default {@link Tracker} for this {@link Application}. 69 | * 70 | * @return tracker 71 | */ 72 | synchronized public Tracker getDefaultTracker() { 73 | if (mTracker == null) { 74 | GoogleAnalytics analytics = GoogleAnalytics.getInstance(this); 75 | // To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG 76 | mTracker = analytics.newTracker("UA-73579165-1"); 77 | mTracker.setAnonymizeIp(true); 78 | } 79 | return mTracker; 80 | } 81 | 82 | /** 83 | * Injects the object 84 | * 85 | * @param object object which should be injected manually 86 | */ 87 | public static void inject(@NonNull Object object) { 88 | injector.injectMembers(object); 89 | } 90 | 91 | 92 | @Override 93 | protected void attachBaseContext(Context base) { 94 | super.attachBaseContext(base); 95 | MultiDex.install(this); 96 | } 97 | 98 | 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/common/Author.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.common; 19 | 20 | import android.database.Cursor; 21 | import android.support.annotation.NonNull; 22 | import android.support.annotation.Nullable; 23 | 24 | import com.google.gson.JsonObject; 25 | 26 | import java.io.Serializable; 27 | 28 | import augsburg.se.alltagsguide.BuildConfig; 29 | import augsburg.se.alltagsguide.persistence.CacheHelper; 30 | import augsburg.se.alltagsguide.utilities.Objects; 31 | 32 | /** 33 | * Created by Daniel-L on 09.10.2015. 34 | */ 35 | public class Author implements Serializable { 36 | @Nullable private String mLogin; 37 | @Nullable private String mFirstName; 38 | @Nullable private String mLastName; 39 | 40 | public Author(@Nullable String login, @Nullable String firstName, @Nullable String lastName) { 41 | mLogin = login; 42 | mFirstName = firstName; 43 | mLastName = lastName; 44 | } 45 | 46 | @Nullable 47 | public String getLogin() { 48 | return mLogin; 49 | } 50 | 51 | @Nullable 52 | public String getFirstName() { 53 | return mFirstName; 54 | } 55 | 56 | @Nullable 57 | public String getLastName() { 58 | return mLastName; 59 | } 60 | 61 | @NonNull 62 | public static Author fromJson(@NonNull final JsonObject jsonTag) { 63 | String login = jsonTag.get("login").getAsString(); 64 | String firstName = jsonTag.get("first_name").getAsString(); 65 | String lastName = jsonTag.get("last_name").getAsString(); 66 | return new Author(login, firstName, lastName); 67 | } 68 | 69 | @NonNull 70 | public static Author fromCursor(@NonNull Cursor cursor) { 71 | if (BuildConfig.DEBUG) { 72 | if (cursor.isClosed()) { 73 | throw new IllegalStateException("Cursor should not be closed"); 74 | } 75 | } 76 | String login = cursor.getString(cursor.getColumnIndex(CacheHelper.AUTHOR_USERNAME)); 77 | String firstName = cursor.getString(cursor.getColumnIndex(CacheHelper.AUTHOR_FIRSTNAME)); 78 | String lastName = cursor.getString(cursor.getColumnIndex(CacheHelper.AUTHOR_LASTNAME)); 79 | return new Author(login, firstName, lastName); 80 | } 81 | 82 | @NonNull 83 | public String toText() { 84 | String text = ""; 85 | if (mFirstName != null) { 86 | text += mFirstName + " "; 87 | } 88 | if (mLastName != null) { 89 | text += mLastName; 90 | } 91 | text = text.trim(); 92 | if (Objects.isNullOrEmpty(text)) { 93 | text += mLogin; 94 | } 95 | return text; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/common/AvailableLanguage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.common; 19 | 20 | import android.database.Cursor; 21 | import android.support.annotation.NonNull; 22 | import android.support.annotation.Nullable; 23 | import android.util.Log; 24 | 25 | import com.google.gson.Gson; 26 | import com.google.gson.JsonElement; 27 | import com.google.gson.reflect.TypeToken; 28 | 29 | import java.io.Serializable; 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | import java.util.Map; 33 | 34 | import augsburg.se.alltagsguide.persistence.CacheHelper; 35 | 36 | /** 37 | * Created by Daniel-L on 10.10.2015. 38 | */ 39 | public class AvailableLanguage implements Serializable { 40 | @NonNull private String mLanguage; 41 | private int mOtherPageId; 42 | private int mOwnPageId; 43 | 44 | @Nullable private Language mLoadedLanguage; 45 | 46 | public AvailableLanguage(@NonNull String language, int otherPageId) { 47 | mLanguage = language; 48 | mOtherPageId = otherPageId; 49 | } 50 | 51 | public void setLanguage(@NonNull Language language) { 52 | mLoadedLanguage = language; 53 | } 54 | 55 | public void setOwnPageId(int ownPageId) { 56 | mOwnPageId = ownPageId; 57 | } 58 | 59 | public int getOwnPageId() { 60 | return mOwnPageId; 61 | } 62 | 63 | @NonNull 64 | public static List fromJson(@NonNull JsonElement elem) { 65 | List languages = new ArrayList<>(); 66 | try { 67 | Map languagesMap = new Gson().fromJson(elem, new TypeToken>() { 68 | }.getType()); 69 | Log.d("AvailableLanguages", "LanguagesMapSize is: " + languagesMap.size()); 70 | for (Map.Entry entry : languagesMap.entrySet()) { 71 | languages.add(new AvailableLanguage(entry.getKey(), entry.getValue())); 72 | } 73 | } catch (Exception e) { 74 | //ignore 75 | Log.e("AvailableLanguage", "fromJson throw an exception"); 76 | } 77 | return languages; 78 | } 79 | 80 | @Nullable 81 | public Language getLoadedLanguage() { 82 | return mLoadedLanguage; 83 | } 84 | 85 | @NonNull 86 | public String getLanguage() { 87 | return mLanguage; 88 | } 89 | 90 | public int getOtherPageId() { 91 | return mOtherPageId; 92 | } 93 | 94 | @NonNull 95 | public static AvailableLanguage loadFrom(@NonNull Cursor cursor) { 96 | String shortLanguage = cursor.getString(cursor.getColumnIndex(CacheHelper.PAGE_AVAIL_PAGE_LANGUAGE)); 97 | int otherPageId = cursor.getInt(cursor.getColumnIndex(CacheHelper.PAGE_AVAIL_OTHER_PAGE)); 98 | int ownPageId = cursor.getInt(cursor.getColumnIndex(CacheHelper.PAGE_AVAIL_PAGE_ID)); 99 | AvailableLanguage language = new AvailableLanguage(shortLanguage, otherPageId); 100 | language.setOwnPageId(ownPageId); 101 | return language; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/common/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.common; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import com.google.gson.JsonObject; 23 | 24 | import java.io.Serializable; 25 | import java.text.ParseException; 26 | 27 | import augsburg.se.alltagsguide.utilities.Helper; 28 | import augsburg.se.alltagsguide.utilities.Objects; 29 | import roboguice.util.Ln; 30 | 31 | /** 32 | * Created by Daniel-L on 08.10.2015. 33 | */ 34 | public class Event implements Serializable { 35 | private int mId; 36 | private long mStartTime; 37 | private long mEndTime; 38 | private boolean mAllDay; 39 | private int mPageId; 40 | 41 | public Event(int id, long startTime, long endTime, boolean allDay, int pageId) { 42 | mId = id; 43 | mStartTime = startTime; 44 | mEndTime = endTime; 45 | mAllDay = allDay; 46 | mPageId = pageId; 47 | } 48 | 49 | public boolean isAllDay() { 50 | return mAllDay; 51 | } 52 | 53 | public int getId() { 54 | return mId; 55 | } 56 | 57 | public int getPageId() { 58 | return mPageId; 59 | } 60 | 61 | public long getStartTime() { 62 | return mStartTime; 63 | } 64 | 65 | public long getEndTime() { 66 | return mEndTime; 67 | } 68 | 69 | public 70 | @NonNull 71 | static Event fromJson(@NonNull final JsonObject jsonEvent, int pageId) { 72 | int id = jsonEvent.get("id").getAsInt(); 73 | String startDate = jsonEvent.get("start_date").getAsString(); 74 | String endDate = jsonEvent.get("end_date").getAsString(); 75 | String startTime = jsonEvent.get("start_time").getAsString(); 76 | String endTime = jsonEvent.get("end_time").getAsString(); 77 | boolean allDay = jsonEvent.get("all_day").getAsInt() == 1; 78 | 79 | long start = -1; 80 | long end = -1; 81 | try { 82 | start = Helper.FROM_DATE_FORMAT.parse(startDate + " " + Objects.emptyIfNull(startTime)).getTime(); 83 | end = Helper.FROM_DATE_FORMAT.parse(endDate + " " + Objects.emptyIfNull(endTime)).getTime(); 84 | } catch (ParseException e) { 85 | Ln.e(e); 86 | 87 | } 88 | return new Event(id, start, end, allDay, pageId); 89 | } 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/common/EventTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.common; 19 | 20 | import android.database.Cursor; 21 | import android.support.annotation.NonNull; 22 | import android.support.annotation.Nullable; 23 | 24 | import com.google.gson.JsonArray; 25 | import com.google.gson.JsonObject; 26 | 27 | import java.io.Serializable; 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | import augsburg.se.alltagsguide.persistence.CacheHelper; 32 | import augsburg.se.alltagsguide.utilities.Helper; 33 | 34 | /** 35 | * Created by Daniel-L on 09.10.2015. 36 | */ 37 | public class EventTag implements Serializable { 38 | @NonNull private String mName; 39 | private int mEventId; 40 | 41 | public EventTag(@NonNull String name) { 42 | mName = name; 43 | } 44 | 45 | @NonNull 46 | public String getName() { 47 | return mName; 48 | } 49 | 50 | @NonNull 51 | public static EventTag fromJson(@NonNull final JsonObject jsonTag) { 52 | String name = Helper.getStringOrDefault(jsonTag.get("name"), ""); 53 | //TODO Tags have an id now. 54 | return new EventTag(name); 55 | } 56 | 57 | @NonNull 58 | public static List fromJson(@NonNull JsonArray array) { 59 | List tags = new ArrayList<>(); 60 | for (int i = 0; i < array.size(); i++) { 61 | EventTag tag = fromJson(array.get(i).getAsJsonObject()); 62 | tags.add(tag); 63 | } 64 | return tags; 65 | } 66 | 67 | @NonNull 68 | public static EventTag loadFrom(@NonNull Cursor cursor) { 69 | EventTag tag = new EventTag(cursor.getString(cursor.getColumnIndex(CacheHelper.EVENT_TAG_NAME))); //TODO sooner or later to TAG_NAME with join 70 | tag.setEventId(cursor.getColumnIndex(CacheHelper.EVENT_TAG_EVENT_ID)); 71 | return tag; 72 | } 73 | 74 | @Nullable 75 | @Override 76 | public String toString() { 77 | return mName; 78 | } 79 | 80 | public int getEventId() { 81 | return mEventId; 82 | } 83 | 84 | private void setEventId(int eventId) { 85 | mEventId = eventId; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/common/Language.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.common; 19 | 20 | import android.database.Cursor; 21 | import android.support.annotation.NonNull; 22 | import android.support.annotation.Nullable; 23 | 24 | import com.google.gson.JsonObject; 25 | 26 | import java.io.Serializable; 27 | 28 | import augsburg.se.alltagsguide.persistence.CacheHelper; 29 | import augsburg.se.alltagsguide.utilities.Newer; 30 | 31 | /** 32 | * Created by Daniel-L on 16.08.2015. 33 | */ 34 | public class Language implements Serializable, Newer { 35 | 36 | private int mId; 37 | @NonNull private String mShortName; 38 | @NonNull private String mName; 39 | @Nullable private String mIconPath; 40 | @Nullable private Location mLocation; 41 | 42 | public Language(int id, @NonNull String shortName, @NonNull String name, @Nullable String iconPath) { 43 | mId = id; 44 | mShortName = shortName; 45 | mName = name; 46 | mIconPath = iconPath; 47 | } 48 | 49 | @Override 50 | public int compareTo(@NonNull Language another) { 51 | return mShortName.compareTo(another.mShortName); 52 | } 53 | 54 | public void setLocation(@NonNull Location location) { 55 | mLocation = location; 56 | } 57 | 58 | @Nullable 59 | public Location getLocation() { 60 | return mLocation; 61 | } 62 | 63 | @Override 64 | public String toString() { 65 | return mShortName; 66 | } 67 | 68 | @NonNull 69 | public static Language fromJson(JsonObject jsonPage) { 70 | int id = jsonPage.get("id").getAsInt(); 71 | String shortName = jsonPage.get("code").getAsString(); 72 | String nativeName = jsonPage.get("native_name").getAsString(); 73 | String countryFlagUrl = jsonPage.get("country_flag_url").getAsString(); 74 | return new Language(id, shortName, nativeName, countryFlagUrl); 75 | } 76 | 77 | public int getId() { 78 | return mId; 79 | } 80 | 81 | @Nullable 82 | public String getIconPath() { 83 | return mIconPath; 84 | } 85 | 86 | @NonNull 87 | public String getName() { 88 | return mName; 89 | } 90 | 91 | @NonNull 92 | public String getShortName() { 93 | return mShortName; 94 | } 95 | 96 | @Override 97 | public boolean equals(@NonNull Object another) { 98 | return another instanceof Language && mId == ((Language) another).getId(); 99 | } 100 | 101 | @NonNull 102 | public static Language fromCursor(@NonNull Cursor cursor) { 103 | int id = cursor.getInt(cursor.getColumnIndex(CacheHelper.LANGUAGE_ID)); 104 | String shortName = cursor.getString(cursor.getColumnIndex(CacheHelper.LANGUAGE_SHORT)); 105 | String name = cursor.getString(cursor.getColumnIndex(CacheHelper.LANGUAGE_NAME)); 106 | String path = cursor.getString(cursor.getColumnIndex(CacheHelper.LANGUAGE_PATH)); 107 | return new Language(id, shortName, name, path); 108 | } 109 | 110 | @Override 111 | public long getTimestamp() { 112 | return -1; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/common/UpdateTime.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.common; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import java.io.Serializable; 23 | import java.util.Date; 24 | 25 | import augsburg.se.alltagsguide.utilities.Helper; 26 | 27 | /** 28 | * Created by Daniel-L on 23.09.2015. 29 | */ 30 | public class UpdateTime implements Serializable { 31 | @NonNull private String mDate; 32 | private static final int OFFSET = 1000; 33 | 34 | public UpdateTime(long time) { 35 | mDate = Helper.TO_DATE_FORMAT.format(new Date(time + OFFSET)); 36 | } 37 | 38 | @NonNull 39 | @Override 40 | public String toString() { 41 | return mDate; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/gcm/GCMCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.gcm; 19 | 20 | import android.content.Context; 21 | 22 | public abstract class GCMCommand { 23 | public abstract void execute(Context context, String type, String extraData); 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/gcm/GCMIntentService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.gcm; 19 | 20 | import android.content.Context; 21 | import android.content.Intent; 22 | 23 | import com.google.android.gcm.GCMBaseIntentService; 24 | 25 | import java.util.Collections; 26 | import java.util.HashMap; 27 | import java.util.Map; 28 | 29 | import augsburg.se.alltagsguide.gcm.command.AnnouncementCommand; 30 | import augsburg.se.alltagsguide.gcm.command.TestCommand; 31 | import augsburg.se.alltagsguide.utilities.CommonUtilities; 32 | import roboguice.util.Ln; 33 | 34 | /** 35 | * {@link android.app.IntentService} responsible for handling GCM messages. 36 | */ 37 | public class GCMIntentService extends GCMBaseIntentService { 38 | 39 | private static final Map MESSAGE_RECEIVERS; 40 | 41 | static { 42 | // Known messages and their GCM message receivers 43 | Map receivers = new HashMap<>(); 44 | receivers.put("test", new TestCommand()); 45 | receivers.put("announcement", new AnnouncementCommand()); 46 | MESSAGE_RECEIVERS = Collections.unmodifiableMap(receivers); 47 | } 48 | 49 | public GCMIntentService() { 50 | super(CommonUtilities.SENDER_ID); 51 | } 52 | 53 | @Override 54 | protected void onRegistered(Context context, String regId) { 55 | Ln.i("Device registered: regId=" + regId); 56 | } 57 | 58 | @Override 59 | protected void onUnregistered(Context context, String regId) { 60 | Ln.i("Device unregistered"); 61 | } 62 | 63 | @Override 64 | protected void onMessage(Context context, Intent intent) { 65 | String action = intent.getStringExtra("action"); 66 | String extraData = intent.getStringExtra("extraData"); 67 | Ln.d("Got GCM message, action=" + action + ", extraData=" + extraData); 68 | 69 | if (action == null) { 70 | Ln.e("Message received without command action"); 71 | return; 72 | } 73 | 74 | action = action.toLowerCase(); 75 | GCMCommand command = MESSAGE_RECEIVERS.get(action); 76 | if (command == null) { 77 | Ln.e("Unknown command received: " + action); 78 | } else { 79 | command.execute(this, action, extraData); 80 | } 81 | 82 | } 83 | 84 | @Override 85 | public void onError(Context context, String errorId) { 86 | Ln.e("Received error: " + errorId); 87 | } 88 | 89 | @Override 90 | protected boolean onRecoverableError(Context context, String errorId) { 91 | // log message 92 | Ln.w("Received recoverable error: " + errorId); 93 | return super.onRecoverableError(context, errorId); 94 | } 95 | } -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/gcm/GCMRedirectedBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.gcm; 19 | 20 | import android.content.Context; 21 | 22 | import com.google.android.gcm.GCMBroadcastReceiver; 23 | 24 | public class GCMRedirectedBroadcastReceiver extends GCMBroadcastReceiver { 25 | 26 | /** 27 | * Gets the class name of the intent service that will handle GCM messages. 28 | * 29 | * Used to override class name, so that GCMIntentService can live in a 30 | * subpackage. 31 | */ 32 | @Override 33 | protected String getGCMIntentServiceClassName(Context context) { 34 | return GCMIntentService.class.getCanonicalName(); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/gcm/command/AnnouncementCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.gcm.command; 19 | 20 | import android.app.NotificationManager; 21 | import android.app.PendingIntent; 22 | import android.content.Context; 23 | import android.content.Intent; 24 | import android.support.v4.app.NotificationCompat; 25 | import android.support.v4.content.ContextCompat; 26 | 27 | import augsburg.se.alltagsguide.R; 28 | import augsburg.se.alltagsguide.gcm.GCMCommand; 29 | import augsburg.se.alltagsguide.overview.OverviewActivity; 30 | import roboguice.util.Ln; 31 | 32 | public class AnnouncementCommand extends GCMCommand { 33 | 34 | @Override 35 | public void execute(Context context, String type, String extraData) { 36 | Ln.i("Received GCM message: " + type); 37 | displayNotification(context, extraData); 38 | } 39 | 40 | private void displayNotification(Context context, String message) { 41 | Ln.i("Displaying notification: " + message); 42 | ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)) 43 | .notify(0, new NotificationCompat.Builder(context) 44 | .setWhen(System.currentTimeMillis()) 45 | .setSmallIcon(R.mipmap.ic_launcher) 46 | .setTicker(message) 47 | .setContentTitle(context.getString(R.string.app_name)) 48 | .setContentText(message) 49 | .setColor(ContextCompat.getColor(context, R.color.primary)) 50 | .setContentIntent( 51 | PendingIntent.getActivity(context, 0, 52 | new Intent(context, OverviewActivity.class) 53 | .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | 54 | Intent.FLAG_ACTIVITY_SINGLE_TOP), 55 | 0)) 56 | .setAutoCancel(true) 57 | .build()); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/gcm/command/TestCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.gcm.command; 19 | 20 | import android.content.Context; 21 | 22 | import augsburg.se.alltagsguide.gcm.GCMCommand; 23 | import roboguice.util.Ln; 24 | 25 | /** 26 | * Created by Daniel-L on 18.10.2015. 27 | */ 28 | public class TestCommand extends GCMCommand { 29 | 30 | @Override 31 | public void execute(Context context, String type, String extraData) { 32 | Ln.i("Received GCM message: type=" + type + ", extraData=" + extraData); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/network/DisclaimersLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.network; 19 | 20 | import android.content.Context; 21 | import android.support.annotation.NonNull; 22 | 23 | import com.google.inject.Inject; 24 | 25 | import java.io.IOException; 26 | import java.util.Collections; 27 | import java.util.List; 28 | 29 | import augsburg.se.alltagsguide.common.AvailableLanguage; 30 | import augsburg.se.alltagsguide.common.Language; 31 | import augsburg.se.alltagsguide.common.Location; 32 | import augsburg.se.alltagsguide.common.Page; 33 | import augsburg.se.alltagsguide.persistence.resources.AvailableLanguageResource; 34 | import augsburg.se.alltagsguide.persistence.resources.DisclaimerResource; 35 | import augsburg.se.alltagsguide.utilities.BasicLoader; 36 | import augsburg.se.alltagsguide.utilities.LoadingType; 37 | import roboguice.util.Ln; 38 | 39 | /** 40 | * Created by Daniel-L on 07.09.2015. 41 | */ 42 | public class DisclaimersLoader extends BasicLoader> { 43 | 44 | @NonNull private Location mLocation; 45 | @NonNull private Language mLanguage; 46 | 47 | @Inject 48 | private DisclaimerResource.Factory pagesFactory; 49 | 50 | @Inject 51 | private AvailableLanguageResource.Factory availableLanguageFactory; 52 | 53 | /** 54 | * Create loader for context 55 | * 56 | * @param context 57 | */ 58 | public DisclaimersLoader(Context context, @NonNull Location location, @NonNull Language language, LoadingType loadingType) { 59 | super(context, loadingType); 60 | mLocation = location; 61 | mLanguage = language; 62 | } 63 | 64 | 65 | 66 | @NonNull 67 | @Override 68 | public List load() { 69 | try { 70 | List pages = get(pagesFactory.under(mLanguage, mLocation)); 71 | List languages = dbCache.load(availableLanguageFactory.under(mLanguage, mLocation)); 72 | Page.recreateRelations(pages, languages, mLanguage); 73 | return pages; 74 | } catch (IOException e) { 75 | Ln.e(e); 76 | return Collections.emptyList(); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/network/EventPagesLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.network; 19 | 20 | import android.content.Context; 21 | import android.support.annotation.NonNull; 22 | 23 | import com.google.inject.Inject; 24 | 25 | import java.io.IOException; 26 | import java.util.Collections; 27 | import java.util.List; 28 | 29 | import augsburg.se.alltagsguide.common.AvailableLanguage; 30 | import augsburg.se.alltagsguide.common.EventCategory; 31 | import augsburg.se.alltagsguide.common.EventPage; 32 | import augsburg.se.alltagsguide.common.EventTag; 33 | import augsburg.se.alltagsguide.common.Language; 34 | import augsburg.se.alltagsguide.common.Location; 35 | import augsburg.se.alltagsguide.persistence.DatabaseCache; 36 | import augsburg.se.alltagsguide.persistence.resources.AvailableLanguageResource; 37 | import augsburg.se.alltagsguide.persistence.resources.EventCategoryResource; 38 | import augsburg.se.alltagsguide.persistence.resources.EventPageResource; 39 | import augsburg.se.alltagsguide.persistence.resources.EventTagResource; 40 | import augsburg.se.alltagsguide.utilities.BasicLoader; 41 | import augsburg.se.alltagsguide.utilities.LoadingType; 42 | import roboguice.util.Ln; 43 | 44 | /** 45 | * Created by Daniel-L on 07.09.2015. 46 | */ 47 | public class EventPagesLoader extends BasicLoader> { 48 | 49 | @Inject 50 | private DatabaseCache dbCache; 51 | @NonNull private Location mLocation; 52 | @NonNull private Language mLanguage; 53 | 54 | @Inject 55 | private EventPageResource.Factory pagesFactory; 56 | 57 | @Inject 58 | private EventCategoryResource.Factory categoriesFactory; 59 | 60 | @Inject 61 | private EventTagResource.Factory tagsFactory; 62 | 63 | @Inject 64 | private AvailableLanguageResource.Factory languageFactory; 65 | 66 | /** 67 | * Create loader for context 68 | * 69 | * @param context 70 | */ 71 | public EventPagesLoader(Context context, @NonNull Location location, @NonNull Language language, LoadingType loadingType) { 72 | super(context, loadingType); 73 | mLocation = location; 74 | mLanguage = language; 75 | } 76 | 77 | @Override 78 | public List load() { 79 | try { 80 | List pages = get(pagesFactory.under(mLanguage, mLocation)); 81 | List categories = dbCache.load(categoriesFactory.under(mLanguage, mLocation)); 82 | List tags = dbCache.load(tagsFactory.under(mLanguage, mLocation)); 83 | List languages = dbCache.load(languageFactory.under(mLanguage, mLocation)); 84 | EventPage.recreateRelations(pages, categories, tags, languages, mLanguage); 85 | return pages; 86 | } catch (IOException e) { 87 | Ln.e(e); 88 | return Collections.emptyList(); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/network/LanguageLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.network; 19 | 20 | import android.content.Context; 21 | import android.support.annotation.NonNull; 22 | 23 | import com.google.inject.Inject; 24 | 25 | import java.io.IOException; 26 | import java.util.Collections; 27 | import java.util.List; 28 | 29 | import augsburg.se.alltagsguide.common.Language; 30 | import augsburg.se.alltagsguide.common.Location; 31 | import augsburg.se.alltagsguide.persistence.DatabaseCache; 32 | import augsburg.se.alltagsguide.persistence.resources.LanguageResource; 33 | import augsburg.se.alltagsguide.utilities.BasicLoader; 34 | import augsburg.se.alltagsguide.utilities.LoadingType; 35 | import roboguice.util.Ln; 36 | 37 | /** 38 | * Created by Daniel-L on 07.09.2015. 39 | */ 40 | public class LanguageLoader extends BasicLoader> { 41 | 42 | @Inject 43 | private LanguageResource.Factory languageFactory; 44 | @Inject 45 | private DatabaseCache db; 46 | 47 | @NonNull 48 | private Location mLocation; 49 | 50 | /** 51 | * Create loader for context 52 | * 53 | * @param context 54 | */ 55 | public LanguageLoader(Context context, @NonNull Location location, LoadingType loadingType) { 56 | super(context, loadingType); 57 | mLocation = location; 58 | } 59 | 60 | 61 | @Override 62 | public List load() { 63 | try { 64 | return get(languageFactory.under(mLocation)); 65 | } catch (IOException e) { 66 | Ln.e(e); 67 | return Collections.emptyList(); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/network/LocationLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.network; 19 | 20 | import android.content.Context; 21 | 22 | import com.google.inject.Inject; 23 | 24 | import java.io.IOException; 25 | import java.util.Collections; 26 | import java.util.List; 27 | 28 | import augsburg.se.alltagsguide.common.Location; 29 | import augsburg.se.alltagsguide.persistence.DatabaseCache; 30 | import augsburg.se.alltagsguide.persistence.resources.LocationResource; 31 | import augsburg.se.alltagsguide.utilities.BasicLoader; 32 | import augsburg.se.alltagsguide.utilities.LoadingType; 33 | import roboguice.util.Ln; 34 | 35 | /** 36 | * Created by Daniel-L on 07.09.2015. 37 | */ 38 | public class LocationLoader extends BasicLoader> { 39 | 40 | @Inject 41 | private DatabaseCache dbCache; 42 | @Inject 43 | private LocationResource locationResource; 44 | 45 | /** 46 | * Create loader for context 47 | * 48 | * @param context 49 | */ 50 | public LocationLoader(Context context, LoadingType loadingType) { 51 | super(context, loadingType); 52 | } 53 | 54 | @Override 55 | public List load() { 56 | try { 57 | return get(locationResource); 58 | } catch (IOException e) { 59 | Ln.e(e); 60 | return Collections.emptyList(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/network/NetworkService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.network; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import java.util.List; 23 | 24 | import augsburg.se.alltagsguide.common.EventPage; 25 | import augsburg.se.alltagsguide.common.Language; 26 | import augsburg.se.alltagsguide.common.Location; 27 | import augsburg.se.alltagsguide.common.Page; 28 | import augsburg.se.alltagsguide.common.UpdateTime; 29 | import retrofit.Callback; 30 | import retrofit.http.GET; 31 | import retrofit.http.Path; 32 | import retrofit.http.Query; 33 | 34 | /** 35 | * Created by Daniel-L on 28.07.2015. 36 | */ 37 | public interface NetworkService { 38 | @GET("/alive") 39 | @NonNull 40 | Boolean isServerAlive(); 41 | 42 | @GET("/{location}/{language}/wp-json/extensions/v0/modified_content/pages") 43 | @NonNull 44 | List getPages(@NonNull @Path("language") Language language, @NonNull @Path(value = "location", encode = false) Location location, @NonNull @Query("since") UpdateTime time); 45 | 46 | @GET("/{location}/{language}/wp-json/extensions/v0/modified_content/events") 47 | @NonNull 48 | List getEventPages(@NonNull @Path("language") Language language, @NonNull @Path(value = "location", encode = false) Location location, @NonNull @Query("since") UpdateTime time); 49 | 50 | @GET("/wordpress/wp-json/extensions/v1/multisites/") 51 | @NonNull 52 | List getAvailableLocations(); 53 | 54 | @GET("/{location}/de/wp-json/extensions/v0/languages/wpml") 55 | @NonNull 56 | List getAvailableLanguages(@NonNull @Path(value = "location", encode = false) Location location); 57 | 58 | @GET("/{location}") 59 | void subscribePush(@NonNull @Path(value = "location", encode = false) Location location, @NonNull @Query("gcm_register_id") String regId, @NonNull Callback callback); 60 | 61 | @GET("/{location}") 62 | void unsubscribePush(@NonNull @Path(value = "location", encode = false) Location location, @NonNull @Query("gcm_unregister_id") String regId, @NonNull Callback callback); 63 | 64 | 65 | @GET("/{location}/{language}/wp-json/extensions/v0/modified_content/disclaimer") 66 | @NonNull 67 | List getDisclaimers(@NonNull @Path("language") Language language, @NonNull @Path(value = "location", encode = false) Location location, @NonNull @Query("since") UpdateTime time); 68 | 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/network/PageLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.network; 19 | 20 | import android.app.Activity; 21 | import android.content.Context; 22 | import android.support.annotation.NonNull; 23 | import android.support.annotation.Nullable; 24 | 25 | import com.google.inject.Inject; 26 | 27 | import java.io.IOException; 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | import augsburg.se.alltagsguide.common.AvailableLanguage; 32 | import augsburg.se.alltagsguide.common.Language; 33 | import augsburg.se.alltagsguide.common.Location; 34 | import augsburg.se.alltagsguide.common.Page; 35 | import augsburg.se.alltagsguide.persistence.DatabaseCache; 36 | import augsburg.se.alltagsguide.persistence.resources.AvailableLanguageResource; 37 | import augsburg.se.alltagsguide.persistence.resources.PageResource; 38 | import augsburg.se.alltagsguide.utilities.BasicLoader; 39 | import augsburg.se.alltagsguide.utilities.LoadingType; 40 | import roboguice.util.Ln; 41 | 42 | /** 43 | * Created by Daniel-L on 07.09.2015. 44 | */ 45 | public class PageLoader extends BasicLoader { 46 | 47 | @Inject 48 | private DatabaseCache dbCache; 49 | @NonNull private Location mLocation; 50 | @NonNull private Language mLanguage; 51 | private int mId; 52 | 53 | @Inject 54 | private PageResource.Factory pagesFactory; 55 | 56 | @Inject 57 | private AvailableLanguageResource.Factory availableLanguageFactory; 58 | 59 | 60 | /** 61 | * Create loader for context 62 | * 63 | * @param context 64 | */ 65 | public PageLoader(Context context, @NonNull Location location, @NonNull Language language, int id) { 66 | super(context, LoadingType.NETWORK_OR_DATABASE); 67 | mLocation = location; 68 | mLanguage = language; 69 | mId = id; 70 | } 71 | 72 | @Nullable 73 | @Override 74 | public Page load() { 75 | PageResource resource = pagesFactory.under(mLanguage, mLocation); 76 | try { 77 | Page translatedPage = dbCache.load(resource, mId); 78 | if (translatedPage == null) { 79 | dbCache.requestAndStore(resource); 80 | translatedPage = dbCache.load(resource, mId); 81 | if (translatedPage == null) { 82 | return null; 83 | } 84 | } 85 | List pages = new ArrayList<>(); 86 | pages.add(translatedPage); 87 | List languages = dbCache.load(availableLanguageFactory.under(mLanguage, mLocation)); 88 | Page.recreateRelations(pages, languages, mLanguage); 89 | for (Page page : pages) { 90 | if (page.getId() == mId) { 91 | return page; 92 | } 93 | } 94 | } catch (IOException e) { 95 | Ln.e(e); 96 | } 97 | return null; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/page/PageActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.page; 19 | 20 | import android.os.Bundle; 21 | import android.support.v4.content.Loader; 22 | 23 | import augsburg.se.alltagsguide.R; 24 | import augsburg.se.alltagsguide.common.AvailableLanguage; 25 | import augsburg.se.alltagsguide.common.Page; 26 | import augsburg.se.alltagsguide.network.PageLoader; 27 | import augsburg.se.alltagsguide.utilities.ui.BasePageWebViewLanguageActivity; 28 | import roboguice.inject.ContentView; 29 | import roboguice.util.Ln; 30 | 31 | @ContentView(R.layout.activity_page) 32 | public class PageActivity extends BasePageWebViewLanguageActivity { 33 | 34 | protected void setMorePageDetails(Page page) { 35 | } 36 | 37 | @Override 38 | public Loader onCreateLoader(int id, Bundle args) { 39 | AvailableLanguage language = (AvailableLanguage) args.getSerializable(ARG_LANGUAGE); 40 | if (language == null || language.getLoadedLanguage() == null) { 41 | Ln.d("AvailableLanguage is null or has no language."); 42 | return null; 43 | } 44 | return new PageLoader(this, mPrefUtilities.getLocation(), language.getLoadedLanguage(), language.getOtherPageId()); 45 | } 46 | 47 | @Override 48 | protected String getScreenName() { 49 | if (mPage == null || mPage.getLanguage() == null || mPage.getLanguage().getLocation() == null){ 50 | return "PageActivity"; 51 | } 52 | return String.format("Page(%s|%s|%s)", 53 | mPage.getLanguage().getLocation().getName(), 54 | mPage.getLanguage().getName(), 55 | mPage.getId()); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/persistence/DatabaseInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.persistence; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | /** 23 | * Created by Daniel-L on 02.10.2015. 24 | */ 25 | public class DatabaseInfo { 26 | 27 | public DatabaseInfo(@NonNull String name, int version) { 28 | this.name = name; 29 | this.version = version; 30 | } 31 | 32 | @NonNull 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | public int getVersion() { 38 | return version; 39 | } 40 | 41 | @NonNull private final String name; 42 | private final int version; 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/persistence/resources/DisclaimerResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.persistence.resources; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import com.google.inject.Inject; 23 | import com.google.inject.assistedinject.Assisted; 24 | 25 | 26 | import java.util.Date; 27 | import java.util.List; 28 | 29 | import augsburg.se.alltagsguide.common.Language; 30 | import augsburg.se.alltagsguide.common.Location; 31 | import augsburg.se.alltagsguide.common.Page; 32 | import augsburg.se.alltagsguide.common.UpdateTime; 33 | import augsburg.se.alltagsguide.network.NetworkService; 34 | import augsburg.se.alltagsguide.persistence.DatabaseCache; 35 | import augsburg.se.alltagsguide.utilities.PrefUtilities; 36 | 37 | /** 38 | * Created by Daniel-L on 07.09.2015. 39 | */ 40 | public class DisclaimerResource extends PageResource { 41 | 42 | @Override 43 | public String getType() { 44 | return "disclaimer"; 45 | } 46 | /** 47 | * Creation factory 48 | */ 49 | public interface Factory { 50 | DisclaimerResource under(Language lang, Location loc); 51 | } 52 | 53 | @Inject 54 | public DisclaimerResource(@NonNull @Assisted Language language, @NonNull @Assisted Location location, @NonNull NetworkService network, @NonNull DatabaseCache cache, @NonNull PrefUtilities preferences) { 55 | super(language, location, network, cache, preferences); 56 | } 57 | 58 | @NonNull 59 | @Override 60 | public List request() { 61 | UpdateTime time = new UpdateTime(getLastModificationDate()); 62 | return mNetwork.getDisclaimers(mLanguage, mLocation, time); 63 | } 64 | 65 | @Override 66 | public boolean shouldUpdate() { 67 | long lastUpdate = mPreferences.lastPageDisclaimerUpdateTime(mLanguage, mLocation); 68 | long now = new Date().getTime(); 69 | long updateCachingTime = 1000 * 60 * 60 * 4; // 4 hours 70 | return now - lastUpdate > updateCachingTime; 71 | } 72 | 73 | @Override 74 | public void loadedFromNetwork() { 75 | mPreferences.setLastPageDisclaimerUpdateTime(mLanguage, mLocation); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/persistence/resources/PersistableNetworkResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.persistence.resources; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import java.io.IOException; 23 | import java.util.List; 24 | 25 | /** 26 | * Describes how to store, load or get-an-update-for a particular set of 27 | * data. 28 | * 29 | * @param type of item 30 | */ 31 | public interface PersistableNetworkResource extends PersistableResource { 32 | /** 33 | * Request the data directly from the GitHub API, rather than attempting to 34 | * load it from the DB cache. 35 | * 36 | * @return list of items 37 | * @throws IOException 38 | */ 39 | @NonNull 40 | List request() throws IOException; 41 | 42 | /** 43 | * Determines if a update should be made 44 | * 45 | * @return true, if update is required, false otherwise 46 | */ 47 | boolean shouldUpdate(); 48 | 49 | void loadedFromNetwork(); 50 | } -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/persistence/resources/PersistableResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.persistence.resources; 19 | 20 | import android.database.Cursor; 21 | import android.database.sqlite.SQLiteDatabase; 22 | import android.support.annotation.NonNull; 23 | import android.support.annotation.Nullable; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * Describes how to store, load or get-an-update-for a particular set of 29 | * data. 30 | * 31 | * @param type of item 32 | */ 33 | public interface PersistableResource { 34 | 35 | /** 36 | * @param readableDatabase 37 | * @return a cursor capable of reading the required information out of the 38 | * database. 39 | */ 40 | @NonNull 41 | Cursor getCursor(@NonNull SQLiteDatabase readableDatabase); 42 | 43 | /** 44 | * @param readableDatabase 45 | * @return a cursor capable of reading the required information out of the 46 | * database. 47 | */ 48 | @NonNull 49 | Cursor getCursor(@NonNull SQLiteDatabase readableDatabase, int id); 50 | 51 | /** 52 | * @param cursor 53 | * @param db for having n:m joins 54 | * @return a single item, read from this row of the cursor 55 | */ 56 | @Nullable 57 | E loadFrom(@NonNull Cursor cursor, @NonNull SQLiteDatabase db); 58 | 59 | /** 60 | * Store supplied items in DB, removing or updating prior entries 61 | * 62 | * @param writableDatabase 63 | * @param items 64 | */ 65 | void store(@NonNull SQLiteDatabase writableDatabase, 66 | @NonNull List items); 67 | 68 | } -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/serialization/EventPageSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.serialization; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import com.google.gson.JsonArray; 23 | import com.google.gson.JsonDeserializationContext; 24 | import com.google.gson.JsonDeserializer; 25 | import com.google.gson.JsonElement; 26 | import com.google.gson.JsonObject; 27 | import com.google.gson.JsonParseException; 28 | 29 | import java.lang.reflect.Type; 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | import java.util.Stack; 33 | 34 | import augsburg.se.alltagsguide.common.EventPage; 35 | 36 | /** 37 | * Created by Daniel-L on 20.09.2015. 38 | */ 39 | public class EventPageSerializer implements JsonDeserializer> { 40 | @NonNull 41 | @Override 42 | public List deserialize(@NonNull JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 43 | if (!json.isJsonArray()){ 44 | return new ArrayList<>(); 45 | } 46 | return parsePages(json.getAsJsonArray()); 47 | } 48 | 49 | @NonNull 50 | private List parsePages(@NonNull final JsonArray jsonPages) { 51 | List rootPages = getPagesByParentId(null, 0, jsonPages); 52 | Stack pagesLeft = new Stack<>(); 53 | pagesLeft.addAll(rootPages); 54 | while (!pagesLeft.isEmpty()) { 55 | EventPage page = pagesLeft.pop(); 56 | List subPages = getPagesByParentId(page, page.getId(), jsonPages); 57 | for (EventPage subPage : subPages) { 58 | page.getSubPages().add(subPage); 59 | } 60 | for (EventPage subPage : subPages) { 61 | pagesLeft.push(subPage); 62 | } 63 | } 64 | return rootPages; 65 | } 66 | 67 | @NonNull 68 | private List getPagesByParentId(final EventPage parent, final int parentId, @NonNull final JsonArray jsonPages) { 69 | final List result = new ArrayList<>(); 70 | for (int i = 0; i < jsonPages.size(); i++) { 71 | JsonObject jsonPage = jsonPages.get(i).getAsJsonObject(); 72 | if (jsonPage.get("parent").getAsInt() == parentId) { 73 | EventPage page = EventPage.fromJson(jsonPage); 74 | page.setParent(parent); 75 | result.add(page); 76 | } 77 | } 78 | return result; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/serialization/LanguageSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.serialization; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import com.google.gson.JsonArray; 23 | import com.google.gson.JsonDeserializationContext; 24 | import com.google.gson.JsonDeserializer; 25 | import com.google.gson.JsonElement; 26 | import com.google.gson.JsonParseException; 27 | 28 | import java.lang.reflect.Type; 29 | import java.util.ArrayList; 30 | import java.util.List; 31 | 32 | import augsburg.se.alltagsguide.common.Language; 33 | 34 | /** 35 | * Created by Daniel-L on 20.09.2015. 36 | */ 37 | public class LanguageSerializer implements JsonDeserializer> { 38 | 39 | 40 | @NonNull 41 | @Override 42 | public List deserialize(@NonNull JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 43 | if (!json.isJsonArray()){ 44 | return new ArrayList<>(); 45 | } 46 | List languages = parseLanguages(json.getAsJsonArray()); 47 | printLanguages(languages); 48 | return languages; 49 | } 50 | 51 | @NonNull 52 | private List parseLanguages(@NonNull final JsonArray jsonPages) { 53 | List Languages = new ArrayList<>(); 54 | for (int i = 0; i < jsonPages.size(); i++) { 55 | Languages.add(Language.fromJson(jsonPages.get(i).getAsJsonObject())); 56 | } 57 | return Languages; 58 | } 59 | 60 | private void printLanguages(@NonNull final List Languages) { 61 | for (Language Language : Languages) { 62 | printLanguage(Language); 63 | } 64 | } 65 | 66 | 67 | private void printLanguage(@NonNull final Language Language) { 68 | System.out.println(Language.getName() + "|" + Language.getShortName() + "|" + Language.getIconPath()); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/serialization/LocationSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.serialization; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import com.google.gson.JsonArray; 23 | import com.google.gson.JsonDeserializationContext; 24 | import com.google.gson.JsonDeserializer; 25 | import com.google.gson.JsonElement; 26 | import com.google.gson.JsonParseException; 27 | 28 | import java.lang.reflect.Type; 29 | import java.util.ArrayList; 30 | import java.util.List; 31 | 32 | import augsburg.se.alltagsguide.common.Location; 33 | 34 | /** 35 | * Created by Daniel-L on 20.09.2015. 36 | */ 37 | public class LocationSerializer implements JsonDeserializer> { 38 | @NonNull 39 | @Override 40 | public List deserialize(@NonNull JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 41 | if (!json.isJsonArray()){ 42 | return new ArrayList<>(); 43 | } 44 | List locations = parseLocations(json.getAsJsonArray()); 45 | printLocations(locations); 46 | return locations; 47 | } 48 | 49 | @NonNull 50 | private List parseLocations(@NonNull final JsonArray jsonPages) { 51 | List locations = new ArrayList<>(); 52 | for (int i = 0; i < jsonPages.size(); i++) { 53 | locations.add(Location.fromJson(jsonPages.get(i).getAsJsonObject())); 54 | } 55 | return locations; 56 | } 57 | 58 | private void printLocations(@NonNull final List locations) { 59 | for (Location location : locations) { 60 | printLocation(location); 61 | } 62 | } 63 | 64 | 65 | private void printLocation(@NonNull final Location location) { 66 | System.out.println(location.getName() + "|" + location.getPath() + "|" + location.getColor()); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/serialization/PageSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.serialization; 19 | 20 | import android.support.annotation.NonNull; 21 | import android.support.annotation.Nullable; 22 | 23 | import com.google.gson.JsonArray; 24 | import com.google.gson.JsonDeserializationContext; 25 | import com.google.gson.JsonDeserializer; 26 | import com.google.gson.JsonElement; 27 | import com.google.gson.JsonObject; 28 | import com.google.gson.JsonParseException; 29 | 30 | import java.lang.reflect.Type; 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import java.util.Stack; 34 | 35 | import augsburg.se.alltagsguide.common.Page; 36 | 37 | /** 38 | * Created by Daniel-L on 20.09.2015. 39 | */ 40 | public class PageSerializer implements JsonDeserializer> { 41 | 42 | @Override 43 | public List deserialize(@NonNull JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 44 | if (!json.isJsonArray()){ 45 | return new ArrayList<>(); 46 | } 47 | return parsePages(json.getAsJsonArray()); 48 | } 49 | 50 | private List parsePages(@NonNull final JsonArray jsonPages) { 51 | List pages = new ArrayList<>(); 52 | for(int i=0;i rootPages) { 68 | printPages(rootPages, 0); 69 | } 70 | 71 | private void printPages(@NonNull final List pages, final int hierarchyLevel) { 72 | for (Page page : pages) { 73 | printIndent(hierarchyLevel); 74 | printPage(page); 75 | printPages(page.getSubPages(), hierarchyLevel + 1); 76 | } 77 | } 78 | 79 | private void printPage(@NonNull final Page page) { 80 | System.out.println(page.getId() + " | " + page.getTitle()); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/settings/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.settings; 19 | 20 | import android.content.Intent; 21 | import android.os.Bundle; 22 | import android.support.v4.content.IntentCompat; 23 | import android.support.v7.widget.Toolbar; 24 | import android.view.MenuItem; 25 | 26 | import augsburg.se.alltagsguide.R; 27 | import augsburg.se.alltagsguide.common.Page; 28 | import augsburg.se.alltagsguide.overview.OverviewActivity; 29 | import augsburg.se.alltagsguide.page.PageActivity; 30 | import augsburg.se.alltagsguide.start.WelcomeActivity; 31 | import augsburg.se.alltagsguide.utilities.ui.BaseActivity; 32 | 33 | public class SettingsActivity extends BaseActivity implements PrefFragment.OnPreferenceListener { 34 | 35 | @Override 36 | protected void onCreate(Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | setContentView(R.layout.activity_settings); 39 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 40 | setSupportActionBar(toolbar); 41 | 42 | if (savedInstanceState == null) { 43 | getSupportFragmentManager() 44 | .beginTransaction() 45 | .replace(R.id.container, new PrefFragment()) 46 | .commit(); 47 | } 48 | setTitle(getString(R.string.action_settings)); 49 | } 50 | 51 | @Override 52 | public boolean onOptionsItemSelected(MenuItem item) { 53 | switch (item.getItemId()) { 54 | // Respond to the action bar's Up/Home button 55 | case android.R.id.home: 56 | Intent intent = new Intent(this, OverviewActivity.class); 57 | intent.addFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); 58 | startActivity(intent); 59 | finish(); 60 | return true; 61 | } 62 | return super.onOptionsItemSelected(item); 63 | } 64 | 65 | @Override 66 | public void onBackPressed() { 67 | Intent intent = new Intent(this, OverviewActivity.class); 68 | intent.addFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); 69 | startActivity(intent); 70 | finish(); 71 | } 72 | 73 | @Override 74 | protected boolean shouldSetDisplayHomeAsUp() { 75 | return true; 76 | } 77 | 78 | @Override 79 | public void onOpenPage(Page page) { 80 | Intent intent = new Intent(SettingsActivity.this, PageActivity.class); 81 | intent.putExtra(PageActivity.ARG_INFO, page); 82 | startActivity(intent); 83 | } 84 | 85 | protected String getScreenName() { 86 | return "Settings"; 87 | } 88 | 89 | public void cacheCleared() { 90 | Intent intent = new Intent(SettingsActivity.this, WelcomeActivity.class); 91 | startActivity(intent); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/start/LanguageAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.start; 19 | 20 | import android.content.Context; 21 | import android.support.annotation.NonNull; 22 | import android.view.LayoutInflater; 23 | import android.view.View; 24 | import android.view.ViewGroup; 25 | import android.widget.ImageView; 26 | import android.widget.TextView; 27 | 28 | import com.google.inject.Inject; 29 | import com.makeramen.roundedimageview.RoundedTransformationBuilder; 30 | import com.marshalchen.ultimaterecyclerview.UltimateRecyclerviewViewHolder; 31 | import com.squareup.picasso.Picasso; 32 | import com.squareup.picasso.Transformation; 33 | 34 | import java.util.List; 35 | 36 | import augsburg.se.alltagsguide.R; 37 | import augsburg.se.alltagsguide.common.Language; 38 | import augsburg.se.alltagsguide.utilities.ui.BaseAdapter; 39 | 40 | /** 41 | * Created by Daniel-L on 16.08.2015. 42 | */ 43 | public class LanguageAdapter extends BaseAdapter { 44 | 45 | @NonNull private LanguageClickListener mListener; 46 | 47 | @Inject private Picasso mPicasso; 48 | 49 | 50 | public interface LanguageClickListener { 51 | void onLanguageClick(Language language); 52 | } 53 | 54 | public LanguageAdapter(@NonNull List languages, @NonNull LanguageClickListener listener, @NonNull Context context) { 55 | super(languages, context); 56 | mListener = listener; 57 | } 58 | 59 | 60 | @Override 61 | public LanguageViewHolder getViewHolder(View view) { 62 | return new LanguageViewHolder(view); 63 | } 64 | 65 | @Override 66 | public LanguageViewHolder onCreateViewHolder(ViewGroup parent) { 67 | return new LanguageViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.language_item_view, parent, false)); 68 | } 69 | 70 | Transformation transformation = new RoundedTransformationBuilder() 71 | .cornerRadiusDp(8) 72 | .oval(false) 73 | .build(); 74 | 75 | @Override 76 | public void onBindViewHolder(LanguageViewHolder holder, int position) { 77 | final Language language = get(position); 78 | holder.title.setText(language.getName()); 79 | mPicasso.load(language.getIconPath()) 80 | .transform(transformation) 81 | .placeholder(R.drawable.icon_language_loading) 82 | .error(R.drawable.icon_language_loading_error) 83 | .fit() 84 | .centerInside() 85 | .into(holder.image); 86 | holder.itemView.setOnClickListener(new View.OnClickListener() { 87 | @Override 88 | public void onClick(View v) { 89 | mListener.onLanguageClick(language); 90 | } 91 | }); 92 | } 93 | 94 | public class LanguageViewHolder extends UltimateRecyclerviewViewHolder { 95 | private TextView title; 96 | private ImageView image; 97 | 98 | public LanguageViewHolder(View itemView) { 99 | super(itemView); 100 | title = (TextView) itemView.findViewById(R.id.title); 101 | image = (ImageView) itemView.findViewById(R.id.image); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/start/LocationAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.start; 19 | 20 | import android.content.Context; 21 | import android.support.annotation.NonNull; 22 | import android.view.LayoutInflater; 23 | import android.view.View; 24 | import android.view.ViewGroup; 25 | import android.widget.ImageView; 26 | import android.widget.TextView; 27 | 28 | import com.google.inject.Inject; 29 | import com.marshalchen.ultimaterecyclerview.UltimateRecyclerviewViewHolder; 30 | import com.squareup.picasso.Picasso; 31 | 32 | import java.util.List; 33 | 34 | import augsburg.se.alltagsguide.R; 35 | import augsburg.se.alltagsguide.common.Location; 36 | import augsburg.se.alltagsguide.utilities.Objects; 37 | import augsburg.se.alltagsguide.utilities.ui.BaseAdapter; 38 | 39 | /** 40 | * Created by Daniel-L on 16.08.2015. 41 | */ 42 | public class LocationAdapter extends BaseAdapter { 43 | 44 | @NonNull private LocationClickListener mListener; 45 | @Inject private Picasso mPicasso; 46 | 47 | public interface LocationClickListener { 48 | void onLocationClick(Location location); 49 | } 50 | 51 | public LocationAdapter(@NonNull List locations, @NonNull LocationClickListener listener, @NonNull Context context) { 52 | super(locations, context); 53 | mListener = listener; 54 | } 55 | 56 | @Override 57 | public LocationViewHolder getViewHolder(View view) { 58 | return new LocationViewHolder(view); 59 | } 60 | 61 | @Override 62 | public LocationViewHolder onCreateViewHolder(ViewGroup parent) { 63 | return new LocationViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.location_item_view, parent, false)); 64 | } 65 | 66 | @Override 67 | public void onBindViewHolder(LocationViewHolder holder, int position) { 68 | final Location location = get(position); 69 | holder.title.setText(location.getName()); 70 | if (!Objects.isNullOrEmpty(location.getCityImage())) { 71 | mPicasso.load(location.getCityImage()) 72 | .placeholder(R.drawable.icon_location_loading) 73 | .error(R.drawable.icon_location_loading_error) 74 | .fit().centerCrop() 75 | .into(holder.image); 76 | } else { 77 | mPicasso.load(R.drawable.icon_location_loading); 78 | } 79 | 80 | holder.itemView.setOnClickListener(new View.OnClickListener() { 81 | @Override 82 | public void onClick(View v) { 83 | mListener.onLocationClick(location); 84 | } 85 | }); 86 | } 87 | 88 | public class LocationViewHolder extends UltimateRecyclerviewViewHolder { 89 | private TextView title; 90 | private ImageView image; 91 | 92 | public LocationViewHolder(View itemView) { 93 | super(itemView); 94 | title = (TextView) itemView.findViewById(R.id.title); 95 | image = (ImageView) itemView.findViewById(R.id.image); 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/start/WelcomeActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.start; 19 | 20 | import android.content.Intent; 21 | import android.os.Bundle; 22 | import android.support.v4.content.IntentCompat; 23 | import android.view.Menu; 24 | import android.view.MenuItem; 25 | 26 | import com.google.inject.Inject; 27 | 28 | import augsburg.se.alltagsguide.R; 29 | import augsburg.se.alltagsguide.common.Language; 30 | import augsburg.se.alltagsguide.common.Location; 31 | import augsburg.se.alltagsguide.overview.OverviewActivity; 32 | import augsburg.se.alltagsguide.utilities.ColorManager; 33 | import augsburg.se.alltagsguide.utilities.Objects; 34 | import augsburg.se.alltagsguide.utilities.ui.BaseActivity; 35 | import roboguice.inject.ContentView; 36 | 37 | @ContentView(R.layout.activity_welcome) 38 | public class WelcomeActivity extends BaseActivity implements LanguageFragment.OnLanguageFragmentInteractionListener, LocationFragment.OnLocationFragmentInteractionListener { 39 | 40 | @Inject 41 | private ColorManager mColorManager; 42 | 43 | @Override 44 | protected void onCreate(Bundle savedInstanceState) { 45 | super.onCreate(savedInstanceState); 46 | 47 | /*String preBuildLocation = getString(R.string.pre_build_location); 48 | if (!Objects.equals("", preBuildLocation)) { 49 | // location was set during gradle build, so dont show location here 50 | //throw new IllegalStateException("Not implemented yet"); 51 | }*/ 52 | if (mPrefUtilities.getLocation() != null && mPrefUtilities.getLanguage() != null) { 53 | startOverview(); 54 | } 55 | 56 | if (savedInstanceState == null) { 57 | getSupportFragmentManager() 58 | .beginTransaction() 59 | .replace(R.id.container, LocationFragment.newInstance()) 60 | .commit(); 61 | } 62 | } 63 | 64 | @Override 65 | protected void setLastColor() { 66 | //override and do nothing as we only show it when a location is selected. 67 | } 68 | 69 | @Override 70 | protected String getScreenName() { 71 | return "Welcome"; 72 | } 73 | 74 | @Override 75 | public boolean onCreateOptionsMenu(Menu menu) { 76 | getMenuInflater().inflate(R.menu.menu_welcome, menu); 77 | return true; 78 | } 79 | 80 | @Override 81 | public boolean onOptionsItemSelected(MenuItem item) { 82 | return super.onOptionsItemSelected(item); 83 | } 84 | 85 | // save values 86 | @Override 87 | public void onLanguageSelected(Location location, Language language) { 88 | mPrefUtilities.setLanguage(language); 89 | mPrefUtilities.setLocation(location); 90 | startOverview(); 91 | } 92 | 93 | private void startOverview() { 94 | Intent intent = new Intent(WelcomeActivity.this, OverviewActivity.class); 95 | intent.addFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); 96 | startActivity(intent); 97 | finish(); 98 | } 99 | 100 | @Override 101 | public void onLocationSelected(Location location) { 102 | getSupportFragmentManager() 103 | .beginTransaction() 104 | .replace(R.id.container, LanguageFragment.newInstance(location)) 105 | .addToBackStack(null) 106 | .commit(); 107 | mPrefUtilities.saveCurrentColor(location.getColor()); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/AsyncLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities; 19 | 20 | import android.content.Context; 21 | import android.support.annotation.NonNull; 22 | import android.support.v4.content.AsyncTaskLoader; 23 | 24 | import roboguice.RoboGuice; 25 | 26 | /** 27 | * Loader which extends AsyncTaskLoaders and handles caveats as pointed out in 28 | * http://code.google.com/p/android/issues/detail?id=14944. 29 | *

30 | * Based on CursorLoader.java in the Fragment compatibility package 31 | * 32 | * @param data type 33 | * @author Alexander Blom (me@alexanderblom.se) 34 | */ 35 | public abstract class AsyncLoader extends AsyncTaskLoader { 36 | 37 | private D data; 38 | 39 | /** 40 | * Create async loader 41 | * 42 | * @param context 43 | */ 44 | public AsyncLoader(@NonNull final Context context) { 45 | super(context); 46 | RoboGuice.injectMembers(context, this); 47 | } 48 | 49 | @Override 50 | public void deliverResult(final D data) { 51 | if (isReset()) { 52 | // An async query came in while the loader is stopped 53 | return; 54 | } 55 | this.data = data; 56 | super.deliverResult(data); 57 | } 58 | 59 | @Override 60 | protected void onStartLoading() { 61 | if (data != null) { 62 | deliverResult(data); 63 | } 64 | if (takeContentChanged() || data == null) { 65 | forceLoad(); 66 | } 67 | } 68 | 69 | @Override 70 | protected void onStopLoading() { 71 | // Attempt to cancel the current load task if possible. 72 | cancelLoad(); 73 | } 74 | 75 | @Override 76 | protected void onReset() { 77 | super.onReset(); 78 | // Ensure the loader is stopped 79 | onStopLoading(); 80 | data = null; 81 | } 82 | } -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/BasicLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities; 19 | 20 | import android.app.Activity; 21 | import android.content.Context; 22 | import android.os.Bundle; 23 | import android.os.Handler; 24 | import android.os.Message; 25 | import android.support.annotation.NonNull; 26 | import android.support.annotation.Nullable; 27 | 28 | import com.google.inject.Inject; 29 | 30 | import java.io.IOException; 31 | import java.util.List; 32 | 33 | import augsburg.se.alltagsguide.network.NetworkService; 34 | import augsburg.se.alltagsguide.persistence.DatabaseCache; 35 | import augsburg.se.alltagsguide.persistence.resources.PersistableNetworkResource; 36 | import roboguice.RoboGuice; 37 | import roboguice.inject.ContextScope; 38 | 39 | /** 40 | * Created by Daniel-L on 07.09.2015. 41 | */ 42 | public abstract class BasicLoader extends AsyncLoader { 43 | 44 | @Inject 45 | private ContextScope contextScope; 46 | 47 | @Inject 48 | protected NetworkService network; 49 | 50 | @Inject 51 | protected DatabaseCache dbCache; 52 | 53 | private LoadingType mLoadingType; 54 | 55 | private Handler handler; 56 | 57 | 58 | /** 59 | * Create loader for context 60 | * 61 | * @param context 62 | * @param loadingType 63 | */ 64 | public BasicLoader(@NonNull final Context context, @NonNull LoadingType loadingType) { 65 | super(context); 66 | RoboGuice.injectMembers(context, this); 67 | mLoadingType = loadingType; 68 | } 69 | 70 | protected List get(PersistableNetworkResource resource) throws IOException { 71 | switch (mLoadingType) { 72 | case FORCE_DATABASE: 73 | return dbCache.load(resource); 74 | case FORCE_NETWORK: 75 | dbCache.requestAndStore(resource); 76 | //TODO maybe consider just returning new network-data (or maybe not -> deletion more complicated) 77 | return dbCache.load(resource); 78 | case NETWORK_OR_DATABASE: 79 | return dbCache.loadOrRequest(resource); 80 | default: 81 | return dbCache.loadOrRequest(resource); 82 | } 83 | } 84 | 85 | /** 86 | * Helper to publish string value 87 | * 88 | * @param value 89 | */ 90 | protected void publishMessage(int value) { 91 | if (handler != null) { 92 | Bundle data = new Bundle(); 93 | data.putSerializable("message", value); 94 | 95 | /* Creating a message */ 96 | Message msg = new Message(); 97 | msg.setData(data); 98 | msg.what = value; 99 | 100 | /* Sending the message */ 101 | handler.sendMessage(msg); 102 | } 103 | } 104 | 105 | @Override 106 | @Nullable 107 | public final D loadInBackground() { 108 | contextScope.enter(getContext()); 109 | try { 110 | return load(); 111 | } finally { 112 | contextScope.exit(getContext()); 113 | } 114 | } 115 | 116 | public void setHandler(Handler handler) { 117 | this.handler = handler; 118 | } 119 | 120 | /** 121 | * Load data 122 | * 123 | * @return data 124 | */ 125 | @Nullable 126 | public abstract D load(); 127 | } 128 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/ColorManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities; 19 | 20 | import android.content.Context; 21 | import android.content.res.TypedArray; 22 | import android.graphics.Color; 23 | import android.support.annotation.ColorInt; 24 | import android.support.annotation.ColorRes; 25 | import android.support.annotation.NonNull; 26 | 27 | import com.google.inject.Inject; 28 | 29 | import augsburg.se.alltagsguide.R; 30 | 31 | public class ColorManager { 32 | @NonNull private final int[] colors; 33 | @NonNull private final int[] darkColors; 34 | 35 | @Inject 36 | public ColorManager(@NonNull Context context) { 37 | final TypedArray typedArrayDefault = context.getResources().obtainTypedArray(R.array.colors); 38 | colors = new int[typedArrayDefault.length()]; 39 | darkColors = new int[typedArrayDefault.length()]; 40 | for (int i = 0; i < typedArrayDefault.length(); i++) { 41 | colors[i] = typedArrayDefault.getColor(i, 0); 42 | darkColors[i] = shiftColor(colors[i]); 43 | } 44 | typedArrayDefault.recycle(); 45 | } 46 | 47 | @ColorInt 48 | public static int shiftColor(@ColorInt int color) { 49 | float[] hsv = new float[3]; 50 | Color.colorToHSV(color, hsv); 51 | hsv[2] *= 0.9f; // value component 52 | return Color.HSVToColor(hsv); 53 | } 54 | 55 | 56 | @ColorInt 57 | public int getDarkColor(int id) { 58 | return darkColors[id % darkColors.length]; 59 | } 60 | 61 | @ColorInt 62 | public int getColor(int id) { 63 | return colors[id % colors.length]; 64 | } 65 | 66 | @ColorInt 67 | public static int moreAlpha(@ColorInt int currentColor, int alpha) { 68 | int red = Color.red(currentColor); 69 | int green = Color.green(currentColor); 70 | int blue = Color.blue(currentColor); 71 | return Color.argb(alpha, red, green, blue); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/CommonUtilities.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities; 19 | 20 | /** 21 | * Created by Daniel-L on 18.10.2015. 22 | */ 23 | public class CommonUtilities { 24 | public static final String SENDER_ID = ""; //TODO 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/FileHelper.java: -------------------------------------------------------------------------------- 1 | package augsburg.se.alltagsguide.utilities; 2 | 3 | import android.content.Context; 4 | 5 | import com.liulishuo.filedownloader.BaseDownloadTask; 6 | import com.liulishuo.filedownloader.FileDownloadListener; 7 | import com.liulishuo.filedownloader.FileDownloadQueueSet; 8 | import com.liulishuo.filedownloader.FileDownloader; 9 | 10 | import org.jsoup.Jsoup; 11 | import org.jsoup.nodes.Document; 12 | import org.jsoup.nodes.Element; 13 | import org.jsoup.select.Elements; 14 | 15 | import java.io.File; 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | import augsburg.se.alltagsguide.common.Page; 20 | 21 | /** 22 | * Created by Daniel-L 23 | * on 28.02.2016 24 | */ 25 | public class FileHelper { 26 | 27 | public static File getPDFFileLink(Context context, String fileLink){ 28 | return new File(new File(context.getExternalFilesDir(null), "pdf"), fileLink.hashCode()+".pdf"); 29 | } 30 | public static void downloadPDfs(List pages, FileDownloadListener listener, Context context) { 31 | List urls = new ArrayList<>(); 32 | for(Page page : pages){ 33 | urls.addAll(page.getPdfs()); 34 | } 35 | final FileDownloadQueueSet queueSet = new FileDownloadQueueSet(listener); 36 | 37 | final List tasks = new ArrayList<>(); 38 | for (String url : urls) { 39 | tasks.add(FileDownloader.getImpl().create(url).setTag(url).setPath(getPDFFileLink(context, url).getPath())); 40 | } 41 | 42 | queueSet.disableCallbackProgressTimes(); 43 | queueSet.setAutoRetryTimes(1); 44 | queueSet.downloadTogether(tasks); 45 | 46 | queueSet.start(); 47 | } 48 | /* 49 | * Returns a list with all links contained in the input 50 | */ 51 | public static List extractUrls(String text) 52 | { 53 | List pdfUrls = new ArrayList<>(); 54 | Document doc = Jsoup.parse(text); 55 | Elements links = doc.select("a"); 56 | for (Element elem : links){ 57 | String linkHref = elem.attr("href"); 58 | if (linkHref.contains(".pdf")){ 59 | pdfUrls.add(linkHref); 60 | } 61 | } 62 | return pdfUrls; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/FontStyle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities; 19 | 20 | 21 | import android.support.annotation.NonNull; 22 | 23 | import augsburg.se.alltagsguide.R; 24 | 25 | public enum FontStyle { 26 | XSmall(R.style.FontStyle_XSmall, "XSmall"), 27 | Small(R.style.FontStyle_Small, "Small"), 28 | Medium(R.style.FontStyle_Medium, "Medium"), 29 | Large(R.style.FontStyle_Large, "Large"), 30 | XLarge(R.style.FontStyle_XLarge, "XLarge"); 31 | 32 | private int resId; 33 | @NonNull private String title; 34 | 35 | public int getResId() { 36 | return resId; 37 | } 38 | 39 | @NonNull 40 | public String getTitle() { 41 | return title; 42 | } 43 | 44 | FontStyle(int resId, @NonNull String title) { 45 | this.resId = resId; 46 | this.title = title; 47 | } 48 | } -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/LoadingType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities; 19 | 20 | /** 21 | * Created by Daniel-L on 25.10.2015. 22 | */ 23 | public enum LoadingType { 24 | FORCE_NETWORK, FORCE_DATABASE, NETWORK_OR_DATABASE 25 | } 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/Newer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities; 19 | 20 | /** 21 | * Created by Daniel-L on 19.10.2015. 22 | */ 23 | public interface Newer extends Comparable { 24 | /* Checks whether or not the item is different (although id might be the same)*/ 25 | long getTimestamp(); 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/Objects.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities; 19 | 20 | import android.support.annotation.NonNull; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * Created by Daniel-L on 16.08.2015. 26 | */ 27 | public class Objects { 28 | public static boolean equals(Object a, Object b) { 29 | return (a == null) ? (b == null) : a.equals(b); 30 | } 31 | 32 | public static boolean isNullOrEmpty(CharSequence s) { 33 | return Objects.equals(s, null) || Objects.equals("", s) || 34 | Objects.equals(s.toString().replaceAll("<.*?>", ""), ""); 35 | } 36 | 37 | public static int compareTo(int a, int b) { 38 | return a > b ? +1 : a < b ? -1 : 0; 39 | } 40 | 41 | @NonNull 42 | public static String emptyIfNull(Object object) { 43 | if (object == null) { 44 | return ""; 45 | } 46 | return object.toString(); 47 | } 48 | 49 | @NonNull 50 | public static String join(@NonNull List objects) { 51 | StringBuilder builder = new StringBuilder(); 52 | for (T o : objects) { 53 | builder.append(o.toString()).append(" "); 54 | } 55 | return builder.toString(); 56 | } 57 | 58 | public static boolean containsIgnoreCase(String stringA, String stringB) { 59 | return stringA != null && (stringB == null || stringA.toLowerCase().contains(stringB.toLowerCase())); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/broadcast/NetworkChangeEvent.java: -------------------------------------------------------------------------------- 1 | package augsburg.se.alltagsguide.utilities.broadcast; 2 | 3 | /** 4 | * Created by Daniel-L 5 | * on 29.11.2015 6 | */ 7 | public class NetworkChangeEvent { 8 | private boolean mIsOnline; 9 | 10 | public NetworkChangeEvent(boolean isOnline) { 11 | mIsOnline = isOnline; 12 | } 13 | 14 | public boolean isOnline() { 15 | return mIsOnline; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/broadcast/NetworkChangeReceiver.java: -------------------------------------------------------------------------------- 1 | package augsburg.se.alltagsguide.utilities.broadcast; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.net.ConnectivityManager; 7 | import android.net.NetworkInfo; 8 | 9 | import com.google.inject.Inject; 10 | 11 | import de.greenrobot.event.EventBus; 12 | import roboguice.receiver.RoboBroadcastReceiver; 13 | 14 | /** 15 | * Created by Daniel-L 16 | * on 29.11.2015 17 | */ 18 | public class NetworkChangeReceiver extends RoboBroadcastReceiver { 19 | @Inject EventBus eventBus; 20 | 21 | protected void handleReceive(Context context, Intent intent) { 22 | eventBus.post(new NetworkChangeEvent(isOnline(context))); 23 | } 24 | 25 | public boolean isOnline(Context context) { 26 | ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 27 | NetworkInfo netInfo = cm.getActiveNetworkInfo(); 28 | //should check null because in air plan mode it will be null 29 | return (netInfo != null && netInfo.isConnected()); 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/ui/BitmapColorTransformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities.ui; 19 | 20 | import android.graphics.Bitmap; 21 | import android.graphics.Canvas; 22 | import android.graphics.Color; 23 | import android.graphics.ColorFilter; 24 | import android.graphics.ColorMatrix; 25 | import android.graphics.ColorMatrixColorFilter; 26 | import android.graphics.LightingColorFilter; 27 | import android.graphics.Paint; 28 | import android.support.annotation.ColorInt; 29 | import android.support.annotation.ColorRes; 30 | 31 | import com.squareup.picasso.Transformation; 32 | 33 | import java.util.HashMap; 34 | import java.util.HashSet; 35 | import java.util.Map; 36 | import java.util.Set; 37 | 38 | /** 39 | * Created by Daniel-L on 19.10.2015. 40 | */ 41 | public class BitmapColorTransformation implements Transformation { 42 | @ColorInt int mColor; 43 | 44 | public BitmapColorTransformation(@ColorInt int color) { 45 | mColor = color; 46 | } 47 | 48 | @Override 49 | public Bitmap transform(Bitmap source) { 50 | if (!hasTransparentColor(source)) { 51 | //bitmap without transparent color -> most likely an image and not an icon 52 | return source; 53 | } 54 | Bitmap bitmap = Bitmap.createBitmap(source.getWidth(), source.getHeight(), 55 | Bitmap.Config.ARGB_8888); 56 | Canvas canvas = new Canvas(bitmap); 57 | Paint paint = new Paint(); 58 | ColorFilter filter = new LightingColorFilter(0, mColor); 59 | paint.setColorFilter(filter); 60 | canvas.drawBitmap(source, 0, 0, paint); 61 | source.recycle(); 62 | return bitmap; 63 | } 64 | 65 | private boolean hasTransparentColor(Bitmap source) { 66 | Set colorSet = new HashSet<>(); 67 | for (int x = 0; x < source.getWidth(); x++) { 68 | for (int y = 0; y < source.getHeight(); y++) { 69 | colorSet.add(source.getPixel(x, y)); 70 | } 71 | } 72 | return colorSet.contains(Color.TRANSPARENT); 73 | } 74 | 75 | @Override 76 | public String key() { 77 | return "ColorTransformation"; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/ui/BitmapInvertTransformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities.ui; 19 | 20 | import android.graphics.Bitmap; 21 | import android.graphics.Canvas; 22 | import android.graphics.ColorFilter; 23 | import android.graphics.ColorMatrix; 24 | import android.graphics.ColorMatrixColorFilter; 25 | import android.graphics.Paint; 26 | 27 | import com.squareup.picasso.Transformation; 28 | 29 | /** 30 | * Created by Daniel-L on 19.10.2015. 31 | */ 32 | public class BitmapInvertTransformation implements Transformation { 33 | @Override 34 | public Bitmap transform(Bitmap source) { 35 | ColorMatrix colorMatrix_Inverted = 36 | new ColorMatrix(new float[]{ 37 | -1, 0, 0, 0, 255, 38 | 0, -1, 0, 0, 255, 39 | 0, 0, -1, 0, 255, 40 | 0, 0, 0, 1, 0}); 41 | 42 | ColorFilter ColorFilter_Sepia = new ColorMatrixColorFilter( 43 | colorMatrix_Inverted); 44 | 45 | Bitmap bitmap = Bitmap.createBitmap(source.getWidth(), source.getHeight(), 46 | Bitmap.Config.ARGB_8888); 47 | Canvas canvas = new Canvas(bitmap); 48 | 49 | Paint paint = new Paint(); 50 | 51 | paint.setColorFilter(ColorFilter_Sepia); 52 | canvas.drawBitmap(source, 0, 0, paint); 53 | source.recycle(); 54 | return bitmap; 55 | } 56 | 57 | @Override 58 | public String key() { 59 | return "InvertTransformation"; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/ui/EmptyRecyclerView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities.ui; 19 | 20 | import android.content.Context; 21 | import android.support.v7.widget.RecyclerView; 22 | import android.util.AttributeSet; 23 | import android.view.View; 24 | 25 | public class EmptyRecyclerView extends RecyclerView { 26 | private View mEmptyView; 27 | 28 | private boolean mObserverAttached = false; 29 | 30 | public EmptyRecyclerView(Context context) { 31 | this(context, null); 32 | } 33 | 34 | public EmptyRecyclerView(Context context, AttributeSet attrs) { 35 | this(context, attrs, 0); 36 | } 37 | 38 | public EmptyRecyclerView(Context context, AttributeSet attrs, int defStyle) { 39 | super(context, attrs, defStyle); 40 | } 41 | 42 | public void setEmptyView(View emptyView) { 43 | mEmptyView = emptyView; 44 | updateEmptyStatus(isEmpty()); 45 | } 46 | 47 | private void updateEmptyStatus(boolean empty) { 48 | if (empty) { 49 | setVisibility(GONE); 50 | if (mEmptyView != null) { 51 | mEmptyView.setVisibility(VISIBLE); 52 | } 53 | } else { 54 | setVisibility(VISIBLE); 55 | if (mEmptyView != null) { 56 | mEmptyView.setVisibility(GONE); 57 | } 58 | } 59 | } 60 | 61 | public boolean isEmpty() { 62 | Adapter adapter = getAdapter(); 63 | return adapter == null || adapter.getItemCount() == 0; 64 | } 65 | 66 | @Override 67 | protected void onDetachedFromWindow() { 68 | super.onDetachedFromWindow(); 69 | Adapter adapter = getAdapter(); 70 | if (adapter != null && mObserverAttached) { 71 | adapter.unregisterAdapterDataObserver(mObserver); 72 | mObserverAttached = false; 73 | } 74 | } 75 | 76 | @Override 77 | public void setAdapter(Adapter adapter) { 78 | super.setAdapter(adapter); 79 | adapter.registerAdapterDataObserver(mObserver); 80 | mObserverAttached = true; 81 | updateEmptyStatus(isEmpty()); 82 | } 83 | 84 | private AdapterDataObserver mObserver = new AdapterDataObserver() { 85 | @Override 86 | public void onChanged() { 87 | super.onChanged(); 88 | updateEmptyStatus(isEmpty()); 89 | } 90 | 91 | @Override 92 | public void onItemRangeChanged(int positionStart, int itemCount) { 93 | super.onItemRangeChanged(positionStart, itemCount); 94 | updateEmptyStatus(isEmpty()); 95 | } 96 | 97 | @Override 98 | public void onItemRangeInserted(int positionStart, int itemCount) { 99 | super.onItemRangeInserted(positionStart, itemCount); 100 | updateEmptyStatus(isEmpty()); 101 | } 102 | 103 | @Override 104 | public void onItemRangeRemoved(int positionStart, int itemCount) { 105 | super.onItemRangeRemoved(positionStart, itemCount); 106 | updateEmptyStatus(isEmpty()); 107 | } 108 | }; 109 | } 110 | -------------------------------------------------------------------------------- /app/src/main/java/augsburg/se/alltagsguide/utilities/ui/LanguageItemAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Integreat. 3 | * 4 | * Integreat is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Integreat is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Integreat. If not, see . 16 | */ 17 | 18 | package augsburg.se.alltagsguide.utilities.ui; 19 | 20 | 21 | import android.annotation.SuppressLint; 22 | import android.content.Context; 23 | import android.support.annotation.NonNull; 24 | import android.view.View; 25 | import android.view.ViewGroup; 26 | import android.widget.BaseAdapter; 27 | import android.widget.ImageView; 28 | import android.widget.TextView; 29 | 30 | import com.google.inject.Inject; 31 | import com.squareup.picasso.Picasso; 32 | 33 | import java.util.ArrayList; 34 | import java.util.List; 35 | 36 | import augsburg.se.alltagsguide.R; 37 | import augsburg.se.alltagsguide.common.AvailableLanguage; 38 | import augsburg.se.alltagsguide.common.Language; 39 | import roboguice.RoboGuice; 40 | 41 | /** 42 | * Simple adapter example for custom items in the dialog 43 | */ 44 | public class LanguageItemAdapter extends BaseAdapter implements View.OnClickListener { 45 | 46 | @NonNull private final Context mContext; 47 | @NonNull private final List mItems; 48 | 49 | @Inject 50 | private Picasso mPicasso; 51 | 52 | public LanguageItemAdapter(@NonNull Context context, @NonNull List items, boolean nothing) { 53 | mContext = context; 54 | List languages = new ArrayList<>(); 55 | for (AvailableLanguage language : items) { 56 | languages.add(language.getLoadedLanguage()); 57 | } 58 | mItems = languages; 59 | RoboGuice.injectMembers(context, this); 60 | } 61 | 62 | public LanguageItemAdapter(@NonNull Context context, @NonNull List items) { 63 | mContext = context; 64 | mItems = items; 65 | RoboGuice.injectMembers(context, this); 66 | } 67 | 68 | @Override 69 | public int getCount() { 70 | return mItems.size(); 71 | } 72 | 73 | @Override 74 | @NonNull 75 | public Object getItem(int position) { 76 | return mItems.get(position); 77 | } 78 | 79 | @Override 80 | public long getItemId(int position) { 81 | return position; 82 | } 83 | 84 | @Override 85 | public boolean hasStableIds() { 86 | return true; 87 | } 88 | 89 | 90 | @SuppressLint("ViewHolder") 91 | @Override 92 | public View getView(int position, View convertView, ViewGroup parent) { 93 | Language language = mItems.get(position); 94 | 95 | if (convertView == null) { 96 | convertView = View.inflate(mContext, R.layout.dialog_language_item, null); 97 | } 98 | if (language == null) { 99 | return convertView; 100 | } 101 | ((TextView) convertView.findViewById(R.id.language_name)).setText(language.getName()); 102 | mPicasso.load(language.getIconPath()) 103 | .placeholder(R.drawable.icon_language_loading) 104 | .error(R.drawable.icon_language_loading_error) 105 | .fit() 106 | .into((ImageView) convertView.findViewById(R.id.language_icon)); 107 | 108 | return convertView; 109 | } 110 | 111 | @Override 112 | public void onClick(View v) { 113 | } 114 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon_language_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-hdpi/icon_language_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon_language_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-hdpi/icon_language_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon_location_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-hdpi/icon_location_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon_location_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-hdpi/icon_location_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/no_events_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-hdpi/no_events_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/no_languages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-hdpi/no_languages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/no_locations_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-hdpi/no_locations_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/no_pages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-hdpi/no_pages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/icon_language_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-ldpi/icon_language_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/icon_language_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-ldpi/icon_language_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/icon_location_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-ldpi/icon_location_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/icon_location_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-ldpi/icon_location_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/no_events_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-ldpi/no_events_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/no_languages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-ldpi/no_languages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/no_locations_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-ldpi/no_locations_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/no_pages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-ldpi/no_pages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon_language_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-mdpi/icon_language_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon_language_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-mdpi/icon_language_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon_location_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-mdpi/icon_location_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon_location_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-mdpi/icon_location_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/no_events_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-mdpi/no_events_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/no_languages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-mdpi/no_languages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/no_locations_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-mdpi/no_locations_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/no_pages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-mdpi/no_pages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/brandenburger_tor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-nodpi/brandenburger_tor.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/circle_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-nodpi/circle_background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/no_events_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-tvdpi/no_events_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/no_locations_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-tvdpi/no_locations_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-tvdpi/no_pages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-tvdpi/no_pages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_language_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xhdpi/icon_language_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_language_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xhdpi/icon_language_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_location_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xhdpi/icon_location_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_location_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xhdpi/icon_location_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/no_events_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xhdpi/no_events_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/no_languages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xhdpi/no_languages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/no_locations_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xhdpi/no_locations_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/no_pages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xhdpi/no_pages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_language_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxhdpi/icon_language_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_language_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxhdpi/icon_language_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_location_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxhdpi/icon_location_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_location_loading_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxhdpi/icon_location_loading_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/no_events_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxhdpi/no_events_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/no_languages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxhdpi/no_languages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/no_locations_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxhdpi/no_locations_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/no_pages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxhdpi/no_pages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/no_events_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxxhdpi/no_events_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/no_languages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxxhdpi/no_languages_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/no_locations_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxxhdpi/no_locations_found.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/no_pages_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/drawable-xxxhdpi/no_pages_found.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_welcome.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 26 | 27 | 31 | 32 | 37 | 38 | 42 | 43 | 52 | 53 | 62 | 63 | 64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /app/src/main/res/layout/category_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_language_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | 32 | 33 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/events_empty_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | 30 | 31 | 38 | 39 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_event_pages.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 25 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_language.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 25 | 26 | 32 | 33 | 42 | 43 | 44 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_location.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 26 | 27 | 28 | 40 | 41 | 49 | 50 | 51 | 52 | 57 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_pages.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 25 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/language_item_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 29 | 30 | 33 | 34 | 42 | 43 | 48 | 49 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/res/layout/languages_empty_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | 30 | 31 | 38 | 39 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/location_item_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 29 | 30 | 33 | 34 | 42 | 43 | 48 | 49 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/res/layout/locations_empty_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 25 | 26 | 31 | 32 | 39 | 40 | 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/layout/navigation_empty_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | 30 | 31 | 38 | 39 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/navigation_header_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 25 | 26 | 37 | 38 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/navigation_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 23 | 28 | 29 | 41 | 42 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /app/src/main/res/layout/pages_empty_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | 30 | 31 | 38 | 39 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/tag_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_welcome.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 |

19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/menu/overview.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 22 | 23 | 29 | 35 | 36 | 42 | 43 | 44 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-de/strings.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Einstellungen / Impressum 20 | 21 | Eine Spalte 22 | Mehrere Spalten 23 | 24 | Öffnen 25 | Schließen 26 | 27 | Allgemeine Ansicht 28 | 29 | Klein 30 | Medium 31 | Groß 32 | Setze die Schriftgröße 33 | Schriftgröße 34 | Sehr groß 35 | Sehr klein 36 | Derzeit gibt es keine Einträge. 37 | Schließen? 38 | Möchten Sie die Anwendung wirklich beenden? 39 | Nein 40 | Ja 41 | Ort ändern 42 | Mehr 43 | Es wurden keine Sprachen gefunden.\nEs scheint, als würde der angegebene Ort derzeit nicht verfügbar sein.\nBitte versuchen Sie es später erneut. 44 | Es wurden keine Orte gefunden.\nEs scheint, als würde die App derzeit nicht zur Verfügung stehen.\nBitte versuchen Sie es später erneut. 45 | Wähle eine Sprache 46 | Suche 47 | Veranstaltungen 48 | Informationen 49 | Laden… 50 | Der Inhalt wird geladen. 51 | Es ist keine andere Sprache für diesen Beitrag verfügbar. 52 | Es ist keine andere Sprache verfügbar. 53 | Suche nach einem Ort 54 | Derzeit sind uns keine Veranstaltungen bekannt. 55 | This text is auto translated. 56 | Dismiss 57 | Entfernt alle Daten und öffnet das Startmenü 58 | Alle Daten entfernen 59 | Copyright 60 | … entworfen von Freepik (www.flaticon.com) 61 | Icons 62 | 63 | -------------------------------------------------------------------------------- /app/src/main/res/values-fa/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | تغییر محل 21 | Impressum / سلب مسئولیت 22 | بسته شدن 23 | هیچ 24 | آره 25 | انتخاب زبان 26 | محتوای بارگیری شده است. 27 | بستن؟ 28 | آیا مطمئن هستید که میخواهید خارج شوید؟ 29 | …در حال بارگذاری 30 | رویدادهای 31 | بزرگ 32 | متوسط 33 | تنظیم اندازه فونت 34 | اندازه فونت 35 | خرده 36 | بسیار بزرگ 37 | بسیار کوچک 38 | اطلاعات 39 | چند ستون 40 | هیچ نوشته ای پیدا نشد. 41 | هیچ زبان یافت شده است. به نظر می رسد مانند محل شما انتخاب کرده اید هنوز در دسترس نیست. لطفا آن را بعدا دوباره امتحان کنید 42 | هیچ محلی یافت شده است. به نظر می رسد که اگر برنامه در حال حاضر در دسترس نیست. لطفا بعدا دوباره امتحان کنید. 43 | هیچ زبان دیگر در دسترس وجود دارد. 44 | هیچ زبان دیگر برای این پست وجود دارد. 45 | افتتاح 46 | بیشتر 47 | نمای کلی 48 | جستجو 49 | ستون 50 | البحث عن مكان 51 | در حال حاضر هیچ رویدادی به ما شناخته شده است. 52 | This text is auto translated. 53 | Dismiss 54 | حذف تمام داده ها و به ارمغان می آورد شما را به منوی شروع 55 | پاک کردن کش 56 | حق چاپ 57 | Freepik (www.flaticon.com) 58 | آیکن 59 | -------------------------------------------------------------------------------- /app/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | Paramètres / Impressum 21 | Changer de lieu 22 | fermeture 23 | Non 24 | oui 25 | Choisissez la langue 26 | Le contenu est chargé. 27 | Fermer? 28 | Êtes-vous sûr de vouloir quitter? 29 | Chargement… 30 | événements 31 | Grand 32 | Milieu 33 | Définissez la taille de la police 34 | taille de la police 35 | Petty 36 | très grande 37 | très petite 38 | informations 39 | plusieurs colonnes 40 | Rien na été trouvé. 41 | Pas de langues ont été trouvées. Il semble que l\'emplacement que vous avez sélectionné est pas encore disponible. S\'il vous plaît essayer de nouveau plus tard 42 | Aucun emplacement n\'a été trouvé. Il semble que si l\'application est actuellement pas disponible. S\'il vous plaît réessayer plus tard. 43 | Il n\'y a pas d\'autre langue disponible. 44 | Il n\'y a aucune autre langue pour ce poste disponible. 45 | ouverture 46 | Plus 47 | vue générale 48 | Recherche 49 | Une colonne 50 | Rechercher un lieu 51 | Aucun événement nous sont connus. 52 | This text is auto translated. 53 | Dismiss 54 | Supprime toutes les données et vous ramène au menu de démarrage 55 | Vider le cache 56 | droits d\'auteur 57 | … conçu par Freepik (www.flaticon.com) 58 | icônes 59 | -------------------------------------------------------------------------------- /app/src/main/res/values-land/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 2 21 | 3 22 | -------------------------------------------------------------------------------- /app/src/main/res/values-v19/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | XSmall 22 | Small 23 | Medium 24 | Large 25 | XLarge 26 | 27 | 28 | 29 | @string/font_size_xsmall 30 | @string/font_size_small 31 | @string/font_size_medium 32 | @string/font_size_large 33 | @string/font_size_xlarge 34 | 35 | 36 | 37 | 38 | #00BCD4 39 | #03A9F4 40 | #1E88E5 41 | #3F51B5 42 | #5E35B1 43 | #9C27B0 44 | #4CAF50 45 | #009688 46 | #FF9800 47 | #FF5722 48 | #D32F2F 49 | #E91E63 50 | #607D8B 51 | #795548 52 | #424242 53 | #1F1F1F 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | #FFC107 21 | #FFA000 22 | #FFECB3 23 | #536DFE 24 | #212121 25 | #727272 26 | #212121 27 | #B6B6B6 28 | -------------------------------------------------------------------------------- /app/src/main/res/values/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 1 21 | 2 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 27 | 28 | 31 | 32 | 40 | 41 | 45 | 46 | 47 | 51 | 52 | 61 | 62 | 69 | 70 | 77 | 78 | 85 | 86 | 93 | 98 | 99 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 28 | 32 | 33 | 34 | 35 | 38 | 39 | -------------------------------------------------------------------------------- /app/version.properties: -------------------------------------------------------------------------------- 1 | #Sun Dec 27 07:56:12 CET 2015 2 | VERSION_BUILD=283 3 | VERSION_CODE=324 4 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.3.0' 9 | classpath 'com.google.gms:google-services:2.0.0-alpha6' 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | ext { 15 | travisBuild = System.getenv("TRAVIS") == "true" 16 | // allows for -Dpre-dex=false to be set 17 | preDexEnabled = "true".equals(System.getProperty("pre-dex", "true")) 18 | } 19 | 20 | allprojects { 21 | repositories { 22 | jcenter() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | com.android.build.gradle.overridePathCheck=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalfabrik/app-android/a6e0230c6fa455a99178e572f4673ff97289bc5b/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed May 10 21:31:23 PDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------