v2.2.0-debug

master
fengyuecanzhu 3 years ago
parent b9266a1b4a
commit 9b37066091
  1. 4
      .idea/assetWizardSettings.xml
  2. 1
      .idea/misc.xml
  3. 6
      app/release.md
  4. 6
      app/src/main/assets/updatelog.fy
  5. 12
      app/src/main/java/xyz/fycz/myreader/base/BaseActivity.java
  6. 1
      app/src/main/java/xyz/fycz/myreader/common/APPCONST.java
  7. 24
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java
  8. 12
      app/src/main/java/xyz/fycz/myreader/ui/activity/FindBookActivity.java
  9. 27
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  10. 9
      app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java
  11. 6
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/SourceExchangeHolder.java
  12. 11
      app/src/main/java/xyz/fycz/myreader/ui/dialog/SourceExchangeDialog.java
  13. 28
      app/src/main/java/xyz/fycz/myreader/ui/fragment/FindBook1Fragment.java
  14. 24
      app/src/main/java/xyz/fycz/myreader/ui/fragment/FindBook2Fragment.java
  15. 9
      app/src/main/res/drawable/ic_right_arrow_small.xml
  16. 42
      app/src/main/res/layout/layout_book_detail_header.xml
  17. 4
      app/version_code.properties

@ -14,8 +14,8 @@
<option name="values">
<map>
<entry key="assetSourceType" value="FILE" />
<entry key="outputName" value="ic_plus" />
<entry key="sourceFile" value="F:\SVG图标\.svg" />
<entry key="outputName" value="ic_right_arrow_small" />
<entry key="sourceFile" value="F:\SVG图标\向右.svg" />
</map>
</option>
</PersistentState>

@ -17,6 +17,7 @@
<entry key="..\:/android/FYReader/app/src/main/res/layout/item_group.xml" value="0.4" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/item_local_source.xml" value="0.21195652173913043" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/layout_about_content.xml" value="0.12132725430597771" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/layout_book_detail_header.xml" value="0.536" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/listview_search_book_item.xml" value="0.22010869565217392" />
<entry key="..\:/android/FYReader/app/src/main/res/layout/view_file_picker.xml" value="0.12132725430597771" />
<entry key="..\:/android/FYReader/app/src/main/res/menu/menu_book.xml" value="0.13703703703703704" />

@ -1,3 +1,3 @@
* 1、新增分组管理界面(支持添加、重命名、删除、排序分组)
* 2、发现界面书籍添加动画效果
* 3、修复v2.1.7版本更新中推送debug版本的问题
* 1、修复从书籍详情页进入阅读后切换日夜模式闪退的bug
* 2、修复从发现页进入阅读后切换日夜模式闪退的bug
* 3、详情页作者支持点击搜索

@ -1,3 +1,9 @@
风月读书v2.2.0
更新内容:
1、修复从书籍详情页进入阅读后切换日夜模式闪退的bug
2、修复从发现页进入阅读后切换日夜模式闪退的bug
3、详情页作者支持点击搜索
2021.08.31
风月读书v2.1.9
更新内容:

@ -35,6 +35,8 @@ import xyz.fycz.myreader.util.StatusBarUtil;
public abstract class BaseActivity extends SwipeBackActivity {
private static final int INVALID_VAL = -1;
protected static final String INTENT = "intent";
protected CompositeDisposable mDisposable;
protected Toolbar mToolbar;
@ -119,6 +121,7 @@ public abstract class BaseActivity extends SwipeBackActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initIntent(savedInstanceState);
initTheme();
ActivityManage.addActivity(this);
bindView();
@ -130,6 +133,15 @@ public abstract class BaseActivity extends SwipeBackActivity {
processLogic();
}
private void initIntent(Bundle savedInstanceState) {
if (savedInstanceState != null) {
Intent intent = savedInstanceState.getParcelable(INTENT);
if (intent != null) {
setIntent(intent);
}
}
}
private void initToolbar() {
//更严谨是通过反射判断是否存在Toolbar
mToolbar = (Toolbar) findViewById(R.id.toolbar);

@ -64,6 +64,7 @@ public class APPCONST {
public static final String RESULT_LAST_READ_POSITION = "result_last_read_position";
public static final String RESULT_HISTORY_CHAPTER = "result_history_chapter";
public static final String RESULT_UP_MENU = "result_up_menu";
public static final String SEARCH_KEY = "searchKey";
public static final String[] READ_STYLE_NIGHT = {"#94928c", "#393431"};//黑夜

@ -12,6 +12,8 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
@ -117,6 +119,22 @@ public class BookDetailedActivity extends BaseActivity {
setContentView(binding.getRoot());
}
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
aBooks = mSourceDialog.getaBooks();
Intent intent = new Intent();
if (aBooks != null) {
aBooks.set(mSourceDialog.getSourceIndex(), mBook);
BitIntentDataManager.getInstance().putData(intent, aBooks);
intent.putExtra(APPCONST.SOURCE_INDEX, mSourceDialog.getSourceIndex());
} else {
BitIntentDataManager.getInstance().putData(intent, mBook);
}
intent.putExtra("isCollected", isCollected);
outState.putParcelable(INTENT, intent);
super.onSaveInstanceState(outState);
}
@Override
protected void onDestroy() {
if (chaptersDis != null) chaptersDis.dispose();
@ -226,12 +244,16 @@ public class BookDetailedActivity extends BaseActivity {
}
mSourceDialog.setABooks(aBooks);
mSourceDialog.setSourceIndex(sourceIndex);
}
@Override
protected void initClick() {
super.initClick();
binding.ih.bookDetailTvAuthor.setOnClickListener(v -> {
Intent intent = new Intent(BookDetailedActivity.this, SearchBookActivity.class);
intent.putExtra(APPCONST.SEARCH_KEY, binding.ih.bookDetailTvAuthor.getText());
startActivity(intent);
});
binding.ic.bookDetailTvDesc.setOnClickListener(v -> showMoreDesc());
binding.ic.bookDetailTvCatalogMore.setOnClickListener(v -> goToMoreChapter());
binding.ib.flAddBookcase.setOnClickListener(view -> {

@ -1,10 +1,13 @@
package xyz.fycz.myreader.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import org.jetbrains.annotations.NotNull;
@ -42,6 +45,15 @@ public class FindBookActivity extends BaseActivity {
setContentView(binding.getRoot());
}
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
Intent intent = new Intent();
BitIntentDataManager.getInstance().putData(intent, findCrawler);
outState.putParcelable(INTENT, intent);
super.onSaveInstanceState(outState);
}
@Override
protected void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);

@ -224,18 +224,6 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
/**************************override***********************************/
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
if (savedInstanceState != null) {
pagePos = savedInstanceState.getInt("pagePos");
chapterPos = savedInstanceState.getInt("chapterPos");
} else {
pagePos = -1;
chapterPos = -1;
}
super.onCreate(savedInstanceState);
}
@Override
protected void onStop() {
recordReadTime();
@ -256,11 +244,18 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
if (mBook != null) {
outState.putInt("pagePos", mBook.getLastReadPosition());
outState.putInt("chapterPos", mBook.getHisttoryChapterNum());
aBooks = mSourceDialog.getaBooks();
Intent intent = new Intent();
if (aBooks != null) {
aBooks.set(mSourceDialog.getSourceIndex(), mBook);
BitIntentDataManager.getInstance().putData(intent, aBooks);
intent.putExtra(APPCONST.SOURCE_INDEX, mSourceDialog.getSourceIndex());
} else {
BitIntentDataManager.getInstance().putData(intent, mBook);
}
intent.putExtra("isCollected", isCollected);
outState.putParcelable(INTENT, intent);
super.onSaveInstanceState(outState);
}
@Override

@ -271,6 +271,15 @@ public class SearchBookActivity extends BaseActivity {
});
}
@Override
protected void processLogic() {
String searchKey = getIntent().getStringExtra(APPCONST.SEARCH_KEY);
if (searchKey != null) {
binding.etSearchKey.setText(searchKey);
binding.etSearchKey.setSelection(searchKey.length());
search();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {

@ -42,9 +42,11 @@ public class SourceExchangeHolder extends ViewHolderImpl<Book> {
public void onBind(RecyclerView.ViewHolder holder, Book data, int pos) {
sourceTvTitle.setText(BookSourceManager.getSourceNameByStr(data.getSource()));
sourceTvChapter.setText(data.getNewestChapterTitle());
if (data.getSource() != null && data.getSource().equals(dialog.getmShelfBook().getSource()))
if (data.getSource() != null && data.getSource().equals(dialog.getmShelfBook().getSource())) {
sourceIv.setVisibility(View.VISIBLE);
else
dialog.setSourceIndex(pos);
} else {
sourceIv.setVisibility(View.GONE);
}
}
}

@ -71,7 +71,16 @@ public class SourceExchangeDialog extends Dialog {
this.sourceIndex = sourceIndex;
}
public int getSourceIndex() {
return sourceIndex;
if (sourceIndex == -1){
for (int i = 0; i < aBooks.size(); i++) {
Book book = aBooks.get(i);
if (book.getSource().equals(mShelfBook.getSource())) {
sourceIndex = i;
break;
}
}
}
return sourceIndex == -1 ? 0 : sourceIndex;
}
public void setOnSourceChangeListener(OnSourceChangeListener listener) {
this.listener = listener;

@ -18,10 +18,13 @@ import java.util.ArrayList;
import java.util.List;
import xyz.fycz.myreader.base.BaseFragment;
import xyz.fycz.myreader.base.BitIntentDataManager;
import xyz.fycz.myreader.base.LazyFragment;
import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.FragmentFindBook1Binding;
import xyz.fycz.myreader.entity.FindKind;
import xyz.fycz.myreader.ui.adapter.TabFragmentPageAdapter;
import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
/**
@ -33,11 +36,36 @@ public class FindBook1Fragment extends LazyFragment {
private List<FindKind> kinds;
private FindCrawler findCrawler;
private PopupMenu kindMenu;
private static final String KINDS = "FindBook1FragmentKinds";
private static final String FIND_CRAWLER = "FindBook1FragmentFindCrawler";
public FindBook1Fragment() {
}
public FindBook1Fragment(List<FindKind> kinds, FindCrawler findCrawler) {
this.kinds = kinds;
this.findCrawler = findCrawler;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
String dataKey = savedInstanceState.getString(APPCONST.DATA_KEY);
kinds = (List<FindKind>) BitIntentDataManager.getInstance().getData(KINDS + dataKey);
findCrawler = (FindCrawler) BitIntentDataManager.getInstance().getData(FIND_CRAWLER + dataKey);
}
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
String dataKey = StringHelper.getStringRandom(25);
BitIntentDataManager.getInstance().putData(KINDS + dataKey, kinds);
BitIntentDataManager.getInstance().putData(FIND_CRAWLER + dataKey, findCrawler);
outState.putString(APPCONST.DATA_KEY, dataKey);
super.onSaveInstanceState(outState);
}
@Override
public void lazyInit() {
kindMenu = new PopupMenu(getContext(), binding.ivMenu, Gravity.END);

@ -31,6 +31,7 @@ import xyz.fycz.myreader.ui.activity.BookstoreActivity;
import xyz.fycz.myreader.ui.adapter.holder.FindBookHolder;
import xyz.fycz.myreader.ui.dialog.SourceExchangeDialog;
import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.RxUtils;
import xyz.fycz.myreader.webapi.BookApi;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
@ -48,12 +49,35 @@ public class FindBook2Fragment extends LazyFragment {
private BaseListAdapter<Book> findBookAdapter;
private SourceExchangeDialog mSourceDia;
private static final String KIND = "kind";
private static final String FIND_CRAWLER = "findCrawler";
public FindBook2Fragment() {
}
public FindBook2Fragment(FindKind kind, FindCrawler findCrawler) {
this.kind = kind;
this.findCrawler = findCrawler;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
String dataKey = savedInstanceState.getString(APPCONST.DATA_KEY);
kind = (FindKind) BitIntentDataManager.getInstance().getData(KIND + dataKey);
findCrawler = (FindCrawler) BitIntentDataManager.getInstance().getData(FIND_CRAWLER + dataKey);
}
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
String dataKey = StringHelper.getStringRandom(25);
BitIntentDataManager.getInstance().putData(KIND + dataKey, kind);
BitIntentDataManager.getInstance().putData(FIND_CRAWLER + dataKey, findCrawler);
outState.putString(APPCONST.DATA_KEY, dataKey);
super.onSaveInstanceState(outState);
}
@Override
public void lazyInit() {
initData();

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M382.53,702.93c-12.05,12.93 -11.33,33.18 1.6,45.23 12.29,11.45 31.34,11.45 43.63,0l213.33,-213.33c12.5,-12.49 12.51,-32.75 0.01,-45.25l-0.01,-0.01 -213.34,-213.35c-12.72,-12.27 -32.98,-11.91 -45.25,0.81 -11.97,12.41 -11.96,32.07 0.02,44.46l190.72,190.72 -190.71,190.72z"
android:fillColor="#ffffff"/>
</vector>

@ -21,37 +21,39 @@
<xyz.fycz.myreader.widget.CoverImageView
android:id="@+id/book_detail_iv_cover"
android:layout_width="82dp"
android:layout_height="110dp"
android:scaleType="centerCrop"
android:background="@color/colorPrimary"
app:srcCompat="@mipmap/default_cover" />
android:id="@+id/book_detail_iv_cover"
android:layout_width="82dp"
android:layout_height="110dp"
android:background="@color/colorPrimary"
android:scaleType="centerCrop"
app:srcCompat="@mipmap/default_cover" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/book_detail_tv_author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/cover"
android:layout_marginStart="14dp"
android:layout_marginTop="30dp"
android:layout_toEndOf="@+id/cover"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/origin"
tools:text=" 茶叶蛋" />
android:id="@+id/book_detail_tv_author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/cover"
android:layout_marginStart="14dp"
android:layout_marginTop="30dp"
android:layout_toEndOf="@+id/cover"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/origin"
app:drawableRightCompat="@drawable/ic_right_arrow_small"
app:drawableTint="@color/textAssistInverted"
tools:text=" 茶叶蛋" />
<com.zhy.view.flowlayout.TagFlowLayout
android:id="@+id/tfl_book_tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/book_detail_tv_author"
android:layout_alignStart="@id/book_detail_tv_author"
android:layout_marginTop="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:max_select="0"
app:tag_gravity="left" />

@ -1,3 +1,3 @@
#Fri Jun 18 21:45:31 CST 2021
VERSION_CODE=219
NEED_CREATE_RELEASE=true
VERSION_CODE=220
NEED_CREATE_RELEASE=false

Loading…
Cancel
Save