Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
6078a319
Kaydet (Commit)
6078a319
authored
Agu 10, 2012
tarafından
Iain Billett
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved Animation code to DocumentViewer.
Change-Id: I3a21783a1ade19bd0c868f58137d244a13e0d132
üst
0093e6b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
22 deletions
+31
-22
DocumentLoader.java
...e4Android/src/org/libreoffice/android/DocumentLoader.java
+31
-22
No files found.
android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java
Dosyayı görüntüle @
6078a319
...
...
@@ -148,33 +148,11 @@ public class DocumentLoader
if
(
event1
.
getX
()
-
event2
.
getX
()
>
120
)
{
if
(((
PageViewer
)
flipper
.
getCurrentView
()).
currentPageNumber
==
pageCount
-
1
)
return
false
;
Animation
inFromRight
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
);
inFromRight
.
setDuration
(
500
);
flipper
.
setInAnimation
(
inFromRight
);
Animation
outToLeft
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
-
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
);
outToLeft
.
setDuration
(
500
);
flipper
.
setOutAnimation
(
outToLeft
);
documentViewer
.
nextPage
();
return
true
;
}
else
if
(
event2
.
getX
()
-
event1
.
getX
()
>
120
)
{
if
(((
PageViewer
)
flipper
.
getCurrentView
()).
currentPageNumber
==
0
)
return
false
;
Animation
inFromLeft
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
-
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
);
inFromLeft
.
setDuration
(
500
);
flipper
.
setInAnimation
(
inFromLeft
);
Animation
outToRight
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
);
outToRight
.
setDuration
(
500
);
flipper
.
setOutAnimation
(
outToRight
);
documentViewer
.
prevPage
();
return
true
;
}
...
...
@@ -811,6 +789,11 @@ public class DocumentLoader
Log
.
i
(
TAG
,
"Page "
+
Integer
.
toString
(
newPage
)
+
" is out of Bounds [0,"
+
Integer
.
toString
(
lastPage
)
+
"]"
);
return
;
}
if
(
newPage
-
currentPage
>
0
){
setAnimationInFromRight
();
}
else
{
setAnimationInFromLeft
();
}
viewFlipper
.
addView
(
fetch
(
newPage
)
);
viewFlipper
.
setDisplayedChild
(
1
);
//remove after so that transition has two pages.
viewFlipper
.
removeViewAt
(
0
);
...
...
@@ -819,6 +802,32 @@ public class DocumentLoader
currentPage
=
newPage
;
}
private
void
setAnimationInFromRight
(){
//going forward
Animation
inFromRight
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
);
inFromRight
.
setDuration
(
500
);
viewFlipper
.
setInAnimation
(
inFromRight
);
Animation
outToLeft
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
-
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
);
outToLeft
.
setDuration
(
500
);
viewFlipper
.
setOutAnimation
(
outToLeft
);
return
;
}
private
void
setAnimationInFromLeft
(){
Animation
inFromLeft
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
-
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
);
inFromLeft
.
setDuration
(
500
);
viewFlipper
.
setInAnimation
(
inFromLeft
);
Animation
outToRight
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
Animation
.
RELATIVE_TO_SELF
,
0
);
outToRight
.
setDuration
(
500
);
viewFlipper
.
setOutAnimation
(
outToRight
);
return
;
}
private
PageViewer
fetch
(
int
page
){
int
cacheIndex
=
pageNumbers
.
indexOf
(
page
);
if
(
cacheIndex
!=
-
1
){
...
...
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