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
e910aa45
Kaydet (Commit)
e910aa45
authored
Eki 02, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: construct LayerView in xml GUI definition (activity_main)
Change-Id: I6cd3c8dff2ca36f3d64559b218d005d5a6da9066
üst
fc8e1ac5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
20 deletions
+65
-20
activity_main.xml
android/experimental/LOAndroid3/res/layout/activity_main.xml
+10
-4
LibreOfficeMainActivity.java
...id3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+6
-1
ViewFactory.java
...ntal/LOAndroid3/src/java/org/libreoffice/ViewFactory.java
+33
-0
LayerController.java
...roid3/src/java/org/mozilla/gecko/gfx/LayerController.java
+5
-1
LayerView.java
.../LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java
+11
-14
No files found.
android/experimental/LOAndroid3/res/layout/activity_main.xml
Dosyayı görüntüle @
e910aa45
...
@@ -16,19 +16,25 @@
...
@@ -16,19 +16,25 @@
android:id=
"@+id/gecko_layout"
android:id=
"@+id/gecko_layout"
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:layout_height=
"fill_parent"
android:layout_weight=
"1"
/>
android:layout_weight=
"1"
>
<org.mozilla.gecko.gfx.LayerView
android:id=
"@+id/layer_view"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
/>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/loadingPanel"
android:id=
"@+id/loadingPanel"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:
gravity=
"center
"
android:
background=
"#9333
"
android:
background=
"#9333
"
>
android:
gravity=
"center
"
>
<ProgressBar
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
/>
</RelativeLayout>
</RelativeLayout>
<View
<View
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
Dosyayı görüntüle @
e910aa45
...
@@ -9,6 +9,7 @@ import android.os.Handler;
...
@@ -9,6 +9,7 @@ import android.os.Handler;
import
android.support.v4.widget.DrawerLayout
;
import
android.support.v4.widget.DrawerLayout
;
import
android.util.DisplayMetrics
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.View
;
...
@@ -21,6 +22,7 @@ import android.widget.TextView;
...
@@ -21,6 +22,7 @@ import android.widget.TextView;
import
org.mozilla.gecko.ZoomConstraints
;
import
org.mozilla.gecko.ZoomConstraints
;
import
org.mozilla.gecko.gfx.GeckoLayerClient
;
import
org.mozilla.gecko.gfx.GeckoLayerClient
;
import
org.mozilla.gecko.gfx.LayerController
;
import
org.mozilla.gecko.gfx.LayerController
;
import
org.mozilla.gecko.gfx.LayerView
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -96,6 +98,8 @@ public class LibreOfficeMainActivity extends Activity {
...
@@ -96,6 +98,8 @@ public class LibreOfficeMainActivity extends Activity {
mMainHandler
=
new
Handler
();
mMainHandler
=
new
Handler
();
LayoutInflater
.
from
(
this
).
setFactory
(
ViewFactory
.
getInstance
());
if
(
getIntent
().
getData
()
!=
null
)
{
if
(
getIntent
().
getData
()
!=
null
)
{
mInputFile
=
getIntent
().
getData
().
getEncodedPath
();
mInputFile
=
getIntent
().
getData
().
getEncodedPath
();
}
else
{
}
else
{
...
@@ -128,8 +132,9 @@ public class LibreOfficeMainActivity extends Activity {
...
@@ -128,8 +132,9 @@ public class LibreOfficeMainActivity extends Activity {
mLayerController
=
new
LayerController
(
this
);
mLayerController
=
new
LayerController
(
this
);
mLayerController
.
setZoomConstraints
(
new
ZoomConstraints
(
true
));
mLayerController
.
setZoomConstraints
(
new
ZoomConstraints
(
true
));
mLayerClient
=
new
GeckoLayerClient
(
this
);
mLayerClient
=
new
GeckoLayerClient
(
this
);
LayerView
layerView
=
(
LayerView
)
findViewById
(
R
.
id
.
layer_view
);
mLayerController
.
setView
(
layerView
);
mLayerController
.
setLayerClient
(
mLayerClient
);
mLayerController
.
setLayerClient
(
mLayerClient
);
mGeckoLayout
.
addView
(
mLayerController
.
getView
(),
0
);
LOKitShell
.
sendEvent
(
LOEventFactory
.
load
(
mInputFile
));
LOKitShell
.
sendEvent
(
LOEventFactory
.
load
(
mInputFile
));
}
}
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/ViewFactory.java
0 → 100644
Dosyayı görüntüle @
e910aa45
package
org
.
libreoffice
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
org.mozilla.gecko.gfx.LayerView
;
public
class
ViewFactory
implements
LayoutInflater
.
Factory
{
private
static
final
String
LOGTAG
=
ViewFactory
.
class
.
getSimpleName
();
private
static
final
String
LAYER_VIEW_ID
=
"org.mozilla.gecko.gfx.LayerView"
;
private
static
final
ViewFactory
INSTANCE
=
new
ViewFactory
();
private
ViewFactory
()
{
}
public
static
LayoutInflater
.
Factory
getInstance
()
{
return
INSTANCE
;
}
@Override
public
View
onCreateView
(
String
name
,
Context
context
,
AttributeSet
attrs
)
{
if
(
name
.
equals
(
LAYER_VIEW_ID
))
{
Log
.
i
(
LOGTAG
,
"Creating custom Gecko view: "
+
name
);
return
new
LayerView
(
context
,
attrs
);
}
return
null
;
}
}
\ No newline at end of file
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java
Dosyayı görüntüle @
e910aa45
...
@@ -69,11 +69,15 @@ public class LayerController implements PanZoomTarget {
...
@@ -69,11 +69,15 @@ public class LayerController implements PanZoomTarget {
DisplayMetrics
displayMetrics
=
context
.
getResources
().
getDisplayMetrics
();
DisplayMetrics
displayMetrics
=
context
.
getResources
().
getDisplayMetrics
();
mViewportMetrics
=
new
ImmutableViewportMetrics
(
displayMetrics
);
mViewportMetrics
=
new
ImmutableViewportMetrics
(
displayMetrics
);
mPanZoomController
=
new
PanZoomController
(
this
);
mPanZoomController
=
new
PanZoomController
(
this
);
mView
=
new
LayerView
(
context
,
this
);
mCheckerboardShouldShowChecks
=
true
;
mCheckerboardShouldShowChecks
=
true
;
mZoomConstraints
=
new
ZoomConstraints
(
false
);
mZoomConstraints
=
new
ZoomConstraints
(
false
);
}
}
public
void
setView
(
LayerView
v
)
{
mView
=
v
;
mView
.
connect
(
this
);
}
public
void
setRoot
(
Layer
layer
)
{
mRootLayer
=
layer
;
}
public
void
setRoot
(
Layer
layer
)
{
mRootLayer
=
layer
;
}
public
void
setLayerClient
(
GeckoLayerClient
layerClient
)
{
public
void
setLayerClient
(
GeckoLayerClient
layerClient
)
{
...
...
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java
Dosyayı görüntüle @
e910aa45
...
@@ -9,6 +9,7 @@ package org.mozilla.gecko.gfx;
...
@@ -9,6 +9,7 @@ package org.mozilla.gecko.gfx;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.PixelFormat
;
import
android.graphics.PixelFormat
;
import
android.util.AttributeSet
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.KeyEvent
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
...
@@ -32,7 +33,6 @@ import java.nio.IntBuffer;
...
@@ -32,7 +33,6 @@ import java.nio.IntBuffer;
public
class
LayerView
extends
SurfaceView
implements
SurfaceHolder
.
Callback
{
public
class
LayerView
extends
SurfaceView
implements
SurfaceHolder
.
Callback
{
private
static
String
LOGTAG
=
"GeckoLayerView"
;
private
static
String
LOGTAG
=
"GeckoLayerView"
;
private
Context
mContext
;
private
LayerController
mController
;
private
LayerController
mController
;
private
TouchEventHandler
mTouchEventHandler
;
private
TouchEventHandler
mTouchEventHandler
;
private
GLController
mGLController
;
private
GLController
mGLController
;
...
@@ -51,18 +51,19 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
...
@@ -51,18 +51,19 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
public
static
final
int
PAINT_BEFORE_FIRST
=
1
;
public
static
final
int
PAINT_BEFORE_FIRST
=
1
;
public
static
final
int
PAINT_AFTER_FIRST
=
2
;
public
static
final
int
PAINT_AFTER_FIRST
=
2
;
public
LayerView
(
Context
context
,
AttributeSet
attrs
)
{
public
LayerView
(
Context
context
,
LayerController
controller
)
{
super
(
context
,
attrs
);
super
(
context
);
SurfaceHolder
holder
=
getHolder
();
SurfaceHolder
holder
=
getHolder
();
holder
.
addCallback
(
this
);
holder
.
addCallback
(
this
);
holder
.
setFormat
(
PixelFormat
.
RGB_565
);
holder
.
setFormat
(
PixelFormat
.
RGB_565
);
mGLController
=
new
GLController
(
this
);
mGLController
=
new
GLController
(
this
);
mContext
=
context
;
}
void
connect
(
LayerController
controller
)
{
mController
=
controller
;
mController
=
controller
;
mTouchEventHandler
=
new
TouchEventHandler
(
context
,
this
,
mController
);
mTouchEventHandler
=
new
TouchEventHandler
(
getContext
()
,
this
,
mController
);
mRenderer
=
new
LayerRenderer
(
this
);
mRenderer
=
new
LayerRenderer
(
this
);
mInputConnectionHandler
=
null
;
mInputConnectionHandler
=
null
;
...
@@ -208,6 +209,10 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
...
@@ -208,6 +209,10 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
mListener
=
listener
;
mListener
=
listener
;
}
}
Listener
getListener
()
{
return
mListener
;
}
public
GLController
getGLController
()
{
public
GLController
getGLController
()
{
return
mGLController
;
return
mGLController
;
}
}
...
@@ -267,10 +272,6 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
...
@@ -267,10 +272,6 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
private
GLThread
mGLThread
;
// Protected by this class's monitor.
private
GLThread
mGLThread
;
// Protected by this class's monitor.
/**
* Creates a Java GL thread. After this is called, the FlexibleGLSurfaceView may be used just
* like a GLSurfaceView. It is illegal to access the controller after this has been called.
*/
public
synchronized
void
createGLThread
()
{
public
synchronized
void
createGLThread
()
{
if
(
mGLThread
!=
null
)
{
if
(
mGLThread
!=
null
)
{
throw
new
LayerViewException
(
"createGLThread() called with a GL thread already in place!"
);
throw
new
LayerViewException
(
"createGLThread() called with a GL thread already in place!"
);
...
@@ -282,10 +283,6 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
...
@@ -282,10 +283,6 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
notifyAll
();
notifyAll
();
}
}
/**
* Destroys the Java GL thread. Returns a Thread that completes when the Java GL thread is
* fully shut down.
*/
public
synchronized
Thread
destroyGLThread
()
{
public
synchronized
Thread
destroyGLThread
()
{
// Wait for the GL thread to be started.
// Wait for the GL thread to be started.
Log
.
e
(
LOGTAG
,
"### Waiting for GL thread to be created..."
);
Log
.
e
(
LOGTAG
,
"### Waiting for GL thread to be created..."
);
...
...
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