Skip to content

Commit

Permalink
Merge pull request #1031 from zhwanng/v3.0.5
Browse files Browse the repository at this point in the history
V3.0.5
  • Loading branch information
zhwanng authored Nov 1, 2024
2 parents 8c77749 + 64a2328 commit 83bebbd
Show file tree
Hide file tree
Showing 164 changed files with 7,077 additions and 2,169 deletions.
11 changes: 5 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
compileSdk rootProject.ext.compileSdkVersion

versionCode 154
versionName "3.0.4"
versionCode 155
versionName "3.0.5"
multiDexEnabled true

resValue "string", "authorities", defaultConfig.applicationId + '.debug.cameraupload.provider'
Expand Down Expand Up @@ -199,14 +199,15 @@ android {
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.core:core-splashscreen:1.0.1'
implementation "androidx.appcompat:appcompat:1.7.0"
implementation "androidx.activity:activity:1.9.1"
implementation "androidx.activity:activity:1.9.3"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation "androidx.preference:preference:1.2.1"
// implementation "androidx.datastore:datastore-preferences:1.0.0"
// implementation "androidx.datastore:datastore-preferences-rxjava2:1.0.0"
implementation "androidx.core:core-splashscreen:1.0.1"
implementation "androidx.webkit:webkit:1.11.0"
implementation "androidx.webkit:webkit:1.12.1"
implementation 'com.google.android.flexbox:flexbox:3.0.0'

//https://github.com/material-components/material-components-android
implementation "com.google.android.material:material:1.12.0"
Expand Down Expand Up @@ -310,8 +311,6 @@ android {
implementation 'com.madgag.spongycastle:core:1.54.0.0'
implementation 'com.madgag.spongycastle:prov:1.54.0.0'

// implementation 'org.greenrobot:eventbus:3.3.1'

def glide_version = "4.16.0"
implementation "com.github.bumptech.glide:glide:$glide_version"
implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@
<activity android:name=".ui.BugHandlerActivity" />
<activity android:name=".ui.settings.SettingsAlbumBackupAdvancedActivity" />
<activity android:name=".ui.data_migrate.DataMigrationV303Activity" />
<activity android:name=".ui.sdoc.SDocWebViewActivity" />
<activity android:name=".ui.sdoc.comments.SDocCommentsActivity" />

<provider
android:name=".provider.SeafileProvider"
Expand Down
45 changes: 29 additions & 16 deletions app/src/main/java/com/seafile/seadroid2/account/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ public Account(String name, String server, String email, String avatar_url, Stri
this.login_time = Long.parseLong(loginTime);
}

public void setServer(String server) {
this.server = server;
}

public void setToken(String token) {
this.token = token;
}

public long getUsageSpace() {
return usage;
}
Expand Down Expand Up @@ -124,20 +132,6 @@ public void setEmail(String email) {
}


public String getServerHost() {
String s = server.substring(server.indexOf("://") + 3);
return s.substring(0, s.indexOf('/'));
}

public String getServerDomainName() {
String dn = getServerHost();
// strip port, like :8000 in 192.168.1.116:8000
if (dn.contains(":"))
dn = dn.substring(0, dn.indexOf(':'));
return dn;
}


public String getEmail() {
return email;
}
Expand All @@ -156,14 +150,33 @@ public String getServer() {
}

/**
* https://dev.xxx.com/dev/ => https://dev.xxx.com
* @return DOMAIN/IP_ADDRESS(:PORT), <br/>like www.goo.gle, like 192.168.0.1:8000
*/
public String getServerHost() {
String s = server.substring(server.indexOf("://") + 3);
return s.substring(0, s.indexOf('/'));
}

/**
* @return DOMAIN/IP_ADDRESS, <br/>like www.goo.gle, like 192.168.0.1
*/
public String getServerDomainName() {
String dn = getServerHost();
// strip port, like :8000 in 192.168.1.116:8000
if (dn.contains(":"))
dn = dn.substring(0, dn.indexOf(':'));
return dn;
}

/**
* @return https://dev.xxx.com/dev/ => https://dev.xxx.com
*/
public String getProtocolHost() {
return URLs.getProtocolHost(server);
}

/**
* https://dev.xxx.com/dev/ => dev.xxx.com/dev
* @return https://dev.xxx.com/dev/ => dev.xxx.com/dev
*/
public String getServerNoProtocol() {
String result = server.substring(server.indexOf("://") + 3);
Expand Down
59 changes: 59 additions & 0 deletions app/src/main/java/com/seafile/seadroid2/config/ColumnType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.seafile.seadroid2.config;

import com.blankj.utilcode.util.CollectionUtils;

import java.util.List;

public class ColumnType {
public static final String INIT_FIELD = "0000";



public static final String TEXT = "text";
public static final String COLLABORATOR = "collaborator";
public static final String DATE = "date";
public static final String LONG_TEXT = "long-text";
public static final String NUMBER = "number";
public static final String DURATION = "duration";
public static final String SINGLE_SELECT = "single-select";
public static final String MULTIPLE_SELECT = "multiple-select";
public static final String IMAGE = "image";
public static final String FILE = "file";
public static final String EMAIL = "email";
public static final String URL = "url";
public static final String CHECKBOX = "checkbox";
public static final String RATE = "rate";

//Advanced
public static final String GEOLOCATION = "geolocation";
public static final String LINK = "link";
public static final String DIGITAL_SIGN = "digital-sign";
public static final String FORMULA = "formula";
public static final String LINK_FORMULA = "link-formula";
public static final String AUTO_NUMBER = "auto-number";
public static final String CTIME = "ctime";
public static final String MTIME = "mtime";
public static final String BUTTON = "button";
public static final String CREATOR = "creator";
public static final String LAST_MODIFIER = "last-modifier";


public final static List<String> ENABLE_TYPE_LIST = CollectionUtils.newArrayList(
TEXT,
COLLABORATOR,
DATE,
LONG_TEXT,
NUMBER,
DURATION,
SINGLE_SELECT,
MULTIPLE_SELECT,
IMAGE,
FILE,
EMAIL,
URL,
CHECKBOX,
RATE,
GEOLOCATION,
LINK,
DIGITAL_SIGN);
}
54 changes: 7 additions & 47 deletions app/src/main/java/com/seafile/seadroid2/context/NavContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,23 @@ public DirentModel getTopDirentModel() {
/**
* Get the parents model of the current Dirent, maybe RepoModel
*/
public boolean hasParentWritePermission() {
public boolean isParentHasWritePermission() {
if (!inRepo()) {
//repo list page should not have permission verification
throw new IllegalArgumentException("Please check your code");
}

if (inRepoRoot()) {
return hasWritePermissionWithRepo();
return getRepoModel().hasWritePermission();
}

BaseModel bd = navStack.elementAt(navStack.size() - 1);
DirentModel d = (DirentModel) bd;
if (d != null) {
return d.hasWritePermission();
if (d == null) {
return false;
}
return false;

return d.hasWritePermission();
}

public RepoModel getRepoModel() {
Expand All @@ -135,7 +137,6 @@ public BaseModel getTopModel() {
return navStack.peek();
}


/**
* @return /a/b/c/d/e/
*/
Expand All @@ -160,27 +161,6 @@ public String getNavPath() {

return fullPath;
}
//
// /**
// * /a/b/c/d/e.txt -> e.txt
// */
// public String getLastNameOfPath() {
// String fullPath = getNavPath();
// if (TextUtils.isEmpty(fullPath)) {
// return null;
// }
//
// if (!fullPath.contains("/")) {
// return fullPath;
// }
//
// String[] slash = fullPath.split("/");
// if (slash.length == 0) {
// return null;
// }
//
// return slash[slash.length - 1];
// }

/**
* /a/b/c -> c
Expand All @@ -201,24 +181,4 @@ public String getLastPathName() {

return null;
}

//
public boolean hasWritePermissionWithRepo() {

// BaseModel baseModel = getTopModel();
// if (baseModel == null) {
// return false;
// }
//
// if (baseModel instanceof RepoModel) {
// return ((RepoModel) baseModel).hasWritePermission();
// }
//
// if (baseModel instanceof DirentModel) {
// return ((DirentModel) baseModel).hasWritePermission();
// }

return getRepoModel().hasWritePermission();
}

}
Loading

0 comments on commit 83bebbd

Please sign in to comment.