Electronic device for moving position of visual object located in folding area and method for controlling same
Electronic devices for moving a visual object located in a folding area and methods for controlling the same are provided. A foldable device according to an embodiment may include at least one sensor, a flexible display, and at least one processor. The at least one processor is configured to detect a folding angle of the foldable device by using the at least one sensor and detect that at least a part of a visual object is displayed in a folding area of the foldable device. In response to the detected folding angle being equal to or less than a predesignated angle, move, based on the displaying of the at least part of the visual object in the folding area, the visual object to an area other than the folding area and display the visual object in such area other than the folding area.
1 . A foldable device comprising:
at least one sensor configured to detect a folding angle of the foldable device;
memory storing instructions,
a flexible display, wherein the flexible display includes a folding area, a first area including an area above the folding area, and a second area including an area below the folding area, and
at least one processor,
wherein the instructions that, when executed by the at least one processor individually or collectively, cause the foldable device to:
detect, using the at least one sensor, the folding angle of the foldable device,
based on the folding angle being equal to or less than a predesignated angle, identify a display position where a visual object is displayed on a part of the first area of the flexible display or on a part of the second area of the flexible display by calculating a difference of Y values of the folding area and the visual object, wherein at least a part of the visual object is displayed in the folding area of the flexible display,
responsive to the visual object being displayed on the part of the first area of the flexible display, move and display the visual object in an upward direction such that a lower border of the visual object contacts with an upper border of the folding area by moving the visual object based on a value of the difference of the Y values, and
responsive to the visual object being displayed on the second area of the flexible display, move and display the visual object in a downward direction such that an upper border of the visual object contacts with a lower border of the folding area by moving the visual object based on summing a first Y value and a second Y value of the visual object to an absolute value of the difference of Y values of the folding area and the visual object.
2 . The foldable device of claim 1 , wherein the instructions cause the foldable device to determine whether the visual object is an object comprising an icon, a virtual button, a switch, or an interactional element.
3 . The foldable device of claim 1 , wherein instructions cause the foldable device to determine whether the visual object is a first type object displayed in a predesignated fixed position on the flexible display, or a second type object in which a display position of the visual object is changeable on the flexible display.
4 . The foldable device of claim 3 , wherein the instructions cause the foldable device to compare, when the visual object is determined to be the second type object, coordinates of the folding area with coordinates of the visual object to move the visual object positioned in at least a partial area of the folding area to a first area or a second area that is different than the folding area and display the visual object in the respective first area or second area.
5 . The foldable device of claim 1 , wherein the instructions cause the foldable device to move, when a user input for the visual object is detected and when the user input is released, the visual object to the area other than folding area and display the visual object in the area other than the folding area.
6 . The foldable device of claim 1 , wherein a size of the folding area is changed depending on a folding angle of the foldable device or a user's configuration.
7 . A method for controlling a foldable device, the method comprising:
detecting, using at least one sensor of the foldable device, a folding angle of the foldable device,
based on the folding angle being equal to or less than a predesignated angle, identifying a display position where a visual object is displayed on a part of a first area of a flexible display or on a part of a second area of the flexible display by calculating a difference of Y values of a folding area and the visual object, wherein at least a part of the visual object is displayed in the folding area of the flexible display,
responsive to the visual object being displayed on the part of the first area of the flexible display, moving and displaying the visual object in an upward direction such that a lower border of the visual object contacts with an upper border of the folding area by moving the visual object based on a value of the difference of the Y values, and
responsive to the visual object being displayed on the second area of the flexible display, moving and displaying the visual object in a downward direction such that an upper border of the visual object contacts with a lower border of the folding area by moving the visual object based on summing a first Y value and a second Y value of the visual object to an absolute value of the difference of Y values of the folding area and the visual object.
8 . The method of claim 7 , further comprising determining whether the visual object is an object comprising an icon, a virtual button, a switch, or an interactional element.
9 . The method of claim 7 , further comprising determining whether the visual object is a first type object displayed in a predesignated fixed position on the flexible display, or a second type object in which a display position of the visual object is changeable on the flexible display.
10 . The method of claim 9 , further comprising, in response to determining the visual object is the second type object, comparing coordinates of the folding area with coordinates of the visual object to move the visual object positioned at least a partial area of the folding area to a first area or a second area other than the folding area and display the visual object in the respective first area or second area.
11 . One or more non-transitory computer-readable storage media storing computer-executable instructions that, when executed by one or more processors of a foldable device individually or collectively, cause the foldable device to perform operations, the operations comprising:
detecting, using at least one sensor of the foldable device, a folding angle of the foldable device,
based on the folding angle being equal to or less than a predesignated angle, identifying a display position where a visual object is displayed on a part of a first area of a flexible display or on a part of a second area of the flexible display by calculating a difference of Y values of a folding area and the visual object, wherein at least a part of the visual object is displayed in the folding area of the flexible display,
responsive to the visual object being displayed on the part of the first area of the flexible display, moving and displaying the visual object in an upward direction such that a lower border of the visual object contacts with an upper border of the folding area by moving the visual object based on a value of the difference of the Y values, and
responsive to the visual object being displayed on the second area of the flexible display, moving and displaying the visual object in a downward direction such that an upper border of the visual object contacts with a lower border of the folding area by moving the visual object based on summing a first Y value and a second Y value of the visual object to an absolute value of the difference of Y values of the folding area and the visual object.