observers = new ArrayList<>();
12 |
13 | public void attach(DbObservrt dbo) {
14 | if (dbo == null) throw new NullPointerException();
15 | if (!observers.contains(dbo)) {
16 | observers.add(dbo);
17 | }
18 | }
19 |
20 | public void detach(DbObservrt dbo) {
21 | observers.remove(dbo);
22 | }
23 |
24 | public abstract void notifyUpdateMovie();
25 | public abstract void notifyUpdateBook();
26 | public abstract void notifyUpdateActor();
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/model/httputils/CachingControlInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.model.httputils;
2 |
3 | import com.lhr.jiandou.MyApplication;
4 |
5 | import java.io.IOException;
6 |
7 | import okhttp3.Interceptor;
8 | import okhttp3.Request;
9 |
10 | /**
11 | * Created by ChinaLHR on 2016/12/18.
12 | * Email:13435500980@163.com
13 | */
14 |
15 | public class CachingControlInterceptor {
16 | /**
17 | * 拦截器
18 | */
19 | private static final int TIMEOUT_CONNECT = 5; //5秒
20 | private static final int TIMEOUT_DISCONNECT = 60 * 60 * 24 * 7; //7天
21 | public static final Interceptor REWRITE_RESPONSE_INTERCEPTOR = new Interceptor() {
22 | @Override
23 | public okhttp3.Response intercept(Chain chain) throws IOException {
24 |
25 | String cache = chain.request().header("cache");
26 | okhttp3.Response originalResponse = chain.proceed(chain.request());
27 | String cacheControl = originalResponse.header("Cache-Control");
28 | if (cacheControl == null) {
29 | if (cache == null || "".equals(cache)) {
30 | cache = TIMEOUT_CONNECT + "";
31 | }
32 | originalResponse = originalResponse.newBuilder()
33 | .header("Cache-Control", "public, max-age=" + cache)
34 | .build();
35 | return originalResponse;
36 | } else {
37 | return originalResponse;
38 | }
39 | }
40 | };
41 | public static final Interceptor REWRITE_RESPONSE_INTERCEPTOR_OFFLINE = new Interceptor() {
42 | @Override
43 | public okhttp3.Response intercept(Chain chain) throws IOException {
44 | Request request = chain.request();
45 | if (!MyApplication.isNetworkAvailable(MyApplication.getContext())) {
46 | request = request.newBuilder()
47 | .header("Cache-Control", "public, only-if-cached, max-stale=" + TIMEOUT_DISCONNECT)
48 | .build();
49 | }
50 | return chain.proceed(request);
51 | }
52 | };
53 |
54 |
55 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/CacheUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import android.content.Context;
4 |
5 | import java.io.File;
6 | import java.io.FileInputStream;
7 | import java.io.FileOutputStream;
8 | import java.io.IOException;
9 | import java.io.ObjectInputStream;
10 | import java.io.ObjectOutputStream;
11 | import java.util.List;
12 |
13 | /**
14 | * Created by ChinaLHR on 2016/12/18.
15 | * Email:13435500980@163.com
16 | *
17 | * 序列化缓存List
18 | */
19 |
20 | public class CacheUtils {
21 | public static final String DataCache_movie = "Cache_File_movie";
22 | public static final String DataCache_book = "Cache_File_book";
23 |
24 | /**
25 | * 序列化List
26 | */
27 | public static void savebean(Context context, List list, String Cache_type, String name) {
28 | if (context == null) {
29 | return;
30 | }
31 | File file;
32 | if (!Cache_type.isEmpty()) {
33 | File fileDir = new File(context.getFilesDir(), Cache_type);
34 | if (!fileDir.exists() || !fileDir.isDirectory()) {
35 | fileDir.mkdir();
36 | }
37 | file = new File(fileDir, name);
38 | } else {
39 | file = new File(context.getFilesDir(), name);
40 | }
41 | if (file.exists()) {
42 | file.delete();
43 | }
44 | try {
45 | ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
46 | oos.writeObject(list);
47 | oos.flush();
48 |
49 | } catch (IOException e) {
50 | e.printStackTrace();
51 | }
52 |
53 | }
54 |
55 | /**
56 | * 反序列化
57 | *
58 | * @param context
59 | * @param name
60 | * @param
61 | * @return
62 | */
63 | public static List readbean(Context context, String Cache_type, String name) {
64 | if (name == null) {
65 | return null;
66 | } else {
67 | File file;
68 | if (!Cache_type.isEmpty()) {
69 | File fileDir = new File(context.getFilesDir(), Cache_type);
70 | if (!fileDir.exists() || !fileDir.isDirectory()) {
71 | fileDir.mkdir();
72 | }
73 |
74 | file = new File(fileDir, name);
75 |
76 | } else {
77 | file = new File(context.getFilesDir(), name);
78 | }
79 | try {
80 | ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file));
81 | List list = (List) ois.readObject();
82 | ois.close();
83 | return list;
84 | } catch (Exception e) {
85 | e.printStackTrace();
86 | return null;
87 | }
88 | }
89 |
90 |
91 | }
92 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/ClearCacheUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import com.lhr.jiandou.MyApplication;
4 |
5 | import java.io.File;
6 | import java.math.BigDecimal;
7 |
8 | /**
9 | * Created by ChinaLHR on 2017/1/2.
10 | * Email:13435500980@163.com
11 | */
12 |
13 | public class ClearCacheUtils {
14 | /**
15 | * 获取缓存
16 | * @return
17 | */
18 | public static String getCacheSize() {
19 | return getFormatSize(getFolderSize(MyApplication.getContext().getCacheDir()));
20 | }
21 |
22 | /**
23 | * 删除缓存
24 | * @param dir
25 | * @return
26 | */
27 | public static boolean deleteDir(File dir) {
28 | if (dir != null && dir.isDirectory()) {
29 | String[] children = dir.list();
30 | for (String aChildren : children) {
31 | boolean success = deleteDir(new File(dir, aChildren));
32 | if (!success) {
33 | return false;
34 | }
35 | }
36 | }
37 | assert dir != null;
38 | return dir.delete();
39 | }
40 |
41 | private static long getFolderSize(File file) {
42 | long size = 0;
43 | try {
44 | File[] fileList = file.listFiles();
45 | for (File aFileList : fileList) {
46 | // 如果下面还有文件
47 | if (aFileList.isDirectory()) {
48 | size = size + getFolderSize(aFileList);
49 | } else {
50 | size = size + aFileList.length();
51 | }
52 | }
53 | } catch (Exception e) {
54 | e.printStackTrace();
55 | }
56 | return size;
57 | }
58 | private static String getFormatSize(double size) {
59 | double kiloByte = size / 1024;
60 | if (kiloByte < 1) {
61 | return "0K";
62 | }
63 |
64 | double megaByte = kiloByte / 1024;
65 | if (megaByte < 1) {
66 | BigDecimal result1 = new BigDecimal(Double.toString(kiloByte));
67 | return result1.setScale(2, BigDecimal.ROUND_HALF_UP)
68 | .toPlainString() + "KB";
69 | }
70 |
71 | double gigaByte = megaByte / 1024;
72 | if (gigaByte < 1) {
73 | BigDecimal result2 = new BigDecimal(Double.toString(megaByte));
74 | return result2.setScale(2, BigDecimal.ROUND_HALF_UP)
75 | .toPlainString() + "MB";
76 | }
77 |
78 | double teraBytes = gigaByte / 1024;
79 | if (teraBytes < 1) {
80 | BigDecimal result3 = new BigDecimal(Double.toString(gigaByte));
81 | return result3.setScale(2, BigDecimal.ROUND_HALF_UP)
82 | .toPlainString() + "GB";
83 | }
84 | BigDecimal result4 = new BigDecimal(teraBytes);
85 | return result4.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString()
86 | + "TB";
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/Constants.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | /**
4 | * Created by ChinaLHR on 2016/12/13.
5 | * Email:13435500980@163.com
6 | */
7 |
8 | public class Constants {
9 | public static final String MOVIE = "电影";
10 | public static final String BOOK = "图书";
11 | public static final String LIST = "电影榜单";
12 | public static final String COLLECTION = "我的收藏";
13 | public static final String CHANGESECTION = "更改标签";
14 | public static final String SETTING = "设置";
15 | public static boolean CHANGELABEL_MOVIE = false;
16 | public static boolean CHANGELABEL_BOOK = false;
17 | public static String[] MOVIETITLE = {"爱情", "喜剧", "动画", "科幻", "动作", "经典"};
18 |
19 | public static String[] BOOKTITLE = {"小说", "名著", "科幻", "历史", "爱情", "编程"};
20 |
21 | public static String[] LEADERBOARD = {"正在热映", "即将上映", "Top250"};
22 | public static String[] ALLMOVIE = {
23 | "爱情", "喜剧", "动画", "剧情",
24 | "科幻", "动作", "经典", "悬疑",
25 | "青春", "犯罪", "惊悚", "文艺",
26 | "搞笑", "纪录片", "励志", "恐怖",
27 | "战争", "短片", "黑色幽默", "魔幻",
28 | "传记", "情色", "感人", "暴力",
29 | "动画", "短片家庭", "音乐", "童年",
30 | "浪漫", "黑帮", "女性", "同志",
31 | "史诗", "童话", "烂片", "cult"
32 | };
33 |
34 | public static String[] ALLBOOK = {
35 | "小说", "日本", "历史", "外国文学",
36 | "漫画", "文学", "中国", "心理学",
37 | "随笔", "哲学", "绘本", "中国文学",
38 | "推理", "美国", "爱情", "经典 ",
39 | "传记", "日本文学", "散文", "文化",
40 | "青春", "旅行", "社会学", "英国",
41 | "言情", "科幻", "科普", "生活 ",
42 | "东野圭吾", "村上春树", "艺术", "悬疑",
43 | "成长", "台湾", "经济学", "设计",
44 | "管理", "励志", "法国", "武侠",
45 | "社会", "政治", "思维", "心理",
46 | "奇幻", "经济", "诗歌", "童话",
47 | "韩寒", "摄影", "日本漫画", "建筑",
48 | "耽美", "商业", "亦舒", "金融",
49 | "女性", "宗教", "电影", "人生", "编程",
50 | "杂文", "互联网", "王小波", "三毛 ",
51 | "英国文学", "儿童文学", "计算机", "古典文学 ",
52 | "数学", "投资", "推理小说", "网络小说",
53 | "职场", "张爱玲", "安妮宝贝", "政治学",
54 | "美国文学", "名著", "香港", "余华",
55 | "美食", "教育", "郭敬明", "穿越",
56 | "个人管理", "金庸", "工具书", "德国 ",
57 |
58 | };
59 | /**
60 | * KEY
61 | */
62 | public static String MOVIEKEY = "moviekey";
63 | public static String BOOKKEY = "bookkey";
64 | public static String NAVKEY = "navkey";
65 |
66 | /**
67 | * SP key
68 | */
69 | public static String PREF_KEY_THEME = "pref_key_theme";
70 | public static String PREF_KEY_AUTO_IMG = "pref_key_auto_img";
71 | public static String PREF_KEY_CACHE = "pref_key_cache";
72 | public static String PREF_KEY_CODE = "pref_key_code";
73 | public static String PREF_KEY_PROTOCOL = "pref_key_protocol";
74 | public static String PREF_KEY_FEEDBACK = "pref_key_feedback";
75 |
76 | /**
77 | * Collect
78 | */
79 | public static String[] COLLECTION_TYPE = {"电影","图书","影人"};
80 | }
81 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/ImageUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import android.graphics.Bitmap;
4 | import android.support.v7.graphics.Palette;
5 |
6 | import com.lhr.jiandou.MyApplication;
7 | import com.lhr.jiandou.R;
8 |
9 | /**
10 | * Created by ChinaLHR on 2016/12/19.
11 | * Email:13435500980@163.com
12 | */
13 |
14 | public class ImageUtils {
15 |
16 | /**
17 | * 根据bitmap提取颜色
18 | *
19 | * @param bitmap
20 | * @return
21 | */
22 | public static int getColor(Bitmap bitmap) {
23 | if (bitmap != null) {
24 | Palette p = Palette.from(bitmap).generate();
25 | Palette.Swatch s_dm = p.getDarkMutedSwatch();
26 | Palette.Swatch s_dv = p.getDarkVibrantSwatch();
27 | if (s_dm != null) {
28 | return s_dm.getRgb();
29 | } else {
30 | if (s_dv != null) {
31 | return s_dv.getRgb();
32 | } else {
33 | return UIUtils.getColor(MyApplication.getContext(), R.color.colorPrimary);
34 | }
35 | }
36 | } else {
37 | return UIUtils.getColor(MyApplication.getContext(), R.color.colorPrimary);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/LogUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import android.util.Log;
4 |
5 | /**
6 | * Created by ChinaLHR on 2016/12/13.
7 | * Email:13435500980@163.com
8 | */
9 |
10 | public class LogUtils {
11 | private LogUtils()
12 | {
13 | throw new UnsupportedOperationException("cannot be instantiated");
14 | }
15 | // 是否需要打印bug,可以在application的onCreate函数里面初始化
16 | public static boolean isDebug = true;
17 | private static final String TAG = "ChinaLHR";
18 |
19 | // 下面四个是默认tag的函数
20 | public static void i(String msg)
21 | {
22 | if (isDebug)
23 | Log.i(TAG, msg);
24 | }
25 |
26 | public static void d(String msg)
27 | {
28 | if (isDebug)
29 | Log.d(TAG, msg);
30 | }
31 |
32 | public static void e(String msg)
33 | {
34 | if (isDebug)
35 | Log.e(TAG, msg);
36 | }
37 |
38 | public static void v(String msg)
39 | {
40 | if (isDebug)
41 | Log.v(TAG, msg);
42 | }
43 |
44 | // 下面是传入自定义tag的函数
45 | public static void i(String tag, String msg)
46 | {
47 | if (isDebug)
48 | Log.i(tag, msg);
49 | }
50 |
51 | public static void d(String tag, String msg)
52 | {
53 | if (isDebug)
54 | Log.i(tag, msg);
55 | }
56 |
57 | public static void e(String tag, String msg)
58 | {
59 | if (isDebug)
60 | Log.i(tag, msg);
61 | }
62 |
63 | public static void v(String tag, String msg)
64 | {
65 | if (isDebug)
66 | Log.i(tag, msg);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/PreferncesUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 |
6 | /**
7 | * Created by ChinaLHR on 2017/1/1.
8 | * Email:13435500980@163.com
9 | */
10 |
11 | public class PreferncesUtils {
12 |
13 | private static SharedPreferences sp;
14 |
15 | private static final String Catch_file = "com.lhr.jiandou_preferences";
16 |
17 | public static String getString(Context ctx, String key, String defValue) {
18 | if (sp == null) {
19 | sp = ctx.getSharedPreferences(Catch_file, Context.MODE_PRIVATE);
20 | }
21 | return sp.getString(key, defValue);
22 | }
23 |
24 | public static Boolean getBoolean(Context ctx, String key, boolean defValue) {
25 | if (sp == null) {
26 | sp = ctx.getSharedPreferences(Catch_file, Context.MODE_PRIVATE);
27 | }
28 | return sp.getBoolean(key, defValue);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/SnackBarUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import android.support.design.widget.CoordinatorLayout;
4 | import android.support.design.widget.Snackbar;
5 | import android.view.View;
6 |
7 | /**
8 | * Created by ChinaLHR on 2016/12/19.
9 | * Email:13435500980@163.com
10 | */
11 |
12 | public class SnackBarUtils {
13 | public static Snackbar mSnackbar;
14 | public static void showSnackBar(View v, String str) {
15 |
16 | if (v instanceof CoordinatorLayout) {
17 | mSnackbar = Snackbar.make(v,str,Snackbar.LENGTH_SHORT).setAction("确定", new View.OnClickListener() {
18 | @Override
19 | public void onClick(View view) {
20 | mSnackbar.dismiss();
21 | }
22 | });
23 | mSnackbar.show();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/StringUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import android.support.annotation.NonNull;
4 | import android.widget.TextView;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * Created by ChinaLHR on 2016/12/25.
10 | * Email:13435500980@163.com
11 | */
12 |
13 | public class StringUtils {
14 |
15 | public static void addViewString(List list, TextView view) {
16 | for (int i = 0; i < list.size(); i++) {
17 | if (i == list.size() - 1) {
18 | view.append(list.get(i));
19 | } else {
20 | view.append(list.get(i) + "/");
21 | }
22 | }
23 | }
24 |
25 | @NonNull
26 | public static String SpliceString(List list) {
27 | StringBuilder sb = new StringBuilder();
28 | for (int i = 0; i < list.size(); i++) {
29 | if (i == list.size() - 1) {
30 | sb.append(list.get(i));
31 | } else {
32 | sb.append(list.get(i) + "/");
33 | }
34 | }
35 | return sb.toString();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/ToastUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.TextView;
7 | import android.widget.Toast;
8 |
9 | import com.lhr.jiandou.R;
10 |
11 | /**
12 | * Created by ChinaLHR on 2016/12/13.
13 | * Email:13435500980@163.com
14 | */
15 |
16 | public class ToastUtils {
17 |
18 | private ToastUtils() {
19 | throw new UnsupportedOperationException("cannot be instantiated");
20 | }
21 |
22 | public static boolean isShow = true;
23 | public static Toast toast = null;
24 |
25 | /**
26 | * 显示Toast
27 | *
28 | * @param context
29 | * @param message
30 | */
31 | public static void show(Context context, String message) {
32 | if (isShow) {
33 | toast = new Toast(context);
34 | LayoutInflater inflater = LayoutInflater.from(context);
35 | View view = inflater.inflate(R.layout.mtoast_layout, null);
36 | TextView tv = (TextView) view.findViewById(R.id.toast_tv);
37 | if (message != null) {
38 | tv.setText(message);
39 | }
40 | toast.setView(view);
41 | toast.setDuration(Toast.LENGTH_SHORT);
42 | toast.show();
43 | }
44 | }
45 |
46 | public static void cancel() {
47 | if (toast != null) {
48 | toast.cancel();
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/UIUtils.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils;
2 |
3 | import android.content.Context;
4 | import android.content.res.ColorStateList;
5 | import android.graphics.drawable.Drawable;
6 |
7 | /**
8 | * Created by ChinaLHR on 2016/12/13.
9 | * Email:13435500980@163.com
10 | */
11 |
12 | public class UIUtils {
13 |
14 |
15 | /**
16 | * 加载资源文件===================
17 | */
18 | // 获取字符串
19 | public static String getString(Context context,int id) {
20 | return context.getResources().getString(id);
21 | }
22 |
23 | // 获取字符串数组
24 | public static String[] getStringArray(Context context,int id) {
25 | return context.getResources().getStringArray(id);
26 | }
27 |
28 | // 获取图片
29 | public static Drawable getDrawable(Context context,int id) {
30 | return context.getResources().getDrawable(id);
31 | }
32 |
33 | // 获取颜色
34 | public static int getColor(Context context,int id) {
35 | return context.getResources().getColor(id);
36 | }
37 |
38 | // 根据id获取颜色的状态选择器
39 | public static ColorStateList getColorStateList(Context context,int id) {
40 | return context.getResources().getColorStateList(id);
41 | }
42 |
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/jsoupUtils/GetActor.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils.jsoupUtils;
2 |
3 | import org.jsoup.Jsoup;
4 | import org.jsoup.nodes.Document;
5 | import org.jsoup.select.Elements;
6 |
7 | import java.io.IOException;
8 | import java.util.ArrayList;
9 | import java.util.List;
10 | import java.util.regex.Matcher;
11 | import java.util.regex.Pattern;
12 |
13 | /**
14 | * Created by ChinaLHR on 2016/12/22.
15 | * Email:13435500980@163.com
16 | */
17 |
18 | public class GetActor {
19 | public String url = "https://movie.douban.com/celebrity/";
20 | public Document doc;
21 |
22 | public GetActor(String id) {
23 | try {
24 | url = url + id + "/";
25 | doc = Jsoup.connect(url).get();
26 | } catch (IOException e) {
27 | e.printStackTrace();
28 | }
29 | }
30 |
31 | /**
32 | * 获取影人图片
33 | *
34 | * @return
35 | */
36 | public List getActorImage() {
37 | List list = new ArrayList<>();
38 | String text;
39 | Pattern pattern = Pattern
40 | .compile("[http|https]+[://]+[0-9A-Za-z:/[-]_#[?][=][.][&]]*");
41 | Elements select = doc.select("[class=pic-col5]");
42 | Elements elements = select.select("img[src$=.jpg]");
43 | for (int i = 0; i < elements.size(); i++) {
44 | text = elements.get(i).toString();
45 | Matcher matcher = pattern.matcher(text);
46 | while (matcher.find()) {
47 | list.add(matcher.group());
48 | }
49 | }
50 | return list;
51 | }
52 |
53 | /**
54 | * 获得影人简介
55 | */
56 | public String getActorSummary() {
57 | String text;
58 | Elements select = doc.select("div.bd");
59 | Elements selecthid = doc.select("[class=all hidden]");
60 | if (selecthid.text().trim()!=null&&!selecthid.text().trim().equals("")){
61 | text = doc.select("[class=all hidden]").text();
62 | }else{
63 | text = select.get(1).text();
64 | }
65 | return text;
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/jsoupUtils/GetLikeMovie.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils.jsoupUtils;
2 |
3 |
4 | import org.jsoup.Jsoup;
5 | import org.jsoup.nodes.Document;
6 | import org.jsoup.select.Elements;
7 |
8 | import java.io.IOException;
9 | import java.util.ArrayList;
10 | import java.util.List;
11 | import java.util.regex.Matcher;
12 | import java.util.regex.Pattern;
13 |
14 | /**
15 | * Created by ChinaLHR on 2016/12/20.
16 | * Email:13435500980@163.com
17 | */
18 |
19 | public class GetLikeMovie {
20 | public String url = "https://movie.douban.com/subject/";
21 | public Document doc;
22 |
23 | public GetLikeMovie(String id) {
24 | try {
25 | url = url + id + "/";
26 | doc = Jsoup.connect(url).get();
27 | } catch (IOException e) {
28 | // TODO Auto-generated catch block
29 | e.printStackTrace();
30 | }
31 | }
32 |
33 | /**
34 | * 获得相关电源的id
35 | *
36 | * @return
37 | */
38 | public List getmovieId() {
39 | List list = new ArrayList<>();
40 | // 获取id
41 | Elements select = doc.select("[class=recommendations-bd] dd");
42 | Elements link = select.select("a");
43 | for (int i = 0; i < link.size(); i++) {
44 | String movieId = link.get(i).toString().replaceAll("[^(0-9)]", "");
45 |
46 | list.add(movieId);
47 |
48 | }
49 |
50 | return list;
51 |
52 | }
53 |
54 | /**
55 | * 获取相关电源的img链接
56 | *
57 | * @return
58 | */
59 | public List getmovieimg() {
60 | List list = new ArrayList<>();
61 | Pattern pattern = Pattern
62 | .compile("[http|https]+[://]+[0-9A-Za-z:/[-]_#[?][=][.][&]]*");
63 | Elements select = doc.select("[class=recommendations-bd]");
64 | Elements img = select.select("img[src$=.jpg]");
65 |
66 | for (int i = 0; i < img.size(); i++) {
67 | Matcher matcher = pattern.matcher(img.get(i).toString());
68 | while (matcher.find()) {
69 | list.add(matcher.group());
70 | }
71 | }
72 |
73 | return list;
74 | }
75 |
76 | /**
77 | * 获取电影的title
78 | *
79 | * @return
80 | */
81 | public List getMovieTitle() {
82 | List list = new ArrayList<>();
83 | Elements select = doc.select("[class=recommendations-bd]");
84 | Elements title = select.select("dd a[href]");
85 | for (int i = 0; i < title.size(); i++) {
86 | list.add(title.get(i).text());
87 | }
88 |
89 | return list;
90 | }
91 | }
92 |
93 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/jsoupUtils/GetNavImage.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils.jsoupUtils;
2 |
3 | import org.jsoup.Jsoup;
4 | import org.jsoup.nodes.Document;
5 | import org.jsoup.select.Elements;
6 |
7 | import java.io.IOException;
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | public class GetNavImage {
12 | private String url = "http://www.bjp.org.cn/col/col89/index.html";
13 | private String defulturl = "http://www.bjp.org.cn";
14 | private Document doc;
15 |
16 | public GetNavImage() {
17 | try {
18 | doc = Jsoup.connect(url).get();
19 | } catch (IOException e) {
20 | e.printStackTrace();
21 | }
22 | }
23 |
24 | public List getImage() {
25 | List mList = new ArrayList<>();
26 | if (doc != null) {
27 | Elements s1 = doc.select("td");
28 | Elements s2 = s1.select("b");
29 | Elements s3 = s2.select("a");
30 | //获取每日一图的描述
31 | if (!s3.get(0).text().trim().equals("")) {
32 | mList.add(s3.get(0).text());
33 | }
34 | // 获取到每日一图的html文件
35 | String html = defulturl + s3.get(0).attr("href");
36 | try {
37 | doc = Jsoup.connect(html).get();
38 | if (doc != null) {
39 | Elements s4 = doc.select("[id=oneday]");
40 | Elements s5 = s4.select("a");
41 | String imageUrl = defulturl + s5.attr("href");
42 | if (!imageUrl.trim().equals("")) {
43 | mList.add(imageUrl);
44 | }
45 | return mList;
46 | }
47 | } catch (IOException e) {
48 | e.printStackTrace();
49 | return mList;
50 | }
51 | }
52 | return mList;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/utils/jsoupUtils/GetVPImage.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.utils.jsoupUtils;
2 |
3 | import org.jsoup.Jsoup;
4 | import org.jsoup.nodes.Document;
5 | import org.jsoup.select.Elements;
6 |
7 | import java.io.IOException;
8 | import java.util.ArrayList;
9 | import java.util.List;
10 | import java.util.regex.Matcher;
11 | import java.util.regex.Pattern;
12 |
13 | /**
14 | * Created by ChinaLHR on 2016/12/29.
15 | * Email:13435500980@163.com
16 | */
17 |
18 | public class GetVPImage {
19 | private String url = "http://www.mtime.com/";
20 | private Document doc;
21 |
22 | public GetVPImage() {
23 | try {
24 | doc = Jsoup.connect(url).get();
25 | } catch (IOException e) {
26 | e.printStackTrace();
27 | }
28 | }
29 |
30 | public List getImage() {
31 | List mList = new ArrayList<>();
32 | Pattern pattern = Pattern
33 | .compile("[http|https]+[://]+[0-9A-Za-z:/[-]_#[?][=][.][&]]*");
34 | if (doc != null) {
35 | if (doc != null) {
36 | Elements s1 = doc.select("[id = indexTopSlide]");
37 | Elements s2 = s1.select("dl");
38 | Elements s3 = s2.select("dd");
39 | Elements s4 = s3.select("div");
40 | for (int i = 0; i < s4.size(); i++) {
41 | Matcher matcher = pattern.matcher(s4.get(i).attr("style"));
42 | while (matcher.find()) {
43 | mList.add(matcher.group());
44 | }
45 | }
46 | return mList;
47 | } else {
48 | return mList;
49 | }
50 |
51 | } else {
52 | return null;
53 | }
54 | }
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/view/NoScrollViewPager.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.view;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 |
8 | /**
9 | * Created by ChinaLHR on 2016/12/23.
10 | * Email:13435500980@163.com
11 | */
12 |
13 | public class NoScrollViewPager extends ViewPager {
14 | private boolean isPagingEnabled = false;
15 |
16 | public NoScrollViewPager(Context context) {
17 | super(context);
18 | }
19 |
20 | public NoScrollViewPager(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | @Override
25 | public boolean onTouchEvent(MotionEvent event) {
26 | return this.isPagingEnabled && super.onTouchEvent(event);
27 | }
28 |
29 | @Override
30 | public boolean onInterceptTouchEvent(MotionEvent event) {
31 | return this.isPagingEnabled && super.onInterceptTouchEvent(event);
32 | }
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/view/ScrollAwareFABBehavior.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.view;
2 |
3 | import android.content.Context;
4 | import android.support.design.widget.CoordinatorLayout;
5 | import android.support.design.widget.FloatingActionButton;
6 | import android.support.v4.view.ViewCompat;
7 | import android.util.AttributeSet;
8 | import android.view.View;
9 |
10 | /**
11 | * Created by ChinaLHR on 2016/12/13.
12 | * Email:13435500980@163.com
13 | */
14 |
15 | public class ScrollAwareFABBehavior extends FloatingActionButton.Behavior {
16 |
17 | public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
18 | super();
19 | }
20 |
21 | /**
22 | * 处理垂直方向上的滚动事件
23 | */
24 | @Override
25 | public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionButton child,
26 | View directTargetChild, View target, int nestedScrollAxes) {
27 | return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL ||
28 | super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target,
29 | nestedScrollAxes);
30 | }
31 |
32 | /**
33 | * 检测Y的位置,并决定按钮动画是否进入或退出
34 | */
35 | @Override
36 | public void onNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionButton child, View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
37 | super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);
38 | if (dyConsumed > 0 && child.getVisibility() == View.VISIBLE) {
39 | // User scrolled down and the FAB is currently visible -> hide the FAB
40 | child.hide();
41 | } else if (dyConsumed < 0 && child.getVisibility() != View.VISIBLE) {
42 | child.show();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/view/animation/DepthPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.view.animation;
2 |
3 | import android.support.v4.view.ViewPager;
4 | import android.view.View;
5 |
6 | /**
7 | * Created by ChinaLHR on 2016/12/31.
8 | * Email:13435500980@163.com
9 | */
10 |
11 | public class DepthPageTransformer implements ViewPager.PageTransformer {
12 | private static final float MIN_SCALE = 0.75f;
13 |
14 | @Override
15 | public void transformPage(View page, float position) {
16 | int pageWidth = page.getWidth();
17 | float scaleFactor = MIN_SCALE
18 | + (1 - MIN_SCALE) * (1 - Math.abs(position));
19 | if (position < -1) {
20 | page.setAlpha(0);
21 | } else if (position <= 0) {
22 | page.setAlpha(1);
23 | page.setTranslationX(0);
24 | page.setScaleX(scaleFactor);
25 | page.setScaleY(scaleFactor);
26 | } else if (position <= 1) { // (0,1]
27 | page.setAlpha(1 - position);
28 | page.setTranslationX(pageWidth * -position);
29 | page.setScaleX(scaleFactor);
30 | page.setScaleY(scaleFactor);
31 |
32 | } else {
33 | page.setAlpha(0);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lhr/jiandou/view/mProgressdialog.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou.view;
2 |
3 | import android.app.ProgressDialog;
4 | import android.content.Context;
5 |
6 | /**
7 | * Created by ChinaLHR on 2016/12/17.
8 | * Email:13435500980@163.com
9 | */
10 |
11 | public class mProgressdialog {
12 | private ProgressDialog mProgressDialog;
13 |
14 | public static boolean isFirst = true;
15 |
16 | public void showProgressdialog(Context context) {
17 | if (isFirst) {
18 | isFirst = false;
19 | mProgressDialog = new ProgressDialog(context);
20 | mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
21 | mProgressDialog.setCancelable(false);
22 | mProgressDialog.show();
23 |
24 | }
25 | }
26 |
27 | public void cancelProgressdialog() {
28 | if (mProgressDialog!=null){
29 | mProgressDialog.cancel();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_channel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_channel_n.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_channel_p.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/collection_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/collection_false.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/drawable/collection_false.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/collection_true.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/drawable/collection_true.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_back_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_cancel_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_chevron_right_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_dehaze_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_fab_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/drawable/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_movie_toweb_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_webview_close_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_webview_go_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_webview_refresh_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_webview_to_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/myratingbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
10 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/nav_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/drawable/nav_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/drawable/search_book.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_close_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/drawable/search_movie.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_open_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_bg_point.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_bg_point_disable.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_bg_point_enable.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tab_actor_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tab_book_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tab_movie_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/toast_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
21 |
22 |
33 |
34 |
35 |
36 |
39 |
43 |
50 |
51 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_webview.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
25 |
28 |
32 |
40 |
46 |
52 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
19 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_changelabel.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_collection.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
13 |
14 |
19 |
20 |
21 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_leaderboard.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
18 |
28 |
29 |
30 |
31 |
36 |
37 |
47 |
48 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_movie.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
19 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/include_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
25 |
26 |
27 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_actor.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
28 |
29 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_actor_movie.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
20 |
21 |
33 |
34 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_basepager.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
21 |
22 |
29 |
30 |
34 |
35 |
42 |
43 |
50 |
51 |
57 |
58 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
17 |
18 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_likemovie.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_my_label_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
24 |
25 |
37 |
38 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_mylabel.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_other_label_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_otherlabel.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_spinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/mtoast_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
20 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pagefragment_collection.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pagefragment_leaderboard.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pagefragment_top250.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
19 |
20 |
28 |
29 |
30 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pagerfragment_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pagerfragment_labelm.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/preference_category_widget.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/preference_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
17 |
18 |
28 |
29 |
36 |
37 |
38 |
39 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_moviedetails_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/nav_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/Collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/Collection.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/books.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/books.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/jb_ico.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/jb_ico.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/label.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/label.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/list.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/movie.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/rb1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/rb1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/rb2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/rb2.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/rb3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/rb3.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/search.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/setting.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/toast_ico.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-hdpi/toast_ico.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_channel_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-xhdpi/ic_channel_edit.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - 白天
5 | - 夜间
6 |
7 |
8 |
9 | - 1
10 | - 2
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #009688
4 | #004d40
5 | #ff9800
6 | #ffffff
7 | #121212
8 | #00bfa5
9 |
10 | #77424242
11 | #ffffff
12 |
13 | #757575
14 | #77C2C2C2
15 |
16 | #9c9c9c
17 | #DDDDDD
18 | #ef4836
19 |
20 | #212121
21 | #000000
22 | #e65600
23 |
24 | #77eaeaea
25 |
26 |
27 | #ffffff
28 | #8bc64a
29 | #cddc39
30 |
31 |
32 | #E5E5E5
33 | #838B83
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 简豆
5 | 电影
6 | 图书
7 | 电影榜单
8 | 我的收藏
9 | 系统
10 | 更改标签
11 | 设置
12 |
13 | 加载出错
14 |
15 | 更多
16 | 收起
17 | 电影类型:
18 | 上映国家:
19 | 上映时间:
20 | 原名:
21 | 简介
22 | 影人
23 | 人评价
24 | 影人
25 | 喜欢这部电影的人也喜欢...
26 | 加载失败...
27 | 加载中...
28 |
29 |
30 | 暂时没有简介...
31 | 个人简介
32 | 代表作品
33 | 性别:
34 | 出生地:
35 |
36 |
37 | 作者:
38 | 出版社:
39 | 副标题:
40 | 页数:
41 | 作者简介
42 | 目录/试读
43 | 喜欢读这本书的人也喜欢...
44 |
45 |
46 |
47 | 长按编辑,点击删添,拖拽排序
48 | 我的标签
49 | 其他标签
50 | 编辑
51 | 完成
52 |
53 |
54 | 收藏成功!
55 | 收藏失败!
56 | 取消收藏成功!
57 | 取消收藏失败!
58 |
59 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
29 |
30 |
31 |
37 |
38 |
44 |
45 |
46 |
49 |
50 |
60 |
61 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/bottombar_tabs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
15 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
16 |
24 |
25 |
26 |
27 |
31 |
36 |
37 |
38 |
42 |
48 |
51 |
52 |
58 |
64 |
65 |
--------------------------------------------------------------------------------
/app/src/test/java/com/lhr/jiandou/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.lhr.jiandou;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app_display_apk/JianDou1.2.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_apk/JianDou1.2.apk
--------------------------------------------------------------------------------
/app_display_jpg/p1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p1.jpg
--------------------------------------------------------------------------------
/app_display_jpg/p2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p2.jpg
--------------------------------------------------------------------------------
/app_display_jpg/p3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p3.jpg
--------------------------------------------------------------------------------
/app_display_jpg/p4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p4.jpg
--------------------------------------------------------------------------------
/app_display_jpg/p5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p5.jpg
--------------------------------------------------------------------------------
/app_display_jpg/p6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p6.jpg
--------------------------------------------------------------------------------
/app_display_jpg/p7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p7.jpg
--------------------------------------------------------------------------------
/app_display_jpg/p8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p8.jpg
--------------------------------------------------------------------------------
/app_display_jpg/p9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/app_display_jpg/p9.jpg
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.0'
9 | classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1'
10 | }
11 | }
12 |
13 | allprojects {
14 | repositories {
15 | jcenter()
16 | }
17 | }
18 |
19 | task clean(type: Delete) {
20 | delete rootProject.buildDir
21 | }
22 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m -XX:MaxPermSize=512m
13 | org.gradle.parallel=true
14 | org.gradle.daemon=true
15 |
16 | # When configured, Gradle will run in incubating parallel mode.
17 | # This option should only be used with decoupled projects. More details, visit
18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
19 | # org.gradle.parallel=true
20 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChinaLHR/JianDou/107f93ad09afcfb50c3e8dc69d79ad0bac52323e/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------