Implemented rotation of slideshow view.
Change-Id: Ib518e1609d21463273a00fcf161f20c80eae6a67
This commit is contained in:
@@ -20,21 +20,14 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".communication.TestClient"
|
||||
android:label="Remote--Direct" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service android:name=".communication.CommunicationService" >
|
||||
</service>
|
||||
|
||||
<activity android:name=".PairingActivity" >
|
||||
</activity>
|
||||
<activity android:name=".StartPresentationActivity" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".PresentationActivity"
|
||||
android:label="@string/title_activity_presentation" >
|
||||
|
BIN
android/sdremote/res/drawable/image_loading.png
Normal file
BIN
android/sdremote/res/drawable/image_loading.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 287 B |
@@ -13,8 +13,8 @@
|
||||
<pl.polidea.coverflow.CoverFlow
|
||||
xmlns:coverflow="http://schemas.android.com/apk/res/org.libreoffice.impressremote"
|
||||
android:id="@+id/presentation_coverflow"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dip"
|
||||
coverflow:imageHeight="150dip"
|
||||
coverflow:imageWidth="180dip"
|
||||
@@ -42,8 +42,8 @@
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/presentation_scrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<WebView
|
||||
android:id="@+id/presentation_notes"
|
||||
|
22
android/sdremote/res/layout/activity_startpresentation.xml
Normal file
22
android/sdremote/res/layout/activity_startpresentation.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/startpresentation_instruction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="5dip"
|
||||
android:text="@string/startpresentation_instruction" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/startpresentation_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/startpresentation_button" />
|
||||
|
||||
</LinearLayout>
|
@@ -24,7 +24,9 @@
|
||||
<string name="wifi">WI-FI</string>
|
||||
<string name="selector_noservers">Searching for computers…</string>
|
||||
<string name="pairing_instructions_1">In Impress, click on the "Slideshow" menu and select "Impress Remote".</string>
|
||||
<string name="pairing_instructions_2_deviceName">Choose "{1}" as your device.</string>
|
||||
<string name="pairing_instructions_2_deviceName">Choose \"{0}\" as your device.</string>
|
||||
<string name="pairing_instructions_3">Then input this PIN:</string>
|
||||
<string name="startpresentation_instruction">No presentation is currently running.</string>
|
||||
<string name="startpresentation_button">Start Presentation</string>
|
||||
|
||||
</resources>
|
@@ -39,21 +39,12 @@ public class PairingActivity extends Activity {
|
||||
Context.BIND_IMPORTANT);
|
||||
mIsBound = true;
|
||||
|
||||
mPinText = (TextView) findViewById(R.id.pairing_pin);
|
||||
|
||||
IntentFilter aFilter = new IntentFilter(
|
||||
CommunicationService.MSG_PAIRING_STARTED);
|
||||
aFilter.addAction(CommunicationService.MSG_PAIRING_SUCCESSFUL);
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(mListener,
|
||||
aFilter);
|
||||
|
||||
// mBluetoothContainer = findViewById(R.id.selector_container_bluetooth);
|
||||
// mBluetoothList = (LinearLayout) findViewById(R.id.selector_list_bluetooth);
|
||||
// mNetworkContainer = findViewById(R.id.selector_container_network);
|
||||
// mNetworkList = (LinearLayout) findViewById(R.id.selector_list_network);
|
||||
// mNoServerLabel = (TextView) findViewById(R.id.selector_label_none);
|
||||
//
|
||||
// refreshLists();
|
||||
}
|
||||
|
||||
private ServiceConnection mConnection = new ServiceConnection() {
|
||||
@@ -61,7 +52,9 @@ public class PairingActivity extends Activity {
|
||||
public void onServiceConnected(ComponentName aClassName,
|
||||
IBinder aService) {
|
||||
setContentView(R.layout.activity_pairing);
|
||||
|
||||
mPinText = (TextView) findViewById(R.id.pairing_pin);
|
||||
mCommunicationService = ((CommunicationService.CBinder) aService)
|
||||
.getService();
|
||||
((TextView) findViewById(R.id.pairing_instruction2_deviceName))
|
||||
.setText(MessageFormat
|
||||
.format(getResources()
|
||||
@@ -69,8 +62,6 @@ public class PairingActivity extends Activity {
|
||||
mCommunicationService
|
||||
.getDeviceName()));
|
||||
|
||||
mCommunicationService = ((CommunicationService.CBinder) aService)
|
||||
.getService();
|
||||
if (mCommunicationService.getState() == State.CONNECTING) {
|
||||
mPinText.setText(mCommunicationService.getPairingPin());
|
||||
}
|
||||
@@ -94,7 +85,9 @@ public class PairingActivity extends Activity {
|
||||
// refreshLists();
|
||||
} else if (aIntent.getAction().equals(
|
||||
CommunicationService.MSG_PAIRING_SUCCESSFUL)) {
|
||||
mPinText.setText("Paired!");
|
||||
Intent nIntent = new Intent(PairingActivity.this,
|
||||
StartPresentationActivity.class);
|
||||
startActivity(nIntent);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,7 +7,6 @@ import java.util.TimeZone;
|
||||
import org.libreoffice.impressremote.communication.CommunicationService;
|
||||
import org.libreoffice.impressremote.communication.SlideShow.Timer;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.FragmentManager;
|
||||
@@ -20,8 +19,6 @@ import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.format.DateFormat;
|
||||
import android.view.KeyEvent;
|
||||
@@ -56,9 +53,11 @@ public class PresentationActivity extends Activity {
|
||||
|
||||
setContentView(R.layout.activity_presentation);
|
||||
mOuterLayout = (FrameLayout) findViewById(R.id.framelayout);
|
||||
mOuterLayout.removeAllViews();
|
||||
mLayout = new InterceptorLayout(this);
|
||||
mOuterLayout.addView(mLayout);
|
||||
mLayout.setId(R.id.presentation_innerFrame);
|
||||
|
||||
//((FrameLayout) findViewById(R.id.framelayout)).addView(mLayout);
|
||||
mThumbnailFragment = new ThumbnailFragment();
|
||||
mPresentationFragment = new PresentationFragment();
|
||||
@@ -69,6 +68,13 @@ public class PresentationActivity extends Activity {
|
||||
fragmentTransaction.add(R.id.presentation_innerFrame,
|
||||
mPresentationFragment, "fragment_presentation");
|
||||
fragmentTransaction.commit();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
mActionBarManager.stop();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,7 +111,6 @@ public class PresentationActivity extends Activity {
|
||||
IBinder aService) {
|
||||
mCommunicationService = ((CommunicationService.CBinder) aService)
|
||||
.getService();
|
||||
mCommunicationService.setActivityMessenger(mMessenger);
|
||||
|
||||
mPresentationFragment
|
||||
.setCommunicationService(mCommunicationService);
|
||||
@@ -119,17 +124,6 @@ public class PresentationActivity extends Activity {
|
||||
}
|
||||
};
|
||||
|
||||
final Messenger mMessenger = new Messenger(new MessageHandler());
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
protected class MessageHandler extends Handler {
|
||||
@Override
|
||||
public void handleMessage(Message aMessage) {
|
||||
mPresentationFragment.handleMessage(aMessage);
|
||||
mThumbnailFragment.handleMessage(aMessage);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------- ACTION BAR ---------------
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
@@ -172,6 +166,8 @@ public class PresentationActivity extends Activity {
|
||||
FragmentManager.OnBackStackChangedListener,
|
||||
TextView.OnEditorActionListener {
|
||||
|
||||
private Handler timerHandler = new Handler();
|
||||
|
||||
private ToggleButton mTimeLabel;
|
||||
private ToggleButton mThumbnailButton;
|
||||
|
||||
@@ -204,6 +200,10 @@ public class PresentationActivity extends Activity {
|
||||
*/
|
||||
private boolean mTimerOn = false;
|
||||
|
||||
public void stop() {
|
||||
timerHandler.removeCallbacks(timerUpdateThread);
|
||||
}
|
||||
|
||||
public ActionBarManager() {
|
||||
|
||||
ActionBar aBar = getActionBar();
|
||||
@@ -284,6 +284,9 @@ public class PresentationActivity extends Activity {
|
||||
}
|
||||
|
||||
private void updateClockBar() {
|
||||
if (mCommunicationService == null) {
|
||||
return;
|
||||
}
|
||||
mClockBar_clockButton.setChecked(!mTimerOn);
|
||||
|
||||
mCountdownBar.setY(mClockBar.getHeight());
|
||||
@@ -325,8 +328,6 @@ public class PresentationActivity extends Activity {
|
||||
|
||||
}
|
||||
|
||||
private Handler timerHandler = new Handler();
|
||||
|
||||
private Thread timerUpdateThread = new Thread() {
|
||||
|
||||
@Override
|
||||
|
@@ -6,7 +6,10 @@ import org.libreoffice.impressremote.communication.SlideShow;
|
||||
import pl.polidea.coverflow.AbstractCoverFlowImageAdapter;
|
||||
import pl.polidea.coverflow.CoverFlow;
|
||||
import android.app.Fragment;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
@@ -14,7 +17,7 @@ import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -47,8 +50,8 @@ public class PresentationFragment extends Fragment {
|
||||
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
mContext = container.getContext();
|
||||
|
||||
mContext = getActivity().getApplicationContext();
|
||||
container.removeAllViews();
|
||||
View v = inflater.inflate(R.layout.fragment_presentation, container,
|
||||
false);
|
||||
|
||||
@@ -85,9 +88,26 @@ public class PresentationFragment extends Fragment {
|
||||
// We need to update the view now
|
||||
aAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
IntentFilter aFilter = new IntentFilter(
|
||||
CommunicationService.MSG_SLIDE_CHANGED);
|
||||
aFilter.addAction(CommunicationService.MSG_SLIDE_NOTES);
|
||||
aFilter.addAction(CommunicationService.MSG_SLIDE_PREVIEW);
|
||||
LocalBroadcastManager
|
||||
.getInstance(getActivity().getApplicationContext())
|
||||
.registerReceiver(mListener, aFilter);
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
LocalBroadcastManager
|
||||
.getInstance(getActivity().getApplicationContext())
|
||||
.unregisterReceiver(mListener);
|
||||
|
||||
}
|
||||
|
||||
private void updateSlideNumberDisplay() {
|
||||
int aSlide = mSlideShow.getCurrentSlide();
|
||||
mNumberText.setText((aSlide + 1) + "/" + mSlideShow.getSize());
|
||||
@@ -204,23 +224,28 @@ public class PresentationFragment extends Fragment {
|
||||
updateSlideNumberDisplay();
|
||||
}
|
||||
|
||||
public void handleMessage(Message aMessage) {
|
||||
Bundle aData = aMessage.getData();
|
||||
switch (aMessage.what) {
|
||||
case CommunicationService.MSG_SLIDE_CHANGED:
|
||||
int aSlide = aData.getInt("slide_number");
|
||||
private BroadcastReceiver mListener = new BroadcastReceiver() {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context aContext, Intent aIntent) {
|
||||
if (aIntent.getAction().equals(
|
||||
CommunicationService.MSG_SLIDE_CHANGED)) {
|
||||
int aSlide = aIntent.getExtras().getInt("slide_number");
|
||||
mTopView.setSelection(aSlide, true);
|
||||
updateSlideNumberDisplay();
|
||||
break;
|
||||
case CommunicationService.MSG_SLIDE_PREVIEW:
|
||||
int aNSlide = aData.getInt("slide_number");
|
||||
} else if (aIntent.getAction().equals(
|
||||
CommunicationService.MSG_SLIDE_PREVIEW)) {
|
||||
int aNSlide = aIntent.getExtras().getInt("slide_number");
|
||||
if (mTopView.getSelectedItemPosition() == aNSlide) {
|
||||
// mTopView. // TODO: update the current item
|
||||
mTopView.setSelection(aNSlide);
|
||||
}
|
||||
} else if (aIntent.getAction().equals(
|
||||
CommunicationService.MSG_SLIDE_NOTES)) {
|
||||
// TODO: update me
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------- THUMBNAIL ADAPTER ----
|
||||
protected class ThumbnailAdapter extends AbstractCoverFlowImageAdapter {
|
||||
|
@@ -61,6 +61,12 @@ public class SelectorActivity extends Activity {
|
||||
refreshLists();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(mListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
mCommunicationService.stopFindingServers();
|
||||
|
@@ -0,0 +1,91 @@
|
||||
package org.libreoffice.impressremote;
|
||||
|
||||
import org.libreoffice.impressremote.communication.CommunicationService;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
||||
public class StartPresentationActivity extends Activity {
|
||||
private CommunicationService mCommunicationService = null;
|
||||
private boolean mIsBound = false;
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_startpresentation);
|
||||
bindService(new Intent(this, CommunicationService.class), mConnection,
|
||||
Context.BIND_IMPORTANT);
|
||||
mIsBound = true;
|
||||
|
||||
IntentFilter aFilter = new IntentFilter(
|
||||
CommunicationService.MSG_SLIDESHOW_STARTED);
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(mListener,
|
||||
aFilter);
|
||||
|
||||
findViewById(R.id.startpresentation_button).setOnClickListener(
|
||||
mClickListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(mListener);
|
||||
}
|
||||
|
||||
private ServiceConnection mConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName aClassName,
|
||||
IBinder aService) {
|
||||
|
||||
mCommunicationService = ((CommunicationService.CBinder) aService)
|
||||
.getService();
|
||||
|
||||
if (mCommunicationService.isSlideShowRunning()) {
|
||||
Intent nIntent = new Intent(StartPresentationActivity.this,
|
||||
PresentationActivity.class);
|
||||
startActivity(nIntent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName aClassName) {
|
||||
mCommunicationService = null;
|
||||
}
|
||||
};
|
||||
|
||||
private OnClickListener mClickListener = new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mCommunicationService != null) {
|
||||
mCommunicationService.getTransmitter().startPresentation();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private BroadcastReceiver mListener = new BroadcastReceiver() {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context aContext, Intent aIntent) {
|
||||
if (aIntent.getAction().equals(
|
||||
CommunicationService.MSG_SLIDESHOW_STARTED)) {
|
||||
Intent nIntent = new Intent(StartPresentationActivity.this,
|
||||
PresentationActivity.class);
|
||||
startActivity(nIntent);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
@@ -12,11 +12,14 @@ import org.libreoffice.impressremote.communication.CommunicationService;
|
||||
import org.libreoffice.impressremote.communication.SlideShow;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -42,24 +45,35 @@ public class ThumbnailFragment extends Fragment {
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
container.removeAllViews();
|
||||
View v = inflater
|
||||
.inflate(R.layout.fragment_thumbnail, container, false);
|
||||
|
||||
mGrid = (GridView) v.findViewById(R.id.thumbnail_grid);
|
||||
|
||||
mGrid.setOnItemClickListener(new ClickListener());
|
||||
mContext = container.getContext();
|
||||
mContext = getActivity().getApplicationContext();
|
||||
|
||||
if (mCommunicationService != null && mSlideShow != null) {
|
||||
mGrid.setAdapter(new ThumbnailAdapter(mContext, mSlideShow));
|
||||
}
|
||||
|
||||
IntentFilter aFilter = new IntentFilter(
|
||||
CommunicationService.MSG_SLIDE_CHANGED);
|
||||
aFilter.addAction(CommunicationService.MSG_SLIDE_PREVIEW);
|
||||
LocalBroadcastManager
|
||||
.getInstance(getActivity().getApplicationContext())
|
||||
.registerReceiver(mListener, aFilter);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
LocalBroadcastManager
|
||||
.getInstance(getActivity().getApplicationContext())
|
||||
.unregisterReceiver(mListener);
|
||||
mGrid = null;
|
||||
mContext = null;
|
||||
mCurrentImage = null;
|
||||
@@ -135,22 +149,21 @@ public class ThumbnailFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
public void handleMessage(Message aMessage) {
|
||||
if (!isVisible()) {
|
||||
return;
|
||||
}
|
||||
private BroadcastReceiver mListener = new BroadcastReceiver() {
|
||||
|
||||
Bundle aData = aMessage.getData();
|
||||
switch (aMessage.what) {
|
||||
case CommunicationService.MSG_SLIDE_CHANGED:
|
||||
int aSlide = aData.getInt("slide_number");
|
||||
break;
|
||||
case CommunicationService.MSG_SLIDE_PREVIEW:
|
||||
@Override
|
||||
public void onReceive(Context aContext, Intent aIntent) {
|
||||
if (aIntent.getAction().equals(
|
||||
CommunicationService.MSG_SLIDE_CHANGED)) {
|
||||
int aSlide = aIntent.getExtras().getInt("slide_number");
|
||||
setSelected(aSlide);
|
||||
} else if (aIntent.getAction().equals(
|
||||
CommunicationService.MSG_SLIDE_PREVIEW)) {
|
||||
mGrid.invalidateViews();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------- THUMBNAIL ADAPTER ----
|
||||
protected class ThumbnailAdapter extends BaseAdapter {
|
||||
|
@@ -34,6 +34,8 @@ public abstract class Client {
|
||||
protected OutputStream mOutputStream;
|
||||
protected String mPin = "";
|
||||
|
||||
private static Client latestInstance = null;
|
||||
|
||||
public abstract void closeConnection();
|
||||
|
||||
private Receiver mReceiver;
|
||||
@@ -42,6 +44,7 @@ public abstract class Client {
|
||||
|
||||
public Client(Context aContext) {
|
||||
mContext = aContext;
|
||||
latestInstance = this;
|
||||
}
|
||||
|
||||
public void setReceiver(Receiver aReceiver) {
|
||||
@@ -77,11 +80,16 @@ public abstract class Client {
|
||||
// TODO stream couldn't be opened.
|
||||
e1.printStackTrace();
|
||||
}
|
||||
latestInstance = null;
|
||||
|
||||
}
|
||||
|
||||
public String getPin() {
|
||||
return mPin;
|
||||
public static String getPin() {
|
||||
if (latestInstance != null) {
|
||||
return latestInstance.mPin;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -12,7 +12,6 @@ import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.Messenger;
|
||||
|
||||
public class CommunicationService extends Service implements Runnable {
|
||||
|
||||
@@ -32,10 +31,7 @@ public class CommunicationService extends Service implements Runnable {
|
||||
}
|
||||
|
||||
public String getPairingPin() {
|
||||
if (mClient != null)
|
||||
return mClient.getPin();
|
||||
else
|
||||
return "";
|
||||
return Client.getPin();
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
@@ -67,6 +63,7 @@ public class CommunicationService extends Service implements Runnable {
|
||||
mState = State.DISCONNECTED;
|
||||
}
|
||||
if (mStateDesired == State.CONNECTED) {
|
||||
mState = State.CONNECTING;
|
||||
switch (mServerDesired.getProtocol()) {
|
||||
case NETWORK:
|
||||
mClient = new NetworkClient(
|
||||
@@ -138,10 +135,10 @@ public class CommunicationService extends Service implements Runnable {
|
||||
|
||||
private final IBinder mBinder = new CBinder();
|
||||
|
||||
public static final int MSG_SLIDESHOW_STARTED = 1;
|
||||
public static final int MSG_SLIDE_CHANGED = 2;
|
||||
public static final int MSG_SLIDE_PREVIEW = 3;
|
||||
public static final int MSG_SLIDE_NOTES = 4;
|
||||
public static final String MSG_SLIDESHOW_STARTED = "SLIDESHOW_STARTED";
|
||||
public static final String MSG_SLIDE_CHANGED = "SLIDE_CHANGED";
|
||||
public static final String MSG_SLIDE_PREVIEW = "SLIDE_PREVIEW";
|
||||
public static final String MSG_SLIDE_NOTES = "SLIDE_NOTES";
|
||||
|
||||
public static final String MSG_SERVERLIST_CHANGED = "SERVERLIST_CHANGED";
|
||||
public static final String MSG_PAIRING_STARTED = "PAIRING_STARTED";
|
||||
@@ -151,14 +148,10 @@ public class CommunicationService extends Service implements Runnable {
|
||||
|
||||
private Client mClient;
|
||||
|
||||
private Receiver mReceiver = new Receiver();
|
||||
private Receiver mReceiver = new Receiver(this);
|
||||
|
||||
private ServerFinder mFinder = new ServerFinder(this);
|
||||
|
||||
public void setActivityMessenger(Messenger aActivityMessenger) {
|
||||
mReceiver.setActivityMessenger(aActivityMessenger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -201,5 +194,9 @@ public class CommunicationService extends Service implements Runnable {
|
||||
return mReceiver.getSlideShow();
|
||||
}
|
||||
|
||||
public boolean isSlideShowRunning() {
|
||||
return mReceiver.isSlideShowRunning();
|
||||
}
|
||||
|
||||
}
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@@ -10,46 +10,40 @@ package org.libreoffice.impressremote.communication;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.os.RemoteException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.util.Base64;
|
||||
|
||||
public class Receiver {
|
||||
|
||||
private Messenger mActivityMessenger;
|
||||
public Receiver(Context aContext) {
|
||||
mContext = aContext;
|
||||
mSlideShow = new SlideShow(mContext);
|
||||
}
|
||||
|
||||
private SlideShow mSlideShow = new SlideShow();
|
||||
private Context mContext;
|
||||
|
||||
private SlideShow mSlideShow;
|
||||
|
||||
public SlideShow getSlideShow() {
|
||||
return mSlideShow;
|
||||
}
|
||||
|
||||
public void setActivityMessenger(Messenger aActivityMessenger) {
|
||||
mActivityMessenger = aActivityMessenger;
|
||||
public boolean isSlideShowRunning() {
|
||||
return (mSlideShow.getSize() > 0);
|
||||
}
|
||||
|
||||
public void parseCommand(ArrayList<String> aCommand) {
|
||||
if (mActivityMessenger == null) {
|
||||
return;
|
||||
}
|
||||
String aInstruction = aCommand.get(0);
|
||||
if (aInstruction.equals("slideshow_started")) {
|
||||
int aSlideShowlength = Integer.parseInt(aCommand.get(1));
|
||||
int aCurrentSlide = Integer.parseInt(aCommand.get(2));
|
||||
mSlideShow.setLength(aSlideShowlength);
|
||||
mSlideShow.setCurrentSlide(aCurrentSlide);
|
||||
|
||||
Message aMessage = Message.obtain(null,
|
||||
Intent aIntent = new Intent(
|
||||
CommunicationService.MSG_SLIDESHOW_STARTED);
|
||||
Bundle aData = new Bundle();
|
||||
aMessage.setData(aData);
|
||||
try {
|
||||
mActivityMessenger.send(aMessage);
|
||||
} catch (RemoteException e) {
|
||||
// Dead Handler -- i.e. Activity gone.
|
||||
}
|
||||
LocalBroadcastManager.getInstance(mContext).sendBroadcast(aIntent);
|
||||
} else {
|
||||
if (mSlideShow == null)
|
||||
return;
|
||||
@@ -60,16 +54,11 @@ public class Receiver {
|
||||
|
||||
mSlideShow.setCurrentSlide(aSlideNumber);
|
||||
|
||||
Message aMessage = Message.obtain(null,
|
||||
Intent aIntent = new Intent(
|
||||
CommunicationService.MSG_SLIDE_CHANGED);
|
||||
Bundle aData = new Bundle();
|
||||
aData.putInt("slide_number", aSlideNumber);
|
||||
aMessage.setData(aData);
|
||||
try {
|
||||
mActivityMessenger.send(aMessage);
|
||||
} catch (RemoteException e) {
|
||||
// Dead Handler -- i.e. Activity gone.
|
||||
}
|
||||
aIntent.putExtra("slide_number", aSlideNumber);
|
||||
LocalBroadcastManager.getInstance(mContext).sendBroadcast(
|
||||
aIntent);
|
||||
} else if (aInstruction.equals("slide_preview")) {
|
||||
int aSlideNumber = Integer.parseInt(aCommand.get(1));
|
||||
String aImageString = aCommand.get(2);
|
||||
@@ -78,18 +67,11 @@ public class Receiver {
|
||||
// Store image internally
|
||||
mSlideShow.putImage(aSlideNumber, aImage);
|
||||
|
||||
// Notify the frontend
|
||||
Message aMessage = Message.obtain(null,
|
||||
Intent aIntent = new Intent(
|
||||
CommunicationService.MSG_SLIDE_PREVIEW);
|
||||
Bundle aData = new Bundle();
|
||||
aData.putInt("slide_number", aSlideNumber);
|
||||
aMessage.setData(aData);
|
||||
try {
|
||||
mActivityMessenger.send(aMessage);
|
||||
} catch (RemoteException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
aIntent.putExtra("slide_number", aSlideNumber);
|
||||
LocalBroadcastManager.getInstance(mContext).sendBroadcast(
|
||||
aIntent);
|
||||
} else if (aInstruction.equals("slide_notes")) {
|
||||
int aSlideNumber = Integer.parseInt(aCommand.get(1));
|
||||
String aNotes = new String();
|
||||
@@ -100,18 +82,11 @@ public class Receiver {
|
||||
// Store image internally
|
||||
mSlideShow.putNotes(aSlideNumber, aNotes);
|
||||
|
||||
// Notify the frontend
|
||||
Message aMessage = Message.obtain(null,
|
||||
Intent aIntent = new Intent(
|
||||
CommunicationService.MSG_SLIDE_NOTES);
|
||||
Bundle aData = new Bundle();
|
||||
aData.putInt("slide_number", aSlideNumber);
|
||||
aMessage.setData(aData);
|
||||
try {
|
||||
mActivityMessenger.send(aMessage);
|
||||
} catch (RemoteException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
aIntent.putExtra("slide_number", aSlideNumber);
|
||||
LocalBroadcastManager.getInstance(mContext).sendBroadcast(
|
||||
aIntent);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -8,6 +8,9 @@
|
||||
*/
|
||||
package org.libreoffice.impressremote.communication;
|
||||
|
||||
import org.libreoffice.impressremote.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.util.SparseArray;
|
||||
@@ -19,8 +22,10 @@ public class SlideShow {
|
||||
|
||||
private int mSize = 0;
|
||||
private int mCurrentSlide = 0;
|
||||
private Context mContext;
|
||||
|
||||
protected SlideShow() {
|
||||
protected SlideShow(Context aContext) {
|
||||
mContext = aContext;
|
||||
}
|
||||
|
||||
protected void setLength(int aSize) {
|
||||
@@ -45,6 +50,10 @@ public class SlideShow {
|
||||
|
||||
public Bitmap getImage(int aSlide) {
|
||||
byte[] aImage = mPreviewImages.get(aSlide);
|
||||
if (aImage == null) {
|
||||
return BitmapFactory.decodeResource(mContext.getResources(),
|
||||
R.drawable.image_loading);
|
||||
}
|
||||
return BitmapFactory.decodeByteArray(aImage, 0, aImage.length);
|
||||
}
|
||||
|
||||
|
@@ -1,197 +1,197 @@
|
||||
/* -*- 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;
|
||||
|
||||
import org.libreoffice.impressremote.PresentationActivity;
|
||||
import org.libreoffice.impressremote.R;
|
||||
import org.libreoffice.impressremote.communication.Server.Protocol;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class TestClient extends Activity {
|
||||
|
||||
private boolean mCurrentPreviewImageMissing = false;
|
||||
|
||||
private boolean mIsBound = false;
|
||||
|
||||
private CommunicationService mCommunicationService;
|
||||
|
||||
final Messenger mMessenger = new Messenger(new MessageHandler());
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.testlayout);
|
||||
setupUI();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
doBindService();
|
||||
|
||||
}
|
||||
|
||||
// FIXME: move all necessary code to CommunicationService.onUnbind
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// TODO Auto-generated method stub
|
||||
mCommunicationService.disconnect();
|
||||
stopService(new Intent(this, CommunicationService.class));
|
||||
doUnbindService();
|
||||
finish();
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
// TODO Auto-generated method stub
|
||||
super.onStop();
|
||||
///* -*- 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;
|
||||
//
|
||||
//import org.libreoffice.impressremote.PresentationActivity;
|
||||
//import org.libreoffice.impressremote.R;
|
||||
//import org.libreoffice.impressremote.communication.Server.Protocol;
|
||||
//
|
||||
//import android.app.Activity;
|
||||
//import android.content.ComponentName;
|
||||
//import android.content.Context;
|
||||
//import android.content.Intent;
|
||||
//import android.content.ServiceConnection;
|
||||
//import android.graphics.Bitmap;
|
||||
//import android.os.Bundle;
|
||||
//import android.os.Handler;
|
||||
//import android.os.IBinder;
|
||||
//import android.os.Message;
|
||||
//import android.os.Messenger;
|
||||
//import android.view.View;
|
||||
//import android.view.View.OnClickListener;
|
||||
//import android.widget.Button;
|
||||
//import android.widget.ImageView;
|
||||
//import android.widget.TextView;
|
||||
//
|
||||
//public class TestClient extends Activity {
|
||||
//
|
||||
// private boolean mCurrentPreviewImageMissing = false;
|
||||
//
|
||||
// private boolean mIsBound = false;
|
||||
//
|
||||
// private CommunicationService mCommunicationService;
|
||||
//
|
||||
// final Messenger mMessenger = new Messenger(new MessageHandler());
|
||||
//
|
||||
// /** Called when the activity is first created. */
|
||||
// @Override
|
||||
// public void onCreate(Bundle savedInstanceState) {
|
||||
// super.onCreate(savedInstanceState);
|
||||
// setContentView(R.layout.testlayout);
|
||||
// setupUI();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void onResume() {
|
||||
// super.onResume();
|
||||
// doBindService();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// // FIXME: move all necessary code to CommunicationService.onUnbind
|
||||
//
|
||||
// @Override
|
||||
// protected void onPause() {
|
||||
// super.onPause();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onBackPressed() {
|
||||
// // TODO Auto-generated method stub
|
||||
// mCommunicationService.disconnect();
|
||||
// stopService(new Intent(this, CommunicationService.class));
|
||||
}
|
||||
|
||||
private ServiceConnection mConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName aClassName,
|
||||
IBinder aService) {
|
||||
mCommunicationService = ((CommunicationService.CBinder) aService)
|
||||
.getService();
|
||||
mCommunicationService.connectTo(new Server(Protocol.NETWORK,
|
||||
"10.0.2.2", "TestServer", 0l));
|
||||
mCommunicationService.setActivityMessenger(mMessenger);
|
||||
enableButtons(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName aClassName) {
|
||||
mCommunicationService = null;
|
||||
enableButtons(false);
|
||||
}
|
||||
};
|
||||
|
||||
void doBindService() {
|
||||
Intent aIntent = new Intent(this, CommunicationService.class);
|
||||
startService(aIntent);
|
||||
bindService(aIntent, mConnection, Context.BIND_IMPORTANT);
|
||||
mIsBound = true;
|
||||
}
|
||||
|
||||
void doUnbindService() {
|
||||
mCommunicationService.setActivityMessenger(null);
|
||||
if (mIsBound) {
|
||||
unbindService(mConnection);
|
||||
mIsBound = false;
|
||||
}
|
||||
}
|
||||
|
||||
private Button mButtonNext;
|
||||
|
||||
private Button mButtonPrevious;
|
||||
|
||||
private ImageView mImageView;
|
||||
|
||||
private TextView mSlideLabel;
|
||||
|
||||
private void setupUI() {
|
||||
mButtonNext = (Button) findViewById(R.id.button_next);
|
||||
mButtonPrevious = (Button) findViewById(R.id.button_previous);
|
||||
mImageView = (ImageView) findViewById(R.id.image_preview);
|
||||
mSlideLabel = (TextView) findViewById(R.id.label_curSlide);
|
||||
|
||||
enableButtons(false);
|
||||
|
||||
mButtonNext.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mCommunicationService.getTransmitter().nextTransition();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
mButtonPrevious.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mCommunicationService.getTransmitter().previousTransition();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Button mThumbnailButton = (Button) findViewById(R.id.button_thumbnail);
|
||||
|
||||
mThumbnailButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent aIntent = new Intent(TestClient.this,
|
||||
PresentationActivity.class);
|
||||
startActivity(aIntent);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void enableButtons(boolean aEnabled) {
|
||||
mButtonNext.setEnabled(aEnabled);
|
||||
mButtonPrevious.setEnabled(aEnabled);
|
||||
}
|
||||
|
||||
class MessageHandler extends Handler {
|
||||
@Override
|
||||
public void handleMessage(Message aMessage) {
|
||||
Bundle aData = aMessage.getData();
|
||||
switch (aMessage.what) {
|
||||
case CommunicationService.MSG_SLIDE_CHANGED:
|
||||
int newSlide = aData.getInt("slide_number");
|
||||
mSlideLabel.setText("Slide " + newSlide);
|
||||
mCurrentPreviewImageMissing = true;
|
||||
// We continue on to try and update the image.
|
||||
case CommunicationService.MSG_SLIDE_PREVIEW:
|
||||
int aSlideNumber = aData.getInt("slide_number");
|
||||
if (mCurrentPreviewImageMissing) {
|
||||
Bitmap aImage = mCommunicationService.getSlideShow()
|
||||
.getImage(aSlideNumber);
|
||||
if (aImage != null) {
|
||||
mImageView.setImageBitmap(aImage);
|
||||
mCurrentPreviewImageMissing = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
// doUnbindService();
|
||||
// finish();
|
||||
// super.onBackPressed();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void onStop() {
|
||||
// // TODO Auto-generated method stub
|
||||
// super.onStop();
|
||||
// // mCommunicationService.disconnect();
|
||||
// // stopService(new Intent(this, CommunicationService.class));
|
||||
// }
|
||||
//
|
||||
// private ServiceConnection mConnection = new ServiceConnection() {
|
||||
// @Override
|
||||
// public void onServiceConnected(ComponentName aClassName,
|
||||
// IBinder aService) {
|
||||
// mCommunicationService = ((CommunicationService.CBinder) aService)
|
||||
// .getService();
|
||||
// mCommunicationService.connectTo(new Server(Protocol.NETWORK,
|
||||
// "10.0.2.2", "TestServer", 0l));
|
||||
// mCommunicationService.setActivityMessenger(mMessenger);
|
||||
// enableButtons(true);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onServiceDisconnected(ComponentName aClassName) {
|
||||
// mCommunicationService = null;
|
||||
// enableButtons(false);
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// void doBindService() {
|
||||
// Intent aIntent = new Intent(this, CommunicationService.class);
|
||||
// startService(aIntent);
|
||||
// bindService(aIntent, mConnection, Context.BIND_IMPORTANT);
|
||||
// mIsBound = true;
|
||||
// }
|
||||
//
|
||||
// void doUnbindService() {
|
||||
// mCommunicationService.setActivityMessenger(null);
|
||||
// if (mIsBound) {
|
||||
// unbindService(mConnection);
|
||||
// mIsBound = false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private Button mButtonNext;
|
||||
//
|
||||
// private Button mButtonPrevious;
|
||||
//
|
||||
// private ImageView mImageView;
|
||||
//
|
||||
// private TextView mSlideLabel;
|
||||
//
|
||||
// private void setupUI() {
|
||||
// mButtonNext = (Button) findViewById(R.id.button_next);
|
||||
// mButtonPrevious = (Button) findViewById(R.id.button_previous);
|
||||
// mImageView = (ImageView) findViewById(R.id.image_preview);
|
||||
// mSlideLabel = (TextView) findViewById(R.id.label_curSlide);
|
||||
//
|
||||
// enableButtons(false);
|
||||
//
|
||||
// mButtonNext.setOnClickListener(new OnClickListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// mCommunicationService.getTransmitter().nextTransition();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// });
|
||||
//
|
||||
// mButtonPrevious.setOnClickListener(new OnClickListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// mCommunicationService.getTransmitter().previousTransition();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// });
|
||||
//
|
||||
// Button mThumbnailButton = (Button) findViewById(R.id.button_thumbnail);
|
||||
//
|
||||
// mThumbnailButton.setOnClickListener(new OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// Intent aIntent = new Intent(TestClient.this,
|
||||
// PresentationActivity.class);
|
||||
// startActivity(aIntent);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private void enableButtons(boolean aEnabled) {
|
||||
// mButtonNext.setEnabled(aEnabled);
|
||||
// mButtonPrevious.setEnabled(aEnabled);
|
||||
// }
|
||||
//
|
||||
// class MessageHandler extends Handler {
|
||||
// @Override
|
||||
// public void handleMessage(Message aMessage) {
|
||||
// Bundle aData = aMessage.getData();
|
||||
// switch (aMessage.what) {
|
||||
// case CommunicationService.MSG_SLIDE_CHANGED:
|
||||
// int newSlide = aData.getInt("slide_number");
|
||||
// mSlideLabel.setText("Slide " + newSlide);
|
||||
// mCurrentPreviewImageMissing = true;
|
||||
// // We continue on to try and update the image.
|
||||
// case CommunicationService.MSG_SLIDE_PREVIEW:
|
||||
// int aSlideNumber = aData.getInt("slide_number");
|
||||
// if (mCurrentPreviewImageMissing) {
|
||||
// Bitmap aImage = mCommunicationService.getSlideShow()
|
||||
// .getImage(aSlideNumber);
|
||||
// if (aImage != null) {
|
||||
// mImageView.setImageBitmap(aImage);
|
||||
// mCurrentPreviewImageMissing = false;
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
///* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
Reference in New Issue
Block a user