新增自定义发现

master
fengyuecanzhu 3 years ago
parent 054b8cb325
commit 463487f161
  1. 157
      app/src/main/java/xyz/fycz/myreader/entity/sourceedit/EditEntityUtil.kt
  2. 6
      app/src/main/java/xyz/fycz/myreader/ui/activity/FindBookActivity.java
  3. 4
      app/src/main/java/xyz/fycz/myreader/ui/activity/MainActivity.java
  4. 10
      app/src/main/java/xyz/fycz/myreader/ui/activity/SourceEditActivity.java
  5. 1
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/FindSourceHolder.java
  6. 73
      app/src/main/java/xyz/fycz/myreader/ui/fragment/FindFragment.java
  7. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/QiDianFindCrawler.java
  8. 11
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/QianDianNSFindCrawler.java
  9. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/find/ThirdFindCrawler.java
  10. 4
      app/src/main/res/layout/activity_source_edit.xml
  11. 91
      app/src/main/res/layout/fragment_find.xml
  12. 17
      app/src/main/res/layout/item_find_source.xml
  13. 2
      app/src/main/res/layout/item_read_record.xml
  14. 92
      app/src/main/res/menu/menu_book.xml

@ -3,6 +3,7 @@ package xyz.fycz.myreader.entity.sourceedit
import xyz.fycz.myreader.R
import xyz.fycz.myreader.greendao.entity.rule.*
import java.util.*
import kotlin.collections.ArrayList
/**
* @author fengyue
@ -15,8 +16,22 @@ object EditEntityUtil {
add(EditEntity("sourceUrl", source?.sourceUrl, R.string.source_url, "不能为空且唯一"))
add(EditEntity("sourceName", source?.sourceName, R.string.source_name, "不能为空"))
add(EditEntity("sourceGroup", source?.sourceGroup, R.string.source_group, "不同分组以;/,隔开"))
add(EditEntity("sourceCharset", source?.sourceCharset, R.string.source_charset, "默认UTF-8"))
add(EditEntity("sourceHeaders", source?.sourceHeaders, R.string.source_headers, "json格式"))
add(
EditEntity(
"sourceCharset",
source?.sourceCharset,
R.string.source_charset,
"默认UTF-8"
)
)
add(
EditEntity(
"sourceHeaders",
source?.sourceHeaders,
R.string.source_headers,
"json格式"
)
)
add(EditEntity("loginUrl", source?.loginUrl, R.string.login_url, ""))
add(EditEntity("sourceComment", source?.sourceComment, R.string.comment, "这是您留给使用者的说明"))
}
@ -26,12 +41,20 @@ object EditEntityUtil {
fun getSearchEntities(searchRule: SearchRule? = SearchRule()): List<EditEntity> {
val searchEntities: ArrayList<EditEntity> = ArrayList()
searchEntities.apply {
add(EditEntity("searchUrl", searchRule?.searchUrl, R.string.r_search_url,
"搜索关键词以{key}进行占位;post请求以“,”分隔url,“,”前是搜索地址,“,”后是请求体"))
add(
EditEntity(
"searchUrl", searchRule?.searchUrl, R.string.r_search_url,
"搜索关键词以{key}进行占位;post请求以“,”分隔url,“,”前是搜索地址,“,”后是请求体"
)
)
add(EditEntity("charset", searchRule?.charset, R.string.r_search_charset, "默认使用书源字符编码"))
add(EditEntity("list", searchRule?.list, R.string.r_book_list,
add(
EditEntity(
"list", searchRule?.list, R.string.r_book_list,
"对于Matcher解析器:此处填写书籍列表所在区间,仅支持普通函数;" +
"\n对于Xpath/JsonPath解析器:此处填写书籍列表规则,仅支持列表函数"))
"\n对于Xpath/JsonPath解析器:此处填写书籍列表规则,仅支持列表函数"
)
)
add(EditEntity("name", searchRule?.name, R.string.r_book_name))
add(EditEntity("author", searchRule?.author, R.string.r_author))
add(EditEntity("type", searchRule?.type, R.string.rule_book_type))
@ -43,12 +66,44 @@ object EditEntityUtil {
add(EditEntity("imgUrl", searchRule?.imgUrl, R.string.rule_img_url))
add(EditEntity("tocUrl", searchRule?.tocUrl, R.string.rule_toc_url))
add(EditEntity("infoUrl", searchRule?.infoUrl, R.string.r_info_url, "为空时使用目录URL"))
add(EditEntity("relatedWithInfo", searchRule?.isRelatedWithInfo?.toString(), R.string.r_search_related_with_info,
"搜索时是否关联书籍详情页,填true/t表示关联,false/f表示不关联,测试时不生效"))
add(
EditEntity(
"relatedWithInfo",
searchRule?.isRelatedWithInfo?.toString(),
R.string.r_search_related_with_info,
"搜索时是否关联书籍详情页,填true/t表示关联,false/f表示不关联,测试时不生效"
)
)
}
return searchEntities
}
fun getFindEntities(findRule: FindRule? = FindRule()): List<EditEntity> {
val findEntities: ArrayList<EditEntity> = ArrayList()
findEntities.apply {
add(EditEntity("url", findRule?.url, R.string.r_find_url))
add(
EditEntity(
"bookList", findRule?.bookList, R.string.r_book_list,
"对于Matcher解析器:此处填写书籍列表所在区间,仅支持普通函数;" +
"\n对于Xpath/JsonPath解析器:此处填写书籍列表规则,仅支持列表函数"
)
)
add(EditEntity("name", findRule?.name, R.string.r_book_name))
add(EditEntity("author", findRule?.author, R.string.r_author))
add(EditEntity("type", findRule?.type, R.string.rule_book_type))
add(EditEntity("wordCount", findRule?.wordCount, R.string.rule_word_count))
add(EditEntity("status", findRule?.status, R.string.rule_status))
add(EditEntity("desc", findRule?.desc, R.string.rule_book_desc))
add(EditEntity("lastChapter", findRule?.lastChapter, R.string.rule_last_chapter))
add(EditEntity("updateTime", findRule?.updateTime, R.string.rule_update_time))
add(EditEntity("imgUrl", findRule?.imgUrl, R.string.rule_img_url))
add(EditEntity("tocUrl", findRule?.tocUrl, R.string.rule_toc_url))
add(EditEntity("infoUrl", findRule?.infoUrl, R.string.r_info_url))
}
return findEntities
}
fun getInfoEntities(infoRule: InfoRule? = InfoRule()): List<EditEntity> {
val infoEntities: ArrayList<EditEntity> = ArrayList()
infoEntities.apply {
@ -71,19 +126,39 @@ object EditEntityUtil {
fun getTocEntities(tocRule: TocRule? = TocRule()): List<EditEntity> {
val tocEntities: ArrayList<EditEntity> = ArrayList()
tocEntities.apply {
add(EditEntity("chapterBaseUrl", tocRule?.chapterBaseUrl, R.string.rule_chapter_base_url,
"如果章节URL(一般为相对路径)无法定位章节,可填写此规则获取,默认为书源URL"))
add(EditEntity("chapterList", tocRule?.chapterList, R.string.rule_chapter_list,
"对于Mathcer解析器:此处填写书籍列表所在区间,仅支持普通函数;" +
"\n对于Xpath/JsonPath解析器:此处填写书籍列表规则,仅支持列表函数"))
add(EditEntity("chapterName", tocRule?.chapterName, R.string.rule_chapter_name,
"对于Mathcer解析器:此处填写章节名称和URL规则,其中章节名称以<title>占位,章节URL以<link>占位,仅支持列表函数\n" +
"对于Xpath/JsonPath解析器:此处填写章节名称,仅支持普通函数"))
add(EditEntity("chapterUrl", tocRule?.chapterUrl, R.string.rule_chapter_url,
"对于Mathcer解析器:此处不用填写\n" +
"对于Xpath/JsonPath解析器:此处填写章节URL规则"))
add(EditEntity("tocUrlNext", tocRule?.tocUrlNext, R.string.rule_next_toc_url,
"填写后获取目录时将会不断地从目录下一页获取章节,直至下一页URL为空时停止,注意:千万不要获取恒存在的URL,否则将出现死循环甚至崩溃"))
add(
EditEntity(
"chapterBaseUrl", tocRule?.chapterBaseUrl, R.string.rule_chapter_base_url,
"如果章节URL(一般为相对路径)无法定位章节,可填写此规则获取,默认为书源URL"
)
)
add(
EditEntity(
"chapterList", tocRule?.chapterList, R.string.rule_chapter_list,
"对于Mathcer解析器:此处填写书籍列表所在区间,仅支持普通函数;" +
"\n对于Xpath/JsonPath解析器:此处填写书籍列表规则,仅支持列表函数"
)
)
add(
EditEntity(
"chapterName", tocRule?.chapterName, R.string.rule_chapter_name,
"对于Mathcer解析器:此处填写章节名称和URL规则,其中章节名称以<title>占位,章节URL以<link>占位,仅支持列表函数\n" +
"对于Xpath/JsonPath解析器:此处填写章节名称,仅支持普通函数"
)
)
add(
EditEntity(
"chapterUrl", tocRule?.chapterUrl, R.string.rule_chapter_url,
"对于Mathcer解析器:此处不用填写\n" +
"对于Xpath/JsonPath解析器:此处填写章节URL规则"
)
)
add(
EditEntity(
"tocUrlNext", tocRule?.tocUrlNext, R.string.rule_next_toc_url,
"填写后获取目录时将会不断地从目录下一页获取章节,直至下一页URL为空时停止,注意:千万不要获取恒存在的URL,否则将出现死循环甚至崩溃"
)
)
}
return tocEntities
}
@ -92,14 +167,23 @@ object EditEntityUtil {
val contentEntities: ArrayList<EditEntity> = ArrayList()
contentEntities.apply {
add(EditEntity("content", contentRule?.content, R.string.rule_book_content))
add(EditEntity("contentBaseUrl", contentRule?.contentBaseUrl, R.string.rule_base_url_content,
"如果下一页URL(一般为相对路径)无法定位下一页,可填写此规则获取,默认为书源URL"))
add(EditEntity("contentUrlNext", contentRule?.contentUrlNext, R.string.rule_next_content,
"填写后正文时将会不断地从下一页获取内容,直至下一页URL为空时停止,注意:千万不要获取恒存在的URL,否则将出现死循环甚至崩溃"))
add(
EditEntity(
"contentBaseUrl", contentRule?.contentBaseUrl, R.string.rule_base_url_content,
"如果下一页URL(一般为相对路径)无法定位下一页,可填写此规则获取,默认为书源URL"
)
)
add(
EditEntity(
"contentUrlNext", contentRule?.contentUrlNext, R.string.rule_next_content,
"填写后正文时将会不断地从下一页获取内容,直至下一页URL为空时停止,注意:千万不要获取恒存在的URL,否则将出现死循环甚至崩溃"
)
)
}
return contentEntities
}
fun getSource(bookSource: BookSource, sourceEntities: List<EditEntity>): BookSource {
val source = bookSource.clone() as BookSource
sourceEntities.forEach {
@ -140,6 +224,28 @@ object EditEntityUtil {
return searchRule
}
fun getFindRule(findEntities: List<EditEntity>): FindRule {
val findRule = FindRule()
findEntities.forEach {
when (it.key) {
"url" -> findRule.url = it.value
"bookList" -> findRule.bookList = it.value
"name" -> findRule.name = it.value
"author" -> findRule.author = it.value
"type" -> findRule.type = it.value
"desc" -> findRule.desc = it.value
"wordCount" -> findRule.wordCount = it.value
"status" -> findRule.status = it.value
"lastChapter" -> findRule.lastChapter = it.value
"updateTime" -> findRule.updateTime = it.value
"imgUrl" -> findRule.imgUrl = it.value
"tocUrl" -> findRule.tocUrl = it.value
"infoUrl" -> findRule.infoUrl = it.value
}
}
return findRule
}
fun getInfoRule(infoRuleEntities: List<EditEntity>): InfoRule {
val infoRule = InfoRule()
infoRuleEntities.forEach {
@ -186,4 +292,5 @@ object EditEntityUtil {
}
return contentRule
}
}

@ -6,13 +6,9 @@ import android.view.MenuItem;
import android.view.View;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.disposables.Disposable;
@ -28,7 +24,6 @@ import xyz.fycz.myreader.ui.fragment.FindBook1Fragment;
import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.RxUtils;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.QiDianFindCrawler;
import xyz.fycz.myreader.webapi.crawler.source.find.ThirdFindCrawler;
/**
@ -58,6 +53,7 @@ public class FindBookActivity extends BaseActivity {
findCrawler = (FindCrawler) obj;
}
if (findCrawler == null) {
ToastUtils.showError("findCrawler为null");
finish();
return;
}

@ -266,6 +266,7 @@ public class MainActivity extends BaseActivity {
menu.setGroupVisible(R.id.bookcase_menu, false);
menu.findItem(R.id.action_finish).setVisible(false);
}
menu.setGroupVisible(R.id.find_menu, binding.viewPagerMain.getCurrentItem() == 1);
return super.onPrepareOptionsMenu(menu);
}
@ -305,6 +306,9 @@ public class MainActivity extends BaseActivity {
} else if (itemId == R.id.action_qr_scan) {
Intent intent = new Intent(this, QRCodeScanActivity.class);
startActivityForResult(intent, APPCONST.REQUEST_QR_SCAN);
} else if (itemId == R.id.action_refresh_find){
mFindFragment.refreshFind();
return true;
}
return mBookcaseFragment.getmBookcasePresenter().onOptionsItemSelected(item);
}

@ -45,6 +45,7 @@ public class SourceEditActivity extends BaseActivity {
private List<EditEntity> infoEntities;
private List<EditEntity> tocEntities;
private List<EditEntity> contentEntities;
private List<EditEntity> findEntities;
private EditEntityUtil entityUtil;
private SourceEditAdapter adapter;
@ -83,6 +84,7 @@ public class SourceEditActivity extends BaseActivity {
private void initEntities(BookSource source) {
sourceEntities = entityUtil.getSourceEntities(source);
searchEntities = entityUtil.getSearchEntities(source.getSearchRule());
findEntities = entityUtil.getFindEntities(source.getFindRule());
infoEntities = entityUtil.getInfoEntities(source.getInfoRule());
tocEntities = entityUtil.getTocEntities(source.getTocRule());
contentEntities = entityUtil.getContentEntities(source.getContentRule());
@ -243,12 +245,15 @@ public class SourceEditActivity extends BaseActivity {
adapter.refreshItems(searchEntities);
break;
case 2:
adapter.refreshItems(infoEntities);
adapter.refreshItems(findEntities);
break;
case 3:
adapter.refreshItems(tocEntities);
adapter.refreshItems(infoEntities);
break;
case 4:
adapter.refreshItems(tocEntities);
break;
case 5:
adapter.refreshItems(contentEntities);
break;
default:
@ -284,6 +289,7 @@ public class SourceEditActivity extends BaseActivity {
}
source.setSourceType(sourceType);
source.setSearchRule(entityUtil.getSearchRule(searchEntities));
source.setFindRule(entityUtil.getFindRule(findEntities));
source.setInfoRule(entityUtil.getInfoRule(infoEntities));
source.setTocRule(entityUtil.getTocRule(tocEntities));
source.setContentRule(entityUtil.getContentRule(contentEntities));

@ -1,6 +1,7 @@
package xyz.fycz.myreader.ui.adapter.holder;
import android.content.Intent;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;

@ -25,21 +25,20 @@ import xyz.fycz.myreader.base.adapter.BaseListAdapter;
import xyz.fycz.myreader.base.adapter.IViewHolder;
import xyz.fycz.myreader.base.observer.MyObserver;
import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.common.URLCONST;
import xyz.fycz.myreader.databinding.FragmentFindBinding;
import xyz.fycz.myreader.entity.Quotation;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.ui.activity.FindBookActivity;
import xyz.fycz.myreader.ui.activity.SourceEditActivity;
import xyz.fycz.myreader.ui.adapter.holder.FindSourceHolder;
import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.GsonExtensionsKt;
import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.util.utils.RxUtils;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.MiaoBiGeFindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.QB5FindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.QiDianFindCrawler;
import xyz.fycz.myreader.widget.DividerItemDecoration;
/**
* @author fengyue
@ -60,9 +59,10 @@ public class FindFragment extends BaseFragment {
protected void initData(Bundle savedInstanceState) {
Observable.create((ObservableOnSubscribe<List<BookSource>>) emitter -> {
List<BookSource> findSources = new ArrayList<>();
initLocalFind(findSources);
List<BookSource> sources = BookSourceManager.getEnabledBookSourceByOrderNum();
for (BookSource source : sources){
if (source.getFindRule() != null && !TextUtils.isEmpty(source.getFindRule().getUrl())){
for (BookSource source : sources) {
if (source.getFindRule() != null && !TextUtils.isEmpty(source.getFindRule().getUrl())) {
findSources.add(source);
}
}
@ -81,6 +81,25 @@ public class FindFragment extends BaseFragment {
});
}
private void initLocalFind(List<BookSource> findSources) {
BookSource source1 = new BookSource();
source1.setSourceName("起点中文网");
source1.setSourceUrl("xyz.fycz.myreader.webapi.crawler.find.QiDianFindCrawler");
BookSource source2 = new BookSource();
source2.setSourceName("起点女生网");
source2.setSourceUrl("xyz.fycz.myreader.webapi.crawler.find.QianDianNSFindCrawler");
BookSource source3 = new BookSource();
source3.setSourceName("妙笔阁");
source3.setSourceUrl("xyz.fycz.myreader.webapi.crawler.find.MiaoBiGeFindCrawler");
BookSource source4 = new BookSource();
source4.setSourceName("全本小说");
source4.setSourceUrl("xyz.fycz.myreader.webapi.crawler.find.QB5FindCrawler");
findSources.add(source1);
findSources.add(source2);
findSources.add(source3);
findSources.add(source4);
}
private void initFindSources(List<BookSource> findSources) {
findSourcesAdapter = new BaseListAdapter<BookSource>() {
@Override
@ -91,14 +110,36 @@ public class FindFragment extends BaseFragment {
binding.rvFindSources.setLayoutManager(new LinearLayoutManager(getContext()));
binding.rvFindSources.setAdapter(findSourcesAdapter);
//设置分割线
binding.rvFindSources.addItemDecoration(new DividerItemDecoration(getContext()));
// binding.rvFindSources.addItemDecoration(new DividerItemDecoration(getContext()));
findSourcesAdapter.setOnItemClickListener((view, pos) -> {
Intent intent = new Intent(getContext(), FindBookActivity.class);
BitIntentDataManager.getInstance().putData(intent, findSourcesAdapter.getItem(pos));
BookSource source = findSourcesAdapter.getItem(pos);
if (source.getFindRule() == null) {
FindCrawler findCrawler = null;
try {
findCrawler = (FindCrawler) Class.forName(source.getSourceUrl()).newInstance();
} catch (IllegalAccessException | java.lang.InstantiationException | ClassNotFoundException e) {
e.printStackTrace();
}
BitIntentDataManager.getInstance().putData(intent, findCrawler);
} else {
BitIntentDataManager.getInstance().putData(intent, source);
}
getContext().startActivity(intent);
});
findSourcesAdapter.setOnItemLongClickListener((view, pos) -> {
BookSource source = findSourcesAdapter.getItem(pos);
if (source.getFindRule() == null) {
ToastUtils.showWarring("内置发现无法编辑");
} else {
Intent intent = new Intent(getContext(), SourceEditActivity.class);
intent.putExtra(APPCONST.BOOK_SOURCE, findSourcesAdapter.getItem(pos));
getContext().startActivity(intent);
}
return true;
});
findSourcesAdapter.refreshItems(findSources);
}
@ -111,17 +152,6 @@ public class FindFragment extends BaseFragment {
protected void initClick() {
super.initClick();
binding.findRlQuotation.setOnClickListener(v -> getQuotation());
binding.findRlQidian.setOnClickListener(v -> comeToBookstore(new QiDianFindCrawler(false)));
binding.findRlQidianNs.setOnClickListener(v -> comeToBookstore(new QiDianFindCrawler(true)));
binding.findRlMiaoquStore.setOnClickListener(v -> comeToBookstore(new MiaoBiGeFindCrawler()));
binding.findRlQb5Store.setOnClickListener(v -> comeToBookstore(new QB5FindCrawler()));
}
private void comeToBookstore(FindCrawler findCrawler) {
Intent intent = new Intent(getContext(), FindBookActivity.class);
BitIntentDataManager.getInstance().putData(intent, findCrawler);
startActivity(intent);
}
private void getQuotation() {
@ -133,6 +163,7 @@ public class FindFragment extends BaseFragment {
public void onSubscribe(Disposable d) {
addDisposable(d);
}
@Override
public void onSuccess(@NotNull Quotation q) {
binding.tvQuotation.setText(q.getHitokoto());
@ -141,6 +172,10 @@ public class FindFragment extends BaseFragment {
});
}
public void refreshFind() {
initData(null);
}
public boolean isRecreate() {
return binding == null;
}

@ -43,6 +43,9 @@ public class QiDianFindCrawler extends BaseFindCrawler {
private LinkedHashMap<String, Integer> sortName = new LinkedHashMap<>();
private boolean isFemale;
public QiDianFindCrawler() {
}
public QiDianFindCrawler(boolean isFemale) {
this.isFemale = isFemale;
}

@ -0,0 +1,11 @@
package xyz.fycz.myreader.webapi.crawler.find;
/**
* @author fengyue
* @date 2021/7/23 12:15
*/
public class QianDianNSFindCrawler extends QiDianFindCrawler {
public QianDianNSFindCrawler() {
super(true);
}
}

@ -80,7 +80,7 @@ public class ThirdFindCrawler extends BaseFindCrawler {
}
FindKind findKindBean = new FindKind();
findKindBean.setTag(source.getSourceUrl());
findKindBean.setName(kind[0]);
findKindBean.setName(kind[0].replaceAll("\\s", ""));
findKindBean.setUrl(kind[1]);
children.add(findKindBean);
}

@ -58,10 +58,10 @@
android:layout_height="wrap_content"
android:text="@string/source_tab_search" />
<!--<com.google.android.material.tabs.TabItem
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/source_tab_find" />-->
android:text="@string/source_tab_find" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"

@ -92,97 +92,6 @@
android:textSize="@dimen/text_small_size" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/find_rl_qidian"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/selector_common_bg"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/find_qidian"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/find_rl_qidian_ns"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/selector_common_bg"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/find_qidian_ns"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/find_rl_qb5_store"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/selector_common_bg"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/read_qb5"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/find_rl_miaoqu_store"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/selector_common_bg"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/read_miaobi"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
</RelativeLayout>
<!--<RelativeLayout
android:id="@+id/find_rl_xs7_store"
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:background="@drawable/selector_common_bg">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size"
android:text="@string/read_xs7"/>
</RelativeLayout>-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_find_sources"
android:layout_width="match_parent"

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rl_find_source"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/selector_common_bg"
android:paddingLeft="20dp"
android:paddingRight="20dp">
android:paddingStart="20dp"
android:paddingEnd="10dp">
<TextView
android:id="@+id/tv_name"
@ -17,4 +17,15 @@
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
<!-- <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_more"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="?android:attr/selectableItemBackground"
android:padding="8dp"
app:srcCompat="@drawable/ic_more"
app:tint="@color/textSecondary" />-->
</RelativeLayout>

@ -95,7 +95,7 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:background="?android:attr/selectableItemBackground"
android:padding="5dp"
android:padding="8dp"
app:srcCompat="@drawable/ic_more"
app:tint="@color/textSecondary" />
</RelativeLayout>

@ -1,57 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<menu 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="match_parent">
<menu 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="match_parent">
<item
android:id="@+id/action_finish"
android:title="@string/finish"
app:showAsAction="always"
android:visible="false"/>
android:id="@+id/action_finish"
android:title="@string/finish"
android:visible="false"
app:showAsAction="always" />
<group android:id="@+id/bookcase_menu">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search"
android:title="@string/menu_bookcase_search"
app:showAsAction="always"/>
android:id="@+id/action_search"
android:icon="@drawable/ic_search"
android:title="@string/menu_bookcase_search"
app:showAsAction="always" />
<item
android:id="@+id/action_change_group"
android:icon="@drawable/ic_change"
android:title="@string/menu_change_group"
app:showAsAction="always"/>
android:id="@+id/action_change_group"
android:icon="@drawable/ic_change"
android:title="@string/menu_change_group"
app:showAsAction="always" />
<item
android:id="@+id/action_edit"
android:icon="@drawable/ic_arrange"
android:title="@string/menu_bookcase_edit"
app:showAsAction="never"/>
<item
android:id="@+id/action_styleChange"
android:icon="@drawable/ic_view_quilt"
android:title="@string/menu_bookcase_style"
app:showAsAction="never"/>
<item
android:id="@+id/action_group_man"
android:icon="@drawable/ic_group"
android:title="@string/menu_group_man"
app:showAsAction="never"/>
<item
android:id="@+id/action_addLocalBook"
android:icon="@drawable/ic_add"
android:title="@string/menu_bookcase_add"
app:showAsAction="never"/>
android:id="@+id/action_edit"
android:icon="@drawable/ic_arrange"
android:title="@string/menu_bookcase_edit"
app:showAsAction="never" />
<item
android:id="@+id/action_styleChange"
android:icon="@drawable/ic_view_quilt"
android:title="@string/menu_bookcase_style"
app:showAsAction="never" />
<item
android:id="@+id/action_group_man"
android:icon="@drawable/ic_group"
android:title="@string/menu_group_man"
app:showAsAction="never" />
<item
android:id="@+id/action_addLocalBook"
android:icon="@drawable/ic_add"
android:title="@string/menu_bookcase_add"
app:showAsAction="never" />
<item
android:id="@+id/action_download_all"
android:icon="@drawable/ic_download_line"
android:title="@string/menu_bookcase_download_all"
app:showAsAction="never"
android:visible="true"/>
android:id="@+id/action_download_all"
android:icon="@drawable/ic_download_line"
android:title="@string/menu_bookcase_download_all"
android:visible="true"
app:showAsAction="never" />
<item
android:id="@+id/action_qr_scan"
android:icon="@drawable/ic_scan"
android:title="@string/menu_scan"
app:showAsAction="never"
android:visible="true"/>
android:visible="true"
app:showAsAction="never" />
</group>
<group
android:id="@+id/find_menu"
android:visible="false">
<item
android:id="@+id/action_refresh_find"
android:icon="@drawable/ic_refresh"
android:title="@string/refresh"
app:showAsAction="always" />
</group>
</menu>

Loading…
Cancel
Save