修复安卓5闪退bug

pull/5/head
fengyuecanzhu 4 years ago
parent d2b31afdf1
commit 4b2a357197
  1. 2
      app/src/main/assets/updatelog.fy
  2. 4
      app/src/main/java/xyz/fycz/myreader/ui/activity/AboutActivity.java
  3. 12
      app/src/main/java/xyz/fycz/myreader/ui/adapter/FontsAdapter.java
  4. 9
      app/src/main/res/layout/layout_about_content.xml
  5. 2
      app/version_code.properties

@ -1,5 +1,5 @@
2020.11.08 2020.11.08
风月读书v1.20.1110811 风月读书v1.20.1110816
1、修复安卓5闪退bug 1、修复安卓5闪退bug
2020.11.03 2020.11.03

@ -61,14 +61,14 @@ public class AboutActivity extends BaseActivity {
protected void initClick() { protected void initClick() {
super.initClick(); super.initClick();
ClipboardManager mClipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipboardManager mClipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
vmAuthor.setOnClickListener(v -> { /*vmAuthor.setOnClickListener(v -> {
//数据 //数据
ClipData mClipData = ClipData.newPlainText("Label", "fy@fycz.xyz"); ClipData mClipData = ClipData.newPlainText("Label", "fy@fycz.xyz");
//把数据设置到剪切板上 //把数据设置到剪切板上
assert mClipboardManager != null; assert mClipboardManager != null;
mClipboardManager.setPrimaryClip(mClipData); mClipboardManager.setPrimaryClip(mClipData);
ToastUtils.showSuccess("邮箱复制成功!"); ToastUtils.showSuccess("邮箱复制成功!");
}); });*/
vmShare.setOnClickListener(v -> ShareUtils.share(this, getString(R.string.share_text) + vmShare.setOnClickListener(v -> ShareUtils.share(this, getString(R.string.share_text) +
SharedPreUtils.getInstance().getString(getString(R.string.downloadLink, URLCONST.LAN_ZOUS_URL)))); SharedPreUtils.getInstance().getString(getString(R.string.downloadLink, URLCONST.LAN_ZOUS_URL))));
vmUpdate.setOnClickListener(v -> MyApplication.checkVersionByServer(this, true, null)); vmUpdate.setOnClickListener(v -> MyApplication.checkVersionByServer(this, true, null));

@ -117,16 +117,16 @@ public class FontsAdapter extends ArrayAdapter<Font> {
//viewHolder.tvExample.setTypeface(typeFace); //viewHolder.tvExample.setTypeface(typeFace);
// viewHolder.tvExample.setTypeface(mTypefaceMap.get(font)); // viewHolder.tvExample.setTypeface(mTypefaceMap.get(font));
viewHolder.tvFontName.setText(font.toString()); viewHolder.tvFontName.setText(font.toString());
viewHolder.tvFontName.setTextColor(mFontsActivity.getColor(R.color.textPrimary)); viewHolder.tvFontName.setTextColor(mFontsActivity.getResources().getColor(R.color.textPrimary));
File fontFile = new File(APPCONST.FONT_BOOK_DIR + font.fileName); File fontFile = new File(APPCONST.FONT_BOOK_DIR + font.fileName);
if (font == Font.本地字体) { if (font == Font.本地字体) {
if (setting.getFont() == Font.本地字体) { if (setting.getFont() == Font.本地字体) {
viewHolder.tvFontName.setText(setting.getLocalFontName()); viewHolder.tvFontName.setText(setting.getLocalFontName());
viewHolder.btnFontUse.setText(getContext().getString(R.string.font_change)); viewHolder.btnFontUse.setText(getContext().getString(R.string.font_change));
viewHolder.btnFontUse.setButtonColor(mFontsActivity.getColor(R.color.toast_blue)); viewHolder.btnFontUse.setButtonColor(mFontsActivity.getResources().getColor(R.color.toast_blue));
} else { } else {
viewHolder.btnFontUse.setText(getContext().getString(R.string.font_select)); viewHolder.btnFontUse.setText(getContext().getString(R.string.font_select));
viewHolder.btnFontUse.setButtonColor(mFontsActivity.getColor(R.color.sys_blue_littler)); viewHolder.btnFontUse.setButtonColor(mFontsActivity.getResources().getColor(R.color.sys_blue_littler));
} }
viewHolder.btnFontUse.setEnabled(true); viewHolder.btnFontUse.setEnabled(true);
viewHolder.btnFontUse.setOnClickListener(new View.OnClickListener() { viewHolder.btnFontUse.setOnClickListener(new View.OnClickListener() {
@ -175,7 +175,7 @@ public class FontsAdapter extends ArrayAdapter<Font> {
if (font != Font.默认字体 && !fontFile.exists()) { if (font != Font.默认字体 && !fontFile.exists()) {
viewHolder.btnFontUse.setEnabled(true); viewHolder.btnFontUse.setEnabled(true);
viewHolder.btnFontUse.setButtonColor(mFontsActivity.getColor(R.color.sys_blue_littler)); viewHolder.btnFontUse.setButtonColor(mFontsActivity.getResources().getColor(R.color.sys_blue_littler));
viewHolder.btnFontUse.setText(getContext().getString(R.string.font_download)); viewHolder.btnFontUse.setText(getContext().getString(R.string.font_download));
viewHolder.btnFontUse.setOnClickListener(v -> { viewHolder.btnFontUse.setOnClickListener(v -> {
viewHolder.btnFontUse.setEnabled(false); viewHolder.btnFontUse.setEnabled(false);
@ -184,11 +184,11 @@ public class FontsAdapter extends ArrayAdapter<Font> {
} else if (setting.getFont() == font) { } else if (setting.getFont() == font) {
viewHolder.btnFontUse.setText(getContext().getString(R.string.font_using)); viewHolder.btnFontUse.setText(getContext().getString(R.string.font_using));
viewHolder.btnFontUse.setEnabled(false); viewHolder.btnFontUse.setEnabled(false);
viewHolder.btnFontUse.setButtonColor(mFontsActivity.getColor(R.color.sys_word_very_little)); viewHolder.btnFontUse.setButtonColor(mFontsActivity.getResources().getColor(R.color.sys_word_very_little));
} else { } else {
viewHolder.btnFontUse.setText(getContext().getString(R.string.font_use)); viewHolder.btnFontUse.setText(getContext().getString(R.string.font_use));
viewHolder.btnFontUse.setEnabled(true); viewHolder.btnFontUse.setEnabled(true);
viewHolder.btnFontUse.setButtonColor(mFontsActivity.getColor(R.color.toast_blue)); viewHolder.btnFontUse.setButtonColor(mFontsActivity.getResources().getColor(R.color.toast_blue));
viewHolder.btnFontUse.setOnClickListener(v -> { viewHolder.btnFontUse.setOnClickListener(v -> {
setting.setFont(font); setting.setFont(font);
SysManager.saveSetting(setting); SysManager.saveSetting(setting);

@ -78,6 +78,7 @@
android:src="@mipmap/ic_avatar_fycz"/> android:src="@mipmap/ic_avatar_fycz"/>
<TextView <TextView
android:layout_marginTop="12dp"
android:id="@+id/fycz" android:id="@+id/fycz"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -87,14 +88,6 @@
android:textColor="@color/textSecondary" android:textColor="@color/textSecondary"
tools:ignore="HardcodedText"/> tools:ignore="HardcodedText"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/fycz"
android:layout_toEndOf="@id/ig_avatar_fycz"
android:text="@string/email"
android:textColor="@color/textSecondary"/>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

@ -1,2 +1,2 @@
#Sun Nov 08 11:10:57 CST 2020 #Sun Nov 08 18:03:05 CST 2020
VERSION_CODE=154 VERSION_CODE=154

Loading…
Cancel
Save