Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppUms_Student
Overview
Overview
Details
Activity
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
tungnq
AppUms_Student
Commits
40431b8d
Commit
40431b8d
authored
Aug 12, 2025
by
tungnq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: Đã fix xong giao diện android
parent
1d341776
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
25 deletions
+11
-25
Header.js
src/components/Header/Header.js
+2
-2
view.js
src/screens/home/view.js
+9
-23
No files found.
src/components/Header/Header.js
View file @
40431b8d
...
...
@@ -23,7 +23,7 @@ const Header = props => {
return
(
<
SafeAreaView
style
=
{
styles
.
safeArea
}
>
<
StatusBar
barStyle
=
"light-content"
backgroundColor
=
{
R
.
colors
.
blue500
}
/
>
<
StatusBar
translucent
=
{
false
}
barStyle
=
"light-content"
backgroundColor
=
{
R
.
colors
.
blue500
}
/
>
<
View
style
=
{
styles
.
headerContainer
}
>
{
isSearch
&&
(
...
...
@@ -57,7 +57,7 @@ const styles = StyleSheet.create({
backgroundColor
:
R
.
colors
.
blue500
,
},
headerContainer
:
{
height
:
HEIGHT
(
3
0
),
height
:
HEIGHT
(
4
0
),
width
:
'100%'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
...
...
src/screens/home/view.js
View file @
40431b8d
...
...
@@ -33,20 +33,16 @@ const HomeView = (props) => {
onSearchChange
,
}
=
props
;
// OPTIMIZE: Move icon reference outside render để tránh re-create
const
ArrowRightIcon
=
R
.
images
.
icArrowRight
;
const
navigate
=
useNavigation
();
// PERFORMANCE: Memoized render function
const
renderMenuItem
=
React
.
useCallback
(({
item
})
=>
{
return
<
ItemGrid
item
=
{
item
}
onPress
=
{()
=>
onMenuItemPress
(
item
)}
/>
;
},
[
onMenuItemPress
]);
// UI/UX: Profile card component với null safety
const
renderProfileCard
=
()
=>
(
<
View
style
=
{
styles
.
profile_card
}
>
<
View
style
=
{
styles
.
profile_left
}
>
{
/* FEATURE: Avatar với fallback */
}
<
View
style
=
{
styles
.
avatar
}
>
{
userProfile
?.
avatar
?
(
<
Image
...
...
@@ -63,7 +59,6 @@ const HomeView = (props) => {
)}
<
/View
>
{
/* FEATURE: User information với null safety */
}
<
View
style
=
{
styles
.
information
}
>
<
Text
style
=
{
styles
.
text_card_info
}
...
...
@@ -82,7 +77,6 @@ const HomeView = (props) => {
<
/View
>
<
/View
>
{
/* FEATURE: Profile button với better UX */
}
<
TouchableOpacity
style
=
{
styles
.
profile_btn
}
onPress
=
{()
=>
navigate
.
navigate
(
SCREENNAME
.
PROFILE
)}
...
...
@@ -99,7 +93,6 @@ const HomeView = (props) => {
<
/View
>
);
// FUNCTIONALITY: Render menu section với reusable logic
const
renderMenuSection
=
(
title
,
data
)
=>
(
<
View
style
=
{
styles
.
menu_container
}
>
<
Text
style
=
{
styles
.
menu_title
}
>
{
title
}
<
/Text
>
...
...
@@ -110,34 +103,28 @@ const HomeView = (props) => {
keyExtractor
=
{(
item
)
=>
item
.
id
.
toString
()}
scrollEnabled
=
{
false
}
columnWrapperStyle
=
{
styles
.
row
}
removeClippedSubviews
=
{
true
}
// PERFORMANCE: Memory optimization
maxToRenderPerBatch
=
{
9
}
// PERFORMANCE: Render batch size
windowSize
=
{
10
}
// PERFORMANCE: Window size optimization
removeClippedSubviews
=
{
true
}
maxToRenderPerBatch
=
{
9
}
windowSize
=
{
10
}
/
>
<
/View
>
);
return
(
<>
{
/* FIXME: StatusBar configuration để loại bỏ white space */
}
<
SafeAreaView
style
=
{
styles
.
container_body
}
>
<
StatusBar
barStyle
=
"light-content"
// Text trắng trên dark background
backgroundColor
=
"transparent"
// Background trong suốt
translucent
=
{
true
}
// Cho phép content extend lên status bar
barStyle
=
"light-content"
translucent
=
{
false
}
/
>
<
TouchableWithoutFeedback
onPress
=
{
Keyboard
.
dismiss
}
accessible
=
{
false
}
>
{
/* FIXME: Dùng View với manual padding thay SafeAreaView */
}
<
View
style
=
{[
{
flex
:
1
},
{
paddingTop
:
Platform
.
OS
===
'ios'
?
0
:
StatusBar
.
currentHeight
}
]}
>
<
View
style
=
{
styles
.
container_body
}
>
<
ImageBackground
source
=
{
R
.
images
.
igBackgroundSlider
}
style
=
{[
styles
.
background_header
,
{
// FIXME: Extend background để cover status bar area
paddingTop
:
Platform
.
OS
===
'ios'
?
50
:
(
StatusBar
.
currentHeight
||
0
)
+
10
,
}]}
>
<
HeaderCus
...
...
@@ -156,10 +143,9 @@ const HomeView = (props) => {
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
style
=
{
styles
.
scroll
}
bounces
=
{
false
}
// OPTIMIZE: Tắt bounce trên iOS
overScrollMode
=
"never"
// OPTIMIZE: Tắt over scroll trên Android
bounces
=
{
false
}
overScrollMode
=
"never"
>
{
/* FUNCTIONALITY: Render các menu sections */
}
{
renderMenuSection
(
"Học tập"
,
menuDataStudy
)}
{
renderMenuSection
(
"Cá nhân"
,
menuDataIndividual
)}
{
renderMenuSection
(
"Dịch vụ trực tuyến"
,
menuDataOnlineSer
)}
...
...
@@ -167,7 +153,7 @@ const HomeView = (props) => {
<
/View
>
<
/View
>
<
/TouchableWithoutFeedback
>
<
/
>
<
/
SafeAreaView
>
);
};
...
...
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