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
c67a772d
Kaydet (Commit)
c67a772d
authored
Tem 23, 2012
tarafından
Andrzej J.R. Hunt
Kaydeden (comit)
Michael Meeks
Agu 06, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed thumbnail control. Changed thumbnail activity to fragment.
Change-Id: I4e8a9d37f3b418728404b7fab4f7b6e3c3b5e5b9
üst
3e0b7a71
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
139 additions
and
100 deletions
+139
-100
activity_presentation.xml
android/sdremote/res/layout/activity_presentation.xml
+4
-11
fragment_thumbnail.xml
android/sdremote/res/layout/fragment_thumbnail.xml
+0
-0
PresentationActivity.java
...c/org/libreoffice/impressremote/PresentationActivity.java
+90
-12
TestClient.java
...dremote/src/org/libreoffice/impressremote/TestClient.java
+1
-1
ThumbnailActivity.java
.../src/org/libreoffice/impressremote/ThumbnailActivity.java
+43
-66
CppunitTest_sd_filters_test.mk
sd/CppunitTest_sd_filters_test.mk
+0
-4
CppunitTest_sd_uimpress.mk
sd/CppunitTest_sd_uimpress.mk
+0
-4
ImagePreparer.cxx
sd/source/ui/remotecontrol/ImagePreparer.cxx
+1
-1
Receiver.hxx
sd/source/ui/remotecontrol/Receiver.hxx
+0
-1
No files found.
android/sdremote/res/layout/activity_presentation.xml
Dosyayı görüntüle @
c67a772d
<
Relativ
eLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Fram
eLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:id=
"@+id/framelayout"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:text=
"@string/hello_world"
tools:context=
".PresentationActivity"
/>
</RelativeLayout>
</FrameLayout>
android/sdremote/res/layout/
activity
_thumbnail.xml
→
android/sdremote/res/layout/
fragment
_thumbnail.xml
Dosyayı görüntüle @
c67a772d
File moved
android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
Dosyayı görüntüle @
c67a772d
package
org
.
libreoffice
.
impressremote
;
import
android.os.Bundle
;
import
org.libreoffice.impressremote.communication.CommunicationService
;
import
android.app.Activity
;
import
android.app.FragmentManager
;
import
android.app.FragmentTransaction
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.ServiceConnection
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.IBinder
;
import
android.os.Message
;
import
android.os.Messenger
;
import
android.view.Menu
;
import
android.widget.FrameLayout
;
public
class
PresentationActivity
extends
Activity
{
private
CommunicationService
mCommunicationService
;
private
boolean
mIsBound
=
false
;
private
FrameLayout
mLayout
;
ThumbnailActivity
mThumbnailFragment
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_presentation
);
bindService
(
new
Intent
(
this
,
CommunicationService
.
class
),
mConnection
,
Context
.
BIND_IMPORTANT
);
FragmentManager
fragmentManager
=
getFragmentManager
();
FragmentTransaction
fragmentTransaction
=
fragmentManager
.
beginTransaction
();
mThumbnailFragment
=
new
ThumbnailActivity
();
fragmentTransaction
.
add
(
R
.
id
.
framelayout
,
mThumbnailFragment
,
"fragment_thumbnail"
);
fragmentTransaction
.
commit
();
mLayout
=
(
FrameLayout
)
findViewById
(
R
.
id
.
framelayout
);
mIsBound
=
true
;
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// MenuInflater inflater = getMenuInflater();
// inflater.inflate(R.menu.main_activity, menu);
// return true;
// }
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
getMenuInflater
().
inflate
(
R
.
menu
.
activity_presentation
,
menu
);
return
true
;
}
private
ServiceConnection
mConnection
=
new
ServiceConnection
()
{
@Override
public
void
onServiceConnected
(
ComponentName
aClassName
,
IBinder
aService
)
{
mCommunicationService
=
((
CommunicationService
.
CBinder
)
aService
)
.
getService
();
mCommunicationService
.
setActivityMessenger
(
mMessenger
);
mThumbnailFragment
.
setCommunicationService
(
mCommunicationService
);
// TODO: add mCommunicationSercie to all fragments.
}
@Override
public
void
onServiceDisconnected
(
ComponentName
aClassName
)
{
mCommunicationService
=
null
;
}
};
final
Messenger
mMessenger
=
new
Messenger
(
new
MessageHandler
());
protected
class
MessageHandler
extends
Handler
{
@Override
public
void
handleMessage
(
Message
aMessage
)
{
mThumbnailFragment
.
handleMessage
(
aMessage
);
// Bundle aData = aMessage.getData();
// TODO: pass to fragments
// switch (aMessage.what) {
// case CommunicationService.MSG_SLIDE_CHANGED:
// int aSlide = aData.getInt("slide_number");
// break;
// case CommunicationService.MSG_SLIDE_PREVIEW:
// // int aNSlide = aData.getInt("slide_number");
// break;
//
// }
}
}
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_presentation
);
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
getMenuInflater
().
inflate
(
R
.
menu
.
activity_presentation
,
menu
);
return
true
;
}
}
android/sdremote/src/org/libreoffice/impressremote/TestClient.java
Dosyayı görüntüle @
c67a772d
...
...
@@ -151,7 +151,7 @@ public class TestClient extends Activity {
@Override
public
void
onClick
(
View
v
)
{
Intent
aIntent
=
new
Intent
(
TestClient
.
this
,
Thumbnail
Activity
.
class
);
Presentation
Activity
.
class
);
startActivity
(
aIntent
);
}
});
...
...
android/sdremote/src/org/libreoffice/impressremote/ThumbnailActivity.java
Dosyayı görüntüle @
c67a772d
...
...
@@ -11,18 +11,12 @@ package org.libreoffice.impressremote;
import
org.libreoffice.impressremote.communication.CommunicationService
;
import
org.libreoffice.impressremote.communication.SlideShow
;
import
android.app.Activity
;
import
android.content.ComponentName
;
import
android.app.Fragment
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.ServiceConnection
;
import
android.graphics.Bitmap
;
import
android.graphics.Typeface
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.IBinder
;
import
android.os.Message
;
import
android.os.Messenger
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -32,47 +26,42 @@ import android.widget.GridView;
import
android.widget.ImageView
;
import
android.widget.TextView
;
public
class
ThumbnailActivity
extends
Activity
{
public
class
ThumbnailActivity
extends
Fragment
{
private
CommunicationService
mCommunicationService
;
private
boolean
mIsBound
=
false
;
private
GridView
mGrid
;
private
ImageView
mCurrentImage
;
private
TextView
mCurrentText
;
private
SlideShow
mSlideShow
;
private
Context
mContext
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_thumbnail
);
bindService
(
new
Intent
(
this
,
CommunicationService
.
class
),
mConnection
,
Context
.
BIND_ADJUST_WITH_ACTIVITY
);
mIsBound
=
true
;
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
// Inflate the layout for this fragment
View
v
=
inflater
.
inflate
(
R
.
layout
.
fragment_thumbnail
,
container
,
false
);
mGrid
=
(
GridView
)
findViewById
(
R
.
id
.
thumbnail_grid
);
mGrid
=
(
GridView
)
v
.
findViewById
(
R
.
id
.
thumbnail_grid
);
mGrid
.
setOnItemClickListener
(
new
ClickListener
());
mContext
=
container
.
getContext
();
return
v
;
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
mCommunicationService
.
setActivityMessenger
(
null
);
if
(
mIsBound
)
{
unbindService
(
mConnection
);
mIsBound
=
false
;
}
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// MenuInflater inflater = getMenuInflater();
// inflater.inflate(R.menu.main_activity, menu);
// return true;
// }
@Override
public
void
onPause
()
{
super
.
onPause
();
}
private
void
setSelected
(
int
position
)
{
formatUnselected
(
mCurrentImage
,
mCurrentText
);
...
...
@@ -92,7 +81,7 @@ public class ThumbnailActivity extends Activity {
R
.
color
.
thumbnail_border
));
}
if
(
aText
!=
null
)
{
aText
.
setTypeface
(
Typeface
.
create
(
mCurrent
Text
.
getTypeface
(),
aText
.
setTypeface
(
Typeface
.
create
(
a
Text
.
getTypeface
(),
Typeface
.
NORMAL
));
}
}
...
...
@@ -103,56 +92,42 @@ public class ThumbnailActivity extends Activity {
R
.
color
.
thumbnail_border_selected
));
}
if
(
aText
!=
null
)
{
aText
.
setTypeface
(
Typeface
.
create
(
mCurrent
Text
.
getTypeface
(),
aText
.
setTypeface
(
Typeface
.
create
(
a
Text
.
getTypeface
(),
Typeface
.
BOLD
));
}
}
// ------------------------------------------------- SERVICE CONNECTION ----
final
Messenger
mMessenger
=
new
Messenger
(
new
MessageHandler
());
private
ServiceConnection
mConnection
=
new
ServiceConnection
()
{
@Override
public
void
onServiceConnected
(
ComponentName
aClassName
,
IBinder
aService
)
{
mCommunicationService
=
((
CommunicationService
.
CBinder
)
aService
)
.
getService
();
mCommunicationService
.
setActivityMessenger
(
mMessenger
);
mSlideShow
=
mCommunicationService
.
getSlideShow
();
mGrid
.
setAdapter
(
new
ThumbnailAdapter
(
ThumbnailActivity
.
this
,
mSlideShow
));
}
@Override
public
void
onServiceDisconnected
(
ComponentName
aClassName
)
{
mCommunicationService
=
null
;
}
};
// ----------------------------------------------------- CLICK LISTENER ----
protected
class
ClickListener
implements
AdapterView
.
OnItemClickListener
{
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
v
,
int
position
,
long
id
)
{
mCommunicationService
.
getTransmitter
().
gotoSlide
(
position
);
if
(
mCommunicationService
!=
null
)
mCommunicationService
.
getTransmitter
().
gotoSlide
(
position
);
}
}
// ---------------------------------------------------- MESSAGE HANDLER ----
protected
class
MessageHandler
extends
Handler
{
@Override
public
void
handleMessage
(
Message
aMessage
)
{
Bundle
aData
=
aMessage
.
getData
();
switch
(
aMessage
.
what
)
{
case
CommunicationService
.
MSG_SLIDE_CHANGED
:
int
aSlide
=
aData
.
getInt
(
"slide_number"
);
setSelected
(
aSlide
);
break
;
case
CommunicationService
.
MSG_SLIDE_PREVIEW
:
// int aNSlide = aData.getInt("slide_number");
mGrid
.
invalidateViews
();
break
;
}
public
void
setCommunicationService
(
CommunicationService
aCommunicationService
)
{
mCommunicationService
=
aCommunicationService
;
mSlideShow
=
mCommunicationService
.
getSlideShow
();
mGrid
.
setAdapter
(
new
ThumbnailAdapter
(
mContext
,
mSlideShow
));
}
public
void
handleMessage
(
Message
aMessage
)
{
Bundle
aData
=
aMessage
.
getData
();
switch
(
aMessage
.
what
)
{
case
CommunicationService
.
MSG_SLIDE_CHANGED
:
int
aSlide
=
aData
.
getInt
(
"slide_number"
);
setSelected
(
aSlide
);
break
;
case
CommunicationService
.
MSG_SLIDE_PREVIEW
:
mGrid
.
invalidateViews
();
break
;
}
}
...
...
@@ -201,6 +176,8 @@ public class ThumbnailActivity extends Activity {
if
((
mSlideShow
!=
null
)
&&
(
position
==
mSlideShow
.
getCurrentSlide
()))
{
formatSelected
(
aImage
,
aText
);
mCurrentImage
=
aImage
;
mCurrentText
=
aText
;
}
else
{
formatUnselected
(
aImage
,
aText
);
}
...
...
sd/CppunitTest_sd_filters_test.mk
Dosyayı görüntüle @
c67a772d
...
...
@@ -67,10 +67,6 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_filters_test, \
$(gb_STDLIBS) \
))
$(eval $(call gb_CppunitTest_add_libs,sd_filters_test,\
$(shell pkg-config --libs glib-2.0 json-glib-1.0) \
))
$(eval $(call gb_CppunitTest_set_include,sd_filters_test,\
-I$(SRCDIR)/sd/source/ui/inc \
-I$(SRCDIR)/sd/inc \
...
...
sd/CppunitTest_sd_uimpress.mk
Dosyayı görüntüle @
c67a772d
...
...
@@ -41,10 +41,6 @@ $(eval $(call gb_CppunitTest_use_api,sd_uimpress,\
udkapi \
))
$(eval $(call gb_CppunitTest_add_libs,sd_uimpress,\
$(shell pkg-config --libs glib-2.0 json-glib-1.0) \
))
$(eval $(call gb_CppunitTest_use_library_objects,sd_uimpress,sd))
$(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\
...
...
sd/source/ui/remotecontrol/ImagePreparer.cxx
Dosyayı görüntüle @
c67a772d
...
...
@@ -58,7 +58,7 @@ void ImagePreparer::execute()
void
ImagePreparer
::
sendPreview
(
sal_uInt32
aSlideNumber
)
{
sal_uInt64
aSize
;
uno
::
Sequence
<
sal_Int8
>
aImageData
=
preparePreview
(
aSlideNumber
,
1
60
,
12
0
,
uno
::
Sequence
<
sal_Int8
>
aImageData
=
preparePreview
(
aSlideNumber
,
1
40
,
10
0
,
aSize
);
if
(
!
xController
->
isRunning
()
)
return
;
...
...
sd/source/ui/remotecontrol/Receiver.hxx
Dosyayı görüntüle @
c67a772d
...
...
@@ -39,4 +39,3 @@ private:
}
#endif // _SD_IMPRESSREMOTE_RECEIVER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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