Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
15157699
Commit
15157699
authored
Jan 08, 2025
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
横屏切换
parent
16592938
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
2 deletions
+108
-2
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+17
-0
YHOrderDetailViewController.swift
...服务中心)/OrderList(服务订单)/C/YHOrderDetailViewController.swift
+6
-0
YHLivePlayerViewController.swift
.../LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
+55
-2
Contents.json
...ive/live_play_interface_orientatio.imageset/Contents.json
+22
-0
live_play_interface_orientatio@2x.png
...orientatio.imageset/live_play_interface_orientatio@2x.png
+0
-0
live_play_interface_orientatio@3x.png
...orientatio.imageset/live_play_interface_orientatio@3x.png
+0
-0
Info.plist
galaxy/galaxy/Res/Info.plist
+8
-0
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
15157699
...
...
@@ -21,6 +21,19 @@ import HyphenateChat
@main
class
AppDelegate
:
UIResponder
,
UIApplicationDelegate
,
WXApiDelegate
{
var
blockRotation
:
UIInterfaceOrientationMask
=
.
portrait
{
didSet
{
if
blockRotation
.
contains
(
.
portrait
){
//强制设置成竖屏
UIDevice
.
current
.
setValue
(
UIInterfaceOrientation
.
portrait
.
rawValue
,
forKey
:
"orientation"
)
}
else
{
//强制设置成横屏
UIDevice
.
current
.
setValue
(
UIInterfaceOrientation
.
landscapeLeft
.
rawValue
,
forKey
:
"orientation"
)
}
}
}
var
window
:
UIWindow
?
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
...
...
@@ -140,6 +153,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
return
true
}
func
application
(
_
application
:
UIApplication
,
supportedInterfaceOrientationsFor
window
:
UIWindow
?)
->
UIInterfaceOrientationMask
{
return
.
all
}
func
application
(
_
app
:
UIApplication
,
open
url
:
URL
,
options
:
[
UIApplication
.
OpenURLOptionsKey
:
Any
]
=
[:])
->
Bool
{
if
let
host
=
url
.
host
,
host
.
contains
(
"platformId=wechat"
)
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/OrderList(服务订单)/C/YHOrderDetailViewController.swift
View file @
15157699
...
...
@@ -21,12 +21,18 @@ class YHOrderDetailViewController: YHBaseViewController {
view
.
backgroundColor
=
.
clear
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
setView
()
getWhiteList
()
getData
()
// Do any additional setup after loading the view.
let
appDelegate
=
UIApplication
.
shared
.
delegate
as!
AppDelegate
appDelegate
.
window
?
.
rootViewController
?
.
setNeedsStatusBarAppearanceUpdate
()
let
orientation
=
UIInterfaceOrientation
.
landscapeLeft
UIDevice
.
current
.
setValue
(
orientation
.
rawValue
,
forKey
:
"orientation"
)
}
func
getData
()
{
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
View file @
15157699
...
...
@@ -36,7 +36,10 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
private
var
isMessageListHidden
=
false
//默认展示
// MARK: - UI Components
override
var
supportedInterfaceOrientations
:
UIInterfaceOrientationMask
{
return
.
all
// 返回支持的方向
}
private
lazy
var
bottomInputBar
:
YHInputBottomBar
=
{
let
view
=
YHInputBottomBar
()
view
.
textViewTappedEvent
=
{
[
weak
self
]
in
...
...
@@ -116,6 +119,12 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
return
button
}()
private
lazy
var
playButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setImage
(
UIImage
(
named
:
"live_play_interface_orientatio"
),
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
playeButtonClicked
)
,
for
:
.
touchUpInside
)
return
button
}()
// MARK: - Initialization
init
(
id
:
Int
,
url
:
String
?
=
nil
,
title
:
String
?
=
nil
,
roomId
:
String
?
=
nil
)
{
...
...
@@ -189,6 +198,7 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
containerView
.
addSubview
(
messageListView
)
containerView
.
addSubview
(
messageListStateButton
)
containerView
.
addSubview
(
closeButton
)
containerView
.
addSubview
(
playButton
)
bottomImageView
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
}
...
...
@@ -215,7 +225,13 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
make
.
right
.
equalToSuperview
()
.
offset
(
-
12
)
make
.
width
.
height
.
equalTo
(
32
)
}
playButton
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
width
.
height
.
equalTo
(
44
)
}
topBarView
.
closeButtonClickEvent
=
{
[
weak
self
]
in
self
?
.
closeLive
()
}
...
...
@@ -905,6 +921,43 @@ extension YHLivePlayerViewController {
closeLive
()
}
//切换横屏
@objc
private
func
playeButtonClicked
()
{
guard
let
windowScene
=
view
.
window
?
.
windowScene
else
{
return
}
// 判断当前方向并确定新的方向
let
newOrientation
:
UIInterfaceOrientation
if
windowScene
.
interfaceOrientation
.
isLandscape
{
newOrientation
=
.
portrait
}
else
{
newOrientation
=
.
landscapeRight
}
// 请求几何更新
let
orientationMask
:
UIInterfaceOrientationMask
=
newOrientation
==
.
portrait
?
.
portrait
:
.
landscape
if
newOrientation
==
.
portrait
{
bottomInputBar
.
isHidden
=
false
messageListView
.
isHidden
=
false
messageListStateButton
.
isHidden
=
false
closeButton
.
isHidden
=
false
topBarView
.
isHidden
=
false
}
else
{
bottomInputBar
.
isHidden
=
true
messageListView
.
isHidden
=
true
messageListStateButton
.
isHidden
=
true
closeButton
.
isHidden
=
true
topBarView
.
isHidden
=
true
}
if
#available(iOS 16.0, *)
{
windowScene
.
requestGeometryUpdate
(
.
iOS
(
interfaceOrientations
:
orientationMask
))
}
else
{
}
}
@objc
private
func
handlePanGesture
(
_
gesture
:
UIPanGestureRecognizer
)
{
let
translation
=
gesture
.
translation
(
in
:
view
)
...
...
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_play_interface_orientatio.imageset/Contents.json
0 → 100644
View file @
15157699
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"live_play_interface_orientatio@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"live_play_interface_orientatio@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_play_interface_orientatio.imageset/live_play_interface_orientatio@2x.png
0 → 100644
View file @
15157699
2.01 KB
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_play_interface_orientatio.imageset/live_play_interface_orientatio@3x.png
0 → 100644
View file @
15157699
3.03 KB
galaxy/galaxy/Res/Info.plist
View file @
15157699
...
...
@@ -2,6 +2,14 @@
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
UIViewControllerBasedStatusBarAppearance
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
agc_applinking_not_read_pasteboard
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
CFBundleDocumentTypes
<
/k
e
y
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment