Skip to content

Support for menu-based zooming on non-touch screens#478

Open
amusergrieve wants to merge 1 commit intoGrapheneOS:mainfrom
amusergrieve:main
Open

Support for menu-based zooming on non-touch screens#478
amusergrieve wants to merge 1 commit intoGrapheneOS:mainfrom
amusergrieve:main

Conversation

@amusergrieve
Copy link
Copy Markdown

Using this on desktop mode has been painful for the eyes, because there is no zooming. This PR adds a menu item that allows zooming with a slider.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use Material Icons like the rest.

import kotlin.math.ln
import kotlin.math.pow

class SetZoomFragment(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fragments need to have a default constructor.

import android.content.DialogInterface
import android.os.Bundle
import android.view.Gravity
import android.widget.FrameLayout
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports.

private val mZoomLevelText: TextView by lazy { TextView(requireActivity()) }

private var mZoomFocusX: Float = 0.0f
public fun setZoomFocusX(value: Float) {mZoomFocusX = value}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall use Kotlin properties which have getters and setters.


override fun onSaveInstanceState(outState: Bundle) {
outState.putInt(STATE_SEEKBAR_CUR, mSeekBar.progress)
outState.putInt(STATE_SEEKBAR_MIN, mSeekBar.min)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mSeekBar.min is aways 0 and mSeekBar.max is always SEEKBAR_RESOLUTION.

}

private void zoom(float scaleFactor, float focusX, float focusY, boolean end) {
public void onZoomPage(float scaleFactor, float focusX, float focusY, boolean end) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the name change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants