Skip to content

Commit

Permalink
Fix klihnt check
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuwu committed Jun 2, 2024
1 parent 16e1a6f commit 970d0a0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import java.nio.file.Path
import javax.inject.Inject
import kotlin.system.measureTimeMillis


class GalleryUpliftFragment : Fragment() {
private val binding by viewBinding(FragmentGalleryBinding::bind)

Expand All @@ -83,7 +82,6 @@ class GalleryUpliftFragment : Fragment() {
private lateinit var stackedToasts: StackedToasts
private lateinit var pagerAdapter: PreviewsPagerUplift


override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
Expand All @@ -92,7 +90,6 @@ class GalleryUpliftFragment : Fragment() {
return inflater.inflate(R.layout.fragment_gallery, container, false)
}


override fun onDestroyView() {
super.onDestroyView()
scoreWidget.onDestroyView()
Expand Down Expand Up @@ -126,35 +123,29 @@ class GalleryUpliftFragment : Fragment() {
requireActivity().onBackPressedDispatcher.addCallback(this) {
onBackClick()
}


pagerAdapter = PreviewsPagerUplift(requireContext(), viewModel)

initViewPager()
scoreWidget.init(ScoreWidgetBinding.bind(binding.scoreWidget))

binding.apply {
val selectingEnabled =
requireArguments().getBoolean(GalleryFragment.SELECTING_ENABLED_KEY)
layoutSelected.isVisible = selectingEnabled
fabStartSelect.isVisible = !selectingEnabled

removeResourceFab.setOnClickListener {
Toast.makeText(
requireContext(),
"Press and hold to delete",
Toast.LENGTH_SHORT
).show()
}

removeResourceFab.setOnLongClickListener {
val time = measureTimeMillis {
viewModel.onRemoveFabClick()
}
Timber.tag(LogTags.GALLERY_SCREEN).d("${time / 1000L}s")
true
}

infoResourceFab.setOnClickListener {
viewModel.onInfoFabClick()
}
Expand Down Expand Up @@ -226,7 +217,6 @@ class GalleryUpliftFragment : Fragment() {
}
}


private fun render(state: GalleryState) {
setControlsVisibility(state.selectingEnabled)
}
Expand Down Expand Up @@ -296,7 +286,6 @@ class GalleryUpliftFragment : Fragment() {
}
}


private fun shareResource(resourcePath: Path) =
openIntentChooser(
resourcePath,
Expand Down Expand Up @@ -421,7 +410,6 @@ class GalleryUpliftFragment : Fragment() {
dialog.show(childFragmentManager, EditTagsDialogFragment.FRAGMENT_TAG)
}


@SuppressLint("ClickableViewAccessibility")
fun setProgressVisibility(isVisible: Boolean, withText: String) {
binding.layoutProgress.apply {
Expand Down Expand Up @@ -455,7 +443,6 @@ class GalleryUpliftFragment : Fragment() {
}
}


private fun displaySelected(
selected: Boolean,
showAnim: Boolean,
Expand Down Expand Up @@ -536,7 +523,6 @@ class GalleryUpliftFragment : Fragment() {
}
}


private fun initViewPager() = with(binding.viewPager) {
adapter = pagerAdapter
offscreenPageLimit = 2
Expand Down Expand Up @@ -594,7 +580,6 @@ class GalleryUpliftFragment : Fragment() {
startActivity(Intent.createChooser(intent, title))
}


private fun getExternalAppIntent(
resourcePath: Path,
actionType: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ class GalleryUpliftViewModel(
emptyList()
}


private fun invokeHandleGalleryExternalChangesUseCase() {
viewModelScope.launch {
intent {
Expand Down

0 comments on commit 970d0a0

Please sign in to comment.