Skip to content

Commit

Permalink
Merge pull request CeuiLiSA#3 from CeuiLiSA/master
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
duzhaokun123 authored Mar 20, 2020
2 parents 14481a9 + bb135f4 commit 8c581fc
Show file tree
Hide file tree
Showing 59 changed files with 709 additions and 1,690 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 CeuiLiSA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,32 @@
</a>


### 开源许可

This project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.

```text
MIT License
Copyright (c) 2020 CeuiLiSA
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```


8 changes: 4 additions & 4 deletions app/src/main/java/ceui/lisa/activities/TemplateActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import ceui.lisa.R;
import ceui.lisa.databinding.ActivityFragmentBinding;
import ceui.lisa.fragments.FragmentAboutApp;
import ceui.lisa.fragments.FragmentMultiDownld;
import ceui.lisa.fragments.FragmentSB;
import ceui.lisa.fragments.FragmentUserInfo;
import ceui.lisa.fragments.FragmentBookedTag;
import ceui.lisa.fragments.FragmentComment;
Expand All @@ -30,7 +32,6 @@
import ceui.lisa.fragments.FragmentLive;
import ceui.lisa.fragments.FragmentLocalUsers;
import ceui.lisa.fragments.FragmentM;
import ceui.lisa.fragments.FragmentMultiDownload;
import ceui.lisa.fragments.FragmentNew;
import ceui.lisa.fragments.FragmentNiceFriend;
import ceui.lisa.fragments.FragmentNovelHolder;
Expand All @@ -42,7 +43,6 @@
import ceui.lisa.fragments.FragmentSearch;
import ceui.lisa.fragments.FragmentSearchResult;
import ceui.lisa.fragments.FragmentSearchUser;
import ceui.lisa.fragments.FragmentSelectBookTag;
import ceui.lisa.fragments.FragmentSettings;
import ceui.lisa.fragments.FragmentUserIllust;
import ceui.lisa.fragments.FragmentUserManga;
Expand Down Expand Up @@ -114,12 +114,12 @@ protected Fragment createNewFragment() {
}
case "按标签收藏": {
int id = intent.getIntExtra(Params.ILLUST_ID, 0);
return FragmentSelectBookTag.newInstance(id);
return FragmentSB.newInstance(id);
}
case "关于软件":
return new FragmentAboutApp();
case "批量下载":
return new FragmentMultiDownload();
return new FragmentMultiDownld();
case "画廊":
return new FragmentWalkThrough();
case "License":
Expand Down
7 changes: 1 addition & 6 deletions app/src/main/java/ceui/lisa/activities/ViewPagerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ViewPagerActivity : BaseActivity<ActivityViewPagerBinding>() {
holder = ViewModelProvider(this).get(Dust::class.java)

holder.dust.observe(this, Observer<List<IllustsBean>> { dust: List<IllustsBean> ->
baseBind.viewPager.adapter = object : FragmentPagerAdapter(supportFragmentManager) {
baseBind.viewPager.adapter = object : FragmentPagerAdapter(supportFragmentManager, 0) {
override fun getItem(i: Int): Fragment {
Common.showLog(className + "setPageTransformer " + i)
return FragmentSingleIllust.newInstance(i)
Expand Down Expand Up @@ -78,9 +78,4 @@ class ViewPagerActivity : BaseActivity<ActivityViewPagerBinding>() {

override fun initData() {
}

fun rise() {
baseBind.viewPager.setPageTransformer(true, GalleryTransformer())
baseBind.viewPager.offscreenPageLimit = 3
}
}
10 changes: 4 additions & 6 deletions app/src/main/java/ceui/lisa/adapters/BaseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
Expand All @@ -16,16 +15,15 @@
import ceui.lisa.utils.Common;

public abstract class BaseAdapter<Item, BindView extends ViewDataBinding> extends
RecyclerView.Adapter<RecyclerView.ViewHolder>{
RecyclerView.Adapter<RecyclerView.ViewHolder> {

public static final int ITEM_HEAD = 1023;
public static final int ITEM_NORMAL = 1024;
protected List<Item> allIllust;
protected Context mContext;
protected int mLayoutID = -1;
protected OnItemClickListener mOnItemClickListener;

public static final int ITEM_HEAD = 1023;
public static final int ITEM_NORMAL = 1024;

public BaseAdapter(List<Item> targetList, Context context) {
Common.showLog(getClass().getSimpleName() + " newInstance");
this.allIllust = targetList;
Expand All @@ -39,7 +37,7 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
if (viewType == ITEM_NORMAL) {
int index = position - headerSize();
bindData(allIllust.get(index), (ViewHolder<BindView>) holder, index);
} else if(viewType == ITEM_HEAD){
} else if (viewType == ITEM_HEAD) {

}
}
Expand Down
129 changes: 0 additions & 129 deletions app/src/main/java/ceui/lisa/adapters/DownlistAdapter.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import ceui.lisa.database.DownloadEntity;
import ceui.lisa.databinding.RecyViewHistoryBinding;
import ceui.lisa.models.IllustsBean;
import ceui.lisa.utils.GlideUtil;

//已下载
public class DownloadedAdapter extends BaseAdapter<DownloadEntity, RecyViewHistoryBinding> {

private int imageSize = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.content.Context;

import com.liulishuo.okdownload.DownloadTask;
import com.liulishuo.okdownload.StatusUtil;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
import ceui.lisa.models.IllustsBean;
import ceui.lisa.utils.GlideUtil;

public class EAdapter extends BaseAdapter<IllustsBean, RecyUserEventBinding> {
//你所关注用户的动态
public class EventAdapter extends BaseAdapter<IllustsBean, RecyUserEventBinding> {

private int imageSize;

public EAdapter(List<IllustsBean> targetList, Context context) {
public EventAdapter(List<IllustsBean> targetList, Context context) {
super(targetList, context);
imageSize = mContext.getResources().getDisplayMetrics().widthPixels;
}
Expand Down
22 changes: 2 additions & 20 deletions app/src/main/java/ceui/lisa/adapters/HistoryAdapter.java
Original file line number Diff line number Diff line change
@@ -1,43 +1,25 @@
package ceui.lisa.adapters;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.facebook.rebound.SimpleSpringListener;
import com.facebook.rebound.Spring;
import com.facebook.rebound.SpringConfig;
import com.facebook.rebound.SpringSystem;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import ceui.lisa.R;
import ceui.lisa.activities.Shaft;
import ceui.lisa.activities.TemplateActivity;
import ceui.lisa.activities.UActivity;
import ceui.lisa.activities.ViewPagerActivity;
import ceui.lisa.database.IllustHistoryEntity;
import ceui.lisa.databinding.RecyViewHistoryBinding;
import ceui.lisa.fragments.FragmentLikeIllust;
import ceui.lisa.interfaces.OnItemClickListener;
import ceui.lisa.models.IllustsBean;
import ceui.lisa.utils.Common;
import ceui.lisa.utils.DataChannel;
import ceui.lisa.utils.GlideUtil;
import ceui.lisa.utils.Params;
import ceui.lisa.utils.PixivOperate;

//浏览历史
public class HistoryAdapter extends BaseAdapter<IllustHistoryEntity, RecyViewHistoryBinding> {

private int imageSize = 0;
Expand Down Expand Up @@ -70,7 +52,7 @@ public void bindData(IllustHistoryEntity target, ViewHolder<RecyViewHistoryBindi
bindView.baseBind.author.setText("by: " + currentIllust.getUser().getName());
bindView.baseBind.time.setText(mTime.format(allIllust.get(position).getTime()));

if(currentIllust.isGif()){
if (currentIllust.isGif()) {
bindView.baseBind.pSize.setText("GIF");
} else {
if (currentIllust.getPage_count() == 1) {
Expand Down
Loading

0 comments on commit 8c581fc

Please sign in to comment.