@@ -21,7 +21,7 @@ const TestDotContainer = ( {color, sizeRatio = 1.0, maxPage=10} )=>{
2121 const [ page , setPage ] = useState ( 0 ) ;
2222
2323 return (
24- < View style = { { flex :1 , } } >
24+ < View style = { { flex :1 , borderBottomWidth : 0.5 , borderBottomColor : 'grey' , marginBottom : 10 } } >
2525 < View style = { { flex :1 , flexDirection :'row' } } >
2626 < View style = { { flex :1 , justifyContent :'space-between' , flexDirection :'row' , alignItems :'center' , marginRight :12 } } >
2727 < Text style = { { fontSize : 16 , fontWeight : '400' , color : 'black' , } } > page</ Text >
@@ -57,7 +57,56 @@ const TestDotContainer = ( {color, sizeRatio = 1.0, maxPage=10} )=>{
5757
5858 </ View >
5959 )
60- }
60+ } ;
61+
62+ const TestDotVerticalContainer = ( { color, sizeRatio = 1.0 , maxPage= 10 } ) => {
63+
64+ const [ page , setPage ] = useState ( 0 ) ;
65+
66+ return (
67+ < View style = { { flex :1 , flexDirection :'row' , borderBottomWidth :0.5 , borderBottomColor :'grey' , marginBottom :10 } } >
68+ < View style = { { flex :5 , flexDirection :'column' } } >
69+ < View style = { { flex :1 , justifyContent :'space-between' , flexDirection :'row' , alignItems :'center' } } >
70+ < Text style = { { fontSize : 16 , fontWeight : '400' , color : 'black' , } } > page</ Text >
71+ < Text style = { { fontSize : 16 , fontWeight : '600' , color : 'grey' , } } > { page + 1 } / { maxPage } </ Text >
72+ </ View >
73+ < View style = { { flex :1 , justifyContent :'space-between' , flexDirection :'row' , alignItems :'center' } } >
74+ < Text style = { { fontSize : 16 , fontWeight : '400' , color : 'black' , } } > sizeRatio</ Text >
75+ < Text style = { { fontSize : 16 , fontWeight : '600' , color : 'grey' , } } > { sizeRatio } </ Text >
76+ </ View >
77+
78+ < View style = { { flex :1 , justifyContent :'space-between' , flexDirection :'row' } } >
79+ < Button
80+ title = "Prev"
81+ onPress = { ( ) => {
82+ setPage ( page - 1 ) ;
83+ } } />
84+
85+ < Button
86+ title = "Next"
87+ onPress = { ( ) => {
88+ setPage ( page + 1 ) ;
89+ } } />
90+ </ View >
91+
92+ </ View >
93+
94+ < View style = { { flex :1 , flexDirection :'column' , justifyContent :'center' , alignItems :'center' } } >
95+
96+ < PaginationDot
97+ activeDotColor = { color }
98+ curPage = { page }
99+ maxPage = { maxPage }
100+ sizeRatio = { sizeRatio }
101+ vertical = { true }
102+ />
103+
104+ </ View >
105+
106+ </ View >
107+ )
108+ } ;
109+
61110
62111const App = ( ) => {
63112 return (
@@ -70,10 +119,11 @@ const App = () => {
70119 fontWeight : '600' ,
71120 color : 'black' , } } > Animated Pagination Dots</ Text >
72121 </ View >
73- < View style = { { flex :2 , flexDirection :'column' , paddingVertical :30 , paddingHorizontal :20 , marginBottom :20 } } >
122+ < View style = { { flex :4 , flexDirection :'column' , paddingVertical :30 , paddingHorizontal :20 , marginBottom :20 } } >
74123 < TestDotContainer maxPage = { 20 } color = { 'black' } sizeRatio = { 1 } />
75- < TestDotContainer maxPage = { 10 } color = { 'red' } sizeRatio = { 1.5 } />
76- < TestDotContainer maxPage = { 4 } color = { 'green' } sizeRatio = { 1.0 } />
124+ < TestDotContainer maxPage = { 4 } color = { 'green' } sizeRatio = { 1.0 } />
125+ < TestDotVerticalContainer maxPage = { 10 } color = { 'rgb(0,0,120)' } />
126+ < TestDotVerticalContainer maxPage = { 4 } color = { 'blue' } sizeRatio = { 1.5 } />
77127 </ View >
78128 </ View >
79129 </ View >
0 commit comments