Java Code Examples for com.socks.jiandan.base.JDApplication

The following examples show how to use com.socks.jiandan.base.JDApplication. These examples are extracted from open source projects. 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
@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 2
Source Project: JianDan_OkHttpWithVolley   Source File: SisterCache.java    License: 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 3
Source Project: JianDan_OkHttpWithVolley   Source File: FreshNewsCache.java    License: 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 4
Source Project: JianDan_OkHttpWithVolley   Source File: VideoCache.java    License: 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 5
Source Project: JianDan_OkHttpWithVolley   Source File: PictureCache.java    License: 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 Project: JianDan_OkHttpWithVolley   Source File: JokeCache.java    License: 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 7
Source Project: JianDan   Source File: VideoDetailActivity.java    License: 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 8
Source Project: JianDan   Source File: SisterCache.java    License: 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 Project: JianDan   Source File: FreshNewsCache.java    License: 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 10
Source Project: JianDan   Source File: VideoCache.java    License: 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 11
Source Project: JianDan   Source File: PictureCache.java    License: 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 Project: JianDan   Source File: JokeCache.java    License: 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 Project: JianDan_OkHttp   Source File: VideoDetailActivity.java    License: 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 14
Source Project: JianDan_OkHttp   Source File: SisterCache.java    License: 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 15
Source Project: JianDan_OkHttp   Source File: FreshNewsCache.java    License: 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 Project: JianDan_OkHttp   Source File: VideoCache.java    License: 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 17
Source Project: JianDan_OkHttp   Source File: PictureCache.java    License: 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 18
Source Project: JianDan_OkHttp   Source File: JokeCache.java    License: 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 Project: JianDan_OkHttpWithVolley   Source File: ShowToast.java    License: 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 20
Source Project: JianDan_OkHttpWithVolley   Source File: ShowToast.java    License: 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 Project: JianDan   Source File: ShowToast.java    License: 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 Project: JianDan   Source File: ShowToast.java    License: 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 Project: JianDan_OkHttp   Source File: ShowToast.java    License: 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 Project: JianDan_OkHttp   Source File: ShowToast.java    License: 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 25
Source Project: JianDan_OkHttpWithVolley   Source File: TestClass.java    License: Apache License 2.0 2 votes vote down vote up
public void testGetCommentators() throws Exception {

		JDApplication.getContext();

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

		JDApplication.getContext();

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

		JDApplication.getContext();

	}