diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 72329a3..3c0b836 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -57,7 +57,7 @@ android:requestLegacyExternalStorage="true" android:networkSecurityConfig="@xml/network_security_config"> - + @@ -75,15 +75,15 @@ android:resource="@xml/file_paths"/> - - + @@ -92,21 +92,21 @@ - + - + - + - - + + - + - - + + diff --git a/app/src/main/java/xyz/fycz/myreader/MainActivity.java b/app/src/main/java/xyz/fycz/myreader/MainActivity.java deleted file mode 100644 index 2855961..0000000 --- a/app/src/main/java/xyz/fycz/myreader/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package xyz.fycz.myreader; - -import android.os.Bundle; - -import androidx.appcompat.app.AppCompatActivity; - -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - } -} diff --git a/app/src/main/java/xyz/fycz/myreader/application/MyApplication.java b/app/src/main/java/xyz/fycz/myreader/application/MyApplication.java index ef895b0..e1a1828 100644 --- a/app/src/main/java/xyz/fycz/myreader/application/MyApplication.java +++ b/app/src/main/java/xyz/fycz/myreader/application/MyApplication.java @@ -8,7 +8,6 @@ import android.app.Application; import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; @@ -25,7 +24,6 @@ import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import java.io.File; -import java.io.IOException; import java.security.SecureRandom; import java.security.cert.X509Certificate; import java.util.concurrent.ExecutorService; @@ -45,8 +43,7 @@ import xyz.fycz.myreader.creator.APPDownloadTip; import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.entity.Setting; import xyz.fycz.myreader.entity.UpdateInfo; -import xyz.fycz.myreader.ui.home.MainActivity; -import xyz.fycz.myreader.ui.home.bookcase.BookcaseFragment; +import xyz.fycz.myreader.ui.fragment.BookcaseFragment; import xyz.fycz.myreader.util.*; diff --git a/app/src/main/java/xyz/fycz/myreader/base/adapter/BaseListAdapter.java b/app/src/main/java/xyz/fycz/myreader/base/adapter/BaseListAdapter.java index 59bedb5..79b982a 100644 --- a/app/src/main/java/xyz/fycz/myreader/base/adapter/BaseListAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/base/adapter/BaseListAdapter.java @@ -4,8 +4,6 @@ import android.os.Handler; import android.view.View; import android.view.ViewGroup; import androidx.recyclerview.widget.RecyclerView; -import xyz.fycz.myreader.base.BaseViewHolder; -import xyz.fycz.myreader.base.IViewHolder; import java.util.ArrayList; import java.util.Collections; diff --git a/app/src/main/java/xyz/fycz/myreader/base/BaseViewHolder.java b/app/src/main/java/xyz/fycz/myreader/base/adapter/BaseViewHolder.java similarity index 90% rename from app/src/main/java/xyz/fycz/myreader/base/BaseViewHolder.java rename to app/src/main/java/xyz/fycz/myreader/base/adapter/BaseViewHolder.java index 6f6453d..f6f92ce 100644 --- a/app/src/main/java/xyz/fycz/myreader/base/BaseViewHolder.java +++ b/app/src/main/java/xyz/fycz/myreader/base/adapter/BaseViewHolder.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.base; +package xyz.fycz.myreader.base.adapter; import android.view.View; import androidx.recyclerview.widget.RecyclerView; diff --git a/app/src/main/java/xyz/fycz/myreader/base/IViewHolder.java b/app/src/main/java/xyz/fycz/myreader/base/adapter/IViewHolder.java similarity index 86% rename from app/src/main/java/xyz/fycz/myreader/base/IViewHolder.java rename to app/src/main/java/xyz/fycz/myreader/base/adapter/IViewHolder.java index 0e495ce..54d2952 100644 --- a/app/src/main/java/xyz/fycz/myreader/base/IViewHolder.java +++ b/app/src/main/java/xyz/fycz/myreader/base/adapter/IViewHolder.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.base; +package xyz.fycz.myreader.base.adapter; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/xyz/fycz/myreader/base/ViewHolderImpl.java b/app/src/main/java/xyz/fycz/myreader/base/adapter/ViewHolderImpl.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/base/ViewHolderImpl.java rename to app/src/main/java/xyz/fycz/myreader/base/adapter/ViewHolderImpl.java index b5bdabd..3c3499e 100644 --- a/app/src/main/java/xyz/fycz/myreader/base/ViewHolderImpl.java +++ b/app/src/main/java/xyz/fycz/myreader/base/adapter/ViewHolderImpl.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.base; +package xyz.fycz.myreader.base.adapter; import android.content.Context; import android.view.LayoutInflater; diff --git a/app/src/main/java/xyz/fycz/myreader/common/APPCONST.java b/app/src/main/java/xyz/fycz/myreader/common/APPCONST.java index 01f2a85..8663dbc 100644 --- a/app/src/main/java/xyz/fycz/myreader/common/APPCONST.java +++ b/app/src/main/java/xyz/fycz/myreader/common/APPCONST.java @@ -10,10 +10,10 @@ import java.io.File; public class APPCONST { - public static String publicKey = "fyds1.0";//服务端公钥 + public static String publicKey = "";//服务端公钥 public static String privateKey;//app私钥 public final static String s = "11940364935628058505"; - public static final String KEY = "readerByFengyue"; + public static final String KEY = ""; public static final String ALARM_SCHEDULE_MSG = "alarm_schedule_msg"; diff --git a/app/src/main/java/xyz/fycz/myreader/creator/APPDownloadTip.java b/app/src/main/java/xyz/fycz/myreader/creator/APPDownloadTip.java index c597b67..a200282 100644 --- a/app/src/main/java/xyz/fycz/myreader/creator/APPDownloadTip.java +++ b/app/src/main/java/xyz/fycz/myreader/creator/APPDownloadTip.java @@ -2,24 +2,19 @@ package xyz.fycz.myreader.creator; import android.annotation.SuppressLint; -import android.app.Activity; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; -import android.os.Build; import android.os.Handler; import android.os.Message; -import android.provider.Settings; -import androidx.core.content.FileProvider; import android.view.View; import xyz.fycz.myreader.application.MyApplication; import xyz.fycz.myreader.base.BaseActivity; import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.common.APPCONST; -import xyz.fycz.myreader.ui.home.MainActivity; -import xyz.fycz.myreader.ui.home.bookcase.BookcaseFragment; -import xyz.fycz.myreader.util.StringHelper; +import xyz.fycz.myreader.ui.activity.MainActivity; +import xyz.fycz.myreader.ui.fragment.BookcaseFragment; +import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.TextHelper; import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.webapi.CommonApi; @@ -126,12 +121,7 @@ public class APPDownloadTip { activity.finish(); } } - }, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - activity.installProcess(newFile, isForceUpdate); - } - }); + }, (dialog, which) -> activity.installProcess(newFile, isForceUpdate)); activity.installProcess(newFile, isForceUpdate); }else { appFile.delete(); @@ -151,20 +141,7 @@ public class APPDownloadTip { if (con != null) { con.disconnect(); } - if (is != null) { - try { - is.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - if (fos != null) { - try { - fos.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } + IOUtils.close(is, fos); } } }); diff --git a/app/src/main/java/xyz/fycz/myreader/creator/ChangeSourceDialog.java b/app/src/main/java/xyz/fycz/myreader/creator/ChangeSourceDialog.java index a67f7d1..543ec1a 100644 --- a/app/src/main/java/xyz/fycz/myreader/creator/ChangeSourceDialog.java +++ b/app/src/main/java/xyz/fycz/myreader/creator/ChangeSourceDialog.java @@ -5,7 +5,7 @@ import android.content.Context; import android.os.Handler; import android.os.Message; import xyz.fycz.myreader.callback.ResultCallback; -import xyz.fycz.myreader.crawler.*; +import xyz.fycz.myreader.webapi.crawler.*; import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.mulvalmap.ConcurrentMultiValueMap; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/about/AboutActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/AboutActivity.java similarity index 88% rename from app/src/main/java/xyz/fycz/myreader/ui/about/AboutActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/AboutActivity.java index 70e6868..d2700b2 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/about/AboutActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/AboutActivity.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.about; +package xyz.fycz.myreader.ui.activity; import android.os.Bundle; import android.widget.LinearLayout; @@ -6,9 +6,9 @@ import android.widget.TextView; import androidx.cardview.widget.CardView; import butterknife.BindView; import butterknife.ButterKnife; -import com.google.android.material.tabs.TabLayout; import xyz.fycz.myreader.R; import xyz.fycz.myreader.base.BaseActivity; +import xyz.fycz.myreader.ui.presenter.AboutPresenter; /** * @author fengyue @@ -35,7 +35,7 @@ public class AboutActivity extends BaseActivity { @BindView(R.id.vw_disclaimer) CardView vmDisclaimer; - private AboutPresent mAboutPresent; + private AboutPresenter mAboutPresenter; @Override protected void onCreate(Bundle savedInstanceState) { @@ -43,8 +43,8 @@ public class AboutActivity extends BaseActivity { setContentView(R.layout.activity_about); ButterKnife.bind(this); setStatusBar(R.color.sys_line); - mAboutPresent = new AboutPresent(this); - mAboutPresent.start(); + mAboutPresenter = new AboutPresenter(this); + mAboutPresenter.start(); } diff --git a/app/src/main/java/xyz/fycz/myreader/ui/bookinfo/BookDetailedActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/bookinfo/BookDetailedActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java index 9165794..e991e68 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/bookinfo/BookDetailedActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.bookinfo; +package xyz.fycz.myreader.ui.activity; import android.annotation.SuppressLint; import android.content.Intent; @@ -22,12 +22,11 @@ import com.bumptech.glide.request.RequestOptions; import xyz.fycz.myreader.R; import xyz.fycz.myreader.application.MyApplication; import xyz.fycz.myreader.base.BaseActivity2; -import xyz.fycz.myreader.base.adapter.BaseListAdapter; import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.common.APPCONST; -import xyz.fycz.myreader.crawler.BookInfoCrawler; -import xyz.fycz.myreader.crawler.ReadCrawler; -import xyz.fycz.myreader.crawler.ReadCrawlerUtil; +import xyz.fycz.myreader.webapi.crawler.BookInfoCrawler; +import xyz.fycz.myreader.webapi.crawler.ReadCrawler; +import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.creator.ChangeSourceDialog; import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.enums.BookSource; @@ -35,9 +34,7 @@ import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.greendao.service.ChapterService; -import xyz.fycz.myreader.ui.read.ReadActivity; -import xyz.fycz.myreader.ui.read.catalog.CatalogActivity; -import xyz.fycz.myreader.ui.read.catalog.ChapterTitleAdapter; +import xyz.fycz.myreader.ui.adapter.DetailCatalogAdapter; import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.TextHelper; import xyz.fycz.myreader.util.utils.NetworkUtils; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/CatalogActivity.java similarity index 94% rename from app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/CatalogActivity.java index a6509dc..b4faabd 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/CatalogActivity.java @@ -1,9 +1,8 @@ -package xyz.fycz.myreader.ui.read.catalog; +package xyz.fycz.myreader.ui.activity; import android.os.Bundle; import android.widget.EditText; import android.widget.ImageView; -import android.widget.LinearLayout; import android.widget.RelativeLayout; import androidx.viewpager.widget.ViewPager; import butterknife.BindView; @@ -11,6 +10,7 @@ import butterknife.ButterKnife; import com.google.android.material.tabs.TabLayout; import xyz.fycz.myreader.R; import xyz.fycz.myreader.base.BaseActivity; +import xyz.fycz.myreader.ui.presenter.CatalogActivityPresenter; /** * @author fengyue diff --git a/app/src/main/java/xyz/fycz/myreader/ui/filesys/FileSystemActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/FileSystemActivity.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/filesys/FileSystemActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/FileSystemActivity.java index bcc56df..554cc71 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/filesys/FileSystemActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/FileSystemActivity.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.filesys; +package xyz.fycz.myreader.ui.activity; import android.widget.Button; @@ -13,6 +13,9 @@ import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.enums.BookSource; import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.service.BookService; +import xyz.fycz.myreader.ui.fragment.BaseFileFragment; +import xyz.fycz.myreader.ui.fragment.FileCategoryFragment; +import xyz.fycz.myreader.ui.fragment.LocalBookFragment; import xyz.fycz.myreader.util.TextHelper; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/font/FontsActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/FontsActivity.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/ui/font/FontsActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/FontsActivity.java index f20af13..7d32cf0 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/font/FontsActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/FontsActivity.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.font; +package xyz.fycz.myreader.ui.activity; import android.app.Activity; import android.content.Intent; @@ -15,6 +15,7 @@ import xyz.fycz.myreader.base.BaseActivity; import butterknife.ButterKnife; import butterknife.BindView; import xyz.fycz.myreader.common.APPCONST; +import xyz.fycz.myreader.ui.presenter.FontsPresenter; import static xyz.fycz.myreader.util.UriFileUtil.getPath; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/user/LoginActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/LoginActivity.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/user/LoginActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/LoginActivity.java index ba5648a..e733b01 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/user/LoginActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/LoginActivity.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.user; +package xyz.fycz.myreader.ui.activity; /** * @author fengyue @@ -18,6 +18,7 @@ import butterknife.ButterKnife; import com.google.android.material.textfield.TextInputLayout; import xyz.fycz.myreader.R; import xyz.fycz.myreader.base.BaseActivity; +import xyz.fycz.myreader.ui.presenter.LoginPresenter; import xyz.fycz.myreader.util.utils.StringUtils; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/MainActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/MainActivity.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/home/MainActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/MainActivity.java index 1887cac..d6e6e4c 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/MainActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/MainActivity.java @@ -1,8 +1,6 @@ -package xyz.fycz.myreader.ui.home; +package xyz.fycz.myreader.ui.activity; -import android.app.Activity; -import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; @@ -24,7 +22,7 @@ import xyz.fycz.myreader.base.BaseActivity; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.custom.CircleImageView; -import xyz.fycz.myreader.ui.filesys.FileSystemActivity; +import xyz.fycz.myreader.ui.presenter.MainPresenter; import xyz.fycz.myreader.util.TextHelper; import butterknife.BindView; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/ReadActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/read/ReadActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java index e799a6f..37973d5 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/ReadActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.read; +package xyz.fycz.myreader.ui.activity; import android.content.DialogInterface; @@ -20,6 +20,7 @@ import xyz.fycz.myreader.application.SysManager; import xyz.fycz.myreader.base.BaseActivity; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.creator.DialogCreator; +import xyz.fycz.myreader.ui.presenter.ReadPresenter; import xyz.fycz.myreader.widget.page.PageView; public class ReadActivity extends BaseActivity { diff --git a/app/src/main/java/xyz/fycz/myreader/ui/user/RegisterActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/RegisterActivity.java similarity index 91% rename from app/src/main/java/xyz/fycz/myreader/ui/user/RegisterActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/RegisterActivity.java index 1744e7b..7c4d16b 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/user/RegisterActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/RegisterActivity.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.user; +package xyz.fycz.myreader.ui.activity; /** * @author fengyue @@ -7,17 +7,13 @@ package xyz.fycz.myreader.ui.user; import android.annotation.SuppressLint; import android.os.Bundle; -import android.text.Editable; -import android.text.TextWatcher; -import android.view.MotionEvent; -import android.view.View; -import android.view.inputmethod.InputMethodManager; import android.widget.*; import butterknife.BindView; import butterknife.ButterKnife; import com.google.android.material.textfield.TextInputLayout; import xyz.fycz.myreader.R; import xyz.fycz.myreader.base.BaseActivity; +import xyz.fycz.myreader.ui.presenter.RegisterPresenter; @SuppressLint("Registered") diff --git a/app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookActivity.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java index 01f7b50..2bec020 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java @@ -1,9 +1,7 @@ -package xyz.fycz.myreader.ui.search; +package xyz.fycz.myreader.ui.activity; -import android.content.Context; import android.os.Bundle; -import android.view.inputmethod.InputMethodManager; import android.widget.*; import com.scwang.smartrefresh.layout.SmartRefreshLayout; @@ -14,6 +12,7 @@ import butterknife.ButterKnife; import butterknife.BindView; import me.gujun.android.taggroup.TagGroup; import xyz.fycz.myreader.custom.DragSortGridView; +import xyz.fycz.myreader.ui.presenter.SearchBookPrensenter; public class SearchBookActivity extends BaseActivity { diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/Splash.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/ui/home/Splash.java rename to app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java index f3d745f..74b000b 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/Splash.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home; +package xyz.fycz.myreader.ui.activity; import android.Manifest; import android.content.Intent; @@ -11,11 +11,11 @@ import androidx.core.app.ActivityCompat; import android.view.Window; import android.view.WindowManager; import xyz.fycz.myreader.R; -import xyz.fycz.myreader.util.PermissionHelper; +import xyz.fycz.myreader.ui.activity.MainActivity; import xyz.fycz.myreader.util.PermissionsChecker; import xyz.fycz.myreader.util.TextHelper; -public class Splash extends AppCompatActivity { +public class SplashActivity extends AppCompatActivity { /*************Constant**********/ private static final int WAIT_INTERVAL = 1000; private static final int PERMISSIONS_REQUEST_STORAGE = 1; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookMarkAdapter.java similarity index 98% rename from app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/BookMarkAdapter.java index b29931c..ac972b5 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookMarkAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.read.catalog.bookmark; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.view.LayoutInflater; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreBookAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookStoreBookAdapter.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreBookAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/BookStoreBookAdapter.java index 2ac6d5c..ce02e4a 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreBookAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookStoreBookAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home.bookstore; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.os.Handler; @@ -16,7 +16,7 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.request.RequestOptions; import xyz.fycz.myreader.R; import xyz.fycz.myreader.callback.ResultCallback; -import xyz.fycz.myreader.crawler.BiQuGeReadCrawler; +import xyz.fycz.myreader.webapi.crawler.BiQuGeReadCrawler; import xyz.fycz.myreader.enums.BookSource; import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.util.StringHelper; @@ -57,7 +57,7 @@ public class BookStoreBookAdapter extends RecyclerView.Adapter datas) { + public BookStoreBookAdapter(Context context, List datas) { mInflater = LayoutInflater.from(context); mDatas = datas; mContext = context; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreBookTypeAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookStoreBookTypeAdapter.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreBookTypeAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/BookStoreBookTypeAdapter.java index 1bb4998..ceba6c5 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreBookTypeAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookStoreBookTypeAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home.bookstore; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.view.LayoutInflater; @@ -27,7 +27,7 @@ public class BookStoreBookTypeAdapter extends RecyclerView.Adapter datas) { + public BookStoreBookTypeAdapter(Context context, List datas) { mInflater = LayoutInflater.from(context); mDatas = datas; mContext = context; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseAdapter.java similarity index 98% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseAdapter.java index 450851b..b939917 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home.bookcase; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.content.DialogInterface; @@ -27,6 +27,7 @@ import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.greendao.service.ChapterService; +import xyz.fycz.myreader.ui.presenter.BookcasePresenter; import xyz.fycz.myreader.util.TextHelper; import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.NetworkUtils; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseDetailedAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseDetailedAdapter.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseDetailedAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseDetailedAdapter.java index 3bb3c14..9967781 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseDetailedAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseDetailedAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home.bookcase; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.content.Intent; @@ -23,8 +23,9 @@ import xyz.fycz.myreader.application.MyApplication; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.greendao.entity.Book; -import xyz.fycz.myreader.ui.bookinfo.BookDetailedActivity; -import xyz.fycz.myreader.ui.read.ReadActivity; +import xyz.fycz.myreader.ui.activity.BookDetailedActivity; +import xyz.fycz.myreader.ui.activity.ReadActivity; +import xyz.fycz.myreader.ui.presenter.BookcasePresenter; import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.TextHelper; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseDragAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseDragAdapter.java similarity index 98% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseDragAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseDragAdapter.java index 9b8d2c5..149162b 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseDragAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseDragAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home.bookcase; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.content.DialogInterface; @@ -22,7 +22,8 @@ import xyz.fycz.myreader.application.MyApplication; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.greendao.entity.Book; -import xyz.fycz.myreader.ui.read.ReadActivity; +import xyz.fycz.myreader.ui.activity.ReadActivity; +import xyz.fycz.myreader.ui.presenter.BookcasePresenter; import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.TextHelper; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/ChapterTitleAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/ChapterTitleAdapter.java similarity index 99% rename from app/src/main/java/xyz/fycz/myreader/ui/read/catalog/ChapterTitleAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/ChapterTitleAdapter.java index 9f92a38..fe2b18c 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/ChapterTitleAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/ChapterTitleAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.read.catalog; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.view.LayoutInflater; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/bookinfo/DetailCatalogAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/DetailCatalogAdapter.java similarity index 70% rename from app/src/main/java/xyz/fycz/myreader/ui/bookinfo/DetailCatalogAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/DetailCatalogAdapter.java index 7365215..fa8dd4b 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/bookinfo/DetailCatalogAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/DetailCatalogAdapter.java @@ -1,8 +1,9 @@ -package xyz.fycz.myreader.ui.bookinfo; +package xyz.fycz.myreader.ui.adapter; -import xyz.fycz.myreader.base.IViewHolder; +import xyz.fycz.myreader.base.adapter.IViewHolder; import xyz.fycz.myreader.base.adapter.BaseListAdapter; import xyz.fycz.myreader.greendao.entity.Chapter; +import xyz.fycz.myreader.ui.adapter.holder.CatalogHolder; /** * @author fengyue diff --git a/app/src/main/java/xyz/fycz/myreader/ui/filesys/FileSystemAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/FileSystemAdapter.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/filesys/FileSystemAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/FileSystemAdapter.java index df8a4d9..3b43bb8 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/filesys/FileSystemAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/FileSystemAdapter.java @@ -1,9 +1,10 @@ -package xyz.fycz.myreader.ui.filesys; +package xyz.fycz.myreader.ui.adapter; import xyz.fycz.myreader.base.adapter.BaseListAdapter; -import xyz.fycz.myreader.base.IViewHolder; +import xyz.fycz.myreader.base.adapter.IViewHolder; import xyz.fycz.myreader.greendao.service.BookService; +import xyz.fycz.myreader.ui.adapter.holder.FileHolder; import java.io.File; import java.util.*; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/font/FontsAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/FontsAdapter.java similarity index 99% rename from app/src/main/java/xyz/fycz/myreader/ui/font/FontsAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/FontsAdapter.java index 4d3eb0f..d2153b9 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/font/FontsAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/FontsAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.font; +package xyz.fycz.myreader.ui.adapter; import android.annotation.SuppressLint; import android.app.Activity; @@ -33,6 +33,7 @@ import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.URLCONST; import xyz.fycz.myreader.entity.Setting; import xyz.fycz.myreader.enums.Font; +import xyz.fycz.myreader.ui.activity.FontsActivity; import xyz.fycz.myreader.util.TextHelper; import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.NetworkUtils; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/SearchBookAdapter.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/SearchBookAdapter.java index 198ed2b..e17d6de 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/SearchBookAdapter.java @@ -1,12 +1,10 @@ -package xyz.fycz.myreader.ui.search; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.os.Handler; -import android.os.Message; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; @@ -17,9 +15,9 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.request.RequestOptions; import xyz.fycz.myreader.R; import xyz.fycz.myreader.callback.ResultCallback; -import xyz.fycz.myreader.crawler.BookInfoCrawler; -import xyz.fycz.myreader.crawler.ReadCrawler; -import xyz.fycz.myreader.crawler.ReadCrawlerUtil; +import xyz.fycz.myreader.webapi.crawler.BookInfoCrawler; +import xyz.fycz.myreader.webapi.crawler.ReadCrawler; +import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.custom.DragAdapter; import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.enums.BookSource; @@ -31,7 +29,6 @@ import xyz.fycz.myreader.webapi.CommonApi; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.Map; /** diff --git a/app/src/main/java/xyz/fycz/myreader/ui/search/SearchHistoryAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/SearchHistoryAdapter.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/search/SearchHistoryAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/SearchHistoryAdapter.java index 1169cd5..619fa85 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/search/SearchHistoryAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/SearchHistoryAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.search; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.view.LayoutInflater; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/search/SuggestBookAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/SuggestBookAdapter.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/search/SuggestBookAdapter.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/SuggestBookAdapter.java index 392582c..191dc96 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/search/SuggestBookAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/SuggestBookAdapter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.search; +package xyz.fycz.myreader.ui.adapter; import android.content.Context; import android.view.LayoutInflater; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/bookinfo/CatalogHolder.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/CatalogHolder.java similarity index 90% rename from app/src/main/java/xyz/fycz/myreader/ui/bookinfo/CatalogHolder.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/CatalogHolder.java index e67d1b6..4c097f1 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/bookinfo/CatalogHolder.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/CatalogHolder.java @@ -1,13 +1,11 @@ -package xyz.fycz.myreader.ui.bookinfo; +package xyz.fycz.myreader.ui.adapter.holder; import android.widget.TextView; import xyz.fycz.myreader.R; -import xyz.fycz.myreader.base.ViewHolderImpl; +import xyz.fycz.myreader.base.adapter.ViewHolderImpl; import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.service.ChapterService; -import java.io.File; - /** * @author fengyue * @date 2020/8/17 15:07 diff --git a/app/src/main/java/xyz/fycz/myreader/ui/filesys/FileHolder.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/FileHolder.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/filesys/FileHolder.java rename to app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/FileHolder.java index e0d1ffc..35a299d 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/filesys/FileHolder.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/FileHolder.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.filesys; +package xyz.fycz.myreader.ui.adapter.holder; import android.view.View; import android.widget.CheckBox; @@ -6,7 +6,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import xyz.fycz.myreader.R; -import xyz.fycz.myreader.base.ViewHolderImpl; +import xyz.fycz.myreader.base.adapter.ViewHolderImpl; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.util.utils.FileUtils; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/filesys/BaseFileFragment.java b/app/src/main/java/xyz/fycz/myreader/ui/fragment/BaseFileFragment.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/ui/filesys/BaseFileFragment.java rename to app/src/main/java/xyz/fycz/myreader/ui/fragment/BaseFileFragment.java index 56fcb0f..6b37beb 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/filesys/BaseFileFragment.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/fragment/BaseFileFragment.java @@ -1,8 +1,9 @@ -package xyz.fycz.myreader.ui.filesys; +package xyz.fycz.myreader.ui.fragment; import xyz.fycz.myreader.base.BaseFragment; +import xyz.fycz.myreader.ui.adapter.FileSystemAdapter; import java.io.File; import java.util.List; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkFragment.java b/app/src/main/java/xyz/fycz/myreader/ui/fragment/BookMarkFragment.java similarity index 93% rename from app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkFragment.java rename to app/src/main/java/xyz/fycz/myreader/ui/fragment/BookMarkFragment.java index b788366..666c911 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkFragment.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/fragment/BookMarkFragment.java @@ -1,16 +1,16 @@ -package xyz.fycz.myreader.ui.read.catalog.bookmark; +package xyz.fycz.myreader.ui.fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; -import android.widget.RelativeLayout; import androidx.fragment.app.Fragment; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.Unbinder; import xyz.fycz.myreader.R; +import xyz.fycz.myreader.ui.presenter.BookMarkPresenter; /** * A simple {@link Fragment} subclass. diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreFragment.java b/app/src/main/java/xyz/fycz/myreader/ui/fragment/BookStoreFragment.java similarity index 94% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreFragment.java rename to app/src/main/java/xyz/fycz/myreader/ui/fragment/BookStoreFragment.java index 6dc071a..cbdaffa 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStoreFragment.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/fragment/BookStoreFragment.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home.bookstore; +package xyz.fycz.myreader.ui.fragment; import android.os.Bundle; @@ -12,6 +12,7 @@ import butterknife.ButterKnife; import butterknife.Unbinder; import com.scwang.smartrefresh.layout.SmartRefreshLayout; import xyz.fycz.myreader.R; +import xyz.fycz.myreader.ui.presenter.BookStorePresenter; /** * A simple {@link Fragment} subclass. diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseFragment.java b/app/src/main/java/xyz/fycz/myreader/ui/fragment/BookcaseFragment.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseFragment.java rename to app/src/main/java/xyz/fycz/myreader/ui/fragment/BookcaseFragment.java index 91805db..d537f01 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcaseFragment.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/fragment/BookcaseFragment.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home.bookcase; +package xyz.fycz.myreader.ui.fragment; import android.os.Build; @@ -6,7 +6,6 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.webkit.WebView; import android.widget.LinearLayout; import android.widget.ProgressBar; @@ -20,6 +19,7 @@ import xyz.fycz.myreader.custom.DragSortGridView; import butterknife.ButterKnife; import butterknife.BindView; import butterknife.Unbinder; +import xyz.fycz.myreader.ui.presenter.BookcasePresenter; /** * A simple {@link Fragment} subclass. diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogFragment.java b/app/src/main/java/xyz/fycz/myreader/ui/fragment/CatalogFragment.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogFragment.java rename to app/src/main/java/xyz/fycz/myreader/ui/fragment/CatalogFragment.java index 9c716ad..8c4e3db 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogFragment.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/fragment/CatalogFragment.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.read.catalog; +package xyz.fycz.myreader.ui.fragment; import android.os.Bundle; import android.view.LayoutInflater; @@ -13,6 +13,7 @@ import butterknife.ButterKnife; import butterknife.Unbinder; import com.google.android.material.floatingactionbutton.FloatingActionButton; import xyz.fycz.myreader.R; +import xyz.fycz.myreader.ui.presenter.CatalogPresenter; /** * A simple {@link Fragment} subclass. diff --git a/app/src/main/java/xyz/fycz/myreader/ui/filesys/FileCategoryFragment.java b/app/src/main/java/xyz/fycz/myreader/ui/fragment/FileCategoryFragment.java similarity index 98% rename from app/src/main/java/xyz/fycz/myreader/ui/filesys/FileCategoryFragment.java rename to app/src/main/java/xyz/fycz/myreader/ui/fragment/FileCategoryFragment.java index 342379a..7cdb572 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/filesys/FileCategoryFragment.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/fragment/FileCategoryFragment.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.filesys; +package xyz.fycz.myreader.ui.fragment; import android.os.Bundle; import android.os.Environment; @@ -9,6 +9,7 @@ import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import xyz.fycz.myreader.R; import xyz.fycz.myreader.greendao.service.BookService; +import xyz.fycz.myreader.ui.adapter.FileSystemAdapter; import xyz.fycz.myreader.util.FileStack; import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.widget.DividerItemDecoration; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/filesys/LocalBookFragment.java b/app/src/main/java/xyz/fycz/myreader/ui/fragment/LocalBookFragment.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/filesys/LocalBookFragment.java rename to app/src/main/java/xyz/fycz/myreader/ui/fragment/LocalBookFragment.java index 3417081..26c0814 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/filesys/LocalBookFragment.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/fragment/LocalBookFragment.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.filesys; +package xyz.fycz.myreader.ui.fragment; import android.media.MediaScannerConnection; import android.os.Bundle; @@ -9,6 +9,7 @@ import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import xyz.fycz.myreader.R; import xyz.fycz.myreader.greendao.service.BookService; +import xyz.fycz.myreader.ui.adapter.FileSystemAdapter; import xyz.fycz.myreader.util.media.MediaStoreHelper; import xyz.fycz.myreader.widget.DividerItemDecoration; import xyz.fycz.myreader.widget.RefreshLayout; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bbs/BBSFragment.java b/app/src/main/java/xyz/fycz/myreader/ui/home/bbs/BBSFragment.java deleted file mode 100644 index b8de42f..0000000 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bbs/BBSFragment.java +++ /dev/null @@ -1,30 +0,0 @@ -package xyz.fycz.myreader.ui.home.bbs; - - -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.fragment.app.Fragment; -import xyz.fycz.myreader.R; - -/** - * A simple {@link Fragment} subclass. - */ -public class BBSFragment extends Fragment { - - - public BBSFragment() { - // Required empty public constructor - } - - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_bbs, container, false); - } - -} diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bbs/BBSPrensenter.java b/app/src/main/java/xyz/fycz/myreader/ui/home/bbs/BBSPrensenter.java deleted file mode 100644 index d969771..0000000 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bbs/BBSPrensenter.java +++ /dev/null @@ -1,15 +0,0 @@ -package xyz.fycz.myreader.ui.home.bbs; - -import xyz.fycz.myreader.base.BasePresenter; - -/** - * Created by zhao on 2017/7/25. - */ - -public class BBSPrensenter implements BasePresenter { - - @Override - public void start() { - - } -} diff --git a/app/src/main/java/xyz/fycz/myreader/ui/about/AboutPresent.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/AboutPresenter.java similarity index 92% rename from app/src/main/java/xyz/fycz/myreader/ui/about/AboutPresent.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/AboutPresenter.java index b7bd3fa..494607a 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/about/AboutPresent.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/AboutPresenter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.about; +package xyz.fycz.myreader.ui.presenter; import android.annotation.SuppressLint; import android.content.ClipData; @@ -10,6 +10,7 @@ import xyz.fycz.myreader.R; import xyz.fycz.myreader.application.MyApplication; import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.creator.DialogCreator; +import xyz.fycz.myreader.ui.activity.AboutActivity; import xyz.fycz.myreader.util.ShareUtils; import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.TextHelper; @@ -18,11 +19,11 @@ import xyz.fycz.myreader.util.TextHelper; * @author fengyue * @date 2020/7/31 11:39 */ -public class AboutPresent implements BasePresenter { +public class AboutPresenter implements BasePresenter { private AboutActivity mAboutActivity; - public AboutPresent(AboutActivity mAboutActivity) { + public AboutPresenter(AboutActivity mAboutActivity) { this.mAboutActivity = mAboutActivity; } diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkPresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookMarkPresenter.java similarity index 94% rename from app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkPresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/BookMarkPresenter.java index 2ccb98d..c0a38b6 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/bookmark/BookMarkPresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookMarkPresenter.java @@ -1,10 +1,7 @@ -package xyz.fycz.myreader.ui.read.catalog.bookmark; +package xyz.fycz.myreader.ui.presenter; import android.app.Activity; import android.content.Intent; -import androidx.core.view.GravityCompat; -import android.view.View; -import android.widget.AdapterView; import xyz.fycz.myreader.R; import xyz.fycz.myreader.application.SysManager; import xyz.fycz.myreader.base.BasePresenter; @@ -12,6 +9,8 @@ import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.BookMark; import xyz.fycz.myreader.greendao.service.BookMarkService; +import xyz.fycz.myreader.ui.adapter.BookMarkAdapter; +import xyz.fycz.myreader.ui.fragment.BookMarkFragment; import java.util.ArrayList; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStorePresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookStorePresenter.java similarity index 93% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStorePresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/BookStorePresenter.java index a9f172b..008821a 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookstore/BookStorePresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookStorePresenter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.home.bookstore; +package xyz.fycz.myreader.ui.presenter; import android.annotation.SuppressLint; import android.content.Intent; @@ -15,8 +15,11 @@ import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.URLCONST; import xyz.fycz.myreader.entity.bookstore.BookType; import xyz.fycz.myreader.greendao.entity.Book; -import xyz.fycz.myreader.ui.bookinfo.BookDetailedActivity; -import xyz.fycz.myreader.ui.home.MainActivity; +import xyz.fycz.myreader.ui.activity.BookDetailedActivity; +import xyz.fycz.myreader.ui.activity.MainActivity; +import xyz.fycz.myreader.ui.adapter.BookStoreBookAdapter; +import xyz.fycz.myreader.ui.adapter.BookStoreBookTypeAdapter; +import xyz.fycz.myreader.ui.fragment.BookStoreFragment; import xyz.fycz.myreader.util.TextHelper; import xyz.fycz.myreader.webapi.BookStoreApi; @@ -65,7 +68,7 @@ public class BookStorePresenter implements BasePresenter { } }; - BookStorePresenter(BookStoreFragment bookStoreFragment){ + public BookStorePresenter(BookStoreFragment bookStoreFragment){ mBookStoreFragment = bookStoreFragment; mMainActivity = ((MainActivity) (mBookStoreFragment.getActivity())); } diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcasePresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookcasePresenter.java similarity index 98% rename from app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcasePresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/BookcasePresenter.java index c173563..81307d2 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/bookcase/BookcasePresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookcasePresenter.java @@ -1,9 +1,8 @@ -package xyz.fycz.myreader.ui.home.bookcase; +package xyz.fycz.myreader.ui.presenter; import android.Manifest; import android.annotation.SuppressLint; import android.app.Notification; -import android.app.NotificationManager; import android.app.PendingIntent; import android.content.*; import android.graphics.BitmapFactory; @@ -17,7 +16,6 @@ import android.widget.PopupMenu; import androidx.appcompat.app.AlertDialog; import androidx.core.app.ActivityCompat; -import androidx.core.app.NotificationCompat; import androidx.core.content.ContextCompat; import java.io.File; @@ -37,8 +35,8 @@ import xyz.fycz.myreader.backup.UserService; import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.common.APPCONST; -import xyz.fycz.myreader.crawler.ReadCrawler; -import xyz.fycz.myreader.crawler.ReadCrawlerUtil; +import xyz.fycz.myreader.webapi.crawler.ReadCrawler; +import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.custom.DragSortGridView; import xyz.fycz.myreader.entity.Setting; @@ -48,13 +46,16 @@ import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.greendao.service.ChapterService; -import xyz.fycz.myreader.ui.about.AboutActivity; -import xyz.fycz.myreader.ui.filesys.FileSystemActivity; -import xyz.fycz.myreader.ui.home.MainActivity; -import xyz.fycz.myreader.ui.search.SearchBookActivity; -import xyz.fycz.myreader.ui.user.LoginActivity; +import xyz.fycz.myreader.ui.activity.AboutActivity; +import xyz.fycz.myreader.ui.activity.FileSystemActivity; +import xyz.fycz.myreader.ui.activity.MainActivity; +import xyz.fycz.myreader.ui.activity.SearchBookActivity; +import xyz.fycz.myreader.ui.activity.LoginActivity; +import xyz.fycz.myreader.ui.adapter.BookcaseAdapter; +import xyz.fycz.myreader.ui.adapter.BookcaseDetailedAdapter; +import xyz.fycz.myreader.ui.adapter.BookcaseDragAdapter; +import xyz.fycz.myreader.ui.fragment.BookcaseFragment; import xyz.fycz.myreader.util.*; -import xyz.fycz.myreader.util.notification.NotificationClickReceiver; import xyz.fycz.myreader.util.notification.NotificationUtil; import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.webapi.CommonApi; @@ -131,7 +132,6 @@ public class BookcasePresenter implements BasePresenter { case 4: showErrorLoadingBooks(); if (MyApplication.isApkInDebug(mMainActivity)) { - MyApplication.runOnUiThread(() -> mBookcaseAdapter.notifyDataSetChanged()); downloadAll(false); } break; @@ -259,7 +259,7 @@ public class BookcasePresenter implements BasePresenter { } - protected void init() { + public void init() { initBook(); if (mBooks.size() == 0) { mBookcaseFragment.getGvBook().setVisibility(View.GONE); diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogActivityPresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/CatalogActivityPresenter.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogActivityPresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/CatalogActivityPresenter.java index e4f2522..fa92e8a 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogActivityPresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/CatalogActivityPresenter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.read.catalog; +package xyz.fycz.myreader.ui.presenter; import android.content.Context; import android.text.Editable; @@ -11,7 +11,9 @@ import xyz.fycz.myreader.R; import xyz.fycz.myreader.application.SysManager; import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.entity.Setting; -import xyz.fycz.myreader.ui.read.catalog.bookmark.BookMarkFragment; +import xyz.fycz.myreader.ui.activity.CatalogActivity; +import xyz.fycz.myreader.ui.fragment.CatalogFragment; +import xyz.fycz.myreader.ui.fragment.BookMarkFragment; import java.util.ArrayList; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogPresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/CatalogPresenter.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogPresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/CatalogPresenter.java index 8365d05..81db310 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/catalog/CatalogPresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/CatalogPresenter.java @@ -1,19 +1,20 @@ -package xyz.fycz.myreader.ui.read.catalog; +package xyz.fycz.myreader.ui.presenter; import android.app.Activity; import android.content.Intent; import android.view.View; -import android.widget.AdapterView; import xyz.fycz.myreader.R; import xyz.fycz.myreader.application.MyApplication; import xyz.fycz.myreader.application.SysManager; import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.common.APPCONST; -import xyz.fycz.myreader.crawler.ReadCrawlerUtil; +import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.service.ChapterService; +import xyz.fycz.myreader.ui.adapter.ChapterTitleAdapter; +import xyz.fycz.myreader.ui.fragment.CatalogFragment; import xyz.fycz.myreader.util.TextHelper; import xyz.fycz.myreader.webapi.CommonApi; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/font/FontsPresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/FontsPresenter.java similarity index 96% rename from app/src/main/java/xyz/fycz/myreader/ui/font/FontsPresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/FontsPresenter.java index e6e62d2..9ae6864 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/font/FontsPresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/FontsPresenter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.font; +package xyz.fycz.myreader.ui.presenter; import android.annotation.SuppressLint; import android.os.Handler; @@ -9,6 +9,8 @@ import xyz.fycz.myreader.R; import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.enums.Font; +import xyz.fycz.myreader.ui.activity.FontsActivity; +import xyz.fycz.myreader.ui.adapter.FontsAdapter; import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.TextHelper; import xyz.fycz.myreader.util.utils.FileUtils; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/user/LoginPresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/LoginPresenter.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/user/LoginPresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/LoginPresenter.java index 2b67529..cdb665b 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/user/LoginPresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/LoginPresenter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.user; +package xyz.fycz.myreader.ui.presenter; import android.annotation.SuppressLint; import android.app.ProgressDialog; @@ -12,7 +12,8 @@ import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.creator.DialogCreator; -import xyz.fycz.myreader.ui.font.FontsActivity; +import xyz.fycz.myreader.ui.activity.LoginActivity; +import xyz.fycz.myreader.ui.activity.RegisterActivity; import xyz.fycz.myreader.util.CodeUtil; import xyz.fycz.myreader.util.CyptoUtils; import xyz.fycz.myreader.util.TextHelper; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/home/MainPresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/MainPresenter.java similarity index 91% rename from app/src/main/java/xyz/fycz/myreader/ui/home/MainPresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/MainPresenter.java index cdd12e0..30e53f8 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/home/MainPresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/MainPresenter.java @@ -1,10 +1,8 @@ -package xyz.fycz.myreader.ui.home; +package xyz.fycz.myreader.ui.presenter; import android.content.DialogInterface; import android.content.Intent; -import android.view.View; - import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentPagerAdapter; import xyz.fycz.myreader.application.MyApplication; @@ -13,13 +11,10 @@ import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.entity.Setting; -import xyz.fycz.myreader.ui.home.bbs.BBSFragment; -import xyz.fycz.myreader.ui.home.bookcase.BookcaseFragment; -import xyz.fycz.myreader.ui.home.bookcase.BookcasePresenter; -import xyz.fycz.myreader.ui.home.bookstore.BookStoreFragment; -import xyz.fycz.myreader.ui.search.SearchBookActivity; -import xyz.fycz.myreader.ui.user.LoginActivity; -import xyz.fycz.myreader.util.AppInfoUtils; +import xyz.fycz.myreader.ui.activity.MainActivity; +import xyz.fycz.myreader.ui.fragment.BookcaseFragment; +import xyz.fycz.myreader.ui.activity.SearchBookActivity; +import xyz.fycz.myreader.ui.activity.LoginActivity; import xyz.fycz.myreader.util.TextHelper; import java.io.File; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/read/ReadPresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/ReadPresenter.java similarity index 99% rename from app/src/main/java/xyz/fycz/myreader/ui/read/ReadPresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/ReadPresenter.java index b035623..b12bdb2 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/read/ReadPresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/ReadPresenter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.read; +package xyz.fycz.myreader.ui.presenter; import android.annotation.SuppressLint; import android.app.Dialog; @@ -21,7 +21,6 @@ import androidx.appcompat.app.AlertDialog; import java.io.File; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import xyz.fycz.myreader.R; @@ -31,8 +30,8 @@ import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.URLCONST; -import xyz.fycz.myreader.crawler.ReadCrawler; -import xyz.fycz.myreader.crawler.ReadCrawlerUtil; +import xyz.fycz.myreader.webapi.crawler.ReadCrawler; +import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.creator.DialogCreator; import xyz.fycz.myreader.entity.Setting; import xyz.fycz.myreader.enums.BookSource; @@ -44,9 +43,9 @@ import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.service.BookMarkService; import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.greendao.service.ChapterService; -import xyz.fycz.myreader.ui.font.FontsActivity; -import xyz.fycz.myreader.ui.home.bookcase.BookcasePresenter; -import xyz.fycz.myreader.ui.read.catalog.CatalogActivity; +import xyz.fycz.myreader.ui.activity.FontsActivity; +import xyz.fycz.myreader.ui.activity.ReadActivity; +import xyz.fycz.myreader.ui.activity.CatalogActivity; import xyz.fycz.myreader.util.BrightUtil; import xyz.fycz.myreader.util.ScreenHelper; import xyz.fycz.myreader.util.StringHelper; @@ -264,7 +263,7 @@ public class ReadPresenter implements BasePresenter { /** * 保存最后阅读章节的进度 */ - protected void saveLastChapterReadPosition() { + public void saveLastChapterReadPosition() { if (!StringHelper.isEmpty(mBook.getId()) && mPageLoader.getPageStatus() == PageLoader.STATUS_FINISH) { mBook.setLastReadPosition(mPageLoader.getPagePos()); mBook.setHisttoryChapterNum(mPageLoader.getChapterPos()); @@ -1201,7 +1200,7 @@ public class ReadPresenter implements BasePresenter { /** * ReadActivity调用 */ - protected void deleteBook() { + public void deleteBook() { mBookService.deleteBookById(mBook.getId()); } diff --git a/app/src/main/java/xyz/fycz/myreader/ui/user/RegisterPresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/RegisterPresenter.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/ui/user/RegisterPresenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/RegisterPresenter.java index b80af55..9e435aa 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/user/RegisterPresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/RegisterPresenter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.user; +package xyz.fycz.myreader.ui.presenter; import android.annotation.SuppressLint; import android.app.ProgressDialog; @@ -9,26 +9,15 @@ import android.text.Editable; import android.text.TextWatcher; import android.text.method.LinkMovementMethod; import android.view.View; -import xyz.fycz.myreader.application.MyApplication; import xyz.fycz.myreader.backup.UserService; import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.callback.ResultCallback; -import xyz.fycz.myreader.common.APPCONST; -import xyz.fycz.myreader.common.URLCONST; import xyz.fycz.myreader.creator.DialogCreator; -import xyz.fycz.myreader.util.AppInfoUtils; +import xyz.fycz.myreader.ui.activity.RegisterActivity; import xyz.fycz.myreader.util.CodeUtil; -import xyz.fycz.myreader.util.CyptoUtils; import xyz.fycz.myreader.util.TextHelper; -import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.StringUtils; -import java.io.BufferedReader; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; import java.util.HashMap; import java.util.Map; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookPrensenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/SearchBookPrensenter.java similarity index 97% rename from app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookPrensenter.java rename to app/src/main/java/xyz/fycz/myreader/ui/presenter/SearchBookPrensenter.java index 5e1f3cc..501a9b4 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/search/SearchBookPrensenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/SearchBookPrensenter.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.ui.search; +package xyz.fycz.myreader.ui.presenter; import android.annotation.SuppressLint; import android.content.Context; @@ -14,10 +14,10 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import xyz.fycz.myreader.application.MyApplication; -import xyz.fycz.myreader.crawler.*; +import xyz.fycz.myreader.webapi.crawler.*; import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.mulvalmap.ConcurrentMultiValueMap; -import xyz.fycz.myreader.ui.bookinfo.BookDetailedActivity; +import xyz.fycz.myreader.ui.activity.BookDetailedActivity; import xyz.fycz.myreader.R; import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.callback.ResultCallback; @@ -25,6 +25,9 @@ import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.SearchHistory; import xyz.fycz.myreader.greendao.service.SearchHistoryService; +import xyz.fycz.myreader.ui.activity.SearchBookActivity; +import xyz.fycz.myreader.ui.adapter.SearchBookAdapter; +import xyz.fycz.myreader.ui.adapter.SearchHistoryAdapter; import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.webapi.CommonApi; @@ -93,7 +96,7 @@ public class SearchBookPrensenter implements BasePresenter { @Override public void start() { mSearchBookActivity.getTvTitleText().setText("搜索"); - mSearchBookActivity.etSearchKey.requestFocus();//get the focus + mSearchBookActivity.getEtSearchKey().requestFocus();//get the focus //enter事件 mSearchBookActivity.getEtSearchKey().setOnEditorActionListener((textView, i, keyEvent) -> { if (i == EditorInfo.IME_ACTION_UNSPECIFIED) { diff --git a/app/src/main/java/xyz/fycz/myreader/webapi/BookStoreApi.java b/app/src/main/java/xyz/fycz/myreader/webapi/BookStoreApi.java index ce920f7..ebeca3c 100644 --- a/app/src/main/java/xyz/fycz/myreader/webapi/BookStoreApi.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/BookStoreApi.java @@ -2,7 +2,7 @@ package xyz.fycz.myreader.webapi; import xyz.fycz.myreader.callback.ResultCallback; -import xyz.fycz.myreader.crawler.BiQuGeReadCrawler; +import xyz.fycz.myreader.webapi.crawler.BiQuGeReadCrawler; /** * Created by zhao on 2017/7/24. diff --git a/app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java b/app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java index 46fb623..3804086 100644 --- a/app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java @@ -1,7 +1,7 @@ package xyz.fycz.myreader.webapi; import xyz.fycz.myreader.common.URLCONST; -import xyz.fycz.myreader.crawler.*; +import xyz.fycz.myreader.webapi.crawler.*; import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.greendao.entity.Book; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/BiQuGe44ReadCrawler.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/BiQuGe44ReadCrawler.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/crawler/BiQuGe44ReadCrawler.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/BiQuGe44ReadCrawler.java index 57673d0..552fd9b 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/BiQuGe44ReadCrawler.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/BiQuGe44ReadCrawler.java @@ -1,11 +1,10 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import android.text.Html; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; -import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.enums.BookSource; import xyz.fycz.myreader.greendao.entity.Book; @@ -14,11 +13,6 @@ import xyz.fycz.myreader.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.util.StringHelper; import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -import static xyz.fycz.myreader.webapi.BaseApi.getCommonReturnHtmlStringApi; - public class BiQuGe44ReadCrawler implements ReadCrawler, BookInfoCrawler{ diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/BiQuGeReadCrawler.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/BiQuGeReadCrawler.java similarity index 98% rename from app/src/main/java/xyz/fycz/myreader/crawler/BiQuGeReadCrawler.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/BiQuGeReadCrawler.java index e05d957..5c2d8cc 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/BiQuGeReadCrawler.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/BiQuGeReadCrawler.java @@ -1,11 +1,10 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import android.text.Html; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; -import xyz.fycz.myreader.callback.ResultCallback; import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.entity.bookstore.BookType; import xyz.fycz.myreader.enums.BookSource; @@ -13,7 +12,6 @@ import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.util.StringHelper; -import xyz.fycz.myreader.webapi.CommonApi; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/BookInfoCrawler.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/BookInfoCrawler.java similarity index 83% rename from app/src/main/java/xyz/fycz/myreader/crawler/BookInfoCrawler.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/BookInfoCrawler.java index 3d96e87..b5fec0e 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/BookInfoCrawler.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/BookInfoCrawler.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import xyz.fycz.myreader.greendao.entity.Book; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/FYReadCrawler.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/FYReadCrawler.java similarity index 98% rename from app/src/main/java/xyz/fycz/myreader/crawler/FYReadCrawler.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/FYReadCrawler.java index 219fc1b..66f7029 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/FYReadCrawler.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/FYReadCrawler.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import android.text.Html; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/PinShuReadCrawler.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/PinShuReadCrawler.java similarity index 99% rename from app/src/main/java/xyz/fycz/myreader/crawler/PinShuReadCrawler.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/PinShuReadCrawler.java index 0128e03..bddefc3 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/PinShuReadCrawler.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/PinShuReadCrawler.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import android.text.Html; import org.jsoup.Jsoup; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/PinShuReadCrawler2.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/PinShuReadCrawler2.java similarity index 99% rename from app/src/main/java/xyz/fycz/myreader/crawler/PinShuReadCrawler2.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/PinShuReadCrawler2.java index 9ebb22a..b5a9798 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/PinShuReadCrawler2.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/PinShuReadCrawler2.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import android.text.Html; import org.jsoup.Jsoup; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/QiDianRankList.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/QiDianRankList.java similarity index 95% rename from app/src/main/java/xyz/fycz/myreader/crawler/QiDianRankList.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/QiDianRankList.java index a18110b..bb9dedd 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/QiDianRankList.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/QiDianRankList.java @@ -1,13 +1,11 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import xyz.fycz.myreader.entity.bookstore.BookType; -import xyz.fycz.myreader.enums.BookSource; import xyz.fycz.myreader.greendao.entity.Book; -import xyz.fycz.myreader.util.StringHelper; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/ReadCrawler.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawler.java similarity index 93% rename from app/src/main/java/xyz/fycz/myreader/crawler/ReadCrawler.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawler.java index 2afef4b..b3abae3 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/ReadCrawler.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawler.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.greendao.entity.Book; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/ReadCrawlerUtil.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java similarity index 93% rename from app/src/main/java/xyz/fycz/myreader/crawler/ReadCrawlerUtil.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java index 2acfde1..bc26866 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/ReadCrawlerUtil.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import java.util.ResourceBundle; diff --git a/app/src/main/java/xyz/fycz/myreader/crawler/TianLaiReadCrawler.java b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/TianLaiReadCrawler.java similarity index 99% rename from app/src/main/java/xyz/fycz/myreader/crawler/TianLaiReadCrawler.java rename to app/src/main/java/xyz/fycz/myreader/webapi/crawler/TianLaiReadCrawler.java index 1796922..063c16c 100644 --- a/app/src/main/java/xyz/fycz/myreader/crawler/TianLaiReadCrawler.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/crawler/TianLaiReadCrawler.java @@ -1,4 +1,4 @@ -package xyz.fycz.myreader.crawler; +package xyz.fycz.myreader.webapi.crawler; import android.text.Html; diff --git a/app/src/main/java/xyz/fycz/myreader/widget/page/NetPageLoader.java b/app/src/main/java/xyz/fycz/myreader/widget/page/NetPageLoader.java index cb1749e..cc32f45 100644 --- a/app/src/main/java/xyz/fycz/myreader/widget/page/NetPageLoader.java +++ b/app/src/main/java/xyz/fycz/myreader/widget/page/NetPageLoader.java @@ -7,8 +7,7 @@ import xyz.fycz.myreader.entity.Setting; import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.service.ChapterService; -import xyz.fycz.myreader.util.StringHelper; -import xyz.fycz.myreader.crawler.ReadCrawler; +import xyz.fycz.myreader.webapi.crawler.ReadCrawler; import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.webapi.CommonApi; diff --git a/app/src/main/java/xyz/fycz/myreader/widget/page/PageView.java b/app/src/main/java/xyz/fycz/myreader/widget/page/PageView.java index 83056d9..61e688b 100644 --- a/app/src/main/java/xyz/fycz/myreader/widget/page/PageView.java +++ b/app/src/main/java/xyz/fycz/myreader/widget/page/PageView.java @@ -11,7 +11,7 @@ import android.view.ViewConfiguration; import xyz.fycz.myreader.entity.Setting; import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.service.ChapterService; -import xyz.fycz.myreader.crawler.ReadCrawler; +import xyz.fycz.myreader.webapi.crawler.ReadCrawler; import xyz.fycz.myreader.widget.animation.*; /** diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 698b317..c8b892e 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -5,7 +5,7 @@ android:fitsSystemWindows="true" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" - tools:context=".ui.about.AboutActivity"> + tools:context=".ui.activity.AboutActivity"> diff --git a/app/src/main/res/layout/activity_catalog.xml b/app/src/main/res/layout/activity_catalog.xml index b6a040d..cad1243 100644 --- a/app/src/main/res/layout/activity_catalog.xml +++ b/app/src/main/res/layout/activity_catalog.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" android:fitsSystemWindows="true" android:orientation="vertical" - tools:context="xyz.fycz.myreader.ui.read.catalog.CatalogActivity"> + tools:context="xyz.fycz.myreader.ui.activity.CatalogActivity"> + tools:context="xyz.fycz.myreader.ui.activity.FontsActivity"> + tools:context="xyz.fycz.myreader.ui.activity.MainActivity"> + tools:context="xyz.fycz.myreader.ui.activity.FontsActivity"> + tools:context="xyz.fycz.myreader.ui.activity.ReadActivity"> + tools:context="xyz.fycz.myreader.ui.activity.SearchBookActivity"> + tools:context="xyz.fycz.myreader.ui.fragment.BookStoreFragment"> + tools:context="xyz.fycz.myreader.ui.fragment.BookcaseFragment"> diff --git a/app/src/main/res/layout/fragment_bookmark.xml b/app/src/main/res/layout/fragment_bookmark.xml index 4b131bc..4df48db 100644 --- a/app/src/main/res/layout/fragment_bookmark.xml +++ b/app/src/main/res/layout/fragment_bookmark.xml @@ -3,7 +3,7 @@ android:id="@+id/rl_bookmark" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="xyz.fycz.myreader.ui.read.catalog.bookmark.BookMarkFragment"> + tools:context="xyz.fycz.myreader.ui.fragment.BookMarkFragment"> + tools:context="xyz.fycz.myreader.ui.fragment.CatalogFragment">