Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solving incomplete camera upload #925

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ debugkey.properties
# Misc
.DS_Store
app/seed.txt
app/map.txt
app/release
out/

*.store
Expand Down
17 changes: 11 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ android {
}
}

lintOptions {
abortOnError false
disable 'MissingTranslation'
}


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -62,7 +57,7 @@ android {
resValue "string", "account_type", "com.seafile.seadroid2.debug.account.api2"
buildConfigField "String", "ACCOUNT_TYPE", '"com.seafile.seadroid2.debug.account.api2"'
signingConfig signingConfigs.debug
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand Down Expand Up @@ -131,6 +126,16 @@ android {
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

implementation 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.3.0'
implementation 'com.alibaba:fastjson:1.1.55.android'
}
lint {
abortOnError false
disable 'MissingTranslation'
}
buildFeatures {
viewBinding false
}
}

297 changes: 160 additions & 137 deletions app/src/main/AndroidManifest.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/src/main/java/com/seafile/seadroid2/SeafConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public class SeafConnection {
public static final int HTTP_STATUS_REPO_PASSWORD_REQUIRED = 440;

private static final String DEBUG_TAG = "SeafConnection";
private static final int CONNECTION_TIMEOUT = 15000;
private static final int READ_TIMEOUT = 30000;
private static final int CONNECTION_TIMEOUT = 5000000;
private static final int READ_TIMEOUT = 5000000;

private Account account;

Expand Down
33 changes: 33 additions & 0 deletions app/src/main/java/com/seafile/seadroid2/SettingsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@

import com.seafile.seadroid2.account.AccountManager;
import com.seafile.seadroid2.gesturelock.LockPatternUtils;
import com.seafile.seadroid2.loopimages.DirInfo;
import com.seafile.seadroid2.util.Utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* Access the app settings
Expand Down Expand Up @@ -102,6 +106,10 @@ private SettingsManager() {
public static final String PIC_CHECK_START = "pic_check_start";
public static final String UPLOAD_COMPLETED_TIME = "upload_completed_time";

// Loop Images Widget
public static final String LOOPIMAGES_REMOTE_LIBRARY_DATAPLAN = PKG + ".loopimages.remote_library_data_plan_";
public static final String LOOPIMAGES_REMOTE_LIBRARY_DIRINFO = PKG + ".loopimages.remote_library_dir_info_";

public static long lock_timestamp = 0;
public static final long LOCK_EXPIRATION_MSECS = 5 * 60 * 1000;

Expand Down Expand Up @@ -230,6 +238,31 @@ public boolean checkCameraUploadNetworkAvailable() {
return true;
}

public void saveLoopImagesWidgetDataPlanAllowed(int appWidgetId, boolean isAllowed){
settingsSharedPref.edit().putBoolean(LOOPIMAGES_REMOTE_LIBRARY_DATAPLAN + appWidgetId, isAllowed).commit();
}

public boolean getLoopImagesWidgetDataPlanAllowed(int appWidgetId){
return settingsSharedPref.getBoolean(LOOPIMAGES_REMOTE_LIBRARY_DATAPLAN + appWidgetId, false);
}

public void setLoopImagesWidgetDirInfo(int appWidgetId, List<String> info) {
String dirInfo = TextUtils.join(";", info);
settingsSharedPref.edit().putString(LOOPIMAGES_REMOTE_LIBRARY_DIRINFO + appWidgetId, dirInfo).commit();
}

public List<String> getLoopImagesWidgetDirInfo(int appWidgetId){
String dirInfoStr = settingsSharedPref.getString(LOOPIMAGES_REMOTE_LIBRARY_DIRINFO + appWidgetId, "");
List<String> res = Arrays.asList(TextUtils.split(dirInfoStr, ";"));
return res;
}

public void deleteLoopImagesWidgetInfo(int appWidgetId) {
if(settingsSharedPref.contains(LOOPIMAGES_REMOTE_LIBRARY_DIRINFO)){
settingsSharedPref.edit().remove(LOOPIMAGES_REMOTE_LIBRARY_DIRINFO + appWidgetId).commit();
}
}

public boolean isDataPlanAllowed() {
return settingsSharedPref.getBoolean(CAMERA_UPLOAD_ALLOW_DATA_PLAN_SWITCH_KEY, false);
}
Expand Down
Loading