com.socks.jiandan.base.JDApplication Java Examples

The following examples show how to use com.socks.jiandan.base.JDApplication. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VideoCache.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
public static VideoCache getInstance(Context context) {

        if (instance == null) {

            synchronized (VideoCache.class) {
                if (instance == null) {
                    instance = new VideoCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mVideoCacheDao = mDaoSession.getVideoCacheDao();
        }
        return instance;
    }
 
Example #2
Source File: VideoDetailActivity.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case android.R.id.home:
            finish();
            return true;
        case R.id.action_more:
            new MaterialDialog.Builder(this)
                    .items(R.array.video_more)
                    .backgroundColor(getResources().getColor(JDApplication.COLOR_OF_DIALOG))
                    .contentColor(JDApplication.COLOR_OF_DIALOG_CONTENT)
                    .itemsCallback(new MaterialDialog.ListCallback() {
                        @Override
                        public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
                            switch (which) {
                                //分享
                                case 0:
                                    ShareUtil.shareText(VideoDetailActivity.this, mToolbar.getTitle() + " " + url);
                                    break;
                                //复制
                                case 1:
                                    TextUtil.copy(VideoDetailActivity.this, url);
                                    break;
                                //浏览器打开
                                case 2:
                                    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
                                    break;
                            }
                        }
                    }).show();
            return true;
    }

    return super.onOptionsItemSelected(item);
}
 
Example #3
Source File: SisterCache.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
public static SisterCache getInstance(Context context) {

		if (instance == null) {

			synchronized (SisterCache.class) {
				if (instance == null) {
					instance = new SisterCache();
				}
			}

			mDaoSession = JDApplication.getDaoSession(context);
			mPictureCacheDao = mDaoSession.getSisterCacheDao();
		}
		return instance;
	}
 
Example #4
Source File: JokeCache.java    From JianDan with Apache License 2.0 5 votes vote down vote up
public static JokeCache getInstance(Context context) {

        if (instance == null) {

            synchronized (JokeCache.class) {
                if (instance == null) {
                    instance = new JokeCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mJokeCacheDao = mDaoSession.getJokeCacheDao();
        }
        return instance;
    }
 
Example #5
Source File: PictureCache.java    From JianDan with Apache License 2.0 5 votes vote down vote up
public static PictureCache getInstance(Context context) {

		if (instance == null) {

			synchronized (PictureCache.class) {
				if (instance == null) {
					instance = new PictureCache();
				}
			}

			mDaoSession = JDApplication.getDaoSession(context);
			mPictureCacheDao = mDaoSession.getPictureCacheDao();
		}
		return instance;
	}
 
Example #6
Source File: VideoCache.java    From JianDan with Apache License 2.0 5 votes vote down vote up
public static VideoCache getInstance(Context context) {

        if (instance == null) {

            synchronized (VideoCache.class) {
                if (instance == null) {
                    instance = new VideoCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mVideoCacheDao = mDaoSession.getVideoCacheDao();
        }
        return instance;
    }
 
Example #7
Source File: FreshNewsCache.java    From JianDan with Apache License 2.0 5 votes vote down vote up
public static FreshNewsCache getInstance(Context context) {

        if (instance == null) {

            synchronized (FreshNewsCache.class) {
                if (instance == null) {
                    instance = new FreshNewsCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mFreshNewsCacheDao = mDaoSession.getFreshNewsCacheDao();
        }
        return instance;
    }
 
Example #8
Source File: SisterCache.java    From JianDan with Apache License 2.0 5 votes vote down vote up
public static SisterCache getInstance(Context context) {

		if (instance == null) {

			synchronized (SisterCache.class) {
				if (instance == null) {
					instance = new SisterCache();
				}
			}

			mDaoSession = JDApplication.getDaoSession(context);
			mPictureCacheDao = mDaoSession.getSisterCacheDao();
		}
		return instance;
	}
 
Example #9
Source File: VideoDetailActivity.java    From JianDan with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case android.R.id.home:
            finish();
            return true;
        case R.id.action_more:
            new MaterialDialog.Builder(this)
                    .items(R.array.video_more)
                    .backgroundColor(getResources().getColor(JDApplication.COLOR_OF_DIALOG))
                    .contentColor(JDApplication.COLOR_OF_DIALOG_CONTENT)
                    .itemsCallback(new MaterialDialog.ListCallback() {
                        @Override
                        public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
                            switch (which) {
                                //分享
                                case 0:
                                    ShareUtil.shareText(VideoDetailActivity.this, mToolbar.getTitle() + " " + url);
                                    break;
                                //复制
                                case 1:
                                    TextUtil.copy(VideoDetailActivity.this, url);
                                    break;
                                //浏览器打开
                                case 2:
                                    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
                                    break;
                            }
                        }
                    }).show();
            return true;
    }

    return super.onOptionsItemSelected(item);
}
 
Example #10
Source File: FreshNewsCache.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
public static FreshNewsCache getInstance(Context context) {

        if (instance == null) {

            synchronized (FreshNewsCache.class) {
                if (instance == null) {
                    instance = new FreshNewsCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mFreshNewsCacheDao = mDaoSession.getFreshNewsCacheDao();
        }
        return instance;
    }
 
Example #11
Source File: PictureCache.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
public static PictureCache getInstance(Context context) {

		if (instance == null) {

			synchronized (PictureCache.class) {
				if (instance == null) {
					instance = new PictureCache();
				}
			}

			mDaoSession = JDApplication.getDaoSession(context);
			mPictureCacheDao = mDaoSession.getPictureCacheDao();
		}
		return instance;
	}
 
Example #12
Source File: JokeCache.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
public static JokeCache getInstance(Context context) {

        if (instance == null) {

            synchronized (JokeCache.class) {
                if (instance == null) {
                    instance = new JokeCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mJokeCacheDao = mDaoSession.getJokeCacheDao();
        }
        return instance;
    }
 
Example #13
Source File: PictureCache.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
public static PictureCache getInstance(Context context) {

		if (instance == null) {

			synchronized (PictureCache.class) {
				if (instance == null) {
					instance = new PictureCache();
				}
			}

			mDaoSession = JDApplication.getDaoSession(context);
			mPictureCacheDao = mDaoSession.getPictureCacheDao();
		}
		return instance;
	}
 
Example #14
Source File: VideoCache.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
public static VideoCache getInstance(Context context) {

        if (instance == null) {

            synchronized (VideoCache.class) {
                if (instance == null) {
                    instance = new VideoCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mVideoCacheDao = mDaoSession.getVideoCacheDao();
        }
        return instance;
    }
 
Example #15
Source File: FreshNewsCache.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
public static FreshNewsCache getInstance(Context context) {

        if (instance == null) {

            synchronized (FreshNewsCache.class) {
                if (instance == null) {
                    instance = new FreshNewsCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mFreshNewsCacheDao = mDaoSession.getFreshNewsCacheDao();
        }
        return instance;
    }
 
Example #16
Source File: SisterCache.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
public static SisterCache getInstance(Context context) {

		if (instance == null) {

			synchronized (SisterCache.class) {
				if (instance == null) {
					instance = new SisterCache();
				}
			}

			mDaoSession = JDApplication.getDaoSession(context);
			mPictureCacheDao = mDaoSession.getSisterCacheDao();
		}
		return instance;
	}
 
Example #17
Source File: VideoDetailActivity.java    From JianDan_OkHttpWithVolley with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case android.R.id.home:
            finish();
            return true;
        case R.id.action_more:
            new MaterialDialog.Builder(this)
                    .items(R.array.video_more)
                    .backgroundColor(getResources().getColor(JDApplication.COLOR_OF_DIALOG))
                    .contentColor(JDApplication.COLOR_OF_DIALOG_CONTENT)
                    .itemsCallback(new MaterialDialog.ListCallback() {
                        @Override
                        public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
                            switch (which) {
                                //分享
                                case 0:
                                    ShareUtil.shareText(VideoDetailActivity.this, mToolbar.getTitle() + " " + url);
                                    break;
                                //复制
                                case 1:
                                    TextUtil.copy(VideoDetailActivity.this, url);
                                    break;
                                //浏览器打开
                                case 2:
                                    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
                                    break;
                            }
                        }
                    }).show();
            return true;
    }

    return super.onOptionsItemSelected(item);
}
 
Example #18
Source File: JokeCache.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
public static JokeCache getInstance(Context context) {

        if (instance == null) {

            synchronized (JokeCache.class) {
                if (instance == null) {
                    instance = new JokeCache();
                }
            }

            mDaoSession = JDApplication.getDaoSession(context);
            mJokeCacheDao = mDaoSession.getJokeCacheDao();
        }
        return instance;
    }
 
Example #19
Source File: ShowToast.java    From JianDan_OkHttpWithVolley with Apache License 2.0 4 votes vote down vote up
public static void Long(@NonNull CharSequence sequence) {
    Toast.makeText(JDApplication.getContext(), sequence, Toast.LENGTH_SHORT).show();
}
 
Example #20
Source File: ShowToast.java    From JianDan_OkHttp with Apache License 2.0 4 votes vote down vote up
public static void Long(@NonNull CharSequence sequence) {
    Toast.makeText(JDApplication.getContext(), sequence, Toast.LENGTH_SHORT).show();
}
 
Example #21
Source File: ShowToast.java    From JianDan_OkHttp with Apache License 2.0 4 votes vote down vote up
public static void Short(@NonNull CharSequence sequence) {
    Toast.makeText(JDApplication.getContext(), sequence, Toast.LENGTH_SHORT).show();
}
 
Example #22
Source File: ShowToast.java    From JianDan with Apache License 2.0 4 votes vote down vote up
public static void Long(@NonNull CharSequence sequence) {
    Toast.makeText(JDApplication.getContext(), sequence, Toast.LENGTH_SHORT).show();
}
 
Example #23
Source File: ShowToast.java    From JianDan with Apache License 2.0 4 votes vote down vote up
public static void Short(@NonNull CharSequence sequence) {
    Toast.makeText(JDApplication.getContext(), sequence, Toast.LENGTH_SHORT).show();
}
 
Example #24
Source File: ShowToast.java    From JianDan_OkHttpWithVolley with Apache License 2.0 4 votes vote down vote up
public static void Short(@NonNull CharSequence sequence) {
    Toast.makeText(JDApplication.getContext(), sequence, Toast.LENGTH_SHORT).show();
}
 
Example #25
Source File: TestClass.java    From JianDan with Apache License 2.0 2 votes vote down vote up
public void testGetCommentators() throws Exception {

		JDApplication.getContext();

	}
 
Example #26
Source File: TestClass.java    From JianDan_OkHttpWithVolley with Apache License 2.0 2 votes vote down vote up
public void testGetCommentators() throws Exception {

		JDApplication.getContext();

	}
 
Example #27
Source File: TestClass.java    From JianDan_OkHttp with Apache License 2.0 2 votes vote down vote up
public void testGetCommentators() throws Exception {

		JDApplication.getContext();

	}