Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbWatershed committed Jan 30, 2022
2 parents d4faaad + 177a151 commit be18b48
Show file tree
Hide file tree
Showing 43 changed files with 610 additions and 361 deletions.
10 changes: 6 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
//noinspection ExpiringTargetSdkVersion
targetSdkVersion 31
versionCode 130 // is updated automatically by BitRise; only used when building locally
versionName '1.15.19'
versionName '1.15.20'

def includeObjectBoxBrowser = System.getenv("INCLUDE_OBJECTBOX_BROWSER") ?: "false"
def includeLeakCanary = System.getenv("INCLUDE_LEAK_CANARY") ?: "false"
Expand Down Expand Up @@ -75,7 +75,9 @@ android {
}
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
resources {
excludes += ['META-INF/rxjava.properties']
}
}
testOptions {
unitTests.includeAndroidResources = true
Expand Down Expand Up @@ -111,7 +113,7 @@ dependencies {
// Support libraries
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0-beta01'
implementation 'com.google.android.material:material:1.6.0-alpha02'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.paging:paging-runtime:2.1.2'
Expand Down Expand Up @@ -232,7 +234,7 @@ dependencies {

// ObjectBox browser dependencies must be set before applying ObjectBox plugin so it does not add objectbox-android
// (would result in two conflicting versions, e.g. "Duplicate files copied in APK lib/armeabi-v7a/libobjectbox.so").
def objectbox_version = "3.0.1"
def objectbox_version = "3.1.1"
if (includeObjectBoxBrowser.toBoolean()) {
debugImplementation "io.objectbox:objectbox-android-objectbrowser:$objectbox_version"
releaseImplementation "io.objectbox:objectbox-android:$objectbox_version"
Expand Down
26 changes: 14 additions & 12 deletions app/objectbox-models/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
},
{
"id": "10:5605025377139576552",
"lastPropertyId": "13:1008829494719594190",
"lastPropertyId": "14:8168924561252314098",
"name": "Group",
"properties": [
{
Expand All @@ -448,14 +448,6 @@
"name": "order",
"type": 5
},
{
"id": "5:5434514687553672562",
"name": "pictureId",
"indexId": "10:3892013958767955149",
"type": 11,
"flags": 520,
"relationTarget": "ImageFile"
},
{
"id": "6:1399053985046563297",
"name": "isBeingDeleted",
Expand Down Expand Up @@ -490,6 +482,14 @@
"id": "13:1008829494719594190",
"name": "favourite",
"type": 1
},
{
"id": "14:8168924561252314098",
"name": "coverContentId",
"indexId": "21:2677634342952249814",
"type": 11,
"flags": 520,
"relationTarget": "Content"
}
],
"relations": []
Expand Down Expand Up @@ -680,7 +680,7 @@
}
],
"lastEntityId": "15:2260398621202196035",
"lastIndexId": "20:5101223626385692255",
"lastIndexId": "21:2677634342952249814",
"lastRelationId": "3:1412032361666532056",
"lastSequenceId": "0:0",
"modelVersion": 5,
Expand All @@ -693,7 +693,8 @@
9049773303925818273,
4642610167694780718,
9182121386646774745,
372149557770070472
372149557770070472,
3892013958767955149
],
"retiredPropertyUids": [
1563990578201199392,
Expand All @@ -710,7 +711,8 @@
753426778229264571,
2206907103185425670,
6457903105882729256,
4015520791093060143
4015520791093060143,
5434514687553672562
],
"retiredRelationUids": [
4182320255043105081,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public void onDrawerClosed(View view) {
initSelectionToolbar();
initUI();
updateToolbar();
updateSelectionToolbar(0, 0, 0);
updateSelectionToolbar(0, 0, 0, 0);

onCreated();
sortCommandsAutoHide = new Debouncer<>(this, 3000, this::hideSearchSortBar);
Expand Down Expand Up @@ -436,7 +436,7 @@ public void onPageSelected(int position) {
enableCurrentFragment();
hideSearchSortBar(false);
updateToolbar();
updateSelectionToolbar(0, 0, 0);
updateSelectionToolbar(0, 0, 0, 0);
}
});
viewPager.setAdapter(pagerAdapter);
Expand Down Expand Up @@ -952,7 +952,8 @@ private void updateToolbar() {
public void updateSelectionToolbar(
long selectedTotalCount,
long selectedLocalCount,
long selectedStreamedCount) {
long selectedStreamedCount,
long selectedEligibleExternalCount) {
boolean isMultipleSelection = selectedTotalCount > 1;
long selectedDownloadedCount = selectedLocalCount - selectedStreamedCount;
long selectedExternalCount = selectedTotalCount - selectedLocalCount;
Expand Down Expand Up @@ -987,8 +988,8 @@ public void updateSelectionToolbar(
mergeMenu.setVisible(
(selectedLocalCount > 1 && 0 == selectedStreamedCount && 0 == selectedExternalCount)
|| (selectedStreamedCount > 1 && 0 == selectedLocalCount && 0 == selectedExternalCount)
|| (selectedExternalCount > 1 && 0 == selectedLocalCount && 0 == selectedStreamedCount)
); // Can only merge downloaded or streamed content together
|| (selectedExternalCount > 1 && 0 == selectedLocalCount && 0 == selectedStreamedCount && selectedEligibleExternalCount == selectedExternalCount)
); // Can only merge downloaded, streamed or non-archive external content together
splitMenu.setVisible(!isMultipleSelection && 1 == selectedLocalCount);
}
}
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/me/devsaki/hentoid/activities/PrefsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.fragment.app.commit
import com.google.android.material.snackbar.BaseTransientBottomBar
import com.google.android.material.snackbar.Snackbar
import me.devsaki.hentoid.R
import me.devsaki.hentoid.activities.bundles.PrefsActivityBundle
import me.devsaki.hentoid.activities.bundles.PrefsBundle
import me.devsaki.hentoid.events.ProcessEvent
import me.devsaki.hentoid.fragments.preferences.PreferencesFragment
import me.devsaki.hentoid.util.FileHelper
Expand Down Expand Up @@ -46,28 +46,28 @@ class PrefsActivity : BaseActivity() {

private fun isViewerPrefs(): Boolean {
return if (intent.extras != null) {
val parser = PrefsActivityBundle.Parser(intent.extras!!)
val parser = PrefsBundle(intent.extras!!)
parser.isViewerPrefs
} else false
}

private fun isBrowserPrefs(): Boolean {
return if (intent.extras != null) {
val parser = PrefsActivityBundle.Parser(intent.extras!!)
val parser = PrefsBundle(intent.extras!!)
parser.isBrowserPrefs
} else false
}

private fun isDownloaderPrefs(): Boolean {
return if (intent.extras != null) {
val parser = PrefsActivityBundle.Parser(intent.extras!!)
val parser = PrefsBundle(intent.extras!!)
parser.isDownloaderPrefs
} else false
}

private fun isStoragePrefs(): Boolean {
return if (intent.extras != null) {
val parser = PrefsActivityBundle.Parser(intent.extras!!)
val parser = PrefsBundle(intent.extras!!)
parser.isStoragePrefs
} else false
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package me.devsaki.hentoid.activities.bundles

import android.os.Bundle
import me.devsaki.hentoid.util.string

/**
* Helper class to transfer data from any Activity to {@link me.devsaki.hentoid.activities.PrefsActivity}
* through a Bundle
*/
class BaseWebActivityBundle(private val bundle: Bundle) {

constructor() : this(Bundle())

var url by bundle.string(default = "")

fun toBundle() = bundle
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit be18b48

Please sign in to comment.