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
3e0b7a71
Kaydet (Commit)
3e0b7a71
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
Added styling and Timer code.
Change-Id: I I044efc4e317fa56f9e3670c7b68d287dcc74ed53
üst
6794e94b
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
384 additions
and
55 deletions
+384
-55
org.eclipse.jdt.core.prefs
android/sdremote/.settings/org.eclipse.jdt.core.prefs
+11
-0
AndroidManifest.xml
android/sdremote/AndroidManifest.xml
+19
-3
ic_action_search.png
android/sdremote/res/drawable-hdpi/ic_action_search.png
+0
-0
ic_action_search.png
android/sdremote/res/drawable-mdpi/ic_action_search.png
+0
-0
ic_action_search.png
android/sdremote/res/drawable-xhdpi/ic_action_search.png
+0
-0
activity_presentation.xml
android/sdremote/res/layout/activity_presentation.xml
+14
-0
activity_presentation.xml
android/sdremote/res/menu/activity_presentation.xml
+6
-0
strings.xml
android/sdremote/res/values/strings.xml
+8
-2
styles.xml
android/sdremote/res/values/styles.xml
+21
-0
ActionBarManager.java
...e/src/org/libreoffice/impressremote/ActionBarManager.java
+19
-0
Launcher.java
.../sdremote/src/org/libreoffice/impressremote/Launcher.java
+10
-0
PresentationActivity.java
...c/org/libreoffice/impressremote/PresentationActivity.java
+20
-0
TestClient.java
...dremote/src/org/libreoffice/impressremote/TestClient.java
+31
-16
ThumbnailActivity.java
.../src/org/libreoffice/impressremote/ThumbnailActivity.java
+60
-25
Client.java
...c/org/libreoffice/impressremote/communication/Client.java
+12
-6
CommunicationService.java
...ice/impressremote/communication/CommunicationService.java
+69
-2
NetworkClient.java
...ibreoffice/impressremote/communication/NetworkClient.java
+11
-1
SlideShow.java
...rg/libreoffice/impressremote/communication/SlideShow.java
+62
-0
Transmitter.java
.../libreoffice/impressremote/communication/Transmitter.java
+11
-0
No files found.
android/sdremote/.settings/org.eclipse.jdt.core.prefs
0 → 100644
Dosyayı görüntüle @
3e0b7a71
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
android/sdremote/AndroidManifest.xml
Dosyayı görüntüle @
3e0b7a71
...
@@ -5,11 +5,15 @@
...
@@ -5,11 +5,15 @@
android:versionName=
"1.0"
>
android:versionName=
"1.0"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-sdk
android:minSdkVersion=
"14"
android:targetSdkVersion=
"14"
/>
<uses-sdk
android:minSdkVersion=
"14"
android:targetSdkVersion=
"14"
/>
<application
<application
android:icon=
"@drawable/ic_launcher"
android:icon=
"@drawable/ic_launcher"
android:label=
"@string/app_name"
>
android:label=
"@string/app_name"
android:theme=
"@style/Theme.ImpressRemote"
>
<activity
<activity
android:name=
"TestClient"
android:name=
"TestClient"
android:label=
"@string/app_name"
>
android:label=
"@string/app_name"
>
...
@@ -22,7 +26,18 @@
...
@@ -22,7 +26,18 @@
<service
android:name=
".communication.CommunicationService"
>
<service
android:name=
".communication.CommunicationService"
>
</service>
</service>
<activity
android:name=
".ThumbnailActivity"
></activity>
<activity
android:name=
".ThumbnailActivity"
>
</activity>
<activity
android:name=
".PresentationActivity"
android:label=
"@string/title_activity_presentation"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
android/sdremote/res/drawable-hdpi/ic_action_search.png
0 → 100644
Dosyayı görüntüle @
3e0b7a71
3.05 KB
android/sdremote/res/drawable-mdpi/ic_action_search.png
0 → 100644
Dosyayı görüntüle @
3e0b7a71
2.96 KB
android/sdremote/res/drawable-xhdpi/ic_action_search.png
0 → 100644
Dosyayı görüntüle @
3e0b7a71
3.12 KB
android/sdremote/res/layout/activity_presentation.xml
0 → 100644
Dosyayı görüntüle @
3e0b7a71
<RelativeLayout
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"
>
<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>
android/sdremote/res/menu/activity_presentation.xml
0 → 100644
Dosyayı görüntüle @
3e0b7a71
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@+id/menu_settings"
android:title=
"@string/menu_settings"
android:orderInCategory=
"100"
android:showAsAction=
"never"
/>
</menu>
android/sdremote/res/values/strings.xml
Dosyayı görüntüle @
3e0b7a71
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<string
name=
"app_name"
>
Launcher
</string>
</resources>
<string
name=
"app_name"
>
LibreOffice Remote
</string>
<string
name=
"hello_world"
>
Hello world!
</string>
<string
name=
"menu_settings"
>
Settings
</string>
<string
name=
"title_activity_presentation"
>
PresentationActivity
</string>
</resources>
\ No newline at end of file
android/sdremote/res/values/styles.xml
0 → 100644
Dosyayı görüntüle @
3e0b7a71
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"orange"
>
#EE4400
</color>
<color
name=
"light_grey"
>
#E8E9E8
</color>
<integer
name=
"thumbnail_border_width"
>
3
</integer>
<color
name=
"thumbnail_border"
>
#B4B4B4
</color>
<color
name=
"thumbnail_border_selected"
>
#EE4400
</color>
<style
name=
"Theme.ImpressRemote.ActionBar"
parent=
"android:style/Widget.Holo.Light.ActionBar"
>
<item
name=
"android:background"
>
@color/orange
</item>
</style>
<style
name=
"Theme.ImpressRemote"
parent=
"android:style/Theme.Holo.Light"
>
<item
name=
"android:actionBarStyle"
>
@style/Theme.ImpressRemote.ActionBar
</item>
<item
name=
"android:windowBackground"
>
@color/light_grey
</item>
</style>
</resources>
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/ActionBarManager.java
0 → 100644
Dosyayı görüntüle @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
;
/**
* Used to manage the action bar whenever a presentation is running.
*
*/
public
class
ActionBarManager
{
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/Launcher.java
Dosyayı görüntüle @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
;
package
org
.
libreoffice
.
impressremote
;
import
android.app.Activity
;
import
android.app.Activity
;
...
@@ -12,3 +20,4 @@ public class Launcher extends Activity {
...
@@ -12,3 +20,4 @@ public class Launcher extends Activity {
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
0 → 100644
Dosyayı görüntüle @
3e0b7a71
package
org
.
libreoffice
.
impressremote
;
import
android.os.Bundle
;
import
android.app.Activity
;
import
android.view.Menu
;
public
class
PresentationActivity
extends
Activity
{
@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 @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
;
package
org
.
libreoffice
.
impressremote
;
import
org.libreoffice.impressremote.communication.CommunicationService
;
import
org.libreoffice.impressremote.communication.CommunicationService
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.ComponentName
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.ServiceConnection
;
import
android.content.ServiceConnection
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.IBinder
;
import
android.os.IBinder
;
...
@@ -25,8 +33,6 @@ public class TestClient extends Activity {
...
@@ -25,8 +33,6 @@ public class TestClient extends Activity {
private
boolean
mIsBound
=
false
;
private
boolean
mIsBound
=
false
;
private
int
mCurrentSlide
=
0
;
private
CommunicationService
mCommunicationService
;
private
CommunicationService
mCommunicationService
;
final
Messenger
mMessenger
=
new
Messenger
(
new
MessageHandler
());
final
Messenger
mMessenger
=
new
Messenger
(
new
MessageHandler
());
...
@@ -51,25 +57,32 @@ public class TestClient extends Activity {
...
@@ -51,25 +57,32 @@ public class TestClient extends Activity {
@Override
@Override
protected
void
onPause
()
{
protected
void
onPause
()
{
super
.
onPause
();
super
.
onPause
();
doUnbindService
();
// doUnbindService();
}
@Override
public
void
onBackPressed
()
{
// TODO Auto-generated method stub
stopService
(
new
Intent
(
this
,
CommunicationService
.
class
));
super
.
onBackPressed
();
}
}
@Override
@Override
protected
void
onStop
()
{
protected
void
onStop
()
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
super
.
onStop
();
super
.
onStop
();
//
mCommunicationService.disconnect();
//
mCommunicationService.disconnect();
stopService
(
new
Intent
(
this
,
CommunicationService
.
class
));
//
stopService(new Intent(this, CommunicationService.class));
}
}
private
ServiceConnection
mConnection
=
new
ServiceConnection
()
{
private
ServiceConnection
mConnection
=
new
ServiceConnection
()
{
@Override
@Override
public
void
onServiceConnected
(
ComponentName
aClassName
,
public
void
onServiceConnected
(
ComponentName
aClassName
,
IBinder
aService
)
{
IBinder
aService
)
{
mCommunicationService
=
((
CommunicationService
.
CBinder
)
aService
)
mCommunicationService
=
((
CommunicationService
.
CBinder
)
aService
)
.
getService
();
.
getService
();
mCommunicationService
.
connectTo
(
mCommunicationService
.
connectTo
(
CommunicationService
.
Protocol
.
NETWORK
,
"10.0.2.2"
);
CommunicationService
.
Protocol
.
NETWORK
,
"10.0.2.2"
);
mCommunicationService
.
setActivityMessenger
(
mMessenger
);
mCommunicationService
.
setActivityMessenger
(
mMessenger
);
enableButtons
(
true
);
enableButtons
(
true
);
}
}
...
@@ -84,8 +97,7 @@ public class TestClient extends Activity {
...
@@ -84,8 +97,7 @@ public class TestClient extends Activity {
void
doBindService
()
{
void
doBindService
()
{
Intent
aIntent
=
new
Intent
(
this
,
CommunicationService
.
class
);
Intent
aIntent
=
new
Intent
(
this
,
CommunicationService
.
class
);
startService
(
aIntent
);
startService
(
aIntent
);
bindService
(
aIntent
,
mConnection
,
bindService
(
aIntent
,
mConnection
,
Context
.
BIND_IMPORTANT
);
Context
.
BIND_IMPORTANT
);
mIsBound
=
true
;
mIsBound
=
true
;
}
}
...
@@ -138,8 +150,9 @@ public class TestClient extends Activity {
...
@@ -138,8 +150,9 @@ public class TestClient extends Activity {
mThumbnailButton
.
setOnClickListener
(
new
OnClickListener
()
{
mThumbnailButton
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
Intent
aIntent
=
new
Intent
(
TestClient
.
this
,
ThumbnailActivity
.
class
);
Intent
aIntent
=
new
Intent
(
TestClient
.
this
,
startActivity
(
aIntent
);
ThumbnailActivity
.
class
);
startActivity
(
aIntent
);
}
}
});
});
...
@@ -162,9 +175,9 @@ public class TestClient extends Activity {
...
@@ -162,9 +175,9 @@ public class TestClient extends Activity {
// We continue on to try and update the image.
// We continue on to try and update the image.
case
CommunicationService
.
MSG_SLIDE_PREVIEW
:
case
CommunicationService
.
MSG_SLIDE_PREVIEW
:
int
aSlideNumber
=
aData
.
getInt
(
"slide_number"
);
int
aSlideNumber
=
aData
.
getInt
(
"slide_number"
);
if
(
mCurrentPreviewImageMissing
)
{
if
(
mCurrentPreviewImageMissing
)
{
Bitmap
aImage
=
mCommunicationService
Bitmap
aImage
=
mCommunicationService
.
getSlideShow
()
.
getSlideShow
()
.
getImage
(
aSlideNumber
);
.
getImage
(
aSlideNumber
);
if
(
aImage
!=
null
)
{
if
(
aImage
!=
null
)
{
mImageView
.
setImageBitmap
(
aImage
);
mImageView
.
setImageBitmap
(
aImage
);
mCurrentPreviewImageMissing
=
false
;
mCurrentPreviewImageMissing
=
false
;
...
@@ -176,3 +189,4 @@ public class TestClient extends Activity {
...
@@ -176,3 +189,4 @@ public class TestClient extends Activity {
}
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/ThumbnailActivity.java
Dosyayı görüntüle @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
;
package
org
.
libreoffice
.
impressremote
;
import
org.libreoffice.impressremote.TestClient.MessageHandler
;
import
org.libreoffice.impressremote.communication.CommunicationService
;
import
org.libreoffice.impressremote.communication.CommunicationService
;
import
org.libreoffice.impressremote.communication.SlideShow
;
import
org.libreoffice.impressremote.communication.SlideShow
;
...
@@ -10,7 +17,6 @@ import android.content.Context;
...
@@ -10,7 +17,6 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.ServiceConnection
;
import
android.content.ServiceConnection
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.Color
;
import
android.graphics.Typeface
;
import
android.graphics.Typeface
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
...
@@ -43,7 +49,7 @@ public class ThumbnailActivity extends Activity {
...
@@ -43,7 +49,7 @@ public class ThumbnailActivity extends Activity {
setContentView
(
R
.
layout
.
activity_thumbnail
);
setContentView
(
R
.
layout
.
activity_thumbnail
);
bindService
(
new
Intent
(
this
,
CommunicationService
.
class
),
mConnection
,
bindService
(
new
Intent
(
this
,
CommunicationService
.
class
),
mConnection
,
Context
.
BIND_ADJUST_WITH_ACTIVITY
);
Context
.
BIND_ADJUST_WITH_ACTIVITY
);
mIsBound
=
true
;
mIsBound
=
true
;
mGrid
=
(
GridView
)
findViewById
(
R
.
id
.
thumbnail_grid
);
mGrid
=
(
GridView
)
findViewById
(
R
.
id
.
thumbnail_grid
);
...
@@ -61,24 +67,44 @@ public class ThumbnailActivity extends Activity {
...
@@ -61,24 +67,44 @@ public class ThumbnailActivity extends Activity {
}
}
}
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// MenuInflater inflater = getMenuInflater();
// inflater.inflate(R.menu.main_activity, menu);
// return true;
// }
private
void
setSelected
(
int
position
)
{
private
void
setSelected
(
int
position
)
{
if
(
mCurrentImage
!=
null
)
{
formatUnselected
(
mCurrentImage
,
mCurrentText
);
mCurrentImage
.
setPadding
(
0
,
0
,
0
,
0
);
}
if
(
mCurrentText
!=
null
)
{
mCurrentText
.
setTypeface
(
Typeface
.
create
(
mCurrentText
.
getTypeface
(),
Typeface
.
NORMAL
));
}
View
aV
=
mGrid
.
getChildAt
(
position
);
View
aV
=
mGrid
.
getChildAt
(
position
);
if
(
aV
!=
null
)
{
if
(
aV
!=
null
)
{
mCurrentImage
=
(
ImageView
)
aV
.
findViewById
(
R
.
id
.
sub_thumbnail
);
mCurrentImage
=
(
ImageView
)
aV
.
findViewById
(
R
.
id
.
sub_thumbnail
);
mCurrentText
=
(
TextView
)
aV
.
findViewById
(
R
.
id
.
sub_number
);
mCurrentText
=
(
TextView
)
aV
.
findViewById
(
R
.
id
.
sub_number
);
mCurrentImage
.
setBackgroundColor
(
Color
.
RED
);
formatSelected
(
mCurrentImage
,
mCurrentText
);
mCurrentImage
.
setPadding
(
2
,
2
,
2
,
2
);
}
mCurrentText
.
setTypeface
(
Typeface
.
create
(
mCurrentText
.
getTypeface
(),
}
Typeface
.
BOLD
));
private
void
formatUnselected
(
ImageView
aImage
,
TextView
aText
)
{
if
(
aImage
!=
null
)
{
aImage
.
setBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
thumbnail_border
));
}
if
(
aText
!=
null
)
{
aText
.
setTypeface
(
Typeface
.
create
(
mCurrentText
.
getTypeface
(),
Typeface
.
NORMAL
));
}
}
private
void
formatSelected
(
ImageView
aImage
,
TextView
aText
)
{
if
(
aImage
!=
null
)
{
aImage
.
setBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
thumbnail_border_selected
));
}
if
(
aText
!=
null
)
{
aText
.
setTypeface
(
Typeface
.
create
(
mCurrentText
.
getTypeface
(),
Typeface
.
BOLD
));
}
}
}
}
...
@@ -88,13 +114,13 @@ public class ThumbnailActivity extends Activity {
...
@@ -88,13 +114,13 @@ public class ThumbnailActivity extends Activity {
private
ServiceConnection
mConnection
=
new
ServiceConnection
()
{
private
ServiceConnection
mConnection
=
new
ServiceConnection
()
{
@Override
@Override
public
void
onServiceConnected
(
ComponentName
aClassName
,
public
void
onServiceConnected
(
ComponentName
aClassName
,
IBinder
aService
)
{
IBinder
aService
)
{
mCommunicationService
=
((
CommunicationService
.
CBinder
)
aService
)
mCommunicationService
=
((
CommunicationService
.
CBinder
)
aService
)
.
getService
();
.
getService
();
mCommunicationService
.
setActivityMessenger
(
mMessenger
);
mCommunicationService
.
setActivityMessenger
(
mMessenger
);
mSlideShow
=
mCommunicationService
.
getSlideShow
();
mSlideShow
=
mCommunicationService
.
getSlideShow
();
mGrid
.
setAdapter
(
new
ThumbnailAdapter
(
ThumbnailActivity
.
this
,
mGrid
.
setAdapter
(
new
ThumbnailAdapter
(
ThumbnailActivity
.
this
,
mSlideShow
));
mSlideShow
));
}
}
@Override
@Override
...
@@ -106,7 +132,7 @@ public class ThumbnailActivity extends Activity {
...
@@ -106,7 +132,7 @@ public class ThumbnailActivity extends Activity {
// ----------------------------------------------------- CLICK LISTENER ----
// ----------------------------------------------------- CLICK LISTENER ----
protected
class
ClickListener
implements
AdapterView
.
OnItemClickListener
{
protected
class
ClickListener
implements
AdapterView
.
OnItemClickListener
{
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
v
,
int
position
,
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
v
,
int
position
,
long
id
)
{
long
id
)
{
mCommunicationService
.
getTransmitter
().
gotoSlide
(
position
);
mCommunicationService
.
getTransmitter
().
gotoSlide
(
position
);
}
}
}
}
...
@@ -160,12 +186,25 @@ public class ThumbnailActivity extends Activity {
...
@@ -160,12 +186,25 @@ public class ThumbnailActivity extends Activity {
@Override
@Override
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
LayoutInflater
aInflater
=
(
LayoutInflater
)
mContext
LayoutInflater
aInflater
=
(
LayoutInflater
)
mContext
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
View
v
=
aInflater
.
inflate
(
R
.
layout
.
slide_thumbnail
,
null
);
View
v
=
aInflater
.
inflate
(
R
.
layout
.
slide_thumbnail
,
null
);
ImageView
aImage
=
(
ImageView
)
v
.
findViewById
(
R
.
id
.
sub_thumbnail
);
ImageView
aImage
=
(
ImageView
)
v
.
findViewById
(
R
.
id
.
sub_thumbnail
);
TextView
aText
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
sub_number
);
TextView
aText
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
sub_number
);
// Do the image & number styling
int
aBorderWidth
=
getResources
().
getInteger
(
R
.
integer
.
thumbnail_border_width
);
aImage
.
setPadding
(
aBorderWidth
,
aBorderWidth
,
aBorderWidth
,
aBorderWidth
);
if
((
mSlideShow
!=
null
)
&&
(
position
==
mSlideShow
.
getCurrentSlide
()))
{
formatSelected
(
aImage
,
aText
);
}
else
{
formatUnselected
(
aImage
,
aText
);
}
Bitmap
aBitmap
=
mSlideShow
.
getImage
(
position
);
Bitmap
aBitmap
=
mSlideShow
.
getImage
(
position
);
if
(
aBitmap
!=
null
)
{
if
(
aBitmap
!=
null
)
{
aImage
.
setImageBitmap
(
aBitmap
);
aImage
.
setImageBitmap
(
aBitmap
);
...
@@ -173,13 +212,8 @@ public class ThumbnailActivity extends Activity {
...
@@ -173,13 +212,8 @@ public class ThumbnailActivity extends Activity {
aText
.
setText
(
String
.
valueOf
(
position
+
1
));
aText
.
setText
(
String
.
valueOf
(
position
+
1
));
// if ((mSlideShow != null)
// && (position == mSlideShow.getCurrentSlide())) {
// setSelected(position);
// }
return
v
;
return
v
;
}
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/communication/Client.java
Dosyayı görüntüle @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
.
communication
;
package
org
.
libreoffice
.
impressremote
.
communication
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
...
@@ -8,10 +16,6 @@ import java.io.OutputStream;
...
@@ -8,10 +16,6 @@ import java.io.OutputStream;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
org.apache.http.util.ByteArrayBuffer
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
/**
/**
* Generic Client for the remote control. To implement a Client for a specific
* Generic Client for the remote control. To implement a Client for a specific
* transport medium you must provide input and output streams (
* transport medium you must provide input and output streams (
...
@@ -50,7 +54,7 @@ public abstract class Client {
...
@@ -50,7 +54,7 @@ public abstract class Client {
BufferedReader
aReader
;
BufferedReader
aReader
;
try
{
try
{
aReader
=
new
BufferedReader
(
new
InputStreamReader
(
mInputStream
,
aReader
=
new
BufferedReader
(
new
InputStreamReader
(
mInputStream
,
CHARSET
));
CHARSET
));
while
(
true
)
{
while
(
true
)
{
ArrayList
<
String
>
aList
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
aList
=
new
ArrayList
<
String
>();
String
aTemp
;
String
aTemp
;
...
@@ -82,10 +86,11 @@ public abstract class Client {
...
@@ -82,10 +86,11 @@ public abstract class Client {
mOutputStream
.
write
(
command
.
getBytes
(
CHARSET
));
mOutputStream
.
write
(
command
.
getBytes
(
CHARSET
));
}
catch
(
UnsupportedEncodingException
e
)
{
}
catch
(
UnsupportedEncodingException
e
)
{
throw
new
Error
(
"Specified network encoding ["
+
CHARSET
throw
new
Error
(
"Specified network encoding ["
+
CHARSET
+
" not available."
);
+
" not available."
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
// TODO Notify that stream has closed.
// TODO Notify that stream has closed.
}
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
Dosyayı görüntüle @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
.
communication
;
package
org
.
libreoffice
.
impressremote
.
communication
;
import
android.app.Service
;
import
android.app.Service
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.os.Binder
;
import
android.os.Binder
;
import
android.os.IBinder
;
import
android.os.IBinder
;
import
android.os.Messenger
;
import
android.os.Messenger
;
...
@@ -59,6 +65,24 @@ public class CommunicationService extends Service {
...
@@ -59,6 +65,24 @@ public class CommunicationService extends Service {
return
mTransmitter
;
return
mTransmitter
;
}
}
/**
* Connect to a specific server. This method cannot be called on the main
* activity thread.
*
* @param aServer
* The Server to connect to.
*/
public
void
connectTo
(
Server
aServer
)
{
connectTo
(
aServer
.
getProtocol
(),
aServer
.
getAddress
());
}
/**
* Connect to a specific server. This method cannot be called on the main
* activity thread.
*
* @param aProtocol
* @param address
*/
public
void
connectTo
(
Protocol
aProtocol
,
String
address
)
{
public
void
connectTo
(
Protocol
aProtocol
,
String
address
)
{
switch
(
aProtocol
)
{
switch
(
aProtocol
)
{
case
NETWORK:
case
NETWORK:
...
@@ -66,11 +90,19 @@ public class CommunicationService extends Service {
...
@@ -66,11 +90,19 @@ public class CommunicationService extends Service {
mTransmitter
=
new
Transmitter
(
mClient
);
mTransmitter
=
new
Transmitter
(
mClient
);
mClient
.
setReceiver
(
mReceiver
);
mClient
.
setReceiver
(
mReceiver
);
break
;
break
;
case
BLUETOOTH:
break
;
default
:
break
;
}
}
}
}
public
Server
[]
getServers
()
{
return
null
;
}
public
void
disconnect
()
{
public
void
disconnect
()
{
mClient
.
closeConnection
();
mClient
.
closeConnection
();
}
}
...
@@ -79,5 +111,39 @@ public class CommunicationService extends Service {
...
@@ -79,5 +111,39 @@ public class CommunicationService extends Service {
return
mReceiver
.
getSlideShow
();
return
mReceiver
.
getSlideShow
();
}
}
// ---------------------------------------------------- SERVER -------------
/**
* Class describing a remote server.
*/
public
class
Server
{
private
Protocol
mProtocol
;
private
String
mAddress
;
private
String
mName
;
protected
Server
(
Protocol
aProtocol
,
String
aAddress
,
String
aName
)
{
mProtocol
=
aProtocol
;
mAddress
=
aAddress
;
mName
=
aName
;
}
public
Protocol
getProtocol
()
{
return
mProtocol
;
}
public
String
getAddress
()
{
return
mAddress
;
}
/**
* Get a human friendly name for the server.
*
* @return The name.
*/
public
String
getName
()
{
return
mName
;
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java
Dosyayı görüntüle @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
.
communication
;
package
org
.
libreoffice
.
impressremote
.
communication
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -20,7 +28,7 @@ public class NetworkClient extends Client {
...
@@ -20,7 +28,7 @@ public class NetworkClient extends Client {
public
NetworkClient
(
String
ipAddress
)
{
public
NetworkClient
(
String
ipAddress
)
{
// FIXME: eventually networking will be fully threaded.
// FIXME: eventually networking will be fully threaded.
StrictMode
.
ThreadPolicy
policy
=
new
StrictMode
.
ThreadPolicy
.
Builder
()
StrictMode
.
ThreadPolicy
policy
=
new
StrictMode
.
ThreadPolicy
.
Builder
()
.
permitAll
().
build
();
.
permitAll
().
build
();
StrictMode
.
setThreadPolicy
(
policy
);
StrictMode
.
setThreadPolicy
(
policy
);
try
{
try
{
mSocket
=
new
Socket
(
ipAddress
,
PORT
);
mSocket
=
new
Socket
(
ipAddress
,
PORT
);
...
@@ -49,3 +57,4 @@ public class NetworkClient extends Client {
...
@@ -49,3 +57,4 @@ public class NetworkClient extends Client {
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
Dosyayı görüntüle @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
.
communication
;
package
org
.
libreoffice
.
impressremote
.
communication
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
...
@@ -34,4 +42,57 @@ public class SlideShow {
...
@@ -34,4 +42,57 @@ public class SlideShow {
byte
[]
aImage
=
mPreviewImages
.
get
(
aSlide
);
byte
[]
aImage
=
mPreviewImages
.
get
(
aSlide
);
return
BitmapFactory
.
decodeByteArray
(
aImage
,
0
,
aImage
.
length
);
return
BitmapFactory
.
decodeByteArray
(
aImage
,
0
,
aImage
.
length
);
}
}
// ---------------------------------------------------- TIMER --------------
private
Timer
mTimer
=
new
Timer
();
public
Timer
getTimer
()
{
return
mTimer
;
}
public
class
Timer
{
/**
* This stores the starting time of the timer if running.
*
* If paused this stores how long the timer was previously running.
*/
private
long
aTime
=
0
;
private
boolean
mIsRunning
=
false
;
public
boolean
isRunning
()
{
return
mIsRunning
;
}
/**
* Reset the timer, and stop it it was running.
*/
public
void
reset
()
{
mIsRunning
=
false
;
aTime
=
0
;
}
public
void
startTimer
()
{
if
(
mIsRunning
)
return
;
aTime
=
System
.
currentTimeMillis
()
-
aTime
;
}
public
void
stopTimer
()
{
if
(!
mIsRunning
)
return
;
aTime
=
System
.
currentTimeMillis
()
-
aTime
;
}
public
long
getTimeMillis
()
{
if
(
mIsRunning
)
return
(
System
.
currentTimeMillis
()
-
aTime
);
else
return
aTime
;
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/communication/Transmitter.java
Dosyayı görüntüle @
3e0b7a71
/* -*- Mode: C++; 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
.
impressremote
.
communication
;
package
org
.
libreoffice
.
impressremote
.
communication
;
import
android.graphics.Color
;
import
android.graphics.Color
;
...
@@ -40,6 +48,7 @@ public class Transmitter {
...
@@ -40,6 +48,7 @@ public class Transmitter {
/**
/**
* Set the screen to a specific colour. Only use if a non default colour is
* Set the screen to a specific colour. Only use if a non default colour is
* needed.
* needed.
*
* @param aColor
* @param aColor
*/
*/
public
void
blankScreen
(
Color
aColor
)
{
public
void
blankScreen
(
Color
aColor
)
{
...
@@ -55,3 +64,4 @@ public class Transmitter {
...
@@ -55,3 +64,4 @@ public class Transmitter {
mClient
.
sendCommand
(
"presentation_stop\n\n"
);
mClient
.
sendCommand
(
"presentation_stop\n\n"
);
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
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