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
d5ad8429
Kaydet (Commit)
d5ad8429
authored
Şub 26, 2015
tarafından
Tomaž Vajngerl
Kaydeden (comit)
Miklos Vajna
Mar 02, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: send selection/cursor change from TextSelectionHandle
Change-Id: Iac570c890717d8e2dcfde7f29da996c809df81dc
üst
b2753b46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
29 deletions
+11
-29
TextSelectionHandle.java
...roid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
+11
-29
No files found.
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
Dosyayı görüntüle @
d5ad8429
...
@@ -74,51 +74,33 @@ public class TextSelectionHandle extends ImageView implements View.OnTouchListen
...
@@ -74,51 +74,33 @@ public class TextSelectionHandle extends ImageView implements View.OnTouchListen
case
MotionEvent
.
ACTION_UP
:
{
case
MotionEvent
.
ACTION_UP
:
{
mTouchStartX
=
0
;
mTouchStartX
=
0
;
mTouchStartY
=
0
;
mTouchStartY
=
0
;
// Reposition handles to line up with ends of selection
JSONObject
args
=
new
JSONObject
();
try
{
args
.
put
(
"handleType"
,
mHandleType
.
toString
());
}
catch
(
Exception
e
)
{
Log
.
e
(
LOGTAG
,
"Error building JSON arguments for TextSelection:Position"
);
}
//GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("TextSelection:Position", args.toString()));
break
;
break
;
}
}
case
MotionEvent
.
ACTION_MOVE
:
{
case
MotionEvent
.
ACTION_MOVE
:
{
move
(
Math
.
round
(
event
.
getX
()),
Math
.
round
(
event
.
getY
()
));
move
(
event
.
getX
(),
event
.
getY
(
));
break
;
break
;
}
}
}
}
return
true
;
return
true
;
}
}
private
void
move
(
int
newX
,
int
newY
)
{
private
void
move
(
float
newX
,
float
newY
)
{
mLeft
=
mLeft
+
newX
-
mTouchStartX
;
mTop
=
mTop
+
newY
-
mTouchStartY
;
LayerView
layerView
=
LOKitShell
.
getLayerView
();
LayerView
layerView
=
LOKitShell
.
getLayerView
();
if
(
layerView
==
null
)
{
if
(
layerView
==
null
)
{
Log
.
e
(
LOGTAG
,
"Can't move selection because layerView is null"
);
Log
.
e
(
LOGTAG
,
"Can't move selection because layerView is null"
);
return
;
return
;
}
}
float
newLeft
=
mLeft
+
newX
-
mTouchStartX
;
float
newTop
=
mTop
+
newY
-
mTouchStartY
;
// Send x coordinate on the right side of the start handle, left side of the end handle.
// Send x coordinate on the right side of the start handle, left side of the end handle.
float
left
=
(
float
)
mLeft
+
adjustLeftForHandle
();
float
left
=
(
float
)
newLeft
+
adjustLeftForHandle
();
PointF
geckoPoint
=
new
PointF
(
left
,
(
float
)
mTop
);
geckoPoint
=
layerView
.
getLayerClient
().
convertViewPointToLayerPoint
(
geckoPoint
);
JSONObject
args
=
new
JSONObject
();
try
{
args
.
put
(
"handleType"
,
mHandleType
.
toString
());
args
.
put
(
"x"
,
Math
.
round
(
geckoPoint
.
x
));
args
.
put
(
"y"
,
Math
.
round
(
geckoPoint
.
y
));
}
catch
(
Exception
e
)
{
Log
.
e
(
LOGTAG
,
"Error building JSON arguments for TextSelection:Move"
);
}
//GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("TextSelection:Move", args.toString()));
setLayoutPosition
();
PointF
documentPoint
=
new
PointF
(
left
,
newTop
);
documentPoint
=
layerView
.
getLayerClient
().
convertViewPointToLayerPoint
(
documentPoint
);
LOKitShell
.
sendChangeHandlePositionEvent
(
mHandleType
,
documentPoint
);
}
}
void
positionFromGecko
(
int
left
,
int
top
,
boolean
rtl
)
{
void
positionFromGecko
(
int
left
,
int
top
,
boolean
rtl
)
{
...
...
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