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
c92ceb54
Kaydet (Commit)
c92ceb54
authored
Nis 14, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: add comments
Change-Id: I30f8180dd9cf9c94eedca61926ab706f241142df
üst
98c9887e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
73 additions
and
5 deletions
+73
-5
InvalidationHandler.java
...ndroid3/src/java/org/libreoffice/InvalidationHandler.java
+6
-0
LOAbout.java
...rimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java
+3
-0
LOKitShell.java
...ental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
+3
-1
LibreOfficeMainActivity.java
...id3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+0
-3
ThumbnailCreator.java
...LOAndroid3/src/java/org/libreoffice/ThumbnailCreator.java
+3
-0
CanvasElementImplRequirement.java
.../org/libreoffice/canvas/CanvasElementImplRequirement.java
+4
-0
CommonCanvasElement.java
.../src/java/org/libreoffice/canvas/CommonCanvasElement.java
+13
-0
Cursor.java
...al/LOAndroid3/src/java/org/libreoffice/canvas/Cursor.java
+18
-0
GraphicSelection.java
...id3/src/java/org/libreoffice/canvas/GraphicSelection.java
+6
-0
SelectionHandleMiddle.java
...rc/java/org/libreoffice/canvas/SelectionHandleMiddle.java
+1
-1
DocumentOverlayView.java
...src/java/org/libreoffice/overlay/DocumentOverlayView.java
+16
-0
No files found.
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -415,10 +415,16 @@ public class InvalidationHandler implements Document.MessageCallback {
return
mState
;
}
/**
* A key event happend (i.e. user started typing.
*/
public
void
keyEvent
()
{
mKeyEvent
=
true
;
}
/**
* The states the overlay.
*/
public
enum
OverlayState
{
/**
* State where the overlay is empty
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -12,6 +12,9 @@ import android.widget.TextView;
import
java.io.File
;
/**
* The about dialog.
*/
public
class
LOAbout
{
private
static
final
String
DEFAULT_DOC_PATH
=
"/assets/example.odt"
;
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -21,7 +21,9 @@ import org.libreoffice.canvas.SelectionHandle;
import
org.mozilla.gecko.gfx.ComposedTileLayer
;
import
org.mozilla.gecko.gfx.LayerView
;
/**
* Common static LOKit functions, functions to send events.
*/
public
class
LOKitShell
{
private
static
final
String
LOGTAG
=
LOKitShell
.
class
.
getSimpleName
();
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -19,7 +19,6 @@ import android.widget.ListView;
import
android.widget.Toast
;
import
org.libreoffice.overlay.DocumentOverlay
;
import
org.mozilla.gecko.ZoomConstraints
;
import
org.mozilla.gecko.gfx.GeckoLayerClient
;
import
org.mozilla.gecko.gfx.LayerView
;
...
...
@@ -178,8 +177,6 @@ public class LibreOfficeMainActivity extends ActionBarActivity {
// create TextCursorLayer
mDocumentOverlay
=
new
DocumentOverlay
(
mAppContext
,
layerView
);
}
private
boolean
copyFileToTemp
()
{
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/ThumbnailCreator.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -16,6 +16,9 @@ import android.widget.ImageView;
import
java.lang.ref.WeakReference
;
/**
* Create thumbnails for the parts of the document.
*/
public
class
ThumbnailCreator
{
private
static
final
String
LOG_TAG
=
ThumbnailCreator
.
class
.
getSimpleName
();
private
static
final
int
THUMBNAIL_SIZE
=
256
;
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/CanvasElementImplRequirement.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -2,6 +2,10 @@ package org.libreoffice.canvas;
import
android.graphics.Canvas
;
/**
* The interface defines a set of method that a typical CanvasElement
* implementation should implement.
*/
interface
CanvasElementImplRequirement
{
/**
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/CommonCanvasElement.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -9,16 +9,25 @@ public abstract class CommonCanvasElement implements CanvasElement, CanvasElemen
private
boolean
mVisible
=
false
;
/**
* Is element visible?
*/
@Override
public
boolean
isVisible
()
{
return
mVisible
;
}
/**
* Set element visibility.
*/
@Override
public
void
setVisible
(
boolean
visible
)
{
mVisible
=
visible
;
}
/**
* Trigger drawing the element on the canvas.
*/
@Override
public
void
draw
(
Canvas
canvas
)
{
if
(
isVisible
())
{
...
...
@@ -26,6 +35,10 @@ public abstract class CommonCanvasElement implements CanvasElement, CanvasElemen
}
}
/**
* Hit test. Return true if the element was hit. Directly return false if
* the element is invisible.
*/
@Override
public
boolean
contains
(
float
x
,
float
y
)
{
if
(!
isVisible
())
{
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/Cursor.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -5,6 +5,9 @@ import android.graphics.Color;
import
android.graphics.Paint
;
import
android.graphics.RectF
;
/**
* Handles the cursor drawing on the canvas.
*/
public
class
Cursor
extends
CommonCanvasElement
{
private
static
final
float
CURSOR_WIDTH
=
2
f
;
private
final
Paint
mCursorPaint
=
new
Paint
();
...
...
@@ -12,26 +15,41 @@ public class Cursor extends CommonCanvasElement {
public
RectF
mScaledPosition
=
new
RectF
();
public
int
mAlpha
=
0
;
/**
* Construct the cursor and set the default values.
*/
public
Cursor
()
{
mCursorPaint
.
setColor
(
Color
.
BLACK
);
mCursorPaint
.
setAlpha
(
0xFF
);
}
/**
* Hit test for cursor, always false.
*/
@Override
public
boolean
onHitTest
(
float
x
,
float
y
)
{
return
false
;
}
/**
* Draw the cursor.
*/
@Override
public
void
onDraw
(
Canvas
canvas
)
{
canvas
.
drawRect
(
mScaledPosition
,
mCursorPaint
);
}
/**
* Reposition the cursor on screen.
*/
public
void
reposition
(
RectF
rect
)
{
mScaledPosition
=
rect
;
mScaledPosition
.
right
=
mScaledPosition
.
left
+
CURSOR_WIDTH
;
}
/**
* Cycle the alpha color of the cursor, makes the
*/
public
void
cycleAlpha
()
{
mCursorPaint
.
setAlpha
(
mCursorPaint
.
getAlpha
()
==
0
?
0xFF
:
0
);
}
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -252,10 +252,16 @@ public class GraphicSelection extends CommonCanvasElement {
}
}
/**
* When a single press (no dragging happend) was performed.
*/
private
void
onSinglePress
(
PointF
screenPosition
)
{
sendGraphicSelection
(
"LongPress"
,
screenPosition
);
}
/**
* Set the visibility of the graphic selection.
*/
@Override
public
void
setVisible
(
boolean
visible
)
{
super
.
setVisible
(
visible
);
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/SelectionHandleMiddle.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -13,11 +13,11 @@ public class SelectionHandleMiddle extends SelectionHandle {
super
(
getBitmapForDrawable
(
context
,
R
.
drawable
.
handle_middle
));
}
@Override
/**
* Change the position of the handle on the screen. Take into account the
* handle alignment to the center.
*/
@Override
public
void
reposition
(
float
x
,
float
y
)
{
super
.
reposition
(
x
,
y
);
// align to the center
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/DocumentOverlayView.java
Dosyayı görüntüle @
c92ceb54
...
...
@@ -329,6 +329,11 @@ public class DocumentOverlayView extends View implements View.OnTouchListener {
return
false
;
}
/**
* Change the handle document position.
* @param type - the type of the handle
* @param position - the new document position
*/
public
void
positionHandle
(
SelectionHandle
.
HandleType
type
,
RectF
position
)
{
SelectionHandle
handle
=
getHandleForType
(
type
);
if
(
RectUtils
.
fuzzyEquals
(
handle
.
mDocumentPosition
,
position
))
{
...
...
@@ -341,6 +346,10 @@ public class DocumentOverlayView extends View implements View.OnTouchListener {
repositionWithViewport
(
metrics
.
viewportRectLeft
,
metrics
.
viewportRectTop
,
metrics
.
zoomFactor
);
}
/**
* Hide the handle.
* @param type - type of the handle
*/
public
void
hideHandle
(
SelectionHandle
.
HandleType
type
)
{
SelectionHandle
handle
=
getHandleForType
(
type
);
if
(
handle
.
isVisible
())
{
...
...
@@ -349,6 +358,10 @@ public class DocumentOverlayView extends View implements View.OnTouchListener {
}
}
/**
* Show the handle.
* @param type - type of the handle
*/
public
void
showHandle
(
SelectionHandle
.
HandleType
type
)
{
SelectionHandle
handle
=
getHandleForType
(
type
);
if
(!
handle
.
isVisible
())
{
...
...
@@ -357,6 +370,9 @@ public class DocumentOverlayView extends View implements View.OnTouchListener {
}
}
/**
* Returns the handle instance for the input type.
*/
private
SelectionHandle
getHandleForType
(
SelectionHandle
.
HandleType
type
)
{
switch
(
type
)
{
case
START:
...
...
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