新增QQ频道

pull/21/head
fengyuecanzhu 3 years ago
parent 23f8336d8e
commit 96f6323d54
  1. 1
      .idea/misc.xml
  2. 4
      app/src/main/java/xyz/fycz/myreader/model/sourceAnalyzer/BookSourceManager.java
  3. 9
      app/src/main/java/xyz/fycz/myreader/ui/activity/SourceEditActivity.java
  4. 2
      app/src/main/res/layout/activity_search_book.xml
  5. 5
      app/src/main/res/menu/menu_source_edit.xml

@ -52,6 +52,7 @@
<entry key="..\:/android/FYReader/app/src/main/res/menu/menu_read.xml" value="0.24947916666666667" />
<entry key="..\:/android/FYReader/app/src/main/res/menu/menu_rule.xml" value="0.24947916666666667" />
<entry key="..\:/android/FYReader/app/src/main/res/menu/menu_search_word.xml" value="0.1425925925925926" />
<entry key="..\:/android/FYReader/app/src/main/res/menu/menu_source_edit.xml" value="0.2815533980582524" />
</map>
</option>
</component>

@ -189,6 +189,10 @@ public class BookSourceManager {
DbManager.getDaoSession().getBookSourceDao().deleteInTx(sources);
}
public static boolean isBookSourceExist(BookSource source){
if (source == null) return false;
return DbManager.getDaoSession().getBookSourceDao().load(source.getSourceUrl()) != null;
}
public static String getBookSourceSort() {
switch (SharedPreUtils.getInstance().getInt("SourceSort", 0)) {

@ -182,6 +182,15 @@ public class SourceEditActivity extends BaseActivity {
} else if (item.getItemId() == R.id.action_clear_cookie) {
DbManager.getDaoSession().getCookieBeanDao().deleteByKey(getSource().getSourceUrl());
ToastUtils.showSuccess("Cookie清除成功");
} else if (item.getItemId() == R.id.action_delete) {
if (BookSourceManager.isBookSourceExist(source)) {
BookSourceManager.removeBookSource(source);
setResult(Activity.RESULT_OK);
ToastUtils.showSuccess("书源删除成功");
finish();
} else {
ToastUtils.showWarring("当前书源暂未保存,无法删除");
}
}
return super.onOptionsItemSelected(item);
}

@ -151,7 +151,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="5dp"
android:visibility="visible">
android:visibility="gone">
<RelativeLayout
android:id="@+id/rl_suggest_bar"

@ -38,4 +38,9 @@
android:title="@string/clear_cookie"
app:showAsAction="never" />
<item
android:id="@+id/action_delete"
android:title="@string/delete"
app:showAsAction="never" />
</menu>
Loading…
Cancel
Save