Commit 3a48ce9d authored by Thomas Krex's avatar Thomas Krex
Browse files

empty view in feedactivity hinzugefügt

parent 2043cb46
# cache for current jar dependency. DO NOT EDIT.
# format is <lastModified> <length> <SHA-1> <path>
# Encoding is UTF-8
1390577451000 627582 db0f122c99ef9f90dbab3fada6d191f2880cbb8e /Volumes/Macintosh HD/Users/thomaskrex/git/TTTAndroidClient/TTTCLient/libs/android-support-v4.jar
1375081746000 271754 53307dc2bd2b69fd5533458ee11885f55807de4b /Volumes/Macintosh HD/Users/thomaskrex/BA_workspace/actionbarsherlock/libs/android-support-v4.jar
......@@ -12,8 +12,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
android:layout_height="match_parent" >
<ImageView
android:id="@+id/playerView_fullscreen"
......@@ -26,6 +25,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:orientation="horizontal"
android:weightSum="3" >
......
<?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/textView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="No Feeds found!!! \n\n Add a feed by clicking on \n + \nin the Actionbar"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/darker_gray" />
</LinearLayout>
\ No newline at end of file
......@@ -10,4 +10,12 @@
android:layout_height="wrap_content" >
</ListView>
<ViewStub
android:id="@+id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout="@layout/empty_feeds" >
</ViewStub>
</LinearLayout>
\ No newline at end of file
......@@ -6,15 +6,15 @@
<TextView
android:id="@+id/itemTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="4"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="@+id/statusIcon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/ic_action_download" >
</ImageView>
......
......@@ -20,7 +20,7 @@
<resources>
<style name="Theme.Customactionbar" parent="@style/Theme.Sherlock.Light">
<style name="Theme.Customactionbar" parent="@style/Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarItemBackground">@drawable/selectable_background_customactionbar</item>
<item name="popupMenuStyle">@style/PopupMenu.Customactionbar</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Customactionbar</item>
......@@ -32,7 +32,7 @@
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Customactionbar</item>
</style>
<style name="ActionBar.Solid.Customactionbar" parent="@style/Widget.Sherlock.Light.ActionBar.Solid">
<style name="ActionBar.Solid.Customactionbar" parent="@style/Widget.Sherlock.Light.ActionBar">
<item name="background">@drawable/ab_solid_customactionbar</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_customactionbar</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_customactionbar</item>
......
......@@ -54,6 +54,8 @@ public class FeedActivity extends SherlockActivity implements
android.R.id.text1, android.R.id.text2 });
feedList.setAdapter(adapter);
View empty = findViewById(R.id.empty);
feedList.setEmptyView(empty);
feedList.setOnItemClickListener(this);
feedList.setOnItemLongClickListener(this);
......
......@@ -108,7 +108,7 @@ public class FeedDetailActivity extends SherlockActivity implements
// init progress dialog for showing downloading/unzipping progress
progressDialog = new ProgressDialog(FeedDetailActivity.this);
progressDialog.setIndeterminate(true);
progressDialog.setTitle("Downloading File");
progressDialog.setTitle("Downloading File...");
progressDialog.setMessage("0% downloaded");
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setCanceledOnTouchOutside(false);
......
......@@ -72,6 +72,8 @@ public class PlayerActivity extends SherlockActivity implements
dialog.setTitle("Please Wait");
dialog.setMessage("Prepare File ...");
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
AsyncTask<Void, Void, Void> initTask = new AsyncTask<Void, Void, Void>() {
......@@ -88,6 +90,10 @@ public class PlayerActivity extends SherlockActivity implements
recording = new Recording(getApplicationContext(), tttFile,
audioPlayer, imgV, scrollView);
Log.d("Prefs",
" bits/pixel "
+ recording.getProtocolPreferences().bitsPerPixel);
OnClickListener prevListener = new OnClickListener() {
@Override
......@@ -145,13 +151,11 @@ public class PlayerActivity extends SherlockActivity implements
@Override
public boolean canSeekBackward() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canSeekForward() {
// TODO Auto-generated method stub
return false;
}
......@@ -292,20 +296,17 @@ public class PlayerActivity extends SherlockActivity implements
void switchLayout(int index) {
// fullscreen
// switch to fullscreen
if (index == 0) {
imgV = (ImageView) findViewById(R.id.playerView_fullscreen);
recording.graphicsContext().setImageView(imgV);
// recording.focusCurrentIndexEntry(recording.getLastIndexFired() -
// 1);
switcher.setDisplayedChild(0);
}
// extended View
// switch to extended View
if (index == 1) {
imgV = (ImageView) findViewById(R.id.playerView_extended);
recording.graphicsContext().setImageView(imgV);
recording.graphicsContext().updateView();
switcher.setDisplayedChild(1);
......
......@@ -20,7 +20,6 @@ import android.graphics.Rect;
import android.media.Image;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.widget.ImageView;
import android.widget.LinearLayout;
......@@ -37,7 +36,6 @@ public class GraphicsContext implements MessageConsumer {
private final Handler scrollHandler;
private final BitmapContainer bitmapContainer;
private final Canvas canvas;
private ImageView imgView;
private boolean refreshEnabled = false;
......@@ -76,7 +74,6 @@ public class GraphicsContext implements MessageConsumer {
Config.ARGB_4444));
// canvas to Bitmap
this.canvas = new Canvas(bitmapContainer.getBimap());
this.pixels = bitmapContainer.getPixels();
hextile_bg_encoded = new byte[prefs.bytesPerPixel];
......@@ -89,13 +86,7 @@ public class GraphicsContext implements MessageConsumer {
@Override
public void handleMessage(android.os.Message inputMessage) {
// Gets the image task from the incoming Message object.
Bitmap bitmap = bitmapContainer.getBimap();
Canvas canvas = new Canvas(bitmap);
if (isWhiteboardEnabled())
paintWhiteboard(canvas);
paintAnnotations(canvas);
recording.highlightSearchResults(canvas);
Bitmap bitmap = (Bitmap) inputMessage.obj;
imgView.setImageBitmap(bitmap);
......@@ -118,14 +109,6 @@ public class GraphicsContext implements MessageConsumer {
};
}
// public void setSurfaceView(SurfaceView surfaceView) {
// this.overlay = surfaceView;
// overlay.setZOrderOnTop(true);
// sHolder = overlay.getHolder();
// sHolder.setFixedSize(prefs.framebufferWidth, prefs.framebufferHeight);
//
// }
// public static void borderRect(int[] array, Rect r, int color,
// int screenWidth) {
// int x = r.left;
......@@ -150,18 +133,6 @@ public class GraphicsContext implements MessageConsumer {
// }
// }
// public void updateOverlay() {
//
// Canvas canvas = sHolder.lockCanvas();
// if (canvas != null) {
// canvas.drawBitmap(bitmapContainer.getBimap(), 0, 0, null);
// paintAnnotations(canvas);
// recording.highlightSearchResults(canvas);
// sHolder.unlockCanvasAndPost(canvas);
// }
//
// }
public void enableRefresh(boolean refresh) {
this.refreshEnabled = refresh;
}
......@@ -204,18 +175,34 @@ public class GraphicsContext implements MessageConsumer {
// draw Canvas on current Bitmap
public void updateView() {
if (refreshEnabled) {
android.os.Message message = viewHandler.obtainMessage();
// Thread paintThread = new Thread(new Runnable() {
//
// @Override
// public void run() {
Bitmap bitmap = bitmapContainer.getBitmap();
Canvas canvas = new Canvas(bitmap);
if (isWhiteboardEnabled())
paintWhiteboard(canvas);
paintAnnotations(canvas);
recording.highlightSearchResults(canvas);
android.os.Message message = viewHandler.obtainMessage(0, bitmap);
message.sendToTarget();
// }
// });
// paintThread.start();
}
}
// // set new Bitmap
// public void updateView(final Bitmap bitmap) {
// if (refreshEnabled) {
// android.os.Message message = viewHandler.obtainMessage(0, bitmap);
// message.sendToTarget();
// }
// }
// set new Bitmap
public void updateView(final Bitmap bitmap) {
if (refreshEnabled) {
android.os.Message message = viewHandler.obtainMessage(0, bitmap);
message.sendToTarget();
}
}
public int decodeColor(byte[] colorField) {
int color = (colorField[1] & 0xFF) << 8 | (colorField[0] & 0xFF);
......@@ -235,6 +222,34 @@ public class GraphicsContext implements MessageConsumer {
}
//
// public int decodeColor(byte[] colorField) {
// int color = 0;
// for (int i = 0, shift = 0; i < prefs.bytesPerPixel; i++, shift += 8) {
// color += (colorField[i] & 0xFF) << shift;
// }
//
// switch (prefs.bitsPerPixel) {
// case 16:
// if (prefs.bigEndian)
// // 16 bit big endian: swap bytes
// color = (color & 0xFF) << 8 | ((color & 0xFF00) >> 8);
// // case 8:
// // // use color table
// // return colors[color];
// // default:
// // // use default color
// // if (prefs.bigEndian) {
// // // 24 bit big endian: swap bytes
// // color = (color & 0xFF) << 24 | (color >> 8 & 0xFF) << 16
// // | (color >> 16 & 0xFF) << 8 | color >> 24 & 0xFF;
// // }
// // return new Color(color);
//
// }
// return color;
// }
public void setForeground(byte[] color, int offset) {
System.arraycopy(color, offset, hextile_fg_encoded, 0,
prefs.bytesPerPixel);
......@@ -255,20 +270,14 @@ public class GraphicsContext implements MessageConsumer {
}
public void handleUpdatedPixels(int[] pixel) {
Log.d("GC", "setting new pixel array");
bitmapContainer.getBimap().setPixels(pixel, 0, prefs.framebufferWidth,
0, 0, prefs.framebufferWidth, prefs.framebufferHeight);
}
public void handleUpdatedPixels(int x, int y, int w, int h) {
// if recording is adjusting, messages are not painted one by one but
// only the final image
if (!recording.adjusting) {
bitmapContainer.getBimap().setPixels(pixels,
x + y * prefs.framebufferWidth, prefs.framebufferWidth, x,
y, w, h);
// bitmapContainer.getCurBitmap().setPixels(pixels,
// x + y * prefs.framebufferWidth, prefs.framebufferWidth, x,
// y, w, h);
updateView();
}
......@@ -352,27 +361,10 @@ public class GraphicsContext implements MessageConsumer {
// show blank page if whiteboard activated
if (isWhiteboardEnabled()) {
// int[] whitePixels = new int[(int) (prefs.framebufferWidth *
// IndexEntry.THUMBNAIL_SCALE_FACTOR)
// * (int) (prefs.framebufferHeight *
// IndexEntry.THUMBNAIL_SCALE_FACTOR)];
// for (int i = 0; i < whitePixels.length; i++) {
// whitePixels[i] = Color.WHITE;
// screenshot.setPixels(whitePixels, 0, stride, x, y, width,
// height);
Canvas canvas = new Canvas(screenshot);
canvas.drawColor(Color.WHITE);
// Bitmap whiteboard = Bitmap
// .createBitmap(
// whitePixels,
// (int) (prefs.framebufferWidth *
// IndexEntry.THUMBNAIL_SCALE_FACTOR),
// (int) (prefs.framebufferHeight *
// IndexEntry.THUMBNAIL_SCALE_FACTOR),
// Config.ARGB_4444);
// return whiteboard;
} else
screenshot.setPixels(pixels, 0, prefs.framebufferWidth, 0, 0,
prefs.framebufferWidth, prefs.framebufferHeight);
......
......@@ -415,7 +415,6 @@ public class Index {
}
// set collected annotations
Log.d("Index", "Annotations: " + annotations.size());
recording.getIndex().get(i).setAnnotations(annotations);
// clear buffer if index ended with a delete event, which was not
......
......@@ -13,6 +13,7 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.LinearLayout;
......@@ -26,7 +27,7 @@ public class IndexEntry extends ImageButton {
private String searchbase_of_page;
private ArrayList<SearchBaseEntry> words;
private ArrayList<Annotation> annotations;
public static double THUMBNAIL_SCALE_FACTOR = 0.3;
public static double THUMBNAIL_SCALE_FACTOR = 1;
public static boolean SCALE_FACTOR_CALCULATED = false;
private boolean hasThumbnail = false;
......@@ -86,7 +87,7 @@ public class IndexEntry extends ImageButton {
}
public void updateThumbail() {
Bitmap bitmap = bitmapContainer.getBimap();
Bitmap bitmap = bitmapContainer.getBitmap();
Canvas canvas = new Canvas(bitmap);
paintAnnotations(canvas);
highlightSearchResultsOnThumbail(canvas);
......@@ -213,20 +214,20 @@ public class IndexEntry extends ImageButton {
}
}
// show annoattions (if enabled)
// show annotations (if enabled)
void paintAnnotations(Canvas canvas) {
boolean paintHighlightAnnotations = index.getAnnotationsPaintMode() == Index.PAINT_ALL_ANNOTATIONS;
if (annotations != null)
if (annotations != null) {
Log.d("IndexEntry", "annotaion to thumbnail");
if (index.getAnnotationsPaintMode() != Index.PAINT_NO_ANNOTATIONS)
for (int i = 0; i < annotations.size(); i++) {
Annotation annotation = annotations.get(i);
if (paintHighlightAnnotations
|| !(annotation instanceof HighlightAnnotation)) {
annotation.paint(canvas);
}
|| !(annotation instanceof HighlightAnnotation))
annotation.paintToThumbnail(canvas);
;
}
}
}
}
......@@ -545,9 +545,9 @@ public class Recording extends MessageProducerAdapter implements Runnable {
// messages.setTime_full_frame_check_regarding_stripes(time);
if (refresh) {
// TODO timeout justieren
if (Math.abs(time - previousTime) < 10 && time > 5) {
return;
}
// if (Math.abs(time - previousTime) < 1000 && time > 5) {
// return;
// }
previousTime = time;
// focusCurrentIndexEntry(time);
......
......@@ -40,20 +40,6 @@ import android.graphics.RectF;
*/
public class SearchBaseEntry {
// character widths for dynamic underlining
// static int[] widths = new int[256];
// static {
// // choose standard font (proportions will be similar for other fonts)
// Font f = new Font("Serif", Font.PLAIN, 16);
// FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(f);
//
// // determine size of printable characters (all others will be zero)
// for (char c = 32; c < 127; c++)
// widths[c] = metrics.charWidth(c);
// for (char c = 161; c < 256; c++)
// widths[c] = metrics.charWidth(c);
// }
private final int x, y, width, height;
// TODO: maybe ratio should be handled in index
......
......@@ -26,7 +26,6 @@ package tttclient.messages;
import tttclient.core.Constants;
import tttclient.core.GraphicsContext;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
......@@ -53,7 +52,9 @@ public abstract class Annotation extends Message {
public boolean temporary;
// special thumbnail drawing if needed (to avoid ugly scaling)
public abstract void paintToThumbnail(Bitmap bitmap);
public void paintToThumbnail(Canvas canvas) {
paint(canvas);
}
abstract public boolean contains(int x, int y);
......
......@@ -26,7 +26,6 @@ package tttclient.messages;
import tttclient.core.Constants;
import tttclient.core.GraphicsContext;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
......@@ -79,10 +78,4 @@ public class DeleteAllAnnotation extends Annotation {
return 1;
}
@Override
public void paintToThumbnail(Bitmap bitmap) {
// TODO Auto-generated method stub
}
}
......@@ -30,7 +30,6 @@ import java.io.OutputStream;
import tttclient.core.Constants;
import tttclient.core.GraphicsContext;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
......@@ -100,10 +99,4 @@ public class DeleteAnnotation extends Annotation {
return 5;
}
@Override
public void paintToThumbnail(Bitmap bitmap) {
// TODO Auto-generated method stub
}
}
Supports Markdown
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