├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── ic_launcher-web.png
│ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── drawable
│ │ │ │ ├── single_note_widget.png
│ │ │ │ ├── note_list_widget_preview.png
│ │ │ │ ├── button_selector.xml
│ │ │ │ ├── ic_add_blue_24dp.xml
│ │ │ │ ├── ic_add_white_24dp.xml
│ │ │ │ ├── splashscreen.xml
│ │ │ │ ├── list_item_color_selector.xml
│ │ │ │ ├── list_item_background_selector.xml
│ │ │ │ ├── list_item_color_selector_low.xml
│ │ │ │ ├── ic_check_grey600_24dp.xml
│ │ │ │ ├── ic_delete_grey600_24dp.xml
│ │ │ │ ├── ic_star_yellow_24dp.xml
│ │ │ │ ├── ic_delete_white_24dp.xml
│ │ │ │ ├── ic_delete_white_32dp.xml
│ │ │ │ ├── ic_star_grey_ccc_24dp.xml
│ │ │ │ ├── ic_star_white_24dp.xml
│ │ │ │ ├── ic_clear_white_24dp.xml
│ │ │ │ ├── ic_folder_white_24dp.xml
│ │ │ │ ├── ic_folder_grey600_18dp.xml
│ │ │ │ ├── ic_folder_grey600_24dp.xml
│ │ │ │ ├── ic_folder_open_grey600_24dp.xml
│ │ │ │ ├── ic_brightness_2_grey_24dp.xml
│ │ │ │ ├── ic_edit_white_24dp.xml
│ │ │ │ ├── ic_create_new_folder_grey600_18dp.xml
│ │ │ │ ├── ic_create_new_folder_grey600_24dp.xml
│ │ │ │ ├── ic_info_outline_grey600_24dp.xml
│ │ │ │ ├── ic_access_time_grey600_24dp.xml
│ │ │ │ ├── ic_star_border_white_24dp.xml
│ │ │ │ ├── ic_search_white_24dp.xml
│ │ │ │ ├── ic_eye_white_24dp.xml
│ │ │ │ ├── ic_sync_blue_18dp.xml
│ │ │ │ ├── ic_remove_red_eye_grey_24dp.xml
│ │ │ │ ├── ic_account_circle_grey_24dp.xml
│ │ │ │ ├── ic_https_grey_24dp.xml
│ │ │ │ ├── ic_share_white_24dp.xml
│ │ │ │ ├── ic_launcher_foreground.xml
│ │ │ │ ├── ic_settings_grey600_24dp.xml
│ │ │ │ └── ic_quicksettings_new.xml
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── ic_splashscreen.png
│ │ │ │ └── ic_widget_create.png
│ │ │ ├── drawable-mdpi
│ │ │ │ ├── ic_splashscreen.png
│ │ │ │ └── ic_widget_create.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── ic_splashscreen.png
│ │ │ │ ├── ic_widget_create.png
│ │ │ │ └── border.xml
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── ic_splashscreen.png
│ │ │ │ └── ic_widget_create.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ └── ic_splashscreen.png
│ │ │ ├── xml
│ │ │ │ ├── searchable.xml
│ │ │ │ ├── network_security_config.xml
│ │ │ │ ├── create_note_widget_provider.xml
│ │ │ │ ├── note_list_widget_provider_info.xml
│ │ │ │ ├── single_note_widget_provider_info.xml
│ │ │ │ ├── shortcuts.xml
│ │ │ │ └── preferences.xml
│ │ │ ├── values-ia
│ │ │ │ └── strings.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable-night
│ │ │ │ ├── border.xml
│ │ │ │ └── button_selector.xml
│ │ │ ├── values
│ │ │ │ ├── arrays.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ └── styles.xml
│ │ │ ├── layout
│ │ │ │ ├── widget_single_note_content.xml
│ │ │ │ ├── activity_about.xml
│ │ │ │ ├── dialog_change_category.xml
│ │ │ │ ├── widget_create_note.xml
│ │ │ │ ├── activity_edit.xml
│ │ │ │ ├── activity_single_note.xml
│ │ │ │ ├── activity_note_list_configuration.xml
│ │ │ │ ├── widget_single_note.xml
│ │ │ │ ├── fragment_notes_list_section_item.xml
│ │ │ │ ├── item_navigation.xml
│ │ │ │ ├── widget_entry.xml
│ │ │ │ ├── activity_notes_list_view.xml
│ │ │ │ ├── fragment_about_license_tab.xml
│ │ │ │ ├── fragment_about_contribution_tab.xml
│ │ │ │ ├── activity_settings.xml
│ │ │ │ ├── widget_note_list.xml
│ │ │ │ ├── drawer_layout.xml
│ │ │ │ └── fragment_about_credits_tab.xml
│ │ │ ├── values-sl
│ │ │ │ └── strings.xml
│ │ │ ├── menu
│ │ │ │ ├── menu_list_context_multiple.xml
│ │ │ │ ├── menu_list_view.xml
│ │ │ │ ├── menu_note_activity.xml
│ │ │ │ └── menu_note_fragment.xml
│ │ │ ├── values-night
│ │ │ │ └── colors.xml
│ │ │ ├── values-bg-rBG
│ │ │ │ └── strings.xml
│ │ │ ├── values-hy
│ │ │ │ └── strings.xml
│ │ │ ├── values-eu
│ │ │ │ └── strings.xml
│ │ │ ├── values-cs
│ │ │ │ └── strings.xml
│ │ │ ├── values-lv
│ │ │ │ └── strings.xml
│ │ │ ├── values-ca
│ │ │ │ └── strings.xml
│ │ │ └── values-ja-rJP
│ │ │ │ └── strings.xml
│ │ └── java
│ │ │ └── it
│ │ │ └── niedermann
│ │ │ └── owncloud
│ │ │ └── notes
│ │ │ ├── model
│ │ │ ├── Item.java
│ │ │ ├── Category.java
│ │ │ ├── SectionItem.java
│ │ │ ├── DBStatus.java
│ │ │ ├── DBNote.java
│ │ │ └── CloudNote.java
│ │ │ ├── util
│ │ │ ├── ICallback.java
│ │ │ ├── Notes.java
│ │ │ ├── MarkDownUtil.java
│ │ │ ├── ServerResponse.java
│ │ │ ├── SupportUtil.java
│ │ │ └── NoteUtil.java
│ │ │ └── android
│ │ │ ├── appwidget
│ │ │ ├── NoteListWidgetService.java
│ │ │ ├── SingleNoteWidgetService.java
│ │ │ ├── CreateNoteWidget.java
│ │ │ ├── SingleNoteWidget.java
│ │ │ ├── SingleNoteWidgetFactory.java
│ │ │ ├── NoteListWidgetFactory.java
│ │ │ └── NoteListWidget.java
│ │ │ ├── activity
│ │ │ ├── SplashscreenActivity.java
│ │ │ ├── PreferencesActivity.java
│ │ │ ├── AboutActivity.java
│ │ │ └── SelectSingleNoteActivity.java
│ │ │ ├── fragment
│ │ │ ├── about
│ │ │ │ ├── AboutFragmentContributingTab.java
│ │ │ │ ├── AboutFragmentCreditsTab.java
│ │ │ │ └── AboutFragmentLicenseTab.java
│ │ │ ├── PreferencesFragment.java
│ │ │ └── NotePreviewFragment.java
│ │ │ ├── quicksettings
│ │ │ └── NewNoteTileService.java
│ │ │ └── AlwaysAutoCompleteTextView.java
│ └── androidTest
│ │ └── java
│ │ └── it
│ │ └── niedermann
│ │ └── owncloud
│ │ └── notes
│ │ ├── ApplicationTest.java
│ │ ├── model
│ │ └── NoteTest.java
│ │ └── util
│ │ ├── NotesClientUtilTest.java
│ │ └── NoteUtilTest.java
├── .classpath
├── project.properties
├── proguard-rules.pro
├── proguard-project.txt
├── .project
└── build.gradle
├── fastlane
└── metadata
│ └── android
│ ├── de-DE
│ ├── title.txt
│ ├── short_description.txt
│ ├── images
│ │ ├── icon.png
│ │ └── phoneScreenshots
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ └── 5.png
│ └── full_description.txt
│ └── en-US
│ ├── title.txt
│ ├── short_description.txt
│ ├── images
│ ├── icon.png
│ └── phoneScreenshots
│ │ ├── 1.png
│ │ ├── 2.png
│ │ ├── 3.png
│ │ ├── 4.png
│ │ └── 5.png
│ └── full_description.txt
├── settings.gradle
├── .gitmodules
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── .travis.yml
├── gradle.properties
├── CONTRIBUTING.md
├── gradlew.bat
├── .tx
└── config
└── README.md
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/title.txt:
--------------------------------------------------------------------------------
1 | Nextcloud Notes
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/title.txt:
--------------------------------------------------------------------------------
1 | Nextcloud Notes
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | include ':cert4android'
3 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/short_description.txt:
--------------------------------------------------------------------------------
1 | View and edit notes on Nextcloud
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/short_description.txt:
--------------------------------------------------------------------------------
1 | Lesen und Bearbeiten Sie Notizen in Nextcloud
2 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "cert4android"]
2 | path = cert4android
3 | url = https://gitlab.com/bitfireAT/cert4android.git
4 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle/
2 | /local.properties
3 | .DS_Store
4 | /build
5 | /captures
6 | /.idea/
7 | *.iml
8 | /projectFilesBackup/
9 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/single_note_widget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable/single_note_widget.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/de-DE/images/icon.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/en-US/images/icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_splashscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-hdpi/ic_splashscreen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_splashscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-mdpi/ic_splashscreen.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_widget_create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-hdpi/ic_widget_create.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_widget_create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-mdpi/ic_widget_create.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_splashscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-xhdpi/ic_splashscreen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_widget_create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-xhdpi/ic_widget_create.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_splashscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-xxhdpi/ic_splashscreen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_widget_create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-xxhdpi/ic_widget_create.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_splashscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable-xxxhdpi/ic_splashscreen.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/note_list_widget_preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/app/src/main/res/drawable/note_list_widget_preview.png
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/model/Item.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.model;
2 |
3 | public interface Item {
4 | boolean isSection();
5 | }
6 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/images/phoneScreenshots/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/de-DE/images/phoneScreenshots/1.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/images/phoneScreenshots/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/de-DE/images/phoneScreenshots/2.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/images/phoneScreenshots/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/de-DE/images/phoneScreenshots/3.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/images/phoneScreenshots/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/de-DE/images/phoneScreenshots/4.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/images/phoneScreenshots/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/de-DE/images/phoneScreenshots/5.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skjnldsv/nextcloud-notes/master/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png
--------------------------------------------------------------------------------
/app/src/main/res/xml/searchable.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/util/ICallback.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.util;
2 |
3 | /**
4 | * Callback
5 | * Created by stefan on 01.10.15.
6 | */
7 | public interface ICallback {
8 | void onFinish();
9 |
10 | void onScheduled();
11 | }
12 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Apr 06 20:28:39 CEST 2018
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-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values-ia/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - %d selectionate
6 | - %d selectionate
7 |
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: android
2 |
3 | jdk: oraclejdk8
4 |
5 | android:
6 | components:
7 | - tools
8 | - build-tools-27.0.3
9 | - android-27
10 | - extra-android-m2repository
11 |
12 | before_install:
13 | - yes | sdkmanager "platforms;android-27"
14 |
15 | script: ./gradlew testDebug
16 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-night/border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @string/pref_value_mode_edit
5 | - @string/pref_value_mode_preview
6 | - @string/pref_value_mode_last
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/widget_single_note_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/button_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add_blue_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/splashscreen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | -
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-night/button_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_item_color_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - %d izbran(a)
6 | - %d izbrana(i)
7 | - %d izbranih
8 | - %d izbranih
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_item_background_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_item_color_selector_low.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_grey600_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_delete_grey600_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star_yellow_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_delete_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_delete_white_32dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star_grey_ccc_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_clear_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_folder_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_folder_grey600_18dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_folder_grey600_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_list_context_multiple.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/it/niedermann/owncloud/notes/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidgetService.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.appwidget;
2 |
3 | import android.content.Intent;
4 | import android.widget.RemoteViewsService;
5 |
6 | public class NoteListWidgetService extends RemoteViewsService {
7 | @Override
8 | public RemoteViewsFactory onGetViewFactory(Intent intent) {
9 | return new NoteListWidgetFactory(this.getApplicationContext(), intent);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_folder_open_grey600_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/SingleNoteWidgetService.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.appwidget;
2 |
3 | import android.content.Intent;
4 | import android.widget.RemoteViewsService;
5 |
6 | public class SingleNoteWidgetService extends RemoteViewsService {
7 | @Override
8 | public RemoteViewsFactory onGetViewFactory(Intent intent) {
9 | return new SingleNoteWidgetFactory(this.getApplicationContext(), intent);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_brightness_2_grey_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_edit_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_create_new_folder_grey600_18dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_create_new_folder_grey600_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info_outline_grey600_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/model/Category.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.model;
2 |
3 | import android.support.annotation.Nullable;
4 |
5 | import java.io.Serializable;
6 |
7 | public class Category implements Serializable {
8 |
9 | @Nullable
10 | public final String category;
11 | @Nullable
12 | public final Boolean favorite;
13 |
14 | public Category(@Nullable String category, @Nullable Boolean favorite) {
15 | this.category = category;
16 | this.favorite = favorite;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_access_time_grey600_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star_border_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/model/SectionItem.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.model;
2 |
3 | public class SectionItem implements Item {
4 |
5 | private String title;
6 |
7 | public SectionItem(String title) {
8 | this.title = title;
9 | }
10 |
11 | public String geTitle() {
12 | return title;
13 | }
14 |
15 | public void setTitle(String title) {
16 | this.title = title;
17 | }
18 |
19 | @Override
20 | public boolean isSection() {
21 | return true;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_eye_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sync_blue_18dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_remove_red_eye_grey_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/create_note_widget_provider.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/full_description.txt:
--------------------------------------------------------------------------------
1 | Companion app to Nextcloud Notes.
2 |
3 | Features
4 |
5 | List, create, edit, share, search and delete notes
6 | Manage categories
7 | Share text and links as new note into the app
8 | Mark notes as favorite
9 | Bulk delete
10 | Formatting with MarkDown (using RxMarkdown)
11 | Multi-Lingual User-Interface
12 |
13 | Requirements
14 |
15 | Nextcloud instance running
16 | Nextcloud Notes app enabled
17 |
18 | Alternatives
19 |
20 | If you dislike this app and you are looking for alternatives: Have a look at MyOwnNotes.
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_account_circle_grey_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 | # Project target.
13 | target=android-19
14 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_list_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_https_grey_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/it/niedermann/owncloud/notes/model/NoteTest.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.model;
2 |
3 | import junit.framework.TestCase;
4 |
5 | import java.util.Calendar;
6 |
7 | /**
8 | * Tests the Note Model
9 | * Created by stefan on 06.10.15.
10 | */
11 | public class NoteTest extends TestCase {
12 |
13 | public void testMarkDownStrip() {
14 | CloudNote note = new CloudNote(0, Calendar.getInstance(), "#Title", "", false, null, null);
15 | assertTrue("Title".equals(note.getTitle()));
16 | note.setTitle("* Aufzählung");
17 | assertTrue("Aufzählung".equals(note.getTitle()));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/de-DE/full_description.txt:
--------------------------------------------------------------------------------
1 | Companion App für Nextcloud Notes.
2 |
3 | Features
4 |
5 | Anzeigen, Erstellen, Bearbeiten, Teilen, Durchsuchen und Löschen von Notizen
6 | Kategorien verwalten
7 | Text und Links als neue Notiz in die App teilen
8 | Notizen als Favoriten markieren
9 | Massenhaftes Löschen von Notizen
10 | Formatierung mit MarkDown (mit RxMarkdown)
11 | Mehrsprachiges User-Interface
12 |
13 | Voraussetzungen
14 |
15 | Laufende Nextcloud Instanz
16 | Aktivierte Nextcloud Notes App
17 |
18 | Alternativen
19 |
20 | Wenn Sie eine Alternative für diese App suchen, versuchen Sie es mit MyOwnNotes.
21 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/activity/SplashscreenActivity.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | /**
8 | * Created by stefan on 18.04.17.
9 | */
10 | public class SplashscreenActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | Intent intent = new Intent(this, NotesListViewActivity.class);
17 | startActivity(intent);
18 | finish();
19 | }
20 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_change_category.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/note_list_widget_provider_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_note_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/single_note_widget_provider_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
--------------------------------------------------------------------------------
/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\stnieder\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/res/drawable/ic_share_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #286090
6 |
7 | #444
8 |
9 | #111
10 | #222222
11 | #ff3333
12 | #eeeeee
13 | #cccccc
14 | #aaaaaa
15 | #666666
16 | #000000
17 |
18 | @color/primary
19 | @color/primary
20 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/shortcuts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/widget_create_note.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/activity/PreferencesActivity.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.activity;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import it.niedermann.owncloud.notes.android.fragment.PreferencesFragment;
8 |
9 | /**
10 | * Allows to change application settings.
11 | */
12 |
13 | public class PreferencesActivity extends AppCompatActivity {
14 | @Override
15 | protected void onCreate(@Nullable Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setResult(RESULT_CANCELED);
18 | getFragmentManager().beginTransaction()
19 | .replace(android.R.id.content, new PreferencesFragment())
20 | .commit();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_single_note.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_note_list_configuration.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
24 |
--------------------------------------------------------------------------------
/app/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | OwnCloudNotes
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #0082C9
6 | #286090
7 |
8 | #d2d2d2
9 |
10 | #aa000000
11 | #f3f3f3
12 | #ffffff
13 | #d40000
14 | #ffcc00
15 | #000000
16 | #333333
17 | #666666
18 | #cccccc
19 | #ffffff
20 | #757575
21 |
22 | #E6FFFFFF
23 |
24 | #FFF
25 | @color/primary
26 |
27 | #000000
28 | #ffffff
29 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/util/Notes.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.util;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import android.content.SharedPreferences;
6 | import android.preference.PreferenceManager;
7 | import android.support.v7.app.AppCompatDelegate;
8 |
9 | public class Notes extends Application {
10 | private static final String DARK_THEME = "darkTheme";
11 |
12 | @Override
13 | public void onCreate() {
14 | setAppTheme(getAppTheme(getApplicationContext()));
15 | super.onCreate();
16 | }
17 |
18 | public static void setAppTheme(Boolean darkTheme) {
19 | if (darkTheme) {
20 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
21 | } else {
22 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
23 | }
24 | }
25 |
26 | public static boolean getAppTheme(Context context) {
27 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
28 | return prefs.getBoolean(DARK_THEME, false);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/widget_single_note.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
23 |
24 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings_grey600_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_notes_list_section_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 16dp
6 | 16dp
7 |
8 |
9 | 16dp
10 | 5dp
11 |
12 | 16sp
13 | 14sp
14 |
15 |
16 | 8dp
17 | 10dp
18 | 0dp
19 |
20 | 2dp
21 | 4dp
22 | 36dp
23 | 30dp
24 |
25 | 4dp
26 | 4dp
27 |
28 | 26dp
29 | 20dp
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/util/MarkDownUtil.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.util;
2 |
3 | import android.content.Context;
4 | import android.support.v4.content.res.ResourcesCompat;
5 |
6 | import com.yydcdut.rxmarkdown.RxMDConfiguration;
7 | import com.yydcdut.rxmarkdown.RxMDConfiguration.Builder;
8 |
9 | import it.niedermann.owncloud.notes.R;
10 |
11 | /**
12 | * Created by stefan on 07.12.16.
13 | */
14 |
15 | public class MarkDownUtil {
16 |
17 | /**
18 | * Ensures every instance of RxMD uses the same configuration
19 | *
20 | * @param context Context
21 | * @return RxMDConfiguration
22 | */
23 | public static Builder getMarkDownConfiguration(Context context) {
24 | return new RxMDConfiguration.Builder(context)
25 | .setUnOrderListColor(ResourcesCompat.getColor(context.getResources(), R.color.fg_default, null))
26 | .setHeader2RelativeSize(1.35f)
27 | .setHeader3RelativeSize(1.25f)
28 | .setHeader4RelativeSize(1.15f)
29 | .setHeader5RelativeSize(1.1f)
30 | .setHeader6RelativeSize(1.05f)
31 | .setHorizontalRulesHeight(2)
32 | .setLinkFontColor(ResourcesCompat.getColor(context.getResources(), R.color.primary, null));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentContributingTab.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.fragment.about;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.TextView;
9 |
10 | import butterknife.BindView;
11 | import butterknife.ButterKnife;
12 | import it.niedermann.owncloud.notes.R;
13 | import it.niedermann.owncloud.notes.util.SupportUtil;
14 |
15 | public class AboutFragmentContributingTab extends Fragment {
16 |
17 | @BindView(R.id.about_source)
18 | TextView aboutSource;
19 | @BindView(R.id.about_issues)
20 | TextView aboutIssues;
21 | @BindView(R.id.about_translate)
22 | TextView aboutTranslate;
23 |
24 | @Override
25 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
26 | View v = inflater.inflate(R.layout.fragment_about_contribution_tab, container, false);
27 | ButterKnife.bind(this, v);
28 | SupportUtil.setHtml(aboutSource, R.string.about_source, getString(R.string.url_source));
29 | SupportUtil.setHtml(aboutIssues, R.string.about_issues, getString(R.string.url_issues));
30 | SupportUtil.setHtml(aboutTranslate, R.string.about_translate, getString(R.string.url_translations));
31 | return v;
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentCreditsTab.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.fragment.about;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.TextView;
9 |
10 | import butterknife.BindView;
11 | import butterknife.ButterKnife;
12 | import it.niedermann.owncloud.notes.BuildConfig;
13 | import it.niedermann.owncloud.notes.R;
14 | import it.niedermann.owncloud.notes.util.SupportUtil;
15 |
16 | public class AboutFragmentCreditsTab extends Fragment {
17 |
18 | @BindView(R.id.about_version)
19 | TextView aboutVersion;
20 | @BindView(R.id.about_maintainer)
21 | TextView aboutMaintainer;
22 | @BindView(R.id.about_translators)
23 | TextView aboutTranslators;
24 |
25 | @Override
26 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
27 | View v = inflater.inflate(R.layout.fragment_about_credits_tab, container, false);
28 | ButterKnife.bind(this, v);
29 | SupportUtil.setHtml(aboutVersion, R.string.about_version, "v" + BuildConfig.VERSION_NAME);
30 | SupportUtil.setHtml(aboutMaintainer, R.string.about_maintainer);
31 | SupportUtil.setHtml(aboutTranslators, R.string.about_translators_transifex, getString(R.string.url_translations));
32 | return v;
33 | }
34 | }
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/quicksettings/NewNoteTileService.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.quicksettings;
2 |
3 | import android.annotation.TargetApi;
4 | import android.content.Intent;
5 | import android.os.Build;
6 | import android.service.quicksettings.Tile;
7 | import android.service.quicksettings.TileService;
8 |
9 | import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
10 |
11 | /**
12 | * This {@link TileService} adds a quick settings tile that leads to the new note view.
13 | */
14 | @TargetApi(Build.VERSION_CODES.N)
15 | public class NewNoteTileService extends TileService {
16 |
17 | @Override
18 | public void onStartListening() {
19 | Tile tile = getQsTile();
20 | tile.setState(Tile.STATE_ACTIVE);
21 |
22 | tile.updateTile();
23 | }
24 |
25 | @Override
26 | public void onClick() {
27 | // create new note intent
28 | final Intent newNoteIntent = new Intent(getApplicationContext(), EditNoteActivity.class);
29 | // ensure it won't open twice if already running
30 | newNoteIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
31 |
32 | // ask to unlock the screen if locked, then start new note intent
33 | unlockAndRun(new Runnable() {
34 | @Override
35 | public void run() {
36 | startActivityAndCollapse(newNoteIntent);
37 | }
38 | });
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_note_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentLicenseTab.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.fragment.about;
2 |
3 | import android.content.Intent;
4 | import android.net.Uri;
5 | import android.os.Bundle;
6 | import android.support.v4.app.Fragment;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.Button;
11 | import android.widget.TextView;
12 |
13 | import butterknife.BindView;
14 | import butterknife.ButterKnife;
15 | import butterknife.OnClick;
16 | import it.niedermann.owncloud.notes.R;
17 | import it.niedermann.owncloud.notes.util.SupportUtil;
18 |
19 | public class AboutFragmentLicenseTab extends Fragment {
20 |
21 | @BindView(R.id.about_icons_disclaimer)
22 | TextView iconsDisclaimer;
23 | @BindView(R.id.about_app_license_button)
24 | Button appLicenseButton;
25 |
26 | @OnClick(R.id.about_app_license_button)
27 | void openLicense() {
28 | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.url_license))));
29 | }
30 |
31 | @Override
32 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
33 | View v = inflater.inflate(R.layout.fragment_about_license_tab, container, false);
34 | ButterKnife.bind(this, v);
35 | SupportUtil.setHtml(iconsDisclaimer, R.string.about_icons_disclaimer, getString(R.string.about_app_icon_author));
36 | return v;
37 | }
38 | }
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing guide
2 |
3 | ## Submitting bug reports
4 |
5 | If you find a bug, feel free to [open an issue](https://github.com/stefan-niedermann/OwnCloud-Notes/issues/new). But please provide these information in the comment:
6 |
7 | **Android version:** e. g. 6.0.1 Marshmallow
8 |
9 | **Device**: e. g. Motorola Moto G 2015
10 |
11 | **System language**: English (US), German, ...
12 |
13 | **App version:** e. g. v0.8.1
14 |
15 | **App source:** Google Play Store, F-Droid or self-built?
16 |
17 | **Steps to reproduce:**
18 | 1. open the app
19 | 2. click on a note
20 | 3. use the top left back-arrow
21 | 4. ...
22 |
23 | ### Copy & Paste
24 | **Android version:** e. g. 6.0.1 Marshmallow
25 |
26 | **Device**: e. g. Motorola Moto G 2015
27 |
28 | **System language**: English (US), German, ...
29 |
30 | **App version:** e. g. v0.8.1
31 |
32 | **App source:** Google Play Store, F-Droid or self-built?
33 |
34 | **Steps to reproduce:**
35 | 1. open the app
36 | 2. click on a note
37 | 3. use the top left back-arrow
38 | 4. ...
39 |
40 | ## Adding new features
41 |
42 | If you want to contribute on the code, you can fork the project, commit your changes and make a pull request. For bigger features/changes, it's better to first [open an issue](https://github.com/stefan-niedermann/OwnCloud-Notes/issues/new) and ask if this feature is needed or wanted – it would be very disappointing if you add a new cool feature and your pull request will be rejected by some reasons you didn't thought about.
43 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 27
5 | buildToolsVersion '27.0.3'
6 |
7 | defaultConfig {
8 | applicationId "it.niedermann.owncloud.notes"
9 | minSdkVersion 14
10 | targetSdkVersion 27
11 | versionCode 33
12 | versionName "0.21.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | lintOptions {
21 | disable 'MissingTranslation'
22 | abortOnError false
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation project(':cert4android')
28 |
29 | implementation 'io.reactivex:rxandroid:1.2.0'
30 | implementation 'io.reactivex:rxjava:1.1.5'
31 | implementation 'com.yydcdut:markdown-processor:0.1.3'
32 | implementation 'com.yydcdut:rxmarkdown-wrapper:0.1.3'
33 |
34 | implementation 'com.jakewharton:butterknife:8.8.1'
35 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
36 |
37 | def supportLibVersion = '27.1.1'
38 |
39 | implementation "com.android.support:appcompat-v7:${supportLibVersion}"
40 | implementation "com.android.support:design:${supportLibVersion}"
41 | implementation "com.android.support:recyclerview-v7:${supportLibVersion}"
42 | // needed for cert4android (conflict resolution)
43 | implementation "com.android.support:cardview-v7:${supportLibVersion}"
44 | implementation fileTree(dir: 'libs', include: ['*.jar'])
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_quicksettings_new.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_navigation.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 |
26 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/model/DBStatus.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.model;
2 |
3 | /**
4 | * Helps to distinguish between different local change types for Server Synchronization.
5 | * Created by stefan on 19.09.15.
6 | */
7 | public enum DBStatus {
8 |
9 | /**
10 | * VOID means, that the Note was not modified locally
11 | */
12 | VOID(""),
13 |
14 | /**
15 | * LOCAL_CREATED is not used anymore, since a newly created note has REMOTE_ID=0
16 | */
17 | @Deprecated
18 | LOCAL_CREATED("LOCAL_CREATED"),
19 |
20 | /**
21 | * LOCAL_EDITED means that a Note was created and/or changed since the last successful synchronization.
22 | * If it was newly created, then REMOTE_ID is 0
23 | */
24 | LOCAL_EDITED("LOCAL_EDITED"),
25 |
26 | /**
27 | * LOCAL_DELETED means that the Note was deleted locally, but this information was not yet synchronized.
28 | * Therefore, the Note have to be kept locally until the synchronization has succeeded.
29 | * However, Notes with this status should not be displayed in the UI.
30 | */
31 | LOCAL_DELETED("LOCAL_DELETED");
32 |
33 | private final String title;
34 |
35 | public String getTitle() {
36 | return title;
37 | }
38 |
39 | DBStatus(String title) {
40 | this.title = title;
41 | }
42 |
43 | /**
44 | * Parse a String an get the appropriate DBStatus enum element.
45 | *
46 | * @param str The String containing the DBStatus identifier. Must not null.
47 | * @return The DBStatus fitting to the String.
48 | */
49 | public static DBStatus parse(String str) {
50 | if (str.isEmpty()) {
51 | return DBStatus.VOID;
52 | } else {
53 | return DBStatus.valueOf(str);
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/widget_entry.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
21 |
22 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/model/DBNote.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Calendar;
5 |
6 | import it.niedermann.owncloud.notes.util.NoteUtil;
7 |
8 | /**
9 | * DBNote represents a single note from the local SQLite database with all attributes.
10 | * It extends CloudNote with attributes required for local data management.
11 | */
12 | public class DBNote extends CloudNote implements Item, Serializable {
13 |
14 | private long id;
15 | private DBStatus status;
16 | private String excerpt = "";
17 |
18 | public DBNote(long id, long remoteId, Calendar modified, String title, String content, boolean favorite, String category, String etag, DBStatus status) {
19 | super(remoteId, modified, title, content, favorite, category, etag);
20 | this.id = id;
21 | setExcerpt(content);
22 | this.status = status;
23 | }
24 |
25 | public long getId() {
26 | return id;
27 | }
28 |
29 | public DBStatus getStatus() {
30 | return status;
31 | }
32 |
33 | public void setStatus(DBStatus status) {
34 | this.status = status;
35 | }
36 |
37 | public String getExcerpt() {
38 | return excerpt;
39 | }
40 |
41 | public void setExcerptDirectly(String content) {
42 | excerpt = content;
43 | }
44 |
45 | private void setExcerpt(String content) {
46 | excerpt = NoteUtil.generateNoteExcerpt(content);
47 | }
48 |
49 | public void setContent(String content) {
50 | super.setContent(content);
51 | setExcerpt(content);
52 | }
53 |
54 | @Override
55 | public boolean isSection() {
56 | return false;
57 | }
58 |
59 | @Override
60 | public String toString() {
61 | return "#" + getId() + "/" + super.toString() + " " + getStatus();
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/AlwaysAutoCompleteTextView.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.AppCompatAutoCompleteTextView;
5 | import android.util.AttributeSet;
6 | import android.util.Log;
7 | import android.view.WindowManager;
8 |
9 | /**
10 | * Extension of the {@link AppCompatAutoCompleteTextView}, but this one is always open, i.e. you can see the list of suggestions even the TextView is empty.
11 | */
12 | public class AlwaysAutoCompleteTextView extends AppCompatAutoCompleteTextView {
13 |
14 | private int myThreshold;
15 |
16 | public AlwaysAutoCompleteTextView(Context context) {
17 | super(context);
18 | }
19 |
20 | public AlwaysAutoCompleteTextView(Context context, AttributeSet attrs, int defStyle) {
21 | super(context, attrs, defStyle);
22 | }
23 |
24 | public AlwaysAutoCompleteTextView(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | }
27 |
28 | @Override
29 | public void setThreshold(int threshold) {
30 | if (threshold < 0) {
31 | threshold = 0;
32 | }
33 | myThreshold = threshold;
34 | }
35 |
36 | @Override
37 | public boolean enoughToFilter() {
38 | return getText().length() >= myThreshold;
39 | }
40 |
41 | @Override
42 | public int getThreshold() {
43 | return myThreshold;
44 | }
45 |
46 | public void showFullDropDown() {
47 | try {
48 | performFiltering(getText(), 0);
49 | showDropDown();
50 | } catch (WindowManager.BadTokenException e) {
51 | // https://github.com/stefan-niedermann/nextcloud-notes/issues/366
52 | e.printStackTrace();
53 | Log.e(AlwaysAutoCompleteTextView.class.getSimpleName(), "Exception", e);
54 | }
55 | }
56 | }
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/CreateNoteWidget.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.appwidget;
2 |
3 | import android.app.PendingIntent;
4 | import android.appwidget.AppWidgetManager;
5 | import android.appwidget.AppWidgetProvider;
6 | import android.content.Context;
7 | import android.content.Intent;
8 | import android.widget.RemoteViews;
9 |
10 | import it.niedermann.owncloud.notes.R;
11 | import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
12 |
13 | /**
14 | * Implementation of App Widget functionality.
15 | */
16 | public class CreateNoteWidget extends AppWidgetProvider {
17 |
18 | private static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
19 | int appWidgetId) {
20 |
21 | // Construct the RemoteViews object
22 | RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_create_note);
23 | Intent intent = new Intent(context, EditNoteActivity.class);
24 |
25 | PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
26 | views.setOnClickPendingIntent(R.id.widget_create_note, pendingIntent);
27 |
28 | // Instruct the widget manager to update the widget
29 | appWidgetManager.updateAppWidget(appWidgetId, views);
30 | }
31 |
32 | @Override
33 | public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
34 |
35 | // There may be multiple widgets active, so update all of them
36 | for (int appWidgetId : appWidgetIds) {
37 | updateAppWidget(context, appWidgetManager, appWidgetId);
38 | }
39 | }
40 |
41 | @Override
42 | public void onEnabled(Context context) {
43 | // Enter relevant functionality for when the first widget is created
44 | }
45 |
46 | @Override
47 | public void onDisabled(Context context) {
48 | // Enter relevant functionality for when the last widget is disabled
49 | }
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
10 |
11 |
12 |
20 |
21 |
27 |
28 |
33 |
39 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_notes_list_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
19 |
20 |
27 |
28 |
34 |
35 |
36 |
37 |
38 |
39 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_about_license_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
18 |
19 |
26 |
27 |
32 |
33 |
40 |
41 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/it/niedermann/owncloud/notes/util/NotesClientUtilTest.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.util;
2 |
3 | import junit.framework.TestCase;
4 |
5 | /**
6 | * Tests the NotesClientUtil
7 | * Created by stefan on 24.09.15.
8 | */
9 | public class NotesClientUtilTest extends TestCase {
10 | public void testFormatURL() {
11 | assertEquals("https://example.com/", NotesClientUtil.formatURL("example.com/"));
12 | assertEquals("http://example.com/", NotesClientUtil.formatURL("http://example.com/"));
13 | assertEquals("https://example.com/", NotesClientUtil.formatURL("example.com/index.php"));
14 | assertEquals("https://example.com/", NotesClientUtil.formatURL("example.com/index.php/"));
15 | assertEquals("https://example.com/", NotesClientUtil.formatURL("example.com/index.php/apps"));
16 | assertEquals("https://example.com/", NotesClientUtil.formatURL("example.com/index.php/apps/notes"));
17 | assertEquals("https://example.com/", NotesClientUtil.formatURL("example.com/index.php/apps/notes/api"));
18 | assertEquals("https://example.com/", NotesClientUtil.formatURL("example.com/index.php/apps/notes/api/v0.2"));
19 | assertEquals("https://example.com/", NotesClientUtil.formatURL("example.com/index.php/apps/notes/api/v0.2/notes"));
20 | assertEquals("https://example.com/nextcloud/", NotesClientUtil.formatURL("example.com/nextcloud"));
21 | assertEquals("http://example.com:443/nextcloud/", NotesClientUtil.formatURL("http://example.com:443/nextcloud/index.php/apps/notes/api/v0.2/notes"));
22 | }
23 |
24 | public void testIsHttp() {
25 | assertTrue(NotesClientUtil.isHttp("http://example.com"));
26 | assertTrue(NotesClientUtil.isHttp("http://www.example.com/"));
27 | assertFalse(NotesClientUtil.isHttp("https://www.example.com/"));
28 | assertFalse(NotesClientUtil.isHttp(null));
29 | }
30 |
31 | public void testIsValidURLTest() {
32 | assertTrue(NotesClientUtil.isValidURL(null, "https://demo.owncloud.org/"));
33 | assertFalse(NotesClientUtil.isValidURL(null, "https://www.example.com/"));
34 | assertFalse(NotesClientUtil.isValidURL(null, "htp://www.example.com/"));
35 | assertFalse(NotesClientUtil.isValidURL(null, null));
36 | }
37 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_about_contribution_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
18 |
19 |
26 |
27 |
33 |
34 |
41 |
42 |
48 |
49 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/PreferencesFragment.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.fragment;
2 |
3 | import android.app.Activity;
4 | import android.content.SharedPreferences;
5 | import android.os.Bundle;
6 | import android.preference.Preference;
7 | import android.preference.PreferenceFragment;
8 | import android.preference.PreferenceManager;
9 | import android.preference.SwitchPreference;
10 | import android.support.annotation.Nullable;
11 | import android.widget.Toast;
12 |
13 | import at.bitfire.cert4android.CustomCertManager;
14 | import it.niedermann.owncloud.notes.R;
15 | import it.niedermann.owncloud.notes.util.Notes;
16 |
17 | public class PreferencesFragment extends PreferenceFragment {
18 | @Override
19 | public void onCreate(@Nullable Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | addPreferencesFromResource(R.xml.preferences);
22 |
23 | Preference resetTrust = findPreference(getString(R.string.pref_key_reset_trust));
24 | resetTrust.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
25 | @Override
26 | public boolean onPreferenceClick(Preference preference) {
27 | CustomCertManager.Companion.resetCertificates(getActivity());
28 | Toast.makeText(getActivity(), getString(R.string.settings_cert_reset_toast), Toast.LENGTH_SHORT).show();
29 | return true;
30 | }
31 | });
32 |
33 | final SwitchPreference themePref = (SwitchPreference) findPreference("darkTheme");
34 | SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
35 | Boolean darkTheme = sp.getBoolean(getString(R.string.pref_key_theme), false);
36 |
37 | setThemePreferenceSummary(themePref, darkTheme);
38 | themePref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
39 | @Override
40 | public boolean onPreferenceChange(Preference preference, Object newValue) {
41 | Boolean darkTheme = (Boolean) newValue;
42 | Notes.setAppTheme(darkTheme);
43 | getActivity().setResult(Activity.RESULT_OK);
44 | getActivity().finish();
45 |
46 | return true;
47 | }
48 | });
49 | }
50 |
51 | private void setThemePreferenceSummary(SwitchPreference themePref, Boolean darkTheme) {
52 | if (darkTheme) {
53 | themePref.setSummary(getString(R.string.pref_value_theme_dark));
54 | } else {
55 | themePref.setSummary(getString(R.string.pref_value_theme_light));
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/activity/AboutActivity.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.activity;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.TabLayout;
5 | import android.support.v4.app.Fragment;
6 | import android.support.v4.app.FragmentManager;
7 | import android.support.v4.app.FragmentPagerAdapter;
8 | import android.support.v4.view.ViewPager;
9 | import android.support.v7.app.AppCompatActivity;
10 |
11 | import butterknife.BindView;
12 | import butterknife.ButterKnife;
13 | import it.niedermann.owncloud.notes.R;
14 | import it.niedermann.owncloud.notes.android.fragment.about.AboutFragmentContributingTab;
15 | import it.niedermann.owncloud.notes.android.fragment.about.AboutFragmentCreditsTab;
16 | import it.niedermann.owncloud.notes.android.fragment.about.AboutFragmentLicenseTab;
17 |
18 | public class AboutActivity extends AppCompatActivity {
19 |
20 | @BindView(R.id.pager)
21 | ViewPager mViewPager;
22 | @BindView(R.id.tabs)
23 | TabLayout mTabLayout;
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.activity_about);
29 | ButterKnife.bind(this);
30 |
31 | mViewPager.setAdapter(new TabsPagerAdapter(getSupportFragmentManager()));
32 | mTabLayout.setupWithViewPager(mViewPager);
33 | }
34 |
35 | private class TabsPagerAdapter extends FragmentPagerAdapter {
36 | private final int PAGE_COUNT = 3;
37 |
38 | public TabsPagerAdapter(FragmentManager fragmentManager) {
39 | super(fragmentManager);
40 | }
41 |
42 | @Override
43 | public int getCount() {
44 | return PAGE_COUNT;
45 | }
46 |
47 | /**
48 | * return the right fragment for the given position
49 | */
50 | @Override
51 | public Fragment getItem(int position) {
52 | switch (position) {
53 | case 0:
54 | return new AboutFragmentCreditsTab();
55 |
56 | case 1:
57 | return new AboutFragmentContributingTab();
58 |
59 | case 2:
60 | return new AboutFragmentLicenseTab();
61 |
62 | default:
63 | return null;
64 | }
65 | }
66 |
67 | /**
68 | * generate title based on given position
69 | */
70 | @Override
71 | public CharSequence getPageTitle(int position) {
72 | switch (position) {
73 | case 0:
74 | return getString(R.string.about_credits_tab_title);
75 |
76 | case 1:
77 | return getString(R.string.about_contribution_tab_title);
78 |
79 | case 2:
80 | return getString(R.string.about_license_tab_title);
81 |
82 | default:
83 | return null;
84 | }
85 | }
86 | }
87 | }
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/activity/SelectSingleNoteActivity.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.activity;
2 |
3 | import android.app.Activity;
4 | import android.appwidget.AppWidgetManager;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | import android.os.Bundle;
8 | import android.preference.PreferenceManager;
9 | import android.support.v4.widget.SwipeRefreshLayout;
10 | import android.view.Menu;
11 | import android.view.View;
12 |
13 | import butterknife.BindView;
14 | import butterknife.ButterKnife;
15 | import it.niedermann.owncloud.notes.R;
16 | import it.niedermann.owncloud.notes.android.appwidget.SingleNoteWidget;
17 | import it.niedermann.owncloud.notes.model.DBNote;
18 | import it.niedermann.owncloud.notes.model.Item;
19 | import it.niedermann.owncloud.notes.model.ItemAdapter;
20 |
21 | public class SelectSingleNoteActivity extends NotesListViewActivity {
22 |
23 | @BindView(R.id.fab_create)
24 | View fabCreate;
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 |
30 | SwipeRefreshLayout swipeRefreshLayout = getSwipeRefreshLayout();
31 |
32 | setResult(Activity.RESULT_CANCELED);
33 |
34 | ButterKnife.bind(this);
35 | fabCreate.setVisibility(View.GONE);
36 |
37 | android.support.v7.app.ActionBar ab = getSupportActionBar();
38 | if (ab != null) {
39 | ab.setTitle(R.string.activity_select_single_note);
40 | }
41 | swipeRefreshLayout.setEnabled(false);
42 | swipeRefreshLayout.setRefreshing(false);
43 | }
44 |
45 | @Override
46 | public boolean onCreateOptionsMenu(Menu menu) {
47 | return true;
48 | }
49 |
50 | @Override
51 | public void onNoteClick(int position, View v) {
52 | ItemAdapter adapter = getItemAdapter();
53 | Item item = adapter.getItem(position);
54 | DBNote note = (DBNote) item;
55 | long noteID = note.getId();
56 | Intent intent = getIntent();
57 | Bundle extras = intent.getExtras();
58 | int mAppWidgetId = -1;
59 |
60 | if (extras != null) {
61 | mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
62 | }
63 |
64 | SharedPreferences.Editor sp = PreferenceManager.getDefaultSharedPreferences(this).edit();
65 |
66 | sp.putLong(SingleNoteWidget.WIDGET_KEY + mAppWidgetId, noteID);
67 | sp.apply();
68 |
69 | Intent retIntent = new Intent(this, SingleNoteWidget.class);
70 | retIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
71 | retIntent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
72 | sendBroadcast(retIntent);
73 | setResult(RESULT_OK, retIntent);
74 | finish();
75 | }
76 |
77 | @Override
78 | public boolean onNoteLongClick(int position, View v) {
79 | return false;
80 | }
81 |
82 | @Override
83 | public void onNoteFavoriteClick(int position, View view) {
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
24 |
25 |
26 |
37 |
38 |
42 |
43 |
50 |
51 |
52 |
57 |
58 |
65 |
66 |
67 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/model/CloudNote.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.model;
2 |
3 | import java.io.Serializable;
4 | import java.text.SimpleDateFormat;
5 | import java.util.Calendar;
6 | import java.util.Locale;
7 |
8 | import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper;
9 | import it.niedermann.owncloud.notes.util.NoteUtil;
10 |
11 | /**
12 | * CloudNote represents a remote note from an OwnCloud server.
13 | * It can be directly generated from the JSON answer from the server.
14 | */
15 | public class CloudNote implements Serializable {
16 | private long remoteId = 0;
17 | private String title = "";
18 | private Calendar modified = null;
19 | private String content = "";
20 | private boolean favorite = false;
21 | private String category = "";
22 | private String etag = "";
23 |
24 | public CloudNote(long remoteId, Calendar modified, String title, String content, boolean favorite, String category, String etag) {
25 | this.remoteId = remoteId;
26 | if (title != null)
27 | setTitle(title);
28 | setTitle(title);
29 | setContent(content);
30 | setFavorite(favorite);
31 | setCategory(category);
32 | setEtag(etag);
33 | this.modified = modified;
34 | }
35 |
36 | public long getRemoteId() {
37 | return remoteId;
38 | }
39 |
40 | public void setRemoteId(long remoteId) {
41 | this.remoteId = remoteId;
42 | }
43 |
44 | public String getTitle() {
45 | return title;
46 | }
47 |
48 | public void setTitle(String title) {
49 | this.title = NoteUtil.removeMarkDown(title);
50 | }
51 |
52 | @SuppressWarnings("WeakerAccess")
53 | public Calendar getModified() {
54 | return modified;
55 | }
56 |
57 | public String getModified(String format) {
58 | if (modified == null)
59 | return null;
60 | return new SimpleDateFormat(format, Locale.GERMANY).format(this.getModified().getTimeInMillis());
61 | }
62 |
63 | public void setModified(Calendar modified) {
64 | this.modified = modified;
65 | }
66 |
67 | public String getContent() {
68 | return content;
69 | }
70 |
71 | public void setContent(String content) {
72 | this.content = content;
73 | }
74 |
75 | public boolean isFavorite() {
76 | return favorite;
77 | }
78 |
79 | public void setFavorite(boolean favorite) {
80 | this.favorite = favorite;
81 | }
82 |
83 | public String getEtag() {
84 | return etag;
85 | }
86 |
87 | public void setEtag(String etag) {
88 | this.etag = etag;
89 | }
90 |
91 | public String getCategory() {
92 | return category;
93 | }
94 |
95 | public void setCategory(String category) {
96 | this.category = category == null ? "" : category;
97 | }
98 |
99 | @Override
100 | public String toString() {
101 | final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
102 | return "R" + getRemoteId() + " " + (isFavorite() ? " (*) " : " ") + getCategory() + " / " + getTitle() + " (" + getModified(DATE_FORMAT) + " / " + getEtag() + ")";
103 | }
104 | }
--------------------------------------------------------------------------------
/.tx/config:
--------------------------------------------------------------------------------
1 | [main]
2 | host = https://www.transifex.com
3 |
4 | [nextcloud.android-notes]
5 | file_filter = app/src/main/res/values-/strings.xml
6 | source_file = app/src/main/res/values/strings.xml
7 | type = ANDROID
8 | source_lang = en
9 | lang_map = af_ZA: af-rZA, am_ET: am-rET, ar_AE: ar-rAE, ar_BH: ar-rBH, ar_DZ: ar-rDZ, ar_EG: ar-rEG, ar_IQ: ar-rIQ, ar_JO: ar-rJO, ar_KW: ar-rKW, ar_LB: ar-rLB, ar_LY: ar-rLY, ar_MA: ar-rMA, ar_OM: ar-rOM, ar_QA: ar-rQA, ar_SA: ar-rSA, ar_SY: ar-rSY, ar_TN: ar-rTN, ar_YE: ar-rYE, arn_CL: arn-rCL, as_IN: as-rIN, az_AZ: az-rAZ, ba_RU: ba-rRU, be_BY: be-rBY, bg_BG: bg-rBG, bn_BD: bn-rBD, bn_IN: bn-rIN, bo_CN: bo-rCN, br_FR: br-rFR, bs_BA: bs-rBA, ca_ES: ca-rES, co_FR: co-rFR, cs_CZ: cs-rCZ, cy_GB: cy-rGB, da_DK: da-rDK, de_AT: de-rAT, de_CH: de-rCH, de_DE: de-rDE, de_LI: de-rLI, de_LU: de-rLU, dsb_DE: dsb-rDE, dv_MV: dv-rMV, el_GR: el-rGR, en_AU: en-rAU, en_BZ: en-rBZ, en_CA: en-rCA, en_GB: b+en+001, en_IE: en-rIE, en_IN: en-rIN, en_JM: en-rJM, en_MY: en-rMY, en_NZ: en-rNZ, en_PH: en-rPH, en_SG: en-rSG, en_TT: en-rTT, en_US: en-rUS, en_ZA: en-rZA, en_ZW: en-rZW, en@pirate: en-rpirate, es_AR: es-rAR, es_BO: es-rBO, es_CL: es-rCL, es_CO: es-rCO, es_CR: es-rCR, es_DO: es-rDO, es_EC: es-rEC, es_ES: es-rES, es_GT: es-rGT, es_HN: es-rHN, es_MX: es-rMX, es_NI: es-rNI, es_PA: es-rPA, es_PE: es-rPE, es_PR: es-rPR, es_PY: es-rPY, es_SV: es-rSV, es_419: b+es+419, es_UY: es-rUY, es_VE: es-rVE, et_EE: et-rEE, eu_ES: eu-rES, fa_IR: fa-rIR, fi_FI: fi-rFI, fil_PH: fil-rPH, fo_FO: fo-rFO, fr_BE: fr-rBE, fr_CA: fr-rCA, fr_CH: fr-rCH, fr_FR: fr-rFR, fr_LU: fr-rLU, fr_MC: fr-rMC, fy_NL: fy-rNL, ga_IE: ga-rIE, gd_GB: gd-rGB, gl_ES: gl-rES, gsw_FR: gsw-rFR, gu_IN: gu-rIN, ha_NG: ha-rNG, he_IL: he-rIL, hi_IN: hi-rIN, hr_BA: hr-rBA, hr_HR: hr-rHR, hsb_DE: hsb-rDE, hu_HU: hu-rHU, hy_AM: hy-rAM, id_ID: id-rID, ig_NG: ig-rNG, ii_CN: ii-rCN, is_IS: is-rIS, it_CH: it-rCH, it_IT: it-rIT, iu_CA: iu-rCA, ja_JP: ja-rJP, ka_GE: ka-rGE, kk_KZ: kk-rKZ, kl_GL: kl-rGL, km_KH: km-rKH, kn_IN: kn-rIN, ko_KR: ko-rKR, kok_IN: kok-rIN, ku_IQ: ku-rIQ, ky_KG: ky-rKG, lb_LU: lb-rLU, lo_LA: lo-rLA, lt_LT: lt-rLT, lv_LV: lv-rLV, mi_NZ: mi-rNZ, mk_MK: mk-rMK, ml_IN: ml-rIN, mn_CN: mn-rCN, mn_MN: mn-rMN, moh_CA: moh-rCA, mr_IN: mr-rIN, ms_BN: ms-rBN, ms_MY: ms-rMY, my_MM: my, mt_MT: mt-rMT, nb_NO: nb-rNO, ne_NP: ne-rNP, nl_BE: nl-rBE, nl_NL: nl-rNL, nn_NO: nn-rNO, nso_ZA: nso-rZA, oc_FR: oc-rFR, or_IN: or-rIN, pa_IN: pa-rIN, pl_PL: pl-rPL, prs_AF: prs-rAF, ps_AF: ps-rAF, pt_BR: pt-rBR, pt_PT: pt-rPT, qut_GT: qut-rGT, quz_BO: quz-rBO, quz_EC: quz-rEC, quz_PE: quz-rPE, rm_CH: rm-rCH, ro_RO: ro-rRO, ru_RU: ru-rRU, rw_RW: rw-rRW, sa_IN: sa-rIN, sah_RU: sah-rRU, se_FI: se-rFI, se_NO: se-rNO, se_SE: se-rSE, si_LK: si-rLK, sk_SK: sk-rSK, sl_SI: sl-rSI, sma_NO: sma-rNO, sma_SE: sma-rSE, smj_NO: smj-rNO, smj_SE: smj-rSE, smn_FI: smn-rFI, sms_FI: sms-rFI, sq_AL: sq-rAL, sr_BA: sr-rBA, sr_CS: sr-rCS, sr_ME: sr-rME, sr_RS: sr-rRS, sr@latin: sr-rSP, sv_FI: sv-rFI, sv_SE: sv-rSE, sw_KE: sw-rKE, syr_SY: syr-rSY, ta_IN: ta-rIN, ta_LK: ta-rLK, te_IN: te-rIN, tg_TJ: tg-rTJ, th_TH: th-rTH, tk_TM: tk-rTM, tn_ZA: tn-rZA, tr_TR: tr-rTR, tt_RU: tt-rRU, tzm_DZ: tzm-rDZ, ug_CN: ug-rCN, uk_UA: uk-rUA, ur_PK: ur-rPK, uz_UZ: uz-rUZ, vi_VN: vi-rVN, wo_SN: wo-rSN, xh_ZA: xh-rZA, yo_NG: yo-rNG, zh_CN: zh-rCN, zh_CN.GB2312:zh-rBG, zh_HK: zh-rHK, zh_MO: zh-rMO, zh_SG: zh-rSG, zh_TW: zh-rTW, zu_ZA: zu-rZA
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
17 |
21 |
22 |
26 |
27 |
30 |
33 |
34 |
35 |
36 |
44 |
45 |
53 |
54 |
60 |
61 |
64 |
65 |
70 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/SingleNoteWidget.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.appwidget;
2 |
3 | import android.app.PendingIntent;
4 | import android.appwidget.AppWidgetManager;
5 | import android.appwidget.AppWidgetProvider;
6 | import android.content.ComponentName;
7 | import android.content.Context;
8 | import android.content.Intent;
9 | import android.content.SharedPreferences;
10 | import android.net.Uri;
11 | import android.preference.PreferenceManager;
12 | import android.widget.RemoteViews;
13 |
14 | import it.niedermann.owncloud.notes.R;
15 | import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
16 |
17 | import static android.appwidget.AppWidgetManager.ACTION_APPWIDGET_UPDATE;
18 |
19 | public class SingleNoteWidget extends AppWidgetProvider {
20 |
21 | public static final String WIDGET_KEY = "single_note_widget";
22 |
23 | @Override
24 | public void onDeleted(Context context, int[] appWidgetIds) {
25 | SharedPreferences.Editor editor = PreferenceManager
26 | .getDefaultSharedPreferences(context).edit();
27 |
28 | for (int appWidgetId : appWidgetIds) {
29 | editor.remove(WIDGET_KEY + appWidgetId);
30 | }
31 |
32 | editor.apply();
33 | super.onDeleted(context, appWidgetIds);
34 | }
35 |
36 | @Override
37 | public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
38 | for (int appWidgetId : appWidgetIds) {
39 | Intent templateIntent = new Intent(context, EditNoteActivity.class);
40 | templateIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
41 |
42 | PendingIntent templatePendingIntent = PendingIntent.getActivity(
43 | context,
44 | appWidgetId,
45 | templateIntent,
46 | PendingIntent.FLAG_UPDATE_CURRENT);
47 |
48 | Intent serviceIntent = new Intent(context, SingleNoteWidgetService.class);
49 | RemoteViews views = new RemoteViews(context.getPackageName(),
50 | R.layout.widget_single_note);
51 |
52 | serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
53 | serviceIntent.setData(Uri.parse(serviceIntent.toUri(Intent.URI_INTENT_SCHEME)));
54 | views.setPendingIntentTemplate(R.id.single_note_widget_lv, templatePendingIntent);
55 | views.setRemoteAdapter(R.id.single_note_widget_lv, serviceIntent);
56 | views.setEmptyView(R.id.single_note_widget_lv, R.id.widget_single_note_placeholder_tv);
57 |
58 | appWidgetManager.updateAppWidget(appWidgetId, views);
59 | }
60 |
61 | super.onUpdate(context, appWidgetManager, appWidgetIds);
62 | }
63 |
64 | @Override
65 | public void onReceive(Context context, Intent intent) {
66 | AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
67 | int ids[] = appWidgetManager.getAppWidgetIds(new ComponentName(context,
68 | SingleNoteWidget.class));
69 |
70 | for (int appWidgetId : ids) {
71 | if (ACTION_APPWIDGET_UPDATE.equals(intent.getAction())) {
72 | appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetId,
73 | R.id.single_note_widget_lv);
74 | }
75 | }
76 |
77 | super.onReceive(context, intent);
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Nextcloud Notes
2 | An android client for [Nextcloud Notes App](https://github.com/nextcloud/notes/).
3 |
4 | [](https://travis-ci.org/stefan-niedermann/nextcloud-notes)
5 | [](https://github.com/stefan-niedermann/nextcloud-notes/issues)
6 | [](https://github.com/stefan-niedermann/nextcloud-notes/stargazers)
7 | [](https://www.gnu.org/licenses/gpl-3.0)
8 |
9 | ## :arrow_forward: Access
10 |
11 | [](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes)
12 | [](https://f-droid.org/repository/browse/?fdid=it.niedermann.owncloud.notes)
13 | [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K7HVLE6J7SXXA)
14 | [](https://liberapay.com/stefan-niedermann/donate)
15 |
16 | ## :eyes: Screenshots
17 |
18 | 
19 | 
20 |
21 | ## :rocket: Features
22 | * List, create, edit, share, search and delete notes
23 | * Share text and links as new note into the app
24 | * Mark notes as favorite
25 | * Bulk delete
26 | * Render MarkDown (using [RxMarkdown](https://github.com/yydcdut/RxMarkdown))
27 | * Translated in many languages on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/)
28 |
29 | ## :checkered_flag: Planned features
30 | * In-note search ([#106](https://github.com/stefan-niedermann/nextcloud-notes/issues/106))
31 | * Toggle checkboxes in view mode ([#451](https://github.com/stefan-niedermann/nextcloud-notes/issues/451))
32 | * Context based formatting ([#363](https://github.com/stefan-niedermann/nextcloud-notes/issues/363))
33 | * Trashbin ([#238](https://github.com/stefan-niedermann/nextcloud-notes/issues/238))
34 |
35 | ## :family: Join the team
36 | * Test the app with different devices
37 | * Report issues in the [issue tracker](https://github.com/stefan-niedermann/nextcloud-notes/issues)
38 | * [Pick a good first issue](https://github.com/nextcloud/server/labels/good%20first%20issue) :notebook:
39 | * Create a [Pull Request](https://opensource.guide/how-to-contribute/#opening-a-pull-request)
40 | * Help translating this app on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/) :flags:
41 | * Buy this app on [Google Play Store](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes)
42 | * Send me a bottle of your favorite beer :beers: :wink:
43 |
44 | ## :link: Requirements
45 | * [Nextcloud](https://nextcloud.com/) instance running
46 | * [Nextcloud Notes](https://github.com/nextcloud/notes) app enabled
47 |
48 | ## :notebook: License
49 | This project is licensed under the [GNU GENERAL PUBLIC LICENSE](/LICENSE).
50 |
51 | ## :twisted_rightwards_arrows: Alternatives
52 | If you dislike this app and you are looking for alternatives: Have a look at [MyOwnNotes](https://github.com/aykit/MyOwnNotes).
53 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/util/ServerResponse.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.util;
2 |
3 | import org.json.JSONArray;
4 | import org.json.JSONException;
5 | import org.json.JSONObject;
6 |
7 | import java.io.IOException;
8 | import java.util.ArrayList;
9 | import java.util.Calendar;
10 | import java.util.GregorianCalendar;
11 | import java.util.List;
12 |
13 | import it.niedermann.owncloud.notes.model.CloudNote;
14 |
15 | /**
16 | * Provides entity classes for handling server responses with a single note ({@link NoteResponse}) or a list of notes ({@link NotesResponse}).
17 | */
18 | public class ServerResponse {
19 |
20 | public static class NotModifiedException extends IOException {
21 | }
22 |
23 | public static class NoteResponse extends ServerResponse {
24 | public NoteResponse(NotesClient.ResponseData response) {
25 | super(response);
26 | }
27 |
28 | public CloudNote getNote() throws JSONException {
29 | return getNoteFromJSON(new JSONObject(getContent()));
30 | }
31 | }
32 |
33 | public static class NotesResponse extends ServerResponse {
34 | public NotesResponse(NotesClient.ResponseData response) {
35 | super(response);
36 | }
37 |
38 | public List getNotes() throws JSONException {
39 | List notesList = new ArrayList<>();
40 | JSONArray notes = new JSONArray(getContent());
41 | for (int i = 0; i < notes.length(); i++) {
42 | JSONObject json = notes.getJSONObject(i);
43 | notesList.add(getNoteFromJSON(json));
44 | }
45 | return notesList;
46 | }
47 | }
48 |
49 |
50 | private final NotesClient.ResponseData response;
51 |
52 | public ServerResponse(NotesClient.ResponseData response) {
53 | this.response = response;
54 | }
55 |
56 | protected String getContent() {
57 | return response.getContent();
58 | }
59 |
60 | public String getETag() {
61 | return response.getETag();
62 | }
63 |
64 | public long getLastModified() {
65 | return response.getLastModified();
66 | }
67 |
68 | protected CloudNote getNoteFromJSON(JSONObject json) throws JSONException {
69 | long id = 0;
70 | String title = "";
71 | String content = "";
72 | Calendar modified = null;
73 | boolean favorite = false;
74 | String category = null;
75 | String etag = null;
76 | if (!json.isNull(NotesClient.JSON_ID)) {
77 | id = json.getLong(NotesClient.JSON_ID);
78 | }
79 | if (!json.isNull(NotesClient.JSON_TITLE)) {
80 | title = json.getString(NotesClient.JSON_TITLE);
81 | }
82 | if (!json.isNull(NotesClient.JSON_CONTENT)) {
83 | content = json.getString(NotesClient.JSON_CONTENT);
84 | }
85 | if (!json.isNull(NotesClient.JSON_MODIFIED)) {
86 | modified = GregorianCalendar.getInstance();
87 | modified.setTimeInMillis(json.getLong(NotesClient.JSON_MODIFIED) * 1000);
88 | }
89 | if (!json.isNull(NotesClient.JSON_FAVORITE)) {
90 | favorite = json.getBoolean(NotesClient.JSON_FAVORITE);
91 | }
92 | if (!json.isNull(NotesClient.JSON_CATEGORY)) {
93 | category = json.getString(NotesClient.JSON_CATEGORY);
94 | }
95 | if (!json.isNull(NotesClient.JSON_ETAG)) {
96 | etag = json.getString(NotesClient.JSON_ETAG);
97 | }
98 | return new CloudNote(id, modified, title, content, favorite, category, etag);
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/widget_note_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
15 |
16 |
29 |
30 |
44 |
45 |
57 |
58 |
59 |
60 |
61 |
67 |
68 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/drawer_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
24 |
25 |
29 |
30 |
38 |
39 |
45 |
46 |
54 |
55 |
56 |
57 |
65 |
66 |
70 |
71 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/SingleNoteWidgetFactory.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.appwidget;
2 |
3 | import android.appwidget.AppWidgetManager;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | import android.os.Bundle;
8 | import android.preference.PreferenceManager;
9 | import android.util.Log;
10 | import android.widget.RemoteViews;
11 | import android.widget.RemoteViewsService;
12 |
13 | import it.niedermann.owncloud.notes.R;
14 | import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
15 | import it.niedermann.owncloud.notes.model.DBNote;
16 | import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper;
17 |
18 | public class SingleNoteWidgetFactory implements RemoteViewsService.RemoteViewsFactory {
19 |
20 | private final Context mContext;
21 | private final int mAppWidgetId;
22 |
23 | private NoteSQLiteOpenHelper db;
24 | private DBNote note;
25 |
26 | private static final String TAG = SingleNoteWidget.class.getSimpleName();
27 |
28 | SingleNoteWidgetFactory(Context context, Intent intent) {
29 | mContext = context;
30 | mAppWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
31 | AppWidgetManager.INVALID_APPWIDGET_ID);
32 | }
33 |
34 | @Override
35 | public void onCreate() {
36 | db = NoteSQLiteOpenHelper.getInstance(mContext);
37 | }
38 |
39 |
40 | @Override
41 | public void onDataSetChanged() {
42 | SharedPreferences sharedprefs = PreferenceManager.getDefaultSharedPreferences(mContext);
43 | long noteID = sharedprefs.getLong(SingleNoteWidget.WIDGET_KEY + mAppWidgetId, -1);
44 |
45 | if (noteID >= 0) {
46 | note = db.getNote(noteID);
47 |
48 | if (note == null) {
49 | Log.e(TAG, "Error: note not found");
50 | }
51 | }
52 | }
53 |
54 | @Override
55 | public void onDestroy() {
56 |
57 | }
58 |
59 | /**
60 | * Returns the number of items in the data set. In this case, always 1 as a single note is
61 | * being displayed. Will return 0 when the note can't be displayed.
62 | */
63 | @Override
64 | public int getCount() {
65 | return (note != null) ? 1 : 0;
66 | }
67 |
68 | /**
69 | * Returns a RemoteView containing the note content in a TextView and
70 | * a fillInIntent to handle the user tapping on the item in the list view.
71 | *
72 | * @param position The position of the item in the list
73 | * @return The RemoteView at the specified position in the list
74 | */
75 | @Override
76 | public RemoteViews getViewAt(int position) {
77 | if (note == null) {
78 | return null;
79 | }
80 |
81 | RemoteViews note_content = new RemoteViews(mContext.getPackageName(),
82 | R.layout.widget_single_note_content);
83 | final Intent fillInIntent = new Intent();
84 | final Bundle extras = new Bundle();
85 |
86 | extras.putLong(EditNoteActivity.PARAM_NOTE_ID, note.getId());
87 | fillInIntent.putExtras(extras);
88 | fillInIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
89 | note_content.setOnClickFillInIntent(R.id.single_note_content_tv, fillInIntent);
90 | note_content.setTextViewText(R.id.single_note_content_tv, note.getContent());
91 |
92 | return note_content;
93 | }
94 |
95 |
96 | // TODO Set loading view
97 | @Override
98 | public RemoteViews getLoadingView() {
99 | return null;
100 | }
101 |
102 | @Override
103 | public int getViewTypeCount() {
104 | return 1;
105 | }
106 |
107 | @Override
108 | public long getItemId(int position) {
109 | return position;
110 | }
111 |
112 | @Override
113 | public boolean hasStableIds() {
114 | return true;
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/util/SupportUtil.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.util;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.os.Build;
6 | import android.preference.PreferenceManager;
7 | import android.support.annotation.WorkerThread;
8 | import android.text.Html;
9 | import android.text.Spanned;
10 | import android.text.method.LinkMovementMethod;
11 | import android.util.Log;
12 | import android.widget.TextView;
13 |
14 | import java.io.IOException;
15 | import java.net.HttpURLConnection;
16 | import java.net.MalformedURLException;
17 | import java.net.URL;
18 | import java.security.KeyManagementException;
19 | import java.security.NoSuchAlgorithmException;
20 |
21 | import javax.net.ssl.HttpsURLConnection;
22 | import javax.net.ssl.SSLContext;
23 | import javax.net.ssl.TrustManager;
24 |
25 | import at.bitfire.cert4android.CustomCertManager;
26 | import it.niedermann.owncloud.notes.R;
27 |
28 | /**
29 | * Some helper functionality in alike the Android support library.
30 | * Currently, it offers methods for working with HTML string resources.
31 | */
32 | public class SupportUtil {
33 |
34 | /**
35 | * Creates a {@link Spanned} from a HTML string on all SDK versions.
36 | *
37 | * @param source Source string with HTML markup
38 | * @return Spannable for using in a {@link TextView}
39 | * @see Html#fromHtml(String)
40 | * @see Html#fromHtml(String, int)
41 | */
42 | public static Spanned fromHtml(String source) {
43 | if (Build.VERSION.SDK_INT >= 24) {
44 | return Html.fromHtml(source, Html.FROM_HTML_MODE_LEGACY);
45 | } else {
46 | return Html.fromHtml(source);
47 | }
48 | }
49 |
50 | /**
51 | * Fills a {@link TextView} with HTML content and activates links in that {@link TextView}.
52 | *
53 | * @param view The {@link TextView} which should be filled.
54 | * @param stringId The string resource containing HTML tags (escaped by <)
55 | * @param formatArgs Arguments for the string resource.
56 | */
57 | public static void setHtml(TextView view, int stringId, Object... formatArgs) {
58 | view.setText(SupportUtil.fromHtml(view.getResources().getString(stringId, formatArgs)));
59 | view.setMovementMethod(LinkMovementMethod.getInstance());
60 | }
61 |
62 | /**
63 | * Create a new {@link HttpURLConnection} for strUrl.
64 | * If protocol equals https, then install CustomCertManager in {@link SSLContext}.
65 | *
66 | * @param ccm
67 | * @param strUrl
68 | * @return HttpURLConnection with custom trust manager
69 | * @throws MalformedURLException
70 | * @throws IOException
71 | */
72 | public static HttpURLConnection getHttpURLConnection(CustomCertManager ccm, String strUrl) throws MalformedURLException, IOException {
73 | URL url = new URL(strUrl);
74 | HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
75 | if (ccm != null && url.getProtocol().equals("https")) {
76 | HttpsURLConnection httpsCon = (HttpsURLConnection) httpCon;
77 | httpsCon.setHostnameVerifier(ccm.hostnameVerifier(httpsCon.getHostnameVerifier()));
78 | try {
79 | SSLContext sslContext = SSLContext.getInstance("TLS");
80 | sslContext.init(null, new TrustManager[]{ccm}, null);
81 | httpsCon.setSSLSocketFactory(sslContext.getSocketFactory());
82 | } catch (NoSuchAlgorithmException e) {
83 | Log.e(SupportUtil.class.getSimpleName(), "Exception", e);
84 | // ignore, use default TrustManager
85 | } catch (KeyManagementException e) {
86 | Log.e(SupportUtil.class.getSimpleName(), "Exception", e);
87 | // ignore, use default TrustManager
88 | }
89 | }
90 | return httpCon;
91 | }
92 |
93 | @WorkerThread
94 | public static CustomCertManager getCertManager(Context ctx) {
95 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(ctx);
96 | return new CustomCertManager(ctx, preferences.getBoolean(ctx.getString(R.string.pref_key_trust_system_certs), true));
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_about_credits_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
24 |
25 |
31 |
32 |
39 |
40 |
46 |
47 |
54 |
55 |
61 |
62 |
69 |
70 |
76 |
77 |
84 |
85 |
91 |
92 |
99 |
100 |
--------------------------------------------------------------------------------
/app/src/main/res/values-bg-rBG/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Бележки
5 | Няма открити бележки
6 | Нова бележка
7 | Настройки
8 | Запис
9 | Отказ
10 | Редакция
11 | Запис
12 | Записване …
13 | Запазено
14 | Отказ
15 | Относно
16 | Избор на бележка
17 | Бележката е изтрита
18 | Бележката е възстановена
19 | Отмяна
20 | Изтриване
21 | Копиране
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 | Синхронизацията е неуспешна: %1$s
47 | Невалиден вход: %1$s
48 | връзката със сървъра е прекъснала
49 | няма връзка с интернет
50 | URL/Сървъра съдържа грешки
51 | Грешен адрес на сървъра
52 | Грешно потребителско име или парола
53 |
54 |
55 | Настройки
56 |
57 |
58 | Версия
59 | В момента ползвате <strong>%1$s</strong>
60 | Отговорник
61 | Разработчици
62 | Преводачи
63 | Nextcloud общност на <a href=\"%1$s\">Transifex</a>
64 | Тестери
65 | Изходен код
66 | Превод
67 | Присъединете към Nextcloud тима на Transifex и помогнете за превода на това приложение: <a href=\"%1$s\">%1$s</a>
68 | Лиценз на приложението
69 | Това приложение се разпространява под лиценза за GNU GENERAL PUBLIC LICENSE v3+.
70 | Преглед на лиценз
71 | Икони
72 | Принос
73 | Лиценз
74 |
75 | Всички бележки
76 | Единична бележка
77 |
78 |
79 |
80 | - %d избранa
81 | - %d избрани
82 |
83 |
84 |
--------------------------------------------------------------------------------
/app/src/main/res/values-hy/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Notes
5 | առայժմ գրառում չկա
6 | նոր գրառում
7 | կարգավորումներ
8 | հիշել
9 | չեղարկել
10 | մշակել
11 | հիշել
12 | հիշել…
13 | պահպանված է
14 | ընդհատել
15 | էջի վերաբերյալ
16 | ընտրելգրառումը
17 | հեռացնել
18 | պատճենահանել
19 | մշակել
20 | կիսվել
21 | էջի վերաբերյալ
22 |
23 | պատճենահանել
24 |
25 | այսօր
26 | երեկ
27 | այս շաբաթ
28 | այս ամիս
29 | ավելի վաղ
30 |
31 |
32 | սերվերի հասցեն
33 | ցույց է տալիս, որ տրված հասցեն հասանելի է
34 | ՈՒՇԱԴՐՈՒԹՅՈՒՆ: "http" պարունակում է վտանգ. առաջարկում ենք օգտագործել "https".
35 | մուտքանուն
36 | գախտնաբառ
37 | ցույց է տալիս, որ մուտքագրված տվյալները ճիշտ են.
38 | միացնել
39 | միացված է…
40 |
41 | միանում է
42 | միացված է
43 | կապն անհասանելի է
44 |
45 | JSON սխալ
46 | IO սխալ
47 | հասցեն սխալ է
48 | մուտքագրված տվյալները սխալ են
49 |
50 |
51 | կարգավորումներ
52 |
53 |
54 |
55 | տարբերակ
56 | դուք օգտագործում եք <strong>%1$s</strong>
57 | ղեկավար
58 | ծրագրավորող
59 | թարգմանիչ
60 | թեսթավորող
61 | ծրագրի կոդը
62 | ծրագիրը տեղադրված է GitHub: <a href="%1$s">%1$s</a>
63 | հայց
64 | բոլոր առաջարկները կարող եք ներկայացնել GitHub հայցեր բաժնում: <a href="%1$s">%1$s</a>
65 | ծրագրի լիցենզիան
66 | տվյալ ծրագիրը լիցենզավորված է GNU GENERAL PUBLIC LICENSE v3+ կողմից.
67 | տեսնել լիցենզիան
68 | լոգոտիպներ
69 | <p>նախնական լոգոտիպը ստեղծված է%1$s</p><p>բոլոր մյուս լոգոտիպերը, որոնք օգտագործվում են տվյալ ծրագրում լիցենզավորված են <a href="https://materialdesignicons.com/" title="Link to Website">Material Design լոգոտիպեր</a> Creative Commons License կողմից.</p>
70 | անվանացանկ
71 | մասնակցել
72 | լիցենզիա
73 |
74 |
75 |
76 |
77 |
78 | - %d ընտրված է
79 | - %d ընտրված է
80 |
81 |
82 |
--------------------------------------------------------------------------------
/app/src/main/res/values-eu/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Oharrak
5 | Ez dago oharrik
6 | Ohar berria
7 | Ezarpenak
8 | Gorde
9 | Ezeztatu
10 | Aldatu
11 | Gorde
12 | Gordetzen …
13 | Gordeta
14 | Ezeztatu
15 | Honi buruz
16 | Oharra aukeratu
17 | Oharra aukeratuta
18 | Oharra berreskuratuta
19 | Desegin
20 | Ezabatu
21 | Kopiatu
22 | Aldatu
23 | Ezeztatu
24 | Gogokoa
25 | Aurreikusi
26 | Partekatu
27 | Honi buruz
28 |
29 | Kopiatu
30 |
31 | Gaur
32 | Atzo
33 | Aste honetan
34 | Hilabete honetan
35 | Lehenago
36 |
37 | Zerbitzariaren helbidea
38 | Erakusten du ea helbideari ping egin daiteken
39 | ERNE: \"http\" ez da segurua. Mesedez, erabili \"https\".
40 | Erabiltzaile izena
41 | Pasahitza
42 | Erakusten du kredentzialak zuzenak diren.
43 | Konektatu
44 | Konektatzen …
45 | Aktibatu jakinarazpen iraunkor bat erakusteko ohar berri bat azkar sortzeko .
46 |
47 | Konektatzen
48 | Konektatuta
49 | Sarea ez dago eskuragarri
50 |
51 |
52 | Sinkronizazioa huts egin du: %1$s
53 | Login-a ez du balio: %1$s
54 | Konexioa zerbitzariarekin ez dabil
55 | Ez dago sare-konexiorik
56 | URL/Zerbitzaria akatsak ditu
57 | Zerbitzari helbide okerra
58 | Erabiltzaile edo pasahitz okerra
59 |
60 |
61 | Ezarpenak
62 |
63 |
64 | Vertsioa
65 | Mantentzailea
66 | Garatzaileak
67 | Itzultzaileak
68 | Frogatzaileak
69 | Iturburu-kodea
70 | Arazoak
71 | Aplikazio lizentzia
72 | Aplikazio hau GNU GENERAL PUBLIC LICENSE v3+ lizentziapean dago.
73 | Lizentzia ikusi
74 | Irudiak
75 | Kredituak
76 | Kontribuzio
77 | Lizentzia
78 |
79 | Ohar guztiak
80 | Ohar bakarra
81 |
82 |
83 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NotePreviewFragment.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.content.res.ResourcesCompat;
6 | import android.support.v4.content.res.TypedArrayUtils;
7 | import android.support.v4.text.TextUtilsCompat;
8 | import android.text.TextUtils;
9 | import android.text.method.LinkMovementMethod;
10 | import android.util.Log;
11 | import android.view.LayoutInflater;
12 | import android.view.Menu;
13 | import android.view.View;
14 | import android.view.ViewGroup;
15 | import android.widget.TextView;
16 |
17 | import com.yydcdut.markdown.callback.OnTodoClickCallback;
18 | import com.yydcdut.markdown.syntax.text.TextFactory;
19 | import com.yydcdut.rxmarkdown.RxMDConfiguration;
20 | import com.yydcdut.rxmarkdown.RxMDTextView;
21 | import com.yydcdut.rxmarkdown.RxMarkdown;
22 |
23 | import butterknife.BindView;
24 | import butterknife.ButterKnife;
25 | import it.niedermann.owncloud.notes.R;
26 | import it.niedermann.owncloud.notes.util.ICallback;
27 | import it.niedermann.owncloud.notes.util.MarkDownUtil;
28 | import rx.Subscriber;
29 | import rx.android.schedulers.AndroidSchedulers;
30 | import rx.schedulers.Schedulers;
31 |
32 | public class NotePreviewFragment extends BaseNoteFragment {
33 |
34 | @BindView(R.id.single_note_content)
35 | RxMDTextView noteContent;
36 |
37 | public static NotePreviewFragment newInstance(long noteId) {
38 | NotePreviewFragment f = new NotePreviewFragment();
39 | Bundle b = new Bundle();
40 | b.putLong(PARAM_NOTE_ID, noteId);
41 | f.setArguments(b);
42 | return f;
43 | }
44 |
45 | @Override
46 | public void onPrepareOptionsMenu(Menu menu) {
47 | super.onPrepareOptionsMenu(menu);
48 | menu.findItem(R.id.menu_edit).setVisible(true);
49 | menu.findItem(R.id.menu_preview).setVisible(false);
50 | }
51 |
52 | @Nullable
53 | @Override
54 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
55 | return inflater.inflate(R.layout.activity_single_note, container, false);
56 | }
57 |
58 | @Override
59 | public void onActivityCreated(@Nullable Bundle savedInstanceState) {
60 | super.onActivityCreated(savedInstanceState);
61 | ButterKnife.bind(this, getView());
62 |
63 | String content = note.getContent();
64 |
65 | RxMarkdown.with(content, getActivity())
66 | .config(
67 | MarkDownUtil.getMarkDownConfiguration(getActivity().getApplicationContext())
68 | /*.setOnTodoClickCallback(new OnTodoClickCallback() {
69 | @Override
70 | public CharSequence onTodoClicked(View view, String line, int lineNumber) {
71 | String[] lines = TextUtils.split(note.getContent(), "\\r?\\n");
72 | if(lines.length >= lineNumber) {
73 | lines[lineNumber] = line;
74 | }
75 | noteContent.setText(TextUtils.join("\n", lines), TextView.BufferType.SPANNABLE);
76 | saveNote(null);
77 | return line;
78 | }
79 | }
80 | )*/.build()
81 | )
82 | .factory(TextFactory.create())
83 | .intoObservable()
84 | .subscribeOn(Schedulers.computation())
85 | .observeOn(AndroidSchedulers.mainThread())
86 | .subscribe(new Subscriber() {
87 | @Override
88 | public void onCompleted() {
89 | }
90 |
91 | @Override
92 | public void onError(Throwable e) {
93 | Log.v(getClass().getSimpleName(), "RxMarkdown error", e);
94 | }
95 |
96 | @Override
97 | public void onNext(CharSequence charSequence) {
98 | noteContent.setText(charSequence, TextView.BufferType.SPANNABLE);
99 | }
100 | });
101 | noteContent.setText(content);
102 | noteContent.setMovementMethod(LinkMovementMethod.getInstance());
103 | }
104 |
105 | @Override
106 | protected String getContent() {
107 | return note.getContent();
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/app/src/main/res/values-cs/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | zápisník
5 | Zatím bez zápisků
6 | Nový zápisek
7 | Nastavení
8 | Uložit
9 | Storno
10 | Upravit
11 | Uložit
12 | Ukládám …
13 | Uloženo
14 | Storno
15 | O aplikaci
16 | Vybrat zápisek
17 | Smazat
18 | Kopírovat
19 | Upravit
20 | Sdílet
21 | O aplikaci
22 |
23 | Kopírovat
24 |
25 | Dnes
26 | Včera
27 | Tento týden
28 | Tento měsíc
29 | Dřívější
30 |
31 |
32 | Adresa serveru
33 | Ukáže, zdali lze na server provést ping.
34 | POZOR: "http" není bezpečné. Použijte "https".
35 | Přihlašovací jméno
36 | Heslo
37 | Ukáže, zdali jsou údaje správné.
38 | Připojit
39 | Spojuji …
40 |
41 | Spojuji
42 | Připojeno
43 | Síť není k dispozici
44 |
45 | Chybný login
46 | JSON error
47 | IO error
48 | Chybná adresa serveru
49 | Chybné jméno nebo heslo
50 |
51 |
52 | Nastavení
53 |
54 |
55 |
56 | Verze
57 | Právě používáte <strong>%1$s</strong>
58 | Správce
59 | Vývojáři
60 | Překladatelé
61 | Testeři
62 | Source code
63 | Projekt je hostovaný na GitHub: <a href="%1$s">%1$s</a>
64 | Chyby
65 | Chyby nebo nové vychytávky hlašte na GitHub issue tracker: <a href="%1$s">%1$s</a>
66 | Licence
67 | Aplikace je licencovaná pod GNU GENERAL PUBLIC LICENSE v3+.
68 | Zobrazit licenci
69 | Ikony
70 | <p>Původní návrh od %1$s</p><p>Všechny další ikony, které tato aplikace využívá jsou <a href="https://materialdesignicons.com/" title="Link to Website">Material Design Icons</a> vytvořeno Google Inc. a licencováno pod Creative Commons License.</p>
71 | Zásluhy
72 | Připěvatelé
73 | Licence
74 |
75 | Všechny zápisky
76 | Jeden zápisek
77 |
78 |
79 |
80 |
81 | - %d vybrán
82 | - %d vybrány
83 | - %d vybráno
84 |
85 |
86 |
--------------------------------------------------------------------------------
/app/src/main/res/values-lv/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Piezīmes
5 | Nav nevienas piezīmes
6 | Jauna piezīme
7 | Iestatījumi
8 | Saglabāt
9 | Atcelt
10 | Rediģēt
11 | Saglabāt
12 | Saglabā …
13 | Saglabāts
14 | Atcelt
15 | Par
16 | Izvēlieties piezīmi
17 | Piezīme ir dzēsta
18 | Piezīme restaurēta
19 | Atsaukt
20 | Dzēst
21 | Kopēt
22 | Rediģēt
23 | Atcelt
24 | Izlase
25 | Priekšskatīt
26 | Koplietot
27 | Par
28 |
29 | Kopēt
30 |
31 | Šodien
32 | Vakar
33 | Šonedēļ
34 | Šis mēnesis
35 | Agrāk
36 |
37 |
38 | Konta iestatījumi
39 | Servera adrese
40 | Parāda, ja adresi var nopingot.
41 | BRĪDINĀJUMS: \"http\" ir nedrošs, lietojiet \"https\" !!!
42 | Lietotājvārds
43 | Parole
44 | Parole (nemainīta)
45 | Rāda, vai akreditācijas dati ir pareizi.
46 | Savienoties
47 | Savienojuma izveide …
48 | Paziņojums
49 | Sertifikāts
50 | Uzticams sertifikāts no sistēmas uzticamās noliktavas
51 |
52 | Savienojuma izveide
53 | Savienots
54 | Nav pieejams tīkls
55 |
56 |
57 | Sinhronizācija neizdevās: %1$s
58 | Nederīgs lietotājvārds: %1$s
59 | servera savienojums ir pārtraukts
60 | nav tīkla savienojumu
61 | URL/Serverim ir kļūdas
62 | Nepareiza servera adrese
63 | Nepareizs lietotājvārds vai parole
64 |
65 |
66 | Iestatījumi
67 |
68 |
69 | Versija
70 | Uzturētājs
71 | Izstrādātāji
72 | Tulkotāji
73 | Testētāji
74 | Izejas kods
75 | Tulkot
76 | Programmas licence
77 | Šī lietojumprogramma tiek licencēta zem GNU GENERAL PUBLIC LICENSE v3+.
78 | Skatīt licenci
79 | Ikonas
80 | Kredīti
81 | Licence
82 |
83 | Visas piezīmes
84 | Viena piezīme
85 |
86 |
87 | Izveidot jaunu pierakstu
88 |
89 |
90 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/util/NoteUtil.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.util;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 | import android.support.annotation.Nullable;
6 |
7 | import java.util.regex.Pattern;
8 |
9 | import it.niedermann.owncloud.notes.R;
10 |
11 | /**
12 | * Provides basic functionality for Note operations.
13 | * Created by stefan on 06.10.15.
14 | */
15 | public class NoteUtil {
16 | private static final Pattern pLists = Pattern.compile("^\\s*[*+-]\\s+", Pattern.MULTILINE);
17 | private static final Pattern pHeadings = Pattern.compile("^#+\\s+(.*?)\\s*#*$", Pattern.MULTILINE);
18 | private static final Pattern pHeadingLine = Pattern.compile("^(?:=*|-*)$", Pattern.MULTILINE);
19 | private static final Pattern pEmphasis = Pattern.compile("(\\*+|_+)(.*?)\\1", Pattern.MULTILINE);
20 | private static final Pattern pSpace1 = Pattern.compile("^\\s+", Pattern.MULTILINE);
21 | private static final Pattern pSpace2 = Pattern.compile("\\s+$", Pattern.MULTILINE);
22 |
23 |
24 | /**
25 | * Strips all MarkDown from the given String
26 | *
27 | * @param s String - MarkDown
28 | * @return Plain Text-String
29 | */
30 | @NonNull
31 | public static String removeMarkDown(@Nullable String s) {
32 | if (s == null)
33 | return "";
34 | s = pLists.matcher(s).replaceAll("");
35 | s = pHeadings.matcher(s).replaceAll("$1");
36 | s = pHeadingLine.matcher(s).replaceAll("");
37 | s = pEmphasis.matcher(s).replaceAll("$2");
38 | s = pSpace1.matcher(s).replaceAll("");
39 | s = pSpace2.matcher(s).replaceAll("");
40 | return s;
41 | }
42 |
43 | /**
44 | * Checks if a line is empty.
45 | *
46 | * " " -> empty
47 | * "\n" -> empty
48 | * "\n " -> empty
49 | * " \n" -> empty
50 | * " \n " -> empty
51 | *
52 | *
53 | * @param line String - a single Line which ends with \n
54 | * @return boolean isEmpty
55 | */
56 | private static boolean isEmptyLine(@Nullable String line) {
57 | return removeMarkDown(line).trim().length() == 0;
58 | }
59 |
60 | /**
61 | * Truncates a string to a desired maximum length.
62 | * Like String.substring(int,int), but throw no exception if desired length is longer than the string.
63 | *
64 | * @param str String to truncate
65 | * @param len Maximum length of the resulting string
66 | * @return truncated string
67 | */
68 | @NonNull
69 | private static String truncateString(@NonNull String str, int len) {
70 | return str.substring(0, Math.min(len, str.length()));
71 | }
72 |
73 | /**
74 | * Generates an excerpt of a content String (reads second line which is not empty)
75 | *
76 | * @param content String
77 | * @return excerpt String
78 | */
79 | @NonNull
80 | public static String generateNoteExcerpt(@NonNull String content) {
81 | if (content.contains("\n"))
82 | return truncateString(removeMarkDown(content.replaceFirst("^.*\n", "")), 200).replace("\n", " ");
83 | else
84 | return "";
85 | }
86 |
87 | @NonNull
88 | public static String generateNonEmptyNoteTitle(@NonNull String content, Context context) {
89 | String title = generateNoteTitle(content);
90 | if (title.isEmpty()) {
91 | title = context.getString(R.string.action_create);
92 | }
93 | return title;
94 | }
95 |
96 | /**
97 | * Generates a title of a content String (reads fist linew which is not empty)
98 | *
99 | * @param content String
100 | * @return excerpt String
101 | */
102 | @NonNull
103 | static String generateNoteTitle(@NonNull String content) {
104 | return getLineWithoutMarkDown(content, 0);
105 | }
106 |
107 | /**
108 | * Reads the requested line and strips all MarkDown. If line is empty, it will go ahead to find the next not-empty line.
109 | *
110 | * @param content String
111 | * @param lineNumber int
112 | * @return lineContent String
113 | */
114 | @NonNull
115 | private static String getLineWithoutMarkDown(@NonNull String content, int lineNumber) {
116 | String line = "";
117 | if (content.contains("\n")) {
118 | String[] lines = content.split("\n");
119 | int currentLine = lineNumber;
120 | while (currentLine < lines.length && NoteUtil.isEmptyLine(lines[currentLine])) {
121 | currentLine++;
122 | }
123 | if (currentLine < lines.length) {
124 | line = NoteUtil.removeMarkDown(lines[currentLine]);
125 | }
126 | } else {
127 | line = content;
128 | }
129 | return line;
130 | }
131 |
132 | @NonNull
133 | public static String extendCategory(@NonNull String category) {
134 | return category.replace("/", " / ");
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/it/niedermann/owncloud/notes/util/NoteUtilTest.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.util;
2 |
3 | import junit.framework.TestCase;
4 |
5 | import java.lang.reflect.InvocationTargetException;
6 | import java.lang.reflect.Method;
7 |
8 | /**
9 | * Tests the NoteUtil
10 | * Created by stefan on 06.10.15.
11 | */
12 | public class NoteUtilTest extends TestCase {
13 | public void testRemoveMarkDown() {
14 | assertEquals("Test", NoteUtil.removeMarkDown("Test"));
15 | assertEquals("Foo\nBar", NoteUtil.removeMarkDown("Foo\nBar"));
16 | assertEquals("Foo\nBar", NoteUtil.removeMarkDown("Foo\n Bar"));
17 | assertEquals("Foo\nBar", NoteUtil.removeMarkDown("Foo \nBar"));
18 | assertEquals("Foo-Bar", NoteUtil.removeMarkDown("Foo-Bar"));
19 | assertEquals("Foo*Bar", NoteUtil.removeMarkDown("Foo*Bar"));
20 | assertEquals("Foo/Bar", NoteUtil.removeMarkDown("Foo/Bar"));
21 | assertEquals("FooTestBar", NoteUtil.removeMarkDown("Foo*Test*Bar"));
22 | assertEquals("FooTestBar", NoteUtil.removeMarkDown("Foo**Test**Bar"));
23 | assertEquals("FooTestBar", NoteUtil.removeMarkDown("Foo***Test***Bar"));
24 | assertEquals("FooTest*Bar", NoteUtil.removeMarkDown("Foo*Test**Bar"));
25 | assertEquals("Foo*TestBar", NoteUtil.removeMarkDown("Foo***Test**Bar"));
26 | assertEquals("FooTestBar", NoteUtil.removeMarkDown("Foo_Test_Bar"));
27 | assertEquals("FooTestBar", NoteUtil.removeMarkDown("Foo__Test__Bar"));
28 | assertEquals("FooTestBar", NoteUtil.removeMarkDown("Foo___Test___Bar"));
29 | assertEquals("Foo\nHeader\nBar", NoteUtil.removeMarkDown("Foo\n# Header\nBar"));
30 | assertEquals("Foo\nHeader\nBar", NoteUtil.removeMarkDown("Foo\n### Header\nBar"));
31 | assertEquals("Foo\nHeader\nBar", NoteUtil.removeMarkDown("Foo\n# Header #\nBar"));
32 | assertEquals("Foo\nHeader\nBar", NoteUtil.removeMarkDown("Foo\n## Header ####\nBar"));
33 | assertEquals("Foo\nNo Header #\nBar", NoteUtil.removeMarkDown("Foo\nNo Header #\nBar"));
34 | assertEquals("Foo\nHeader\nBar", NoteUtil.removeMarkDown("Foo\nHeader\n=\nBar"));
35 | assertEquals("Foo\nHeader\nBar", NoteUtil.removeMarkDown("Foo\nHeader\n-----\nBar"));
36 | assertEquals("Foo\nHeader\n--=--\nBar", NoteUtil.removeMarkDown("Foo\nHeader\n--=--\nBar"));
37 | assertEquals("Foo\nAufzählung\nBar", NoteUtil.removeMarkDown("Foo\n* Aufzählung\nBar"));
38 | assertEquals("Foo\nAufzählung\nBar", NoteUtil.removeMarkDown("Foo\n+ Aufzählung\nBar"));
39 | assertEquals("Foo\nAufzählung\nBar", NoteUtil.removeMarkDown("Foo\n- Aufzählung\nBar"));
40 | assertEquals("Foo\nAufzählung\nBar", NoteUtil.removeMarkDown("Foo\n - Aufzählung\nBar"));
41 | assertEquals("Foo\nAufzählung *\nBar", NoteUtil.removeMarkDown("Foo\n* Aufzählung *\nBar"));
42 | }
43 |
44 | public void testIsEmptyLine() {
45 | try {
46 | Method m = NoteUtil.class.getDeclaredMethod("isEmptyLine");
47 | m.setAccessible(true);
48 | assertTrue((Boolean) m.invoke(null, " "));
49 | assertTrue((Boolean) m.invoke(null, "\n"));
50 | assertTrue((Boolean) m.invoke(null, "\n "));
51 | assertTrue((Boolean) m.invoke(null, " \n"));
52 | assertTrue((Boolean) m.invoke(null, " \n "));
53 | assertFalse((Boolean) m.invoke(null, "a \n "));
54 | } catch (NoSuchMethodException e) {
55 | e.printStackTrace();
56 | } catch (IllegalAccessException e) {
57 | e.printStackTrace();
58 | } catch (InvocationTargetException e) {
59 | e.printStackTrace();
60 | }
61 | }
62 |
63 | public void testGetLineWithoutMarkDown() {
64 | try {
65 | Method m = NoteUtil.class.getDeclaredMethod("isEmptyLine");
66 | m.setAccessible(true);
67 | assertEquals("Test", (String) m.invoke(null, "Test", 0));
68 | assertEquals("Test", (String) m.invoke(null, "\nTest", 0));
69 | assertEquals("Foo", (String) m.invoke(null, "Foo\nBar", 0));
70 | assertEquals("Bar", (String) m.invoke(null, "Foo\nBar", 1));
71 | } catch (NoSuchMethodException e) {
72 | e.printStackTrace();
73 | } catch (IllegalAccessException e) {
74 | e.printStackTrace();
75 | } catch (InvocationTargetException e) {
76 | e.printStackTrace();
77 | }
78 | }
79 |
80 | public void testGenerateNoteTitle() {
81 | assertEquals("Test", NoteUtil.generateNoteTitle("Test"));
82 | assertEquals("Test", NoteUtil.generateNoteTitle("Test\n"));
83 | assertEquals("Test", NoteUtil.generateNoteTitle("Test\nFoo"));
84 | assertEquals("Test", NoteUtil.generateNoteTitle("\nTest"));
85 | assertEquals("Test", NoteUtil.generateNoteTitle("\n\nTest"));
86 | }
87 |
88 | public void testGenerateNoteExcerpt() {
89 | assertEquals("", NoteUtil.generateNoteExcerpt("Test"));
90 | assertEquals("Foo", NoteUtil.generateNoteExcerpt("Test\nFoo"));
91 | assertEquals("Foo Bar", NoteUtil.generateNoteExcerpt("Test\nFoo\nBar"));
92 | assertEquals("", NoteUtil.generateNoteExcerpt(""));
93 | }
94 | }
--------------------------------------------------------------------------------
/app/src/main/res/values-ca/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Notes
5 | No hi ha notes encara
6 | Nova nota
7 | Paràmetres
8 | Guardar
9 | Cancel·lar
10 | Editar
11 | Guardar
12 | Guardant …
13 | Guardat
14 | Cancel·lar
15 | Sobre
16 | Selecciona una nota
17 | S\\\'ha esborrat la nota
18 | S\\\'ha restaurat la nota
19 | Des-fes
20 | Esborrar
21 | Copiar
22 | Editar
23 | Cancel·lar
24 | Preferit
25 | Previsuatlització
26 | Compartir
27 | Sobre
28 |
29 | Copiar
30 |
31 | Avui
32 | Ahir
33 | Aquesta setmana
34 | Aquest mes
35 | Aviat
36 |
37 | Adreça del servidor
38 | Mostra si es pot fer ping a l\\\'adreça
39 | ATENCIÓ: \"http\" és insegur. Si us plau utilitzeu \"https\".
40 | Nom d\\\'usuari
41 | Contrasenya
42 | Mostar si les credencials son correctes
43 | Connecta
44 | Conectant …
45 | Habilitar per a mostrar una notificació permanent per a crear noves notes ràpidament
46 |
47 | Connectant
48 | Connectant
49 | No hi ha connexió disponible
50 |
51 |
52 | Error en la sincronització: %1$s
53 | Inici de sessió invàlid: %1$s
54 | S\\\'ha trencat la connecció amb el servidor
55 | No hi ha connexió a la xarxa
56 | L\\\'URL/Server conté errors
57 | Adreça del servidor incorrecta
58 | Usuari o contrasenya erroni
59 |
60 |
61 | Paràmetres
62 |
63 |
64 | Versió
65 | Manteniment
66 | Desenvolupadors
67 | Traductors
68 | Provadors
69 | Codi font
70 | Aquest projecte està hostatjat a Github: <a href=\"%1$s\">%1$s</a>
71 | Problemes
72 | Tradueix
73 | Uneix-te a l\'equip Nextcloud a Transifex i ajuda\'ns a traduïr aquesta aplicacio: <a href=\"%1$s\">%1$s</a>
74 | Llicència de l\\\'aplicació
75 | Aquesta aplicació està llicenciada sota GNU GENERAL PUBLIC LICENSE v3+
76 | Veure llicència
77 | Icones
78 | Crèdits
79 | Contribució
80 | Llicència
81 |
82 | Totes les notes
83 | Una nota
84 |
85 |
86 |
87 | - %d escollit
88 | - %d escollits
89 |
90 |
91 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidgetFactory.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.appwidget;
2 |
3 | import android.appwidget.AppWidgetManager;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | import android.net.Uri;
8 | import android.os.Bundle;
9 | import android.preference.PreferenceManager;
10 | import android.view.View;
11 | import android.widget.RemoteViews;
12 | import android.widget.RemoteViewsService;
13 |
14 | import java.util.List;
15 |
16 | import it.niedermann.owncloud.notes.R;
17 | import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
18 | import it.niedermann.owncloud.notes.model.DBNote;
19 | import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper;
20 |
21 | public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFactory {
22 | private final Context context;
23 | private final int displayMode;
24 | private final int appWidgetId;
25 | private String category;
26 | private final SharedPreferences sp;
27 | private NoteSQLiteOpenHelper db;
28 | private List dbNotes;
29 |
30 | NoteListWidgetFactory(Context context, Intent intent) {
31 | this.context = context;
32 | appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
33 | AppWidgetManager.INVALID_APPWIDGET_ID);
34 | sp = PreferenceManager.getDefaultSharedPreferences(this.context);
35 | displayMode = sp.getInt(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, -1);
36 | }
37 |
38 | @Override
39 | public void onCreate() {
40 | db = NoteSQLiteOpenHelper.getInstance(context);
41 | RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_note_list);
42 |
43 | switch (displayMode)
44 | {
45 | case NoteListWidget.NLW_DISPLAY_ALL:
46 | views.setTextViewText(R.id.widget_note_list_title_tv, context.getString(R.string.app_name));
47 | break;
48 | case NoteListWidget.NLW_DISPLAY_STARRED:
49 | views.setTextViewText(R.id.widget_note_list_title_tv, "Starred");
50 | break;
51 | case NoteListWidget.NLW_DISPLAY_CATEGORY:
52 | category = sp.getString(NoteListWidget.WIDGET_CATEGORY_KEY + appWidgetId, null);
53 | if (category.equals("")) {
54 | views.setTextViewText(R.id.widget_note_list_title_tv, context.getString(R.string.action_uncategorized));
55 | } else {
56 | views.setTextViewText(R.id.widget_note_list_title_tv, category);
57 | }
58 | break;
59 | }
60 |
61 | AppWidgetManager awm = AppWidgetManager.getInstance(context);
62 | awm.updateAppWidget(appWidgetId, views);
63 | }
64 |
65 | @Override
66 | public void onDataSetChanged() {
67 | if (displayMode == NoteListWidget.NLW_DISPLAY_ALL) {
68 | dbNotes = db.getNotes();
69 | } else if (displayMode == NoteListWidget.NLW_DISPLAY_STARRED) {
70 | dbNotes = db.searchNotes(null,null, true);
71 | } else if (displayMode == NoteListWidget.NLW_DISPLAY_CATEGORY) {
72 | dbNotes = db.searchNotes(null, category, null);
73 | }
74 | }
75 |
76 | @Override
77 | public void onDestroy() {
78 |
79 | }
80 |
81 | /**
82 | * getCount()
83 | *
84 | * @return Total number of entries
85 | */
86 | @Override
87 | public int getCount() {
88 | if (dbNotes == null) {
89 | return 0;
90 | }
91 |
92 | return dbNotes.size();
93 | }
94 |
95 | @Override
96 | public RemoteViews getViewAt(int i) {
97 | if (dbNotes == null || dbNotes.get(i) == null) {
98 | return null;
99 | }
100 |
101 | RemoteViews note_content = new RemoteViews(context.getPackageName(),
102 | R.layout.widget_entry);
103 | DBNote note = dbNotes.get(i);
104 | final Intent fillInIntent = new Intent();
105 | final Bundle extras = new Bundle();
106 |
107 | extras.putLong(EditNoteActivity.PARAM_NOTE_ID, note.getId());
108 | fillInIntent.putExtras(extras);
109 | fillInIntent.setData(Uri.parse(fillInIntent.toUri(Intent.URI_INTENT_SCHEME)));
110 | note_content.setOnClickFillInIntent(R.id.widget_note_list_entry, fillInIntent);
111 |
112 | if (note.isFavorite()) {
113 | note_content.setViewVisibility(R.id.widget_entry_fav_icon, View.VISIBLE);
114 | } else {
115 | note_content.setViewVisibility(R.id.widget_entry_fav_icon, View.INVISIBLE);
116 | }
117 | note_content.setTextViewText(R.id.widget_entry_content_tv, note.getTitle());
118 |
119 | return note_content;
120 | }
121 |
122 | @Override
123 | public RemoteViews getLoadingView() {
124 | return null;
125 | }
126 |
127 | @Override
128 | public int getViewTypeCount() {
129 | return 1;
130 | }
131 |
132 | @Override
133 | public long getItemId(int i) {
134 | return i;
135 | }
136 |
137 | @Override
138 | public boolean hasStableIds() {
139 | return true;
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/app/src/main/res/values-ja-rJP/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ノート
5 | まだノートはありません
6 | 新しいノート
7 | 設定
8 | 検索
9 | 保存
10 | キャンセル
11 | 編集
12 | 保存
13 | 保存中…
14 | 保存しました
15 | キャンセル
16 | アプリについて
17 | ノートを選択
18 | 元に戻す
19 | 削除
20 | コピー
21 | 編集
22 | キャンセル
23 | カテゴリ
24 | お気に入り
25 | プレビュー
26 | 共有
27 | アプリについて
28 |
29 | カテゴリを選択
30 | コピー
31 |
32 | 今日
33 | 昨日
34 | 今週
35 | 今月
36 | 早期
37 |
38 |
39 | アカウント設定
40 | サーバーアドレス
41 | 警告: \"http\" は安全ではありません。 \"https\" を使用してください。
42 | ユーザー名
43 | パスワード
44 | パスワード (変更されていません)
45 | 接続
46 | 接続中…
47 | 証明書
48 |
49 | ノート - セキュリティ接続
50 | ノートで未知の証明書が発見されました。これを信頼しますか?
51 |
52 |
53 | 接続中
54 | 接続しました
55 | ネットワークが利用できません
56 |
57 |
58 | 同期に失敗しました: %1$s
59 | ログインが無効: %1$s
60 | ノートアプリはサーバー上で有効になっていますか?
61 | サーバー接続が壊れています
62 | ネットワーク接続がありません
63 | URL/サーバーにエラーがあります
64 | サーバーアドレスが間違っています
65 | ユーザー名またはパスワードが間違っています
66 |
67 |
68 | 設定
69 |
70 |
71 | バージョン
72 | 現在 <strong>%1$s</strong> を使用しています
73 | 管理者
74 | 開発者
75 | 翻訳者
76 | <a href=\"%1$s\">Transifex</a> のNextcloud コミュニティ
77 | テスター
78 | ソースコード
79 | このプロジェクトは GitHub: <a href=\"%1$s\">%1$s</a> にホストされています
80 | 問題
81 | GitHub の問題追跡ツールで、バグ、拡張の提案、機能のリクエストを報告できます: <a href=\"%1$s\">%1$s</a>
82 | 翻訳
83 | Transexex の Nextcloud チームに参加して、このアプリの翻訳を手伝ってください: <a href=\"%1$s\">%1$s</a>
84 | アプリ ライセンス
85 | このアプリケーションは GNU GENERAL PUBLIC LICENSE v3+ でライセンスされています。
86 | ライセンスを表示
87 | アイコン
88 | クレジット
89 | 貢献
90 | ライセンス
91 |
92 | 一つのノート
93 | ノートを作成
94 | アプリを起動する
95 |
96 | ノートを選択
97 |
98 |
99 | 新しいノートを作成
100 |
101 |
102 |
103 | - %d 選択済
104 |
105 |
106 |
--------------------------------------------------------------------------------
/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidget.java:
--------------------------------------------------------------------------------
1 | package it.niedermann.owncloud.notes.android.appwidget;
2 |
3 | import android.app.PendingIntent;
4 | import android.appwidget.AppWidgetManager;
5 | import android.appwidget.AppWidgetProvider;
6 | import android.content.ComponentName;
7 | import android.content.Context;
8 | import android.content.Intent;
9 | import android.content.SharedPreferences;
10 | import android.net.Uri;
11 | import android.preference.PreferenceManager;
12 | import android.widget.RemoteViews;
13 |
14 | import it.niedermann.owncloud.notes.R;
15 | import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
16 | import it.niedermann.owncloud.notes.android.activity.NotesListViewActivity;
17 |
18 | import static android.appwidget.AppWidgetManager.ACTION_APPWIDGET_UPDATE;
19 |
20 | public class NoteListWidget extends AppWidgetProvider {
21 | public static final String WIDGET_MODE_KEY = "NLW_mode";
22 | public static final String WIDGET_CATEGORY_KEY = "NLW_cat";
23 | public static final int NLW_DISPLAY_ALL = 0;
24 | public static final int NLW_DISPLAY_STARRED = 1;
25 | public static final int NLW_DISPLAY_CATEGORY = 2;
26 |
27 | @Override
28 | public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
29 | super.onUpdate(context, appWidgetManager, appWidgetIds);
30 |
31 | for (int appWidgetId : appWidgetIds) {
32 | SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
33 | int displayMode = sp.getInt(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, -1);
34 | String category = sp.getString(NoteListWidget.WIDGET_CATEGORY_KEY + appWidgetId, null);
35 | Intent serviceIntent = new Intent(context, NoteListWidgetService.class);
36 | RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_note_list);
37 |
38 | serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
39 | serviceIntent.putExtra(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, displayMode);
40 |
41 | // Launch application when user taps the header icon or app title
42 | Intent intent = new Intent("android.intent.action.MAIN");
43 | intent.setComponent(new ComponentName(context.getPackageName(),
44 | NotesListViewActivity.class.getName()));
45 |
46 | PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
47 | intent,
48 | PendingIntent.FLAG_UPDATE_CURRENT);
49 |
50 | views.setOnClickPendingIntent(R.id.widget_note_header_icon, pendingIntent);
51 | views.setOnClickPendingIntent(R.id.widget_note_list_title_tv, pendingIntent);
52 |
53 | // Launch create note activity if user taps "+" sign in header
54 | intent = new Intent(context, EditNoteActivity.class);
55 | pendingIntent = PendingIntent.getActivity(context,0,
56 | intent,
57 | PendingIntent.FLAG_UPDATE_CURRENT);
58 |
59 | views.setOnClickPendingIntent(R.id.widget_note_list_create_icon, pendingIntent);
60 |
61 | Intent templateIntent = new Intent(context, EditNoteActivity.class);
62 | PendingIntent templatePI = PendingIntent.getActivity(context,
63 | 0, templateIntent,
64 | PendingIntent.FLAG_UPDATE_CURRENT);
65 |
66 | if (displayMode == NLW_DISPLAY_CATEGORY) {
67 | serviceIntent.putExtra(NoteListWidget.WIDGET_CATEGORY_KEY + appWidgetId, category);
68 | }
69 | serviceIntent.setData(Uri.parse(serviceIntent.toUri(Intent.URI_INTENT_SCHEME)));
70 | views.setPendingIntentTemplate(R.id.note_list_widget_lv, templatePI);
71 | views.setRemoteAdapter(appWidgetId, R.id.note_list_widget_lv, serviceIntent);
72 | views.setEmptyView(R.id.note_list_widget_lv, R.id.widget_note_list_placeholder_tv);
73 | appWidgetManager.updateAppWidget(appWidgetId, views);
74 | }
75 | }
76 |
77 | @Override
78 | public void onReceive(Context context, Intent intent) {
79 | super.onReceive(context, intent);
80 |
81 | AppWidgetManager awm = AppWidgetManager.getInstance(context);
82 | int appWidgetIds[] = awm.getAppWidgetIds(new ComponentName(context, NoteListWidget.class));
83 |
84 | for (int appWidgetId : appWidgetIds) {
85 | if (ACTION_APPWIDGET_UPDATE.equals(intent.getAction())) {
86 | awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.note_list_widget_lv);
87 | }
88 | }
89 | }
90 |
91 | @Override
92 | public void onDeleted(Context context, int[] appWidgetIds) {
93 | super.onDeleted(context, appWidgetIds);
94 |
95 | SharedPreferences.Editor editor = PreferenceManager
96 | .getDefaultSharedPreferences(context).edit();
97 |
98 | for (int appWidgetId : appWidgetIds) {
99 | editor.remove(WIDGET_MODE_KEY + appWidgetId);
100 | editor.remove(WIDGET_CATEGORY_KEY + appWidgetId);
101 | }
102 |
103 | editor.apply();
104 | }
105 | }
106 |
--------------------------------------------------------------------------------