parent
1848beef19
commit
8b30c0a72b
@ -0,0 +1,18 @@ |
|||||||
|
package xyz.fycz.myreader.ui.adapter.helper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author fengyue |
||||||
|
* @date 2021/6/3 17:47 |
||||||
|
*/ |
||||||
|
public interface IItemTouchHelperViewHolder { |
||||||
|
|
||||||
|
/** |
||||||
|
* item被选中,在侧滑或拖拽过程中更新状态 |
||||||
|
*/ |
||||||
|
void onItemSelected(); |
||||||
|
|
||||||
|
/** |
||||||
|
* item的拖拽或侧滑结束,恢复默认的状态 |
||||||
|
*/ |
||||||
|
void onItemClear(); |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package xyz.fycz.myreader.ui.adapter.helper; |
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author fengyue |
||||||
|
* @date 2021/6/3 18:39 |
||||||
|
*/ |
||||||
|
public interface OnStartDragListener { |
||||||
|
/** |
||||||
|
* 当View需要拖拽时回调 |
||||||
|
* |
||||||
|
* @param viewHolder The holder of view to drag |
||||||
|
*/ |
||||||
|
void onStartDrag(RecyclerView.ViewHolder viewHolder); |
||||||
|
} |
@ -0,0 +1,225 @@ |
|||||||
|
package xyz.fycz.myreader.util.utils; |
||||||
|
|
||||||
|
import android.content.Context; |
||||||
|
import android.graphics.Bitmap; |
||||||
|
import android.graphics.BitmapFactory; |
||||||
|
import android.graphics.Canvas; |
||||||
|
import android.graphics.Color; |
||||||
|
import android.text.TextPaint; |
||||||
|
import android.text.TextUtils; |
||||||
|
import android.util.Log; |
||||||
|
import android.widget.ImageView; |
||||||
|
|
||||||
|
import com.google.zxing.EncodeHintType; |
||||||
|
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
import java.io.FileOutputStream; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import cn.bingoogolapple.qrcode.zxing.QRCodeEncoder; |
||||||
|
import io.reactivex.Single; |
||||||
|
import io.reactivex.SingleOnSubscribe; |
||||||
|
import io.reactivex.annotations.NonNull; |
||||||
|
import xyz.fycz.myreader.R; |
||||||
|
import xyz.fycz.myreader.base.observer.MySingleObserver; |
||||||
|
import xyz.fycz.myreader.common.APPCONST; |
||||||
|
import xyz.fycz.myreader.common.URLCONST; |
||||||
|
import xyz.fycz.myreader.entity.SharedBook; |
||||||
|
import xyz.fycz.myreader.greendao.entity.Book; |
||||||
|
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager; |
||||||
|
import xyz.fycz.myreader.util.IOUtils; |
||||||
|
import xyz.fycz.myreader.util.ShareUtils; |
||||||
|
import xyz.fycz.myreader.util.SharedPreUtils; |
||||||
|
import xyz.fycz.myreader.util.ToastUtils; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author fengyue |
||||||
|
* @date 2021/6/3 21:46 |
||||||
|
*/ |
||||||
|
public class ShareBookUtil { |
||||||
|
/** |
||||||
|
* 分享书籍 |
||||||
|
*/ |
||||||
|
public static void shareBook(Context context, Book mBook, ImageView cover) { |
||||||
|
if ("本地书籍".equals(mBook.getType())) { |
||||||
|
File file = new File(mBook.getChapterUrl()); |
||||||
|
if (!file.exists()) { |
||||||
|
ToastUtils.showWarring("书籍源文件不存在,无法分享!"); |
||||||
|
return; |
||||||
|
} |
||||||
|
try { |
||||||
|
ShareUtils.share(context, file, mBook.getName() + ".txt", "text/plain"); |
||||||
|
} catch (Exception e) { |
||||||
|
String dest = APPCONST.SHARE_FILE_DIR + File.separator + mBook.getName() + ".txt"; |
||||||
|
FileUtils.copy(mBook.getChapterUrl(), dest); |
||||||
|
ShareUtils.share(context, new File(dest), mBook.getName() + ".txt", "text/plain"); |
||||||
|
} |
||||||
|
return; |
||||||
|
} |
||||||
|
ToastUtils.showInfo("正在生成分享图片"); |
||||||
|
Single.create((SingleOnSubscribe<File>) emitter -> { |
||||||
|
// 使用url
|
||||||
|
String url = SharedPreUtils.getInstance().getString(context.getString(R.string.downloadLink), URLCONST.LAN_ZOUS_URL); |
||||||
|
if (url == null) |
||||||
|
url = ""; |
||||||
|
|
||||||
|
int maxLength = 1273 - 1 - url.length(); |
||||||
|
|
||||||
|
SharedBook sharedBook = SharedBook.bookToSharedBook(mBook); |
||||||
|
|
||||||
|
url = url + "#" + GsonExtensionsKt.getGSON().toJson(sharedBook); |
||||||
|
|
||||||
|
Log.d("QRcode", "Length=" + url.length() + "\n" + url); |
||||||
|
|
||||||
|
Bitmap bitmap; |
||||||
|
QRCodeEncoder.HINTS.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L); |
||||||
|
bitmap = QRCodeEncoder.syncEncodeQRCode(url, 360); |
||||||
|
QRCodeEncoder.HINTS.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); |
||||||
|
|
||||||
|
File share = makeShareFile(context, mBook, cover, bitmap); |
||||||
|
if (share == null) { |
||||||
|
ToastUtils.showError("分享图片生成失败"); |
||||||
|
return; |
||||||
|
} |
||||||
|
emitter.onSuccess(share); |
||||||
|
}).compose(RxUtils::toSimpleSingle) |
||||||
|
.subscribe(new MySingleObserver<File>() { |
||||||
|
@Override |
||||||
|
public void onSuccess(@NonNull File File) { |
||||||
|
share(context, File); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 生成分享图片 |
||||||
|
* |
||||||
|
* @param QRCode |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
|
||||||
|
private static File makeShareFile(Context context, Book mBook, ImageView cover, Bitmap QRCode) { |
||||||
|
FileOutputStream fos = null; |
||||||
|
try { |
||||||
|
Bitmap back = BitmapFactory.decodeStream(context.getResources().getAssets().open("share.png")).copy(Bitmap.Config.ARGB_8888, true); |
||||||
|
int backWidth = back.getWidth(); |
||||||
|
int backHeight = back.getHeight(); |
||||||
|
|
||||||
|
int margin = 60; |
||||||
|
|
||||||
|
int marginTop = 24; |
||||||
|
|
||||||
|
cover.setDrawingCacheEnabled(true); |
||||||
|
Bitmap img = Bitmap.createBitmap(cover.getDrawingCache()).copy(Bitmap.Config.ARGB_8888, true); |
||||||
|
cover.setDrawingCacheEnabled(false); |
||||||
|
img = BitmapUtil.getBitmap(img, 152, 209); |
||||||
|
|
||||||
|
Canvas cv = new Canvas(back); |
||||||
|
cv.drawBitmap(img, margin, margin + marginTop * 2, null); |
||||||
|
|
||||||
|
TextPaint textPaint = new TextPaint(); |
||||||
|
textPaint.setAntiAlias(true); |
||||||
|
textPaint.setFilterBitmap(true); |
||||||
|
textPaint.setColor(Color.BLACK); |
||||||
|
textPaint.setTextSize(40); |
||||||
|
|
||||||
|
String name = TextUtils.ellipsize(mBook.getName(), textPaint, backWidth - margin + marginTop * 3 - img.getWidth(), TextUtils.TruncateAt.END).toString(); |
||||||
|
cv.drawText(name, margin + marginTop + img.getWidth(), margin + marginTop * 4, textPaint); |
||||||
|
|
||||||
|
|
||||||
|
textPaint.setColor(context.getResources().getColor(R.color.origin)); |
||||||
|
textPaint.setTextSize(32); |
||||||
|
cv.drawText(mBook.getAuthor(), margin + marginTop + img.getWidth(), margin + marginTop * 6, textPaint); |
||||||
|
|
||||||
|
textPaint.setColor(Color.BLACK); |
||||||
|
cv.drawText(mBook.getType() == null ? "" : mBook.getType(), margin + marginTop + img.getWidth(), margin + marginTop * 8, textPaint); |
||||||
|
cv.drawText("书源:" + BookSourceManager.getSourceNameByStr(mBook.getSource()), margin + marginTop + img.getWidth(), margin + marginTop * 10, textPaint); |
||||||
|
|
||||||
|
int textSize = 35; |
||||||
|
int textInterval = textSize / 2; |
||||||
|
textPaint.setTextSize(textSize); |
||||||
|
|
||||||
|
drawDesc(getDescLines(mBook, backWidth - margin * 2, textPaint), textPaint, cv, margin + marginTop * 4 + img.getHeight(), margin, textInterval); |
||||||
|
|
||||||
|
cv.drawBitmap(QRCode, backWidth - QRCode.getWidth(), backHeight - QRCode.getHeight(), null); |
||||||
|
|
||||||
|
cv.save();// 保存
|
||||||
|
cv.restore();// 存储
|
||||||
|
|
||||||
|
File share = FileUtils.getFile(APPCONST.SHARE_FILE_DIR + mBook.getName() + "_share.png"); |
||||||
|
fos = new FileOutputStream(share); |
||||||
|
back.compress(Bitmap.CompressFormat.PNG, 100, fos); |
||||||
|
fos.flush(); |
||||||
|
Log.i("tag", "saveBitmap success: " + share.getAbsolutePath()); |
||||||
|
|
||||||
|
back.recycle(); |
||||||
|
img.recycle(); |
||||||
|
QRCode.recycle(); |
||||||
|
|
||||||
|
return share; |
||||||
|
} catch (Exception e) { |
||||||
|
e.printStackTrace(); |
||||||
|
ToastUtils.showError(e.getLocalizedMessage() + ""); |
||||||
|
return null; |
||||||
|
} finally { |
||||||
|
IOUtils.close(fos); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 分享生成的图片 |
||||||
|
* |
||||||
|
* @param share |
||||||
|
*/ |
||||||
|
private static void share(Context context, File share) { |
||||||
|
ShareUtils.share(context, share, "分享书籍", "image/png"); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 绘制简介 |
||||||
|
* |
||||||
|
* @param lines |
||||||
|
* @param textPaint |
||||||
|
* @param canvas |
||||||
|
* @param top |
||||||
|
* @param left |
||||||
|
* @param textInterval |
||||||
|
*/ |
||||||
|
private static void drawDesc(List<String> lines, TextPaint textPaint, Canvas canvas, int top, int left, int textInterval) { |
||||||
|
float interval = textInterval + textPaint.getTextSize(); |
||||||
|
for (String line : lines) { |
||||||
|
canvas.drawText(line, left, top, textPaint); |
||||||
|
top += interval; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 生成简介lines |
||||||
|
* |
||||||
|
* @param width |
||||||
|
* @param textPaint |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
|
||||||
|
private static List<String> getDescLines(Book mBook, int width, TextPaint textPaint) { |
||||||
|
List<String> lines = new ArrayList<>(); |
||||||
|
String desc = StringUtils.halfToFull(" ") + mBook.getDesc(); |
||||||
|
int i = 0; |
||||||
|
int wordCount = 0; |
||||||
|
String subStr = null; |
||||||
|
while (desc.length() > 0) { |
||||||
|
if (i == 9) { |
||||||
|
lines.add(TextUtils.ellipsize(desc, textPaint, width / 1.8f, TextUtils.TruncateAt.END).toString()); |
||||||
|
break; |
||||||
|
} |
||||||
|
wordCount = textPaint.breakText(desc, true, width, null); |
||||||
|
subStr = desc.substring(0, wordCount); |
||||||
|
lines.add(subStr); |
||||||
|
desc = desc.substring(wordCount); |
||||||
|
i++; |
||||||
|
} |
||||||
|
return lines; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,18 @@ |
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
android:width="24dp" |
||||||
|
android:height="24dp" |
||||||
|
android:viewportWidth="1024" |
||||||
|
android:viewportHeight="1024"> |
||||||
|
<path |
||||||
|
android:pathData="M348.16,153.6m40.96,0l245.76,0q40.96,0 40.96,40.96l0,286.72q0,40.96 -40.96,40.96l-245.76,0q-40.96,0 -40.96,-40.96l0,-286.72q0,-40.96 40.96,-40.96Z" |
||||||
|
android:fillColor="#689CD5"/> |
||||||
|
<path |
||||||
|
android:pathData="M174.08,409.6m40.96,0l593.92,0q40.96,0 40.96,40.96l0,378.88q0,40.96 -40.96,40.96l-593.92,0q-40.96,0 -40.96,-40.96l0,-378.88q0,-40.96 40.96,-40.96Z" |
||||||
|
android:fillColor="#81B7EF"/> |
||||||
|
<path |
||||||
|
android:pathData="M122.88,588.8m40.96,0l696.32,0q40.96,0 40.96,40.96l0,199.68q0,40.96 -40.96,40.96l-696.32,0q-40.96,0 -40.96,-40.96l0,-199.68q0,-40.96 40.96,-40.96Z" |
||||||
|
android:fillColor="#689CD5"/> |
||||||
|
<path |
||||||
|
android:pathData="M511.99,481.51C479.65,507.55 458.66,516.92 449.02,509.59c-9.64,-7.31 -7.6,-31.05 6.12,-71.22 -33.6,-24.41 -48.61,-42.36 -45.03,-53.86 3.58,-11.51 25.83,-16.82 66.74,-15.93C488.57,327.66 500.28,307.2 511.99,307.2s23.42,20.46 35.13,61.38c40.83,-1.17 63.08,4.15 66.74,15.93 3.67,11.79 -11.35,29.74 -45.03,53.86 13.34,40.45 15.38,64.19 6.12,71.22 -9.27,7.03 -30.25,-2.33 -62.96,-28.09z" |
||||||
|
android:fillColor="#E2EEFD"/> |
||||||
|
</vector> |
@ -0,0 +1,14 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||||
|
<solid android:color="@color/nothing" /> |
||||||
|
<stroke |
||||||
|
android:width="1dp" |
||||||
|
android:color="@color/textAssist" /> |
||||||
|
<corners |
||||||
|
android:topLeftRadius="20dp" |
||||||
|
android:topRightRadius="20dp" |
||||||
|
android:bottomRightRadius="20dp" |
||||||
|
android:bottomLeftRadius="20dp"/> |
||||||
|
|
||||||
|
</shape> |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
||||||
|
<item android:state_enabled="true" android:color="@color/md_blue_400"/> |
||||||
|
<item android:state_enabled="false" android:color="@color/textSecondary"/> |
||||||
|
</selector> |
@ -0,0 +1,45 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="600dp" |
||||||
|
android:orientation="vertical"> |
||||||
|
<LinearLayout |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="50dp" |
||||||
|
android:orientation="horizontal"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/btn_cancel" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="match_parent" |
||||||
|
android:gravity="center" |
||||||
|
android:paddingLeft="15dp" |
||||||
|
android:paddingRight="15dp" |
||||||
|
android:text="@string/cancel" |
||||||
|
android:textColor="@color/textPrimary" |
||||||
|
android:textSize="@dimen/text_normal_size" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_title" |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="match_parent" |
||||||
|
android:gravity="center" |
||||||
|
android:text="@string/app_name" |
||||||
|
android:textColor="@color/textPrimary" |
||||||
|
android:textSize="@dimen/text_medium_size" |
||||||
|
android:layout_weight="1" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/btn_finish" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="match_parent" |
||||||
|
android:gravity="center" |
||||||
|
android:paddingLeft="15dp" |
||||||
|
android:paddingRight="15dp" |
||||||
|
android:text="@string/finish" |
||||||
|
android:textColor="@drawable/selector_btn_input_finish" |
||||||
|
android:textSize="@dimen/text_normal_size" /> |
||||||
|
</LinearLayout> |
||||||
|
|
||||||
|
<include layout="@layout/edit_text"/> |
||||||
|
</LinearLayout> |
@ -1,16 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<com.google.android.material.textfield.TextInputLayout |
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android" |
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|
||||||
android:id="@+id/text_input_lay" |
|
||||||
android:layout_width="match_parent" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
android:padding="5dp" |
|
||||||
app:counterEnabled="true"> |
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText |
|
||||||
android:layout_width="match_parent" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
android:inputType="text"/> |
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout> |
|
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<com.google.android.material.textfield.TextInputLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
|
android:id="@+id/text_input_lay" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:paddingHorizontal="10dp" |
||||||
|
android:paddingVertical="5dp" |
||||||
|
app:counterEnabled="true"> |
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:inputType="text" /> |
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout> |
@ -0,0 +1,233 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
android:layout_marginBottom="10dp" |
||||||
|
android:paddingHorizontal="10dp"> |
||||||
|
|
||||||
|
<RelativeLayout |
||||||
|
android:id="@+id/rl_book_detail" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
android:paddingVertical="5dp"> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:id="@+id/ll_book_item" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
android:padding="5dp"> |
||||||
|
|
||||||
|
<xyz.fycz.myreader.widget.CoverImageView |
||||||
|
android:id="@+id/iv_book_img" |
||||||
|
android:layout_width="40dp" |
||||||
|
android:layout_height="55dp" |
||||||
|
android:scaleType="fitXY" |
||||||
|
app:srcCompat="@mipmap/default_cover" /> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:id="@+id/ll_book_read" |
||||||
|
android:paddingHorizontal="5dp" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" |
||||||
|
android:orientation="vertical"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_book_name" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:maxLines="1" |
||||||
|
android:padding="4dp" |
||||||
|
android:text="@string/app_name" |
||||||
|
android:textColor="@color/textPrimary" |
||||||
|
android:textSize="@dimen/text_normal_size" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_book_author" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:maxLines="1" |
||||||
|
android:padding="4dp" |
||||||
|
android:text="@string/app_name" |
||||||
|
android:textColor="@color/textSecondary" |
||||||
|
android:textSize="@dimen/text_default_size" /> |
||||||
|
|
||||||
|
</LinearLayout> |
||||||
|
</LinearLayout> |
||||||
|
|
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_theme_mode_select" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_alignParentEnd="true" |
||||||
|
android:layout_centerVertical="true" |
||||||
|
android:layout_marginEnd="5dp" |
||||||
|
android:background="@drawable/menu_book_detail" |
||||||
|
android:paddingHorizontal="10dp" |
||||||
|
android:paddingVertical="5dp" |
||||||
|
android:text="详情" |
||||||
|
android:textColor="@color/textPrimary" |
||||||
|
android:textSize="@dimen/text_small_size" /> |
||||||
|
</RelativeLayout> |
||||||
|
|
||||||
|
<View |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="0.5dp" |
||||||
|
android:background="@color/sys_window_back" /> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="55dp" |
||||||
|
android:layout_marginVertical="5dp" |
||||||
|
android:paddingVertical="5dp"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_top" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_book_Top" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_top" /> |
||||||
|
<LinearLayout |
||||||
|
android:layout_width="0dp" |
||||||
|
android:layout_height="match_parent" |
||||||
|
android:layout_weight="1" |
||||||
|
android:orientation="vertical"> |
||||||
|
|
||||||
|
<androidx.appcompat.widget.SwitchCompat |
||||||
|
android:id="@+id/sc_is_update" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_gravity="center_horizontal" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:gravity="center_horizontal" |
||||||
|
android:textColor="@color/textPrimary" |
||||||
|
android:textSize="@dimen/text_small_size" |
||||||
|
android:text="@string/menu_is_update"/> |
||||||
|
</LinearLayout> |
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_download" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_book_download" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_download" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_export_cathe" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_book_cache" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_export" /> |
||||||
|
|
||||||
|
</LinearLayout> |
||||||
|
|
||||||
|
<View |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="0.5dp" |
||||||
|
android:background="@color/sys_window_back" /> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_marginVertical="5dp" |
||||||
|
|
||||||
|
android:layout_height="55dp" |
||||||
|
android:paddingVertical="5dp"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_change_source" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_change_source" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_change" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_set_group" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_group_setting" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_group" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_share" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_share" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_share" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_remove" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_book_delete" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_delete" /> |
||||||
|
</LinearLayout> |
||||||
|
|
||||||
|
<View |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="0.5dp" |
||||||
|
android:background="@color/sys_window_back" /> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="55dp" |
||||||
|
android:layout_marginVertical="5dp" |
||||||
|
|
||||||
|
android:paddingVertical="5dp"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_edit" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_edit" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_edit" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_refresh" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/refresh_books" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_refresh" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_link" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_open_link" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_link" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_edit_source" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/book_source" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_source" /> |
||||||
|
</LinearLayout> |
||||||
|
</LinearLayout> |
@ -0,0 +1,124 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
android:layout_marginBottom="10dp" |
||||||
|
android:paddingHorizontal="10dp"> |
||||||
|
|
||||||
|
<RelativeLayout |
||||||
|
android:id="@+id/rl_book_detail" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="vertical" |
||||||
|
android:paddingVertical="5dp"> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:id="@+id/ll_book_item" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
android:padding="5dp"> |
||||||
|
|
||||||
|
<xyz.fycz.myreader.widget.CoverImageView |
||||||
|
android:id="@+id/iv_book_img" |
||||||
|
android:layout_width="40dp" |
||||||
|
android:layout_height="55dp" |
||||||
|
android:scaleType="fitXY" |
||||||
|
app:srcCompat="@mipmap/default_cover" /> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:id="@+id/ll_book_read" |
||||||
|
android:paddingHorizontal="5dp" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" |
||||||
|
android:orientation="vertical"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_book_name" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:maxLines="1" |
||||||
|
android:padding="4dp" |
||||||
|
android:text="@string/app_name" |
||||||
|
android:textColor="@color/textPrimary" |
||||||
|
android:textSize="@dimen/text_normal_size" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_book_author" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:maxLines="1" |
||||||
|
android:padding="4dp" |
||||||
|
android:text="@string/app_name" |
||||||
|
android:textColor="@color/textSecondary" |
||||||
|
android:textSize="@dimen/text_default_size" /> |
||||||
|
|
||||||
|
</LinearLayout> |
||||||
|
</LinearLayout> |
||||||
|
|
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_theme_mode_select" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_alignParentEnd="true" |
||||||
|
android:layout_centerVertical="true" |
||||||
|
android:layout_marginEnd="5dp" |
||||||
|
android:background="@drawable/menu_book_detail" |
||||||
|
android:paddingHorizontal="10dp" |
||||||
|
android:paddingVertical="5dp" |
||||||
|
android:text="详情" |
||||||
|
android:textColor="@color/textPrimary" |
||||||
|
android:textSize="@dimen/text_small_size" /> |
||||||
|
</RelativeLayout> |
||||||
|
|
||||||
|
<View |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="0.5dp" |
||||||
|
android:background="@color/sys_window_back" /> |
||||||
|
|
||||||
|
<LinearLayout |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="55dp" |
||||||
|
android:layout_marginVertical="5dp" |
||||||
|
android:paddingVertical="5dp"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_edit" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_edit" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_edit" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_top" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_book_Top" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_top" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_set_group" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_group_setting" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_group" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/tv_remove" |
||||||
|
style="@style/MAppTheme.TextAppearance.BookMenu" |
||||||
|
android:clickable="true" |
||||||
|
android:focusable="true" |
||||||
|
android:text="@string/menu_book_delete" |
||||||
|
app:drawableTint="@color/textPrimary" |
||||||
|
app:drawableTopCompat="@drawable/ic_delete" /> |
||||||
|
</LinearLayout> |
||||||
|
</LinearLayout> |
@ -1,2 +1,2 @@ |
|||||||
#Wed Jun 02 20:55:52 CST 2021 |
#Thu Jun 03 14:18:11 CST 2021 |
||||||
VERSION_CODE=206 |
VERSION_CODE=207 |
||||||
|
Loading…
Reference in new issue