Commit 3d2f65ca authored by Thomas Krex's avatar Thomas Krex

skalierung des vollbildes funtkioniert. container view des surfaceViews wird skaliert.

parent 8db0bb29
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.make_local_variable_final=false
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=true
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_trailing_whitespaces=false
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=true
sp_cleanup.remove_unnecessary_nls_tags=false
sp_cleanup.remove_unused_imports=false
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
......@@ -5,14 +5,19 @@
android:orientation="horizontal"
>
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true">
<SurfaceView
android:id="@+id/playerView"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
/>
</LinearLayout>
<ScrollView
android:id="@+id/indexScrollView"
......
package tttclient.activities;
import android.content.Context;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
public class MySurfaceView extends SurfaceView implements
SurfaceHolder.Callback {
private final Context context;
private final SurfaceHolder holder;
public MySurfaceView(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
this.holder = getHolder();
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
// TODO Auto-generated method stub
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
// TODO Auto-generated method stub
}
}
......@@ -11,12 +11,15 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.view.Display;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.inputmethod.EditorInfo;
import android.widget.LinearLayout;
import android.widget.MediaController;
import android.widget.MediaController.MediaPlayerControl;
import android.widget.ScrollView;
......@@ -47,6 +50,7 @@ public class PlayerActivity extends SherlockActivity implements
static final int LAYOUT_MODE_EXTENDED = 1;
public String fileName;
public String filePath;
private LinearLayout container;
public SurfaceView surfaceView;
private SurfaceHolder sHolder;
private ViewSwitcher switcher;
......@@ -66,6 +70,7 @@ public class PlayerActivity extends SherlockActivity implements
// switcher = (ViewSwitcher) findViewById(R.id.viewSwitcher);
// default fullscreen
container = (LinearLayout) findViewById(R.id.container);
surfaceView = (SurfaceView) findViewById(R.id.playerView);
fileName = getIntent().getStringExtra(DownloadService.FILE_NAME);
setTitle(fileName);
......@@ -146,6 +151,7 @@ public class PlayerActivity extends SherlockActivity implements
@Override
protected void onPostExecute(Void result) {
scaleView();
// close dialog
dialog.dismiss();
// show control bar
......@@ -348,4 +354,14 @@ public class PlayerActivity extends SherlockActivity implements
}
public void scaleView() {
Display display = getWindowManager().getDefaultDisplay();
float aspectRatio = (float) display.getHeight()
/ (float) recording.getProtocolPreferences().framebufferHeight;
LayoutParams lp = container.getLayoutParams();
lp.width = (int) (aspectRatio * recording.getProtocolPreferences().framebufferWidth);
container.setLayoutParams(lp);
}
}
......@@ -111,6 +111,7 @@ public class GraphicsContext implements MessageConsumer {
recording.getProtocolPreferences().framebufferWidth,
recording.getProtocolPreferences().framebufferHeight,
false, null);
// savecount = canvas.save();
// } else
// canvas.restoreToCount(savecount);
......
......@@ -94,6 +94,7 @@ public class Recording extends MessageProducerAdapter implements Runnable {
@Override
public void run() {
holder.setFixedSize(prefs.framebufferWidth,
prefs.framebufferHeight);
......
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