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
2550cb01
Kaydet (Commit)
2550cb01
authored
Eyl 24, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: introduce TileProviderFactory
Change-Id: I98ba16b4d1537ddeb2f8a29d15a803d527ccafe3
üst
ef2b36f8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
12 deletions
+47
-12
LOKitThread.java
...ntal/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+9
-4
LibreOfficeMainActivity.java
...id3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+6
-8
TileProviderFactory.java
...ndroid3/src/java/org/libreoffice/TileProviderFactory.java
+32
-0
No files found.
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
Dosyayı görüntüle @
2550cb01
...
...
@@ -26,6 +26,7 @@ public class LOKitThread extends Thread {
private
boolean
mCheckboardImageSet
=
false
;
public
LOKitThread
()
{
TileProviderFactory
.
initialize
();
}
private
RectF
normlizeRect
(
ImmutableViewportMetrics
metrics
)
{
...
...
@@ -35,9 +36,9 @@ public class LOKitThread extends Thread {
}
private
Rect
roundToTileSize
(
RectF
input
,
int
tileSize
)
{
int
minX
=
(
Math
.
round
(
input
.
left
)
/
tileSize
)
*
tileSize
;
int
minY
=
(
Math
.
round
(
input
.
top
)
/
tileSize
)
*
tileSize
;
int
maxX
=
((
Math
.
round
(
input
.
right
)
/
tileSize
)
+
1
)
*
tileSize
;
int
minX
=
(
Math
.
round
(
input
.
left
)
/
tileSize
)
*
tileSize
;
int
minY
=
(
Math
.
round
(
input
.
top
)
/
tileSize
)
*
tileSize
;
int
maxX
=
((
Math
.
round
(
input
.
right
)
/
tileSize
)
+
1
)
*
tileSize
;
int
maxY
=
((
Math
.
round
(
input
.
bottom
)
/
tileSize
)
+
1
)
*
tileSize
;
return
new
Rect
(
minX
,
minY
,
maxX
,
maxY
);
}
...
...
@@ -136,7 +137,7 @@ public class LOKitThread extends Thread {
if
(
mTileProvider
!=
null
)
{
mTileProvider
.
close
();
}
mTileProvider
=
new
LOKitTileProvider
(
mApplication
.
getLayerController
(),
filename
);
mTileProvider
=
TileProviderFactory
.
create
(
mApplication
.
getLayerController
(),
filename
);
boolean
isReady
=
mTileProvider
.
isReady
();
if
(
isReady
)
{
updateCheckbardImage
();
...
...
@@ -191,4 +192,8 @@ public class LOKitThread extends Thread {
Log
.
i
(
LOGTAG
,
"Event: "
+
event
.
getTypeString
());
mEventQueue
.
add
(
event
);
}
public
void
clearQueue
()
{
mEventQueue
.
clear
();
}
}
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
Dosyayı görüntüle @
2550cb01
...
...
@@ -13,7 +13,6 @@ import android.widget.AdapterView;
import
android.widget.ListView
;
import
android.widget.RelativeLayout
;
import
org.libreoffice.kit.LibreOfficeKit
;
import
org.mozilla.gecko.gfx.GeckoLayerClient
;
import
org.mozilla.gecko.gfx.LayerController
;
...
...
@@ -111,19 +110,18 @@ public class LibreOfficeMainActivity extends Activity {
mDrawerList
.
setOnItemClickListener
(
new
DocumentPartClickListener
());
}
LibreOfficeKit
.
loadStatic
();
if
(
sLOKitThread
==
null
)
{
sLOKitThread
=
new
LOKitThread
();
sLOKitThread
.
start
();
}
else
{
sLOKitThread
.
clearQueue
();
}
mLayerController
=
new
LayerController
(
this
);
mLayerClient
=
new
GeckoLayerClient
(
this
);
mLayerController
.
setLayerClient
(
mLayerClient
);
mGeckoLayout
.
addView
(
mLayerController
.
getView
(),
0
);
if
(
sLOKitThread
==
null
)
{
sLOKitThread
=
new
LOKitThread
();
sLOKitThread
.
start
();
}
sLOKitThread
.
mEventQueue
.
clear
();
LOKitShell
.
sendEvent
(
LOEvent
.
load
(
inputFile
));
Log
.
w
(
LOGTAG
,
"UI almost up"
);
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/TileProviderFactory.java
0 → 100644
Dosyayı görüntüle @
2550cb01
package
org
.
libreoffice
;
import
org.libreoffice.kit.LibreOfficeKit
;
import
org.mozilla.gecko.gfx.LayerController
;
public
class
TileProviderFactory
{
private
static
TileProviderID
currentTileProvider
=
TileProviderID
.
LOKIT
;
private
TileProviderFactory
()
{
}
public
static
void
initialize
()
{
if
(
currentTileProvider
==
TileProviderID
.
LOKIT
)
{
LibreOfficeKit
.
loadStatic
();
}
}
public
static
TileProvider
create
(
LayerController
layerController
,
String
filename
)
{
if
(
currentTileProvider
==
TileProviderID
.
LOKIT
)
{
return
new
LOKitTileProvider
(
layerController
,
filename
);
}
else
{
return
new
MockTileProvider
(
layerController
,
filename
);
}
}
private
static
enum
TileProviderID
{
MOCK
,
LOKIT
}
}
\ No newline at end of file
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