Skip to content

Commit 7cba7db

Browse files
fix: buttons rotation (#41)
* fix: buttons rotation * fix: add back shutter rotation --------- Co-authored-by: Naveen Singh <[email protected]> Co-authored-by: Naveen Singh <[email protected]>
1 parent 78972de commit 7cba7db

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

app/src/main/kotlin/org/fossify/camera/activities/MainActivity.kt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,15 +646,27 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
646646
private fun animateViews(degrees: Int) = binding.apply {
647647
val views = arrayOf(
648648
toggleCamera,
649+
layoutTop.toggleTimer,
649650
layoutTop.toggleFlash,
650651
layoutTop.changeResolution,
651652
shutter,
652653
layoutTop.settings,
653-
lastPhotoVideoPreview
654+
lastPhotoVideoPreview,
655+
layoutTimer.timerOff,
656+
layoutTimer.timer3s,
657+
layoutTimer.timer5s,
658+
layoutTimer.timer10S,
659+
layoutFlash.flashOff,
660+
layoutFlash.flashAuto,
661+
layoutFlash.flashOn,
662+
layoutFlash.flashAlwaysOn
654663
)
655664
for (view in views) {
656665
rotate(view, degrees)
657666
}
667+
mediaSizeToggleGroup?.children?.forEach { child ->
668+
rotate(child, degrees)
669+
}
658670
}
659671

660672
private fun rotate(view: View, degrees: Int) =
@@ -834,8 +846,15 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
834846
onSelect.invoke(index, selectedResolution.buttonViewId != clickedViewId)
835847
}
836848

849+
val currentDegrees = when (mLastHandledOrientation) {
850+
ORIENT_LANDSCAPE_LEFT -> 90
851+
ORIENT_LANDSCAPE_RIGHT -> -90
852+
else -> 0
853+
}
854+
837855
resolutions.forEach {
838856
val button = createButton(it, onItemClick)
857+
button.rotation = currentDegrees.toFloat()
839858
mediaSizeToggleGroup.addView(button)
840859
}
841860

0 commit comments

Comments
 (0)