From c707683656b9bd41984d5b11d28af0b5ef622976 Mon Sep 17 00:00:00 2001 From: limuyang Date: Mon, 6 Aug 2018 16:19:16 +0800 Subject: [PATCH] fix bug --- .../photolibrary/activity/LPhotoPickerPreviewActivity.kt | 2 +- .../limuyang2/photolibrary/fragment/LPreviewItemFragment.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/photolibrary/src/main/java/top/limuyang2/photolibrary/activity/LPhotoPickerPreviewActivity.kt b/photolibrary/src/main/java/top/limuyang2/photolibrary/activity/LPhotoPickerPreviewActivity.kt index f178b15..98beccb 100644 --- a/photolibrary/src/main/java/top/limuyang2/photolibrary/activity/LPhotoPickerPreviewActivity.kt +++ b/photolibrary/src/main/java/top/limuyang2/photolibrary/activity/LPhotoPickerPreviewActivity.kt @@ -39,7 +39,7 @@ class LPhotoPickerPreviewActivity : LBaseActivity() { override fun getThemeId(): Int = intent.getIntExtra(EXTRA_THEME, R.style.LPhotoTheme) override fun initView(savedInstanceState: Bundle?) { - window.setBackgroundDrawable(ColorDrawable(getColor(R.color.l_pp_photo_preview_bg))) + window.setBackgroundDrawable(ColorDrawable(resources.getColor(R.color.l_pp_photo_preview_bg))) initAttr() setStatusBar() checkBox.setChecked(true, false) diff --git a/photolibrary/src/main/java/top/limuyang2/photolibrary/fragment/LPreviewItemFragment.kt b/photolibrary/src/main/java/top/limuyang2/photolibrary/fragment/LPreviewItemFragment.kt index 3c69a11..e2bdc5d 100644 --- a/photolibrary/src/main/java/top/limuyang2/photolibrary/fragment/LPreviewItemFragment.kt +++ b/photolibrary/src/main/java/top/limuyang2/photolibrary/fragment/LPreviewItemFragment.kt @@ -41,11 +41,11 @@ class LPreviewItemFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) view.photoView.setOnPhotoTapListener { _, _, _ -> - if (System.currentTimeMillis() - mLastShowHiddenTime > 500) { + if (System.currentTimeMillis() - mLastShowHiddenTime > 300) { mLastShowHiddenTime = System.currentTimeMillis() - if (context is LPhotoPickerPreviewActivity) { - val activity = context as LPhotoPickerPreviewActivity + if (mContext is LPhotoPickerPreviewActivity) { + val activity = mContext as LPhotoPickerPreviewActivity activity.changeToolBar() } }