Skip to content

Commit

Permalink
Merge pull request #436 from sunbeams001/minor-fix-51
Browse files Browse the repository at this point in the history
一些修改
  • Loading branch information
sunbeams001 authored Oct 31, 2021
2 parents c03988b + c4ed86b commit 277999a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 13 deletions.
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
本应用无iOS版,推荐使用其他开发者的 [PixEz Flutter](https://github.com/Notsfsssf/pixez-flutter)

+ #### 打不开登录/注册页 / 无法进行 reCAPTCHA 认证 / 连不上网
登录过程请使用代理,具体方法参见各软件/网络服务商说明;登录结束后如果能直连则不再需要代理。登录界面-右上角设置-网络-开启直连:[关闭]为代理模式,[开启]为直连模式
登录过程请使用外部代理,具体方法参见各软件/网络服务商说明;登录结束后如果能直连则不再需要外部代理。登录界面-右上角设置-网络-开启直连:[关闭]为代理模式,需要使用外部代理,[开启]为直连模式,通过域前置实现访问

+ #### 开启直连后无法看图
确认设置中已开启直连,先关闭代理,然后尝试完全关闭并重启应用(从最近使用中清理以结束运行),如果不行再尝试开启`使用PixivCat代理`;需要注意,网络供应商为中国移动、广电、长城等或处于校园网时无法保证直连效果
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "ceui.lisa.pixiv"
minSdkVersion 21
targetSdkVersion 30
versionCode 218
versionName "3.2.18"
versionCode 219
versionName "3.2.19"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

javaCompileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void doSomething(Progress t) {
@Override
public void onClick(View v) {
if (target.isPaused()) {
manager.startOne(mContext, target.getUuid());
manager.startOne(target.getUuid());
bindView.baseBind.state.setText("未开始");
} else {
manager.stopOne(target.getUuid());
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/ceui/lisa/core/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ public void startAll() {
if (!Common.isEmpty(content)) {
for (DownloadItem item : content) {
//item.setProcessed(false);
if (item.getState() != DownloadItem.DownloadState.PAUSED) {
item.setPaused(false);
if (item.getState() == DownloadItem.DownloadState.FAILED) {
item.setState(DownloadItem.DownloadState.INIT);
}
item.setPaused(false);
}
}
if (isRunning) {
Expand All @@ -146,12 +146,15 @@ public void startAll() {
loop();
}

public void startOne(Context context, String uuid) {
public void startOne(String uuid) {
for (int i = 0; i < content.size(); i++) {
DownloadItem downloadItem = content.get(i);
if (downloadItem != null && downloadItem.getUuid().equals(uuid)) {
//downloadItem.setProcessed(false);
downloadItem.setPaused(false);
if(downloadItem.getState() == DownloadItem.DownloadState.FAILED){
downloadItem.setState(DownloadItem.DownloadState.INIT);
}
Common.showLog("已开始 " + uuid);
break;
}
Expand Down
19 changes: 17 additions & 2 deletions app/src/main/java/ceui/lisa/feature/worker/Worker.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
public class Worker {

private ArrayList<AbstractTask> runningTask = new ArrayList<>();
private final Thread workThread = new Thread(this::execute);
//private final Thread workThread = new Thread(this::execute);
private static final Handler handler = new Handler();
private FeedBack mFeedBack;
private FeedBack mFinalFeedBack;

private Worker() {
}
Expand Down Expand Up @@ -62,7 +63,7 @@ public void removeTask(int index) {
public void start() {
if (!isRunning) {
isRunning = true;
workThread.start();
new Thread(this::execute).start();
}
}

Expand Down Expand Up @@ -90,6 +91,12 @@ public void next() {
if (mFeedBack != null) {
mFeedBack.doSomething();
}
if(runningTask == null || runningTask.size() == 0){
if(mFinalFeedBack != null){
mFinalFeedBack.doSomething();
mFinalFeedBack = null;
}
}
execute();
}
});
Expand All @@ -106,4 +113,12 @@ public FeedBack getFeedBack() {
public void setFeedBack(FeedBack feedBack) {
mFeedBack = feedBack;
}

public FeedBack getFinalFeedBack() {
return mFinalFeedBack;
}

public void setFinalFeedBack(FeedBack mFinalFeedBack) {
this.mFinalFeedBack = mFinalFeedBack;
}
}
13 changes: 13 additions & 0 deletions app/src/main/java/ceui/lisa/fragments/FragmentMultiDownload.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import ceui.lisa.feature.worker.BatchStarTask;
import ceui.lisa.feature.worker.Worker;
import ceui.lisa.interfaces.Callback;
import ceui.lisa.interfaces.FeedBack;
import ceui.lisa.interfaces.OnItemLongClickListener;
import ceui.lisa.models.IllustsBean;
import ceui.lisa.utils.Common;
Expand Down Expand Up @@ -108,13 +109,25 @@ public void doSomething(Uri t) {
allItem.getId(), 0);
Worker.get().addTask(task);
}
Worker.get().setFinalFeedBack(new FeedBack() {
@Override
public void doSomething() {
Common.showToast("全部收藏成功");
}
});
Worker.get().start();
} else if (item.getItemId() == R.id.action_5) {
for (IllustsBean allItem : allItems) {
BatchStarTask task = new BatchStarTask(allItem.getUser().getName(),
allItem.getId(), 1);
Worker.get().addTask(task);
}
Worker.get().setFinalFeedBack(new FeedBack() {
@Override
public void doSomething() {
Common.showToast("全部取消收藏成功");
}
});
Worker.get().start();
} else if (item.getItemId() == R.id.action_6) {
for (int i = 0; i < allItems.size(); i++) {
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/res/layout/recy_single_line_text_with_delete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

<TextView
android:id="@+id/tag_title"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:layout_weight="1"
android:textColor="@color/second_text_color"
android:textSize="13sp" />

Expand All @@ -36,8 +36,6 @@
android:layout_marginStart="@dimen/four_dp"
android:src="@drawable/ic_cancel_black_24dp" />



</LinearLayout>

<data>
Expand Down

0 comments on commit 277999a

Please sign in to comment.