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
7f4ac902
Kaydet (Commit)
7f4ac902
authored
Mar 18, 2015
tarafından
Tomaž Vajngerl
Kaydeden (comit)
Miklos Vajna
Mar 23, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: move handle code to DrawElementHandle
Change-Id: Ica316ed9660e235e756ef380da8f441c976de07f
üst
e48d983d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
27 deletions
+67
-27
DrawElementHandle.java
...OAndroid3/src/java/org/libreoffice/DrawElementHandle.java
+41
-0
TextCursorView.java
...l/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
+26
-27
No files found.
android/experimental/LOAndroid3/src/java/org/libreoffice/DrawElementHandle.java
0 → 100644
Dosyayı görüntüle @
7f4ac902
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package
org
.
libreoffice
;
import
android.graphics.Canvas
;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.PointF
;
public
class
DrawElementHandle
{
public
PointF
mPosition
=
new
PointF
();
private
float
mRadius
=
20.0f
;
private
Paint
mGraphicHandleFillPaint
=
new
Paint
();
private
Paint
mGraphicSelectionPaint
=
new
Paint
();
public
DrawElementHandle
(
Paint
graphicSelectionPaint
)
{
mGraphicSelectionPaint
=
graphicSelectionPaint
;
mGraphicHandleFillPaint
.
setStyle
(
Paint
.
Style
.
FILL
);
mGraphicHandleFillPaint
.
setColor
(
Color
.
WHITE
);
}
public
void
draw
(
Canvas
canvas
)
{
canvas
.
drawCircle
(
mPosition
.
x
,
mPosition
.
y
,
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mPosition
.
x
,
mPosition
.
y
,
mRadius
,
mGraphicSelectionPaint
);
}
public
void
reposition
(
float
x
,
float
y
)
{
mPosition
.
x
=
x
;
mPosition
.
y
=
y
;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
Dosyayı görüntüle @
7f4ac902
...
...
@@ -51,14 +51,16 @@ public class TextCursorView extends View implements View.OnTouchListener {
private
RectF
mGraphicSelection
=
new
RectF
();
private
RectF
mGraphicScaledSelection
=
new
RectF
();
private
Paint
mGraphicSelectionPaint
=
new
Paint
();
private
Paint
mGraphicHandleFillPaint
=
new
Paint
();
private
float
mRadius
=
20.0f
;
private
boolean
mGraphicSelectionVisible
;
private
PointF
mTouchStart
=
new
PointF
();
private
PointF
mDeltaPoint
=
new
PointF
();
private
boolean
mGraphicSelectionMove
=
false
;
private
LayerView
mLayerView
;
private
DrawElementHandle
mHandles
[]
=
new
DrawElementHandle
[
8
];
public
TextCursorView
(
Context
context
)
{
super
(
context
);
initialize
();
...
...
@@ -92,11 +94,17 @@ public class TextCursorView extends View implements View.OnTouchListener {
mGraphicSelectionPaint
.
setStyle
(
Paint
.
Style
.
STROKE
);
mGraphicSelectionPaint
.
setColor
(
Color
.
BLACK
);
mGraphicSelectionPaint
.
setStrokeWidth
(
2
);
mGraphicHandleFillPaint
.
setStyle
(
Paint
.
Style
.
FILL
);
mGraphicHandleFillPaint
.
setColor
(
Color
.
WHITE
);
mGraphicSelectionVisible
=
false
;
mHandles
[
0
]
=
new
DrawElementHandle
(
mGraphicSelectionPaint
);
mHandles
[
1
]
=
new
DrawElementHandle
(
mGraphicSelectionPaint
);
mHandles
[
2
]
=
new
DrawElementHandle
(
mGraphicSelectionPaint
);
mHandles
[
3
]
=
new
DrawElementHandle
(
mGraphicSelectionPaint
);
mHandles
[
4
]
=
new
DrawElementHandle
(
mGraphicSelectionPaint
);
mHandles
[
5
]
=
new
DrawElementHandle
(
mGraphicSelectionPaint
);
mHandles
[
6
]
=
new
DrawElementHandle
(
mGraphicSelectionPaint
);
mHandles
[
7
]
=
new
DrawElementHandle
(
mGraphicSelectionPaint
);
postDelayed
(
cursorAnimation
,
CURSOR_BLINK_TIME
);
mInitialized
=
true
;
...
...
@@ -156,6 +164,16 @@ public class TextCursorView extends View implements View.OnTouchListener {
mGraphicScaledSelection
=
RectUtils
.
scale
(
mGraphicSelection
,
zoom
);
mGraphicScaledSelection
.
offset
(-
x
,
-
y
);
mHandles
[
0
].
reposition
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
top
);
mHandles
[
1
].
reposition
(
mGraphicScaledSelection
.
centerX
(),
mGraphicScaledSelection
.
top
);
mHandles
[
2
].
reposition
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
top
);
mHandles
[
3
].
reposition
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
centerY
());
mHandles
[
4
].
reposition
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
centerY
());
mHandles
[
5
].
reposition
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
bottom
);
mHandles
[
6
].
reposition
(
mGraphicScaledSelection
.
centerX
(),
mGraphicScaledSelection
.
bottom
);
mHandles
[
7
].
reposition
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
bottom
);
invalidate
();
}
...
...
@@ -172,29 +190,10 @@ public class TextCursorView extends View implements View.OnTouchListener {
}
if
(
mGraphicSelectionVisible
)
{
canvas
.
drawRect
(
mGraphicScaledSelection
,
mGraphicSelectionPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
top
,
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
top
,
mRadius
,
mGraphicSelectionPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
top
,
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
top
,
mRadius
,
mGraphicSelectionPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
bottom
,
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
bottom
,
mRadius
,
mGraphicSelectionPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
bottom
,
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
bottom
,
mRadius
,
mGraphicSelectionPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
centerY
(),
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
left
,
mGraphicScaledSelection
.
centerY
(),
mRadius
,
mGraphicSelectionPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
centerY
(),
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
right
,
mGraphicScaledSelection
.
centerY
(),
mRadius
,
mGraphicSelectionPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
centerX
(),
mGraphicScaledSelection
.
top
,
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
centerX
(),
mGraphicScaledSelection
.
top
,
mRadius
,
mGraphicSelectionPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
centerX
(),
mGraphicScaledSelection
.
bottom
,
mRadius
,
mGraphicHandleFillPaint
);
canvas
.
drawCircle
(
mGraphicScaledSelection
.
centerX
(),
mGraphicScaledSelection
.
bottom
,
mRadius
,
mGraphicSelectionPaint
);
for
(
DrawElementHandle
handle
:
mHandles
)
{
handle
.
draw
(
canvas
);
}
if
(
mGraphicSelectionMove
)
{
RectF
one
=
new
RectF
(
mGraphicScaledSelection
);
...
...
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