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
593e4a11
Kaydet (Commit)
593e4a11
authored
Kas 26, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: extract duplicated casts to helper methods
Change-Id: Ib77731839ad9e46626a7a07d4b2c6c7e32d4bba1
üst
ef348c6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
DocumentLoader.java
.../src/org/libreoffice/android/examples/DocumentLoader.java
+15
-5
No files found.
android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
Dosyayı görüntüle @
593e4a11
...
...
@@ -145,6 +145,16 @@ public class DocumentLoader
Bundle
extras
;
PageViewer
getPageViewerAt
(
int
index
)
{
return
(
PageViewer
)
flipper
.
getChildAt
(
index
);
}
PageViewer
getCurrentPageViewer
()
{
return
(
PageViewer
)
flipper
.
getCurrentView
();
}
class
GestureListener
extends
GestureDetector
.
SimpleOnGestureListener
{
...
...
@@ -156,7 +166,7 @@ public class DocumentLoader
{
Log
.
i
(
TAG
,
"onFling: "
+
event1
+
" "
+
event2
);
if
(
event1
.
getX
()
-
event2
.
getX
()
>
120
)
{
if
(
((
PageViewer
)
flipper
.
getCurrentView
()
).
currentPageNumber
==
documentContext
.
pageCount
-
1
)
if
(
getCurrentPageViewer
(
).
currentPageNumber
==
documentContext
.
pageCount
-
1
)
return
false
;
Animation
inFromRight
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
...
...
@@ -172,10 +182,10 @@ public class DocumentLoader
flipper
.
showNext
();
((
PageViewer
)
flipper
.
getChildAt
((
flipper
.
getDisplayedChild
()
+
PAGECACHE_PLUSMINUS
)
%
PAGECACHE_SIZE
)).
display
(((
PageViewer
)
flipper
.
getCurrentView
()
).
currentPageNumber
+
PAGECACHE_PLUSMINUS
);
getPageViewerAt
((
flipper
.
getDisplayedChild
()
+
PAGECACHE_PLUSMINUS
)
%
PAGECACHE_SIZE
).
display
(
getCurrentPageViewer
(
).
currentPageNumber
+
PAGECACHE_PLUSMINUS
);
return
true
;
}
else
if
(
event2
.
getX
()
-
event1
.
getX
()
>
120
)
{
if
(
((
PageViewer
)
flipper
.
getCurrentView
()
).
currentPageNumber
==
0
)
if
(
getCurrentPageViewer
(
).
currentPageNumber
==
0
)
return
false
;
Animation
inFromLeft
=
new
TranslateAnimation
(
Animation
.
RELATIVE_TO_SELF
,
-
1
,
Animation
.
RELATIVE_TO_SELF
,
0
,
...
...
@@ -191,7 +201,7 @@ public class DocumentLoader
flipper
.
showPrevious
();
((
PageViewer
)
flipper
.
getChildAt
((
flipper
.
getDisplayedChild
()
+
PAGECACHE_SIZE
-
PAGECACHE_PLUSMINUS
)
%
PAGECACHE_SIZE
)).
display
(((
PageViewer
)
flipper
.
getCurrentView
()
).
currentPageNumber
-
PAGECACHE_PLUSMINUS
);
getPageViewerAt
((
flipper
.
getDisplayedChild
()
+
PAGECACHE_SIZE
-
PAGECACHE_PLUSMINUS
)
%
PAGECACHE_SIZE
).
display
(
getCurrentPageViewer
(
).
currentPageNumber
-
PAGECACHE_PLUSMINUS
);
return
true
;
}
...
...
@@ -938,7 +948,7 @@ public class DocumentLoader
public
Object
onRetainNonConfigurationInstance
()
{
ArrayList
ret
=
new
ArrayList
(
2
);
ret
.
add
(
bootstrapContext
);
documentContext
.
currentPageNumber
=
((
PageViewer
)
flipper
.
getCurrentView
()
).
currentPageNumber
;
documentContext
.
currentPageNumber
=
getCurrentPageViewer
(
).
currentPageNumber
;
ret
.
add
(
documentContext
);
return
ret
;
}
...
...
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