Skip to content

Commit

Permalink
Merge branch 'release-1.8.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
nevenz committed Jun 26, 2021
2 parents 05aa893 + f1835be commit ee50050
Show file tree
Hide file tree
Showing 46 changed files with 1,198 additions and 281 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
minSdkVersion 16 // Jelly Bean (4.1)
targetSdkVersion 29 // Android 10
applicationId "com.orgzly"
versionCode 155
versionName "1.8.4"
versionCode 158
versionName "1.8.5"

testInstrumentationRunner "com.orgzly.android.OrgzlyTestRunner"
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -177,7 +177,7 @@ dependencies {

implementation "com.github.bumptech.glide:glide:$versions.glide"

implementation("com.thegrizzlylabs.sardine-android:sardine-android:$versions.sardine") {
implementation("com.github.thegrizzlylabs:sardine-android:$versions.sardine") {
exclude group: 'xpp3', module: 'xpp3'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,4 +815,12 @@ public void testScheduledTimestamp() {

onNotesInSearch().check(matches(recyclerViewItemCount(1)));
}

@Test
public void testNotScheduled() {
testUtils.setupBook("notebook-1", "* Note A");
ActivityScenario.launch(MainActivity.class);
searchForText("s.no");
onNotesInSearch().check(matches(recyclerViewItemCount(1)));
}
}
23 changes: 15 additions & 8 deletions app/src/androidTest/java/com/orgzly/android/query/QueryTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,27 @@ class QueryTest(private val param: Parameter) : OrgzlyTest() {
Parameter(
queryString = "s.le.2w",
expectedQueryString = "s.2w",
expectedSqlSelection = "((scheduled_is_active = 1 AND (scheduled_time_timestamp != 0 AND scheduled_time_timestamp < " + TimeUtils.timeFromNow(Calendar.DAY_OF_MONTH, 14+1) + ")))"
expectedSqlSelection = "((scheduled_is_active = 1 AND scheduled_time_timestamp != 0 AND scheduled_time_timestamp < " + TimeUtils.timeFromNow(Calendar.DAY_OF_MONTH, 14+1) + "))"
),
Parameter(
queryString = "s.le.3d",
expectedQueryString = "s.3d",
expectedSqlSelection = "((scheduled_is_active = 1 AND (scheduled_time_timestamp != 0 AND scheduled_time_timestamp < " + TimeUtils.timeFromNow(Calendar.DAY_OF_MONTH, 3+1) + ")))"
expectedSqlSelection = "((scheduled_is_active = 1 AND scheduled_time_timestamp != 0 AND scheduled_time_timestamp < " + TimeUtils.timeFromNow(Calendar.DAY_OF_MONTH, 3+1) + "))"
),
Parameter(
queryString = "s.le.2h",
expectedQueryString = "s.2h",
expectedSqlSelection = "((scheduled_is_active = 1 AND (scheduled_time_timestamp != 0 AND scheduled_time_timestamp < " + TimeUtils.timeFromNow(Calendar.HOUR_OF_DAY, 2+1) + ")))"
expectedSqlSelection = "((scheduled_is_active = 1 AND scheduled_time_timestamp != 0 AND scheduled_time_timestamp < " + TimeUtils.timeFromNow(Calendar.HOUR_OF_DAY, 2+1) + "))"
),
Parameter(
queryString = "s.le.+2h",
expectedQueryString = "s.2h",
expectedSqlSelection = "((scheduled_is_active = 1 AND (scheduled_time_timestamp != 0 AND scheduled_time_timestamp < " + TimeUtils.timeFromNow(Calendar.HOUR_OF_DAY, 2+1) + ")))"
expectedSqlSelection = "((scheduled_is_active = 1 AND scheduled_time_timestamp != 0 AND scheduled_time_timestamp < " + TimeUtils.timeFromNow(Calendar.HOUR_OF_DAY, 2+1) + "))"
),
Parameter(
queryString = "d.tom",
expectedQueryString = "d.tomorrow",
expectedSqlSelection = "((deadline_is_active = 1 AND (deadline_time_timestamp != 0 AND deadline_time_timestamp < " + TimeUtils.timeFromNow(Calendar.DAY_OF_MONTH, 1+1) + ")))"
expectedSqlSelection = "((deadline_is_active = 1 AND deadline_time_timestamp != 0 AND deadline_time_timestamp < " + TimeUtils.timeFromNow(Calendar.DAY_OF_MONTH, 1+1) + "))"
),
Parameter(
queryString = "c.eq.today",
Expand Down Expand Up @@ -278,12 +278,14 @@ class QueryTest(private val param: Parameter) : OrgzlyTest() {
Parameter(
queryString = "s.ge.3d",
expectedQueryString = "s.ge.3d",
expectedSqlSelection = "((scheduled_is_active = 1 AND (scheduled_time_timestamp != 0 AND ${TimeUtils.timeFromNow(Calendar.DAY_OF_MONTH, 3)} <= scheduled_time_timestamp)))"
expectedSqlSelection = "((scheduled_is_active = 1 AND scheduled_time_timestamp != 0 AND ${TimeUtils.timeFromNow(Calendar.DAY_OF_MONTH, 3)} <= scheduled_time_timestamp))"
),
Parameter(
queryString = "((i.todo s.no) or i.later) o.state",
expectedQueryString = "(i.todo s.none or i.later) o.state",
expectedQuerySortOrders = listOf(SortOrder.State())
expectedQuerySortOrders = listOf(SortOrder.State()),
expectedSqlSelection = "(((COALESCE(state, '') = ? AND scheduled_time_timestamp IS NULL) OR COALESCE(state, '') = ?))",
expectedSelectionArgs = listOf("TODO", "LATER")
),
Parameter(
queryString = "o.title",
Expand All @@ -292,7 +294,12 @@ class QueryTest(private val param: Parameter) : OrgzlyTest() {
expectedSelectionArgs = listOf(),
expectedSqlOrder = "title, lft",
expectedQuerySortOrders = listOf(SortOrder.Title())
)
),
Parameter(
queryString = "s.no",
expectedQueryString = "s.none",
expectedSqlSelection = "(scheduled_time_timestamp IS NULL)"
),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,26 @@ class SqliteQueryBuilder(val context: Context) {
}

is Condition.Event -> {
toInterval("event_timestamp", expr.interval, expr.relation)
toInterval("event_timestamp", null, expr.interval, expr.relation)
}

is Condition.Scheduled -> {
hasScheduledCondition = true
"(scheduled_is_active = 1 AND ${toInterval("scheduled_time_timestamp", expr.interval, expr.relation)})"
toInterval("scheduled_time_timestamp", "scheduled_is_active", expr.interval, expr.relation)
}

is Condition.Deadline -> {
hasDeadlineCondition = true
"(deadline_is_active = 1 AND ${toInterval("deadline_time_timestamp", expr.interval, expr.relation)})"
toInterval("deadline_time_timestamp", "deadline_is_active", expr.interval, expr.relation)
}

is Condition.Created -> {
hasCreatedCondition = true
toInterval("created_at", expr.interval, expr.relation)
toInterval("created_at", null, expr.interval, expr.relation)
}

is Condition.Closed -> {
toInterval("closed_time_timestamp", expr.interval, expr.relation)
toInterval("closed_time_timestamp", null, expr.interval, expr.relation)
}

is Condition.HasText -> {
Expand All @@ -264,7 +264,7 @@ class SqliteQueryBuilder(val context: Context) {
}
}

private fun toInterval(column: String, interval: QueryInterval, relation: Relation): String {
private fun toInterval(column: String, isActiveColumn: String?, interval: QueryInterval, relation: Relation): String {
if (interval.none) {
return "$column IS NULL"
}
Expand All @@ -284,7 +284,13 @@ class SqliteQueryBuilder(val context: Context) {
Relation.GE -> "$timeFromNow <= $column"
}

return "($column != 0 AND $cond)"
val activeOnly = if (isActiveColumn != null) {
"$isActiveColumn = 1 AND "
} else {
""
}

return "($activeOnly$column != 0 AND $cond)"
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.google.gson.JsonSyntaxException
import com.google.gson.annotations.SerializedName

data class RefileLocation(
val type: Type,
val type: Type? = null,

val id: Long? = null,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RefileViewModel(
RefileLocation.fromJson(it)
}

val item = if (location != null) {
val item = if (location?.type != null) {
replayUntilNoteId(location)
} else {
HOME
Expand Down
51 changes: 51 additions & 0 deletions app/src/main/res/layout/dialog_whats_new.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,57 @@
android:layout_marginBottom="@dimen/space_between_content_areas"
android:text="@string/whats_new_intro"/>


<TextView
style="@style/WhatsNewVersion"
android:text="v1.8.5"
tools:ignore="HardcodedText" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Support &lt;tt&gt;.tn&lt;/tt&gt; search operator" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Preference to insert new note at the beginning of notebook" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Preference to define root directory for file links" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Gray out notes with &lt;tt&gt;ARCHIVE&lt;/tt&gt; tag" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Support &lt;tt&gt;+&lt;/tt&gt; as a bullet for lists" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Support “Keep screen on” option in note view" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Allow picking directory for saved searches export" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Fix list continuing on some keyboards" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Handle escaped brackets in links" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Few fixes for timestamps without time part set (fix for &lt;tt&gt;s.now&lt;/tt&gt; and reminders)" />

<com.orgzly.android.ui.views.WhatsNewChange
style="@style/WhatsNewChange"
app:text="Ignore inactive scheduled and deadline times in agenda" />


<TextView
style="@style/WhatsNewVersion"
android:text="v1.8.4"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-cs-rCZ/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Kliknutí a podržení ikony rozvine celý úsek.

Při hledání poznámek se štítkem "štítek1" a použijete "t.štítek1", bude tato poznámka zahrnuta do výsledků hledání.

*** Poznámka s nastaveným =ARCHIVE= štítkem je zašedlá :ARCHIVE:

** TODO Poznámka může mít stav

Lze nastavit množství stavů: TODO, NEXT, DONE, atd.
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-de-rDE/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Halten Sie das Symbol gedrückt, um den gesamten Unterbaum aufzuklappen.

Wenn Sie mit der Abfrage „t.Schlagwort1“ nach Notizen mit dem Schlagwort „Schlagwort1“ suchen, wird diese Notiz in die Suchergebnisse aufgenommen.

*** Eine Notiz mit dem Schlagwort =ARCHIVE= ist ausgegraut :ARCHIVE:

** TODO-Notizen können einen Status besitzen

Sie können eine beliebige Anzahl zu verwendender Status konfigurieren: TODO, NEXT, DONE usw.
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-es-rES/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Haga clic largo en el icono para desplegar subárbol completo.

Si busca por notas con la etiqueta "etiqueta1" usando la búsqueda "t.etiqueta1", esta nota se incluirá en los resultados de búsqueda.

*** Una nota que tiene la etiqueta =ARCHIVE= se pone grisácea :ARCHIVE:

** TODO Una nota puede tener un estado

Puede configurar cualquier número de estados a utilizar: TODO, NEXT, DONE, etc.
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-fr-rFR/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Appuyiez longuement pour ouvrir toute la sous-arborescence.

Si vous recherchez des notes avec le tag “tag1” en utilisant la requête “t.tag1”, cette note sera incluse dans les résultats de recherche.

*** Une note qui a la balise =ARCHIVE= est grisée :ARCHIVE:

** TODO Les notes peuvent avoir un état

Vous pouvez configurer tous les états que vous souhaitez : TODO, NEXT, DONE, etc.
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-hu-rHU/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Hosszú koppintás az ikonon megnyitja az egész fát.

Ha a "címke1" címkéjű bejegyzéseket keresed a "t.címke1" lekérdezés használatával, akkor ez a bejegyzés benne lesz a keresési eredményben.

*** Az =ARCHIVE= -nak cimkézett jegyzet kiszürkített :ARCHIVE:

** TODO Egy bejegyzésnek állapota is lehet

Létre lehet hozni akárhány állapot jelzőt: TODO, NEXT, DONE, stb.
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-in-rID/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Long-click the icon to unfold entire subtree.

If you search for notes with tag “tag1” using “t.tag1” query, this note will be included in search results.

*** A note that has the =ARCHIVE= tag set is grayed out :ARCHIVE:

** Catatan TODO harus memiliki status

Anda dapat mengkonfigurasi sejumlah bagian negara untuk menggunakan: TODO, NEXT, DONE, dll.
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/raw-it-rIT/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Fare clic sull'icona per dispiegare l'intero sotto-albero.

Se si cerca note con tag “tag1” utilizzando la query “t.tag1”, questa nota sarà inclusa nei risultati di ricerca.

*** A note that has the =ARCHIVE= tag set is grayed out :ARCHIVE:

** TODO La nota può avere uno stato

È possibile configurare qualsiasi numero di stati da usare: TODO, NEXT, DONE, ecc.
Expand All @@ -35,7 +37,7 @@ CLOSED: [2018-01-24 Mer 17:00]
SCHEDULED: <2015-02-20 Ven 15:15>

*** Gli orari possono avere una ripetizione
SCHEDULED: <2015-02-16 Mon .+2d>
SCHEDULED: <2015-02-16 Lun .+2d>

** Puoi anche stabilire una scadenza
DEADLINE: <2015-02-20 Ven>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-ja-rJP/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Orgzly へようこそ!

"tag1"を検索する"t.tag1"クエリを使うと、このメモも検索結果に含まれます

*** =ARCHIVE= タグのついたメモはグレーアウト表示されます :ARCHIVE:

** TODO メモには状態を付けられます

状態はいくつでも設定できます。 TODO, NEXT, DONE, などです。
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-ko-rKR/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Long-click the icon to unfold entire subtree.

If you search for notes with tag “tag1” using “t.tag1” query, this note will be included in search results.

*** A note that has the =ARCHIVE= tag set is grayed out :ARCHIVE:

** TODO 메모에 처리 상태를 설정할 수 있습니다.

처리상태: TODO, NEXT, DONE, etc.
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/raw-nl-rNL/orgzly_getting_started.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Lang klikken op het pictogram om volledig te ontvouwen.

Als u notities zoekt met tag "tag1" met "t.tag1" zoekopdracht, zal deze notitie worden opgenomen in zoekresultaten.

*** Een notitie welke de =ARCHIVE= tag gezet heeft, wordt uitgegrijst :ARCHIVE:

** TODO Een notitie kan een status hebben

Je kunt zo veel statussen configureren als je wilt: TODO, NEXT, DONE, etc.
Expand Down
Loading

0 comments on commit ee50050

Please sign in to comment.