Commit 6d90ee31 authored by Thomas Krex's avatar Thomas Krex
Browse files

anpassung des layouts für alle displaygrößen

(layout_weight)
-problem mit höhe der imagebuttons gelöst
-sklaierung wird nun vollständig von android übernommen
parent c5e680f4
# cache for current jar dependency. DO NOT EDIT.
# format is <lastModified> <length> <SHA-1> <path>
# Encoding is UTF-8
......@@ -18,30 +18,29 @@
android:id="@+id/playerView_fullscreen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
android:scaleType="centerInside" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
android:orientation="horizontal"
android:weightSum="3" >
<ScrollView
android:id="@+id/indexScrollView"
android:layout_width="300dp"
android:layout_height="fill_parent"
android:layout_weight="3"
android:fillViewport="true"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:fillViewport="false"
android:paddingLeft="5dip" >
</ScrollView>
<ImageView
android:id="@+id/playerView_extended"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/scrollView1"
android:layout_weight="5"
android:layout_weight="2"
android:background="@drawable/my_border"
android:padding="10dip"
android:scaleType="centerInside"
......
......@@ -151,8 +151,8 @@ public class PlayerActivity extends Activity implements MediaPlayerControl {
recording.getIndex().search(word);
// update display if recording is not playing
if (!recording.isPlaying())
recording.graphicsContext().updateCanvas();
// if (!recording.isPlaying())
recording.graphicsContext().updateCanvas();
}
......@@ -308,7 +308,6 @@ public class PlayerActivity extends Activity implements MediaPlayerControl {
if (index == 1) {
imgV = (ImageView) findViewById(R.id.playerView_extended);
recording.graphicsContext().setImageView(imgV);
recording.graphicsContext().setImageView(imgV);
recording.graphicsContext().refresh();
switcher.setDisplayedChild(1);
......
......@@ -25,7 +25,6 @@
package tttclient.messages;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import tttclient.ttt.Constants;
......@@ -76,16 +75,6 @@ public class CopyRectMessage extends FramebufferUpdateMessage {
******************************************************************************************************************/
// write message to TTT output stream
@Override
public void write(DataOutputStream out, int writeTimestamp)
throws IOException {
// header
writeHeader(out, writeTimestamp);
out.writeShort(x);
out.writeShort(y);
out.writeShort(width);
out.writeShort(height);
};
// return size of message in bytes (if written to stream)
@Override
......
......@@ -293,21 +293,6 @@ public class CursorMessage extends FramebufferUpdateMessage {
* write message
******************************************************************************************************************/
// write message to TTT output stream
@Override
public void write(DataOutputStream out, int writeTimestamp)
throws IOException {
// header
writeHeader(out, writeTimestamp);
out.writeShort(x);
out.writeShort(y);
out.writeShort(width);
out.writeShort(height);
// encoded data
out.write(data);
};
// return size of message in bytes (if written to stream)
@Override
public int getSize() {
......
......@@ -25,7 +25,6 @@
package tttclient.messages;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import tttclient.ttt.Constants;
......@@ -68,15 +67,6 @@ public class CursorPositionMessage extends FramebufferUpdateMessage {
* write message
******************************************************************************************************************/
// write message to TTT output stream
@Override
public void write(DataOutputStream out, int writeTimestamp)
throws IOException {
writeHeader(out, writeTimestamp);
out.writeShort(x);
out.writeShort(y);
};
// return size of message in bytes (if written to stream)
@Override
public int getSize() {
......
......@@ -25,7 +25,6 @@
package tttclient.messages;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import tttclient.ttt.Constants;
......@@ -78,19 +77,6 @@ public abstract class FramebufferUpdateMessage extends Message {
******************************************************************************************************************/
// write message to TTT output stream
@Override
public void write(DataOutputStream out, int writeTimestamp)
throws IOException {
// header
// writeHeader(out, writeTimestamp);
out.writeShort(x);
out.writeShort(y);
out.writeShort(width);
out.writeShort(height);
// encoded data
out.write(data);
};
// return size of message in bytes (if written to stream)
@Override
......
......@@ -24,12 +24,14 @@
package tttclient.messages;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import tttclient.messages.annotations.DeleteAllAnnotation;
import tttclient.messages.annotations.DeleteAnnotation;
import tttclient.messages.annotations.FreehandAnnotation;
import tttclient.messages.annotations.HighlightAnnotation;
import tttclient.messages.annotations.LineAnnotation;
import tttclient.messages.annotations.RectangleAnnotation;
import tttclient.ttt.Constants;
import tttclient.ttt.GraphicsContext;
import tttclient.ttt.ProtocolPreferences;
......@@ -84,39 +86,39 @@ public abstract class Message {
static final public int TIMESTAMP_OF_MESSAGE = -2;
// write message to TTT output stream
abstract public void write(DataOutputStream out, int writeTimestamp)
throws IOException;
// helper method to write message header, because it's the same for all
// messages
final void writeHeader(DataOutputStream out, int writeTimestamp)
throws IOException {
switch (writeTimestamp) {
case NO_TIMESTAMP:
// size of message
out.writeInt(getSize());
// encoding without timestamp
out.writeByte(getEncoding());
break;
case TIMESTAMP_OF_MESSAGE:
// size of message
out.writeInt(getSize() + 4);
// encoding and timestamp
out.writeByte(getEncoding() | Constants.EncodingFlagTimestamp);
out.writeInt(getTimestamp());
break;
default:
// size of message
out.writeInt(getSize() + 4);
// encoding and timestamp
out.writeByte(getEncoding() | Constants.EncodingFlagTimestamp);
out.writeInt(writeTimestamp);
break;
}
}
// abstract public void write(DataOutputStream out, int writeTimestamp)
// throws IOException;
//
// // helper method to write message header, because it's the same for all
// // messages
// final void writeHeader(DataOutputStream out, int writeTimestamp)
// throws IOException {
// switch (writeTimestamp) {
// case NO_TIMESTAMP:
// // size of message
// out.writeInt(getSize());
// // encoding without timestamp
// out.writeByte(getEncoding());
// break;
//
// case TIMESTAMP_OF_MESSAGE:
// // size of message
// out.writeInt(getSize() + 4);
// // encoding and timestamp
// out.writeByte(getEncoding() | Constants.EncodingFlagTimestamp);
// out.writeInt(getTimestamp());
// break;
//
// default:
// // size of message
// out.writeInt(getSize() + 4);
// // encoding and timestamp
// out.writeByte(getEncoding() | Constants.EncodingFlagTimestamp);
// out.writeInt(writeTimestamp);
//
// break;
// }
// }
// return size of message in bytes (if written to stream)
abstract public int getSize();
......@@ -169,17 +171,17 @@ public abstract class Message {
// read body
switch (encoding) {
// case Constants.AnnotationRectangle:
// message = new RectangleAnnotation(timestamp, in);
// break;
case Constants.AnnotationRectangle:
message = new RectangleAnnotation(timestamp, in);
break;
//
case Constants.AnnotationHighlight:
message = new HighlightAnnotation(timestamp, in);
break;
//
// case Constants.AnnotationLine:
// message = new LineAnnotation(timestamp, in);
// break;
case Constants.AnnotationLine:
message = new LineAnnotation(timestamp, in);
break;
//
case Constants.AnnotationFreehand:
message = new FreehandAnnotation(timestamp, in);
......@@ -193,9 +195,9 @@ public abstract class Message {
// message = new TextAnnotation(timestamp, in); // MODMSG
// break;
//
// case Constants.AnnotationDelete:
// message = new DeleteAnnotation(timestamp, in);
// break;
case Constants.AnnotationDelete:
message = new DeleteAnnotation(timestamp, in);
break;
//
case Constants.AnnotationDeleteAll:
message = new DeleteAllAnnotation(timestamp);
......
......@@ -25,7 +25,6 @@
package tttclient.messages;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
......@@ -181,36 +180,6 @@ public class Messages {
return total;
}
/*******************************************************************************************************************
* write messages
******************************************************************************************************************/
public void writeMessages(DataOutputStream out) throws IOException {
// write all messages
System.out.print("writing ");
int lastTimestamp = -1; // causes first message including timestamp
for (int i = 0; i < messages.size(); i++) {
Message message = messages.get(i);
// write message (with timestamp if needed)
int timestamp = message.getTimestamp();
if (timestamp == lastTimestamp)
message.write(out, Message.NO_TIMESTAMP);
else
message.write(out, timestamp);
lastTimestamp = timestamp;
if (i % 1000 == 0)
System.out.print(".");
}
out.close();
System.out.println(" done.");
}
/*******************************************************************************************************************
* keyframes *
******************************************************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment