Merge branch 'master' into 832-nlw-to-db

# Conflicts:
#	app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidget.java
#	app/src/main/res/layout/widget_note_list.xml
This commit is contained in:
Stefan Niedermann 2020-05-26 14:28:46 +02:00
commit 1519efb011
33 changed files with 111 additions and 76 deletions

View file

@ -39,6 +39,7 @@ An android client for [Nextcloud Notes App](https://github.com/nextcloud/notes/)
* Mark notes as favorite
* Bulk delete
* In-note search
* Single note widget and note list widget
* Render MarkDown (using [RxMarkdown](https://github.com/yydcdut/RxMarkdown))
* Translated in many languages on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/)
* Context based formatting ([#363](https://github.com/stefan-niedermann/nextcloud-notes/issues/363))

View file

@ -2,21 +2,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="2311.243244"
android:viewportHeight="2311.243244">
<group
android:translateX="483.77396"
android:translateY="483.77396">
android:viewportWidth="66.666664"
android:viewportHeight="66.666664">
<group android:translateX="17.333334"
android:translateY="17.333334">
<path
android:pathData="M306.29,160.01C225.24,160.01 160,225.25 160,306.29l0,731.42C160,1118.76 225.24,1184 306.29,1184l731.43,0C1118.76,1184 1184,1118.76 1184,1037.72l0,-611.43 -33.13,33.16L957.7,266.28 1064.01,160 306.29,160ZM884.55,339.43 L1077.72,532.59 773.71,836.57 452.57,964.57 580.57,643.44 884.55,339.43zM613.71,675.44 L516.57,836.57 580.57,900.57 741.71,803.44 613.71,675.44z"
android:fillColor="#ffffff" />
android:fillColor="#fff"
android:pathData="m24.484 3.5156c-1.0237 0-2.0471 0.38887-2.8281 1.1699l5.6582 5.6582c1.5621-1.5621 1.5621-4.0961 0-5.6582-0.78105-0.78105-1.8064-1.1699-2.8301-1.1699zm-4.2422 2.584-12.02 12.021 5.6562 5.6562 12.021-12.02-5.6582-5.6582zm-13.436 13.436-2.1211 7.7793 7.7793-2.1211-5.6582-5.6582z" />
</group>
<group
android:translateX="1050"
android:translateY="1500"
android:translateX="27.6"
android:translateY="34.7"
android:rotation="-45"
android:scaleX="7"
android:scaleY="7">
android:scaleX=".13"
android:scaleY=".13">
<path
android:pathData="M11.908125 40h11.4c4.44 0 7.24 -1.04 9.2 -3.4 2.32 -2.72 3.56 -6.68 3.56 -11.2 0 -4.48 -1.24 -8.44 -3.56 -11.2 -1.96 -2.36 -4.72 -3.36 -9.2 -3.36h-11.4zm6 -5V15.84h5.4c4.52 0 6.76 3.16 6.76 9.6 0 6.4 -2.24 9.56 -6.76 9.56z"
android:fillColor="#0991db"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -29,6 +29,10 @@ import static it.niedermann.owncloud.notes.model.NoteListsWidgetData.MODE_DISPLA
public class NoteListWidget extends AppWidgetProvider {
private static final String TAG = NoteListWidget.class.getSimpleName();
public static final int PENDING_INTENT_NEW_NOTE_RQ = 0;
public static final int PENDING_INTENT_EDIT_NOTE_RQ = 1;
public static final int PENDING_INTENT_OPEN_APP_RQ = 2;
static void updateAppWidget(Context context, AppWidgetManager awm, int[] appWidgetIds) {
final NotesDatabase db = NotesDatabase.getInstance(context);
@ -56,15 +60,16 @@ public class NoteListWidget extends AppWidgetProvider {
NotesListViewActivity.class.getName()));
// Open the main app if the user taps the widget header
PendingIntent openAppI = PendingIntent.getActivity(context, 0, intent,
PendingIntent openAppI = PendingIntent.getActivity(context, PENDING_INTENT_OPEN_APP_RQ,
intent,
PendingIntent.FLAG_UPDATE_CURRENT);
// Launch create note activity if user taps "+" icon on header
PendingIntent newNoteI = PendingIntent.getActivity(context, 0,
PendingIntent newNoteI = PendingIntent.getActivity(context, PENDING_INTENT_NEW_NOTE_RQ,
new Intent(context, EditNoteActivity.class).putExtra(PARAM_CATEGORY, new Category(category, data.getMode() == MODE_DISPLAY_STARRED)),
PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent templatePI = PendingIntent.getActivity(context, 0,
PendingIntent templatePI = PendingIntent.getActivity(context, PENDING_INTENT_EDIT_NOTE_RQ,
new Intent(context, EditNoteActivity.class),
PendingIntent.FLAG_UPDATE_CURRENT);

View file

@ -3,6 +3,7 @@ package it.niedermann.owncloud.notes.util;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
@ -11,7 +12,6 @@ import androidx.annotation.Nullable;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Objects;
import it.niedermann.owncloud.notes.R;
@ -43,16 +43,32 @@ public class ClipboardUtil {
return true;
}
@Nullable
public static String getClipboardURLorNull(Context context) {
String clipboardURL = null;
ClipData clipboardData = Objects.requireNonNull(((ClipboardManager) Objects.requireNonNull(context.getSystemService(CLIPBOARD_SERVICE))).getPrimaryClip());
if (clipboardData.getItemCount() > 0) {
try {
clipboardURL = new URL(clipboardData.getItemAt(0).getText().toString()).toString();
} catch (MalformedURLException e) {
Log.d(TAG, "Clipboard does not contain a valid URL: " + clipboardData.getItemAt(0).getText().toString());
}
final ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);
if (clipboardManager == null) {
return null;
}
return clipboardURL;
final ClipData clipboardData = clipboardManager.getPrimaryClip();
if (clipboardData == null) {
return null;
}
if (clipboardData.getItemCount() < 1) {
return null;
}
final ClipData.Item clipItem = clipboardData.getItemAt(0);
if (clipItem == null) {
return null;
}
final CharSequence clipText = clipItem.getText();
if (TextUtils.isEmpty(clipText)) {
return null;
}
try {
return new URL(clipText.toString()).toString();
} catch (MalformedURLException e) {
Log.d(TAG, "Clipboard does not contain a valid URL: " + clipText);
}
return null;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -2,13 +2,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="2311.5479"
android:viewportHeight="2311.5479">
<group
android:translateX="483.77396"
android:translateY="483.77396">
<path
android:pathData="M306.29,160.01C225.24,160.01 160,225.25 160,306.29l0,731.42C160,1118.76 225.24,1184 306.29,1184l731.43,0C1118.76,1184 1184,1118.76 1184,1037.72l0,-611.43 -33.13,33.16L957.7,266.28 1064.01,160 306.29,160ZM884.55,339.43 L1077.72,532.59 773.71,836.57 452.57,964.57 580.57,643.44 884.55,339.43zM613.71,675.44 L516.57,836.57 580.57,900.57 741.71,803.44 613.71,675.44z"
android:fillColor="#ffffff" />
</group>
</vector>
android:viewportWidth="66.666664"
android:viewportHeight="66.666664">
<group android:translateX="17.333334"
android:translateY="17.333334">
<path
android:fillColor="#fff"
android:pathData="m24.484 3.5156c-1.0237 0-2.0471 0.38887-2.8281 1.1699l5.6582 5.6582c1.5621-1.5621 1.5621-4.0961 0-5.6582-0.78105-0.78105-1.8064-1.1699-2.8301-1.1699zm-4.2422 2.584-12.02 12.021 5.6562 5.6562 12.021-12.02-5.6582-5.6582zm-13.436 13.436-2.1211 7.7793 7.7793-2.1211-5.6582-5.6582z" />
</group>
</vector>

View file

@ -3,37 +3,42 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/widget_note_list_entry"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/widget_note_list_padding">
android:paddingStart="@dimen/spacer_1hx"
android:paddingLeft="@dimen/spacer_1hx"
android:paddingTop="@dimen/spacer_1x"
android:paddingEnd="@dimen/spacer_1hx"
android:paddingRight="@dimen/spacer_1hx"
android:paddingBottom="@dimen/spacer_1x">
<ImageView
android:id="@+id/widget_entry_fav_icon"
android:layout_width="@dimen/widget_note_list_fav_icon_width"
android:layout_height="@dimen/widget_note_list_fav_icon_height"
android:layout_gravity="center_vertical"
android:contentDescription="@string/widget_entry_fav_contentDescription"
android:foregroundGravity="center_vertical"
android:paddingStart="@dimen/widget_note_list_inner_padding"
android:paddingLeft="@dimen/widget_note_list_inner_padding"
android:paddingEnd="@dimen/widget_note_list_outer_padding"
android:paddingRight="@dimen/widget_note_list_outer_padding"
app:srcCompat="@drawable/ic_star_yellow_24dp"
android:contentDescription="@string/widget_entry_fav_contentDescription" />
app:srcCompat="@drawable/ic_star_yellow_24dp" />
<TextView
android:id="@+id/widget_entry_content_tv"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:lines="1"
android:paddingStart="@dimen/widget_note_list_inner_padding"
android:paddingLeft="@dimen/widget_note_list_inner_padding"
android:paddingEnd="@dimen/widget_note_list_outer_padding"
android:paddingRight="@dimen/widget_note_list_outer_padding"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:textColor="@color/widget_fg_default"
android:ellipsize="end"
android:lines="1"
tools:text="@string/app_name_long"/>
tools:text="@string/app_name_long" />
</LinearLayout>

View file

@ -3,37 +3,43 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/widget_note_list_entry_dark"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/widget_note_list_padding">
android:paddingStart="@dimen/spacer_1hx"
android:paddingLeft="@dimen/spacer_1hx"
android:paddingTop="@dimen/spacer_1x"
android:paddingEnd="@dimen/spacer_1hx"
android:paddingRight="@dimen/spacer_1hx"
android:paddingBottom="@dimen/spacer_1x"
tools:background="@color/widget_background_dark_theme">
<ImageView
android:id="@+id/widget_entry_fav_icon_dark"
android:layout_width="@dimen/widget_note_list_fav_icon_width"
android:layout_height="@dimen/widget_note_list_fav_icon_height"
android:layout_gravity="center_vertical"
android:contentDescription="@string/widget_entry_fav_contentDescription"
android:foregroundGravity="center_vertical"
android:paddingStart="@dimen/widget_note_list_inner_padding"
android:paddingLeft="@dimen/widget_note_list_inner_padding"
android:paddingEnd="@dimen/widget_note_list_outer_padding"
android:paddingRight="@dimen/widget_note_list_outer_padding"
app:srcCompat="@drawable/ic_star_yellow_24dp"
android:contentDescription="@string/widget_entry_fav_contentDescription" />
app:srcCompat="@drawable/ic_star_yellow_24dp" />
<TextView
android:id="@+id/widget_entry_content_tv_dark"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:lines="1"
android:paddingStart="@dimen/widget_note_list_inner_padding"
android:paddingLeft="@dimen/widget_note_list_inner_padding"
android:paddingEnd="@dimen/widget_note_list_outer_padding"
android:paddingRight="@dimen/widget_note_list_outer_padding"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:textColor="@color/fg_default_dark_theme"
android:lines="1"
android:ellipsize="end"
tools:text="@string/app_name_long"/>
tools:text="@string/app_name_long" />
</LinearLayout>

View file

@ -44,7 +44,6 @@
android:paddingRight="@dimen/widget_note_list_inner_padding"
android:textColor="@color/widget_fg_contrast"
android:textSize="18sp"
android:textStyle="bold"
tools:text="@string/app_name" />
<ImageView

View file

@ -1,62 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/widget_background_dark_theme"
android:orientation="vertical"
android:background="@color/widget_background_dark_theme">
tools:background="@null">
<!-- Widget header -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/widget_note_list_header_height"
android:background="@color/primary"
android:background="@drawable/ic_launcher_background"
android:padding="@dimen/widget_note_list_hdr_padding">
<ImageView
android:id="@+id/widget_note_header_icon_dark"
android:layout_width="@dimen/widget_note_list_icon_width"
android:layout_height="match_parent"
android:src="@mipmap/ic_launcher"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:paddingStart="4dp"
android:contentDescription="@string/widget_app_launcher_contentDescription"
android:paddingStart="@dimen/widget_note_list_outer_padding"
android:paddingLeft="@dimen/widget_note_list_outer_padding"
android:paddingEnd="@dimen/widget_note_list_inner_padding"
android:paddingLeft="4dp"
android:paddingRight="@dimen/widget_note_list_inner_padding"
android:contentDescription="@string/widget_app_launcher_contentDescription" />
android:scaleX="2"
android:scaleY="2"
android:src="@drawable/ic_launcher_foreground" />
<TextView
android:id="@+id/widget_note_list_title_tv_dark"
android:layout_width="match_parent"
android:id="@+id/widget_note_list_title_tv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="@color/fg_default_dark_theme"
android:textStyle="bold"
android:textSize="18sp"
android:layout_toRightOf="@id/widget_note_header_icon_dark"
android:layout_toEndOf="@id/widget_note_header_icon_dark"
android:layout_toStartOf="@id/widget_note_list_create_icon_dark"
android:layout_toLeftOf="@id/widget_note_list_create_icon_dark"
android:layout_toEndOf="@id/widget_note_header_icon_dark"
android:layout_toRightOf="@id/widget_note_header_icon_dark"
android:gravity="center_vertical"
android:paddingStart="@dimen/widget_note_list_outer_padding"
android:paddingEnd="@dimen/widget_note_list_inner_padding"
android:paddingLeft="@dimen/widget_note_list_outer_padding"
android:paddingEnd="@dimen/widget_note_list_inner_padding"
android:paddingRight="@dimen/widget_note_list_inner_padding"
tools:text="@string/app_name"/>
android:textColor="@color/widget_fg_contrast"
android:textSize="18sp"
tools:text="@string/app_name" />
<ImageView
android:id="@+id/widget_note_list_create_icon_dark"
android:layout_width="@dimen/widget_note_list_icon_width"
android:layout_height="match_parent"
android:src="@drawable/ic_add_white_24dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:contentDescription="@string/widget_create_note"
android:paddingStart="@dimen/widget_note_list_inner_padding"
android:paddingEnd="@dimen/widget_note_list_outer_padding"
android:paddingLeft="@dimen/widget_note_list_inner_padding"
android:paddingEnd="@dimen/widget_note_list_outer_padding"
android:paddingRight="@dimen/widget_note_list_outer_padding"
android:contentDescription="@string/widget_create_note" />
android:src="@drawable/ic_add_white_24dp" />
</RelativeLayout>
<!-- End header -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -86,7 +86,7 @@
<string name="about_app_license_title">App license</string>
<string name="about_app_license">This application is licensed under the GNU GENERAL PUBLIC LICENSE v3+.</string>
<string name="about_app_license_button">View license</string>
<string name="about_app_icon_author" translatable="false">&lt;a href="http://jancborchardt.net/">Jan C. Borchardt&lt;/a> (&lt;a href="https://github.com/owncloud/notes/commits/master/img/notes.svg">GitHub&lt;/a>)</string>
<string name="about_app_icon_author" translatable="false">&lt;a href="http://jancborchardt.net/">Jan C. Borchardt&lt;/a> (&lt;a href="https://github.com/nextcloud/notes/blob/76d15214f80f2bf7ea08427bff73ad145128f090/img/notes.svg">GitHub&lt;/a>)</string>
<string name="about_icons_disclaimer_title">Icons</string>
<string name="about_icons_disclaimer">&lt;p>Original icon made by %1$s&lt;/p>&lt;p>All further icons used by this app are &lt;a href="https://materialdesignicons.com/">Material Design Icons&lt;/a> made by Google Inc. and licensed under the Apache 2.0 License.&lt;/p></string>
<string name="about_credits_tab_title">Credits</string>

View file

@ -12,6 +12,7 @@ Companion App für Nextcloud Notes.
* Render MarkDown ✨
* Context based formatting 🧰
* Dark mode 🌙
* Einzel-Notizen- und Listen-Widget 📊
* Translated in many languages 🌎

View file

@ -1 +1,2 @@
- Note list widget should create a note in it's respective category (#817)
- Note list widget should create a note in it's respective category (#817)
- "Link" functionality in text menu causes error (#841)

View file

@ -12,6 +12,7 @@ Companion app to Nextcloud Notes.
* MarkDown-Rendering ✨
* Kontext-basierte Formatierung 🧰
* Dark Mode 🌙
* Single note widget and note list widget 📊
* Übersetzt in viele Sprachen 🌎