Commit 8c0f8fa1 authored by Sébastien Toque's avatar Sébastien Toque

don't use deprecated getWidth & getHeight + remove unused imports

parent fedc8720
......@@ -18,9 +18,7 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
import com.actionbarsherlock.app.SherlockListFragment;
......
......@@ -21,20 +21,16 @@
package org.videolan.vlc.gui.audio;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.videolan.vlc.AudioServiceController;
import org.videolan.vlc.LibVLC;
import org.videolan.vlc.Media;
import org.videolan.vlc.MediaLibrary;
import org.videolan.vlc.R;
import org.videolan.vlc.gui.video.VideoPlayerActivity;
import org.videolan.vlc.interfaces.ISortable;
import org.videolan.vlc.widget.FlingViewGroup;
import org.videolan.vlc.widget.FlingViewGroup.ViewSwitchListener;
......
......@@ -27,8 +27,8 @@ import org.videolan.vlc.Util;
import org.videolan.vlc.interfaces.IAudioPlayer;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.media.AudioManager;
import android.os.Bundle;
import android.util.Log;
......@@ -64,9 +64,10 @@ public class AudioPlayerActivity extends Activity implements IAudioPlayer {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
android.view.Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
Point size = new Point();
getWindowManager().getDefaultDisplay().getSize(size);
int width = size.x;
int height = size.y;
Log.v(TAG, "width = " + width + " : height = " + height);
if(width == 240 && height == 320) /* QVGA 2.7in */
setContentView(R.layout.audio_player_qvga);
......
......@@ -33,6 +33,7 @@ import org.videolan.vlc.Util;
import android.app.ListActivity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.Bitmap.Config;
import android.os.Bundle;
import android.os.Handler;
......@@ -108,8 +109,9 @@ public class MediaInfoActivity extends ListActivity {
mHandler.sendEmptyMessage(NEW_TEXT);
if (mImage == null) {
int width = Math.min(getWindowManager().getDefaultDisplay().getWidth(),
getWindowManager().getDefaultDisplay().getHeight());
Point size = new Point();
getWindowManager().getDefaultDisplay().getSize(size);
int width = Math.min(size.x, size.y);
int height = width * 9 / 16;
// Get the thumbnail.
......
......@@ -48,6 +48,7 @@ import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.media.AudioManager;
import android.os.Build;
import android.os.Bundle;
......@@ -421,8 +422,10 @@ public class VideoPlayerActivity extends Activity {
private void changeSurfaceSize() {
// get screen size
int dw = getWindowManager().getDefaultDisplay().getWidth();
int dh = getWindowManager().getDefaultDisplay().getHeight();
Point size = new Point();
getWindowManager().getDefaultDisplay().getSize(size);
int dw = size.x;
int dh = size.y;
// calculate aspect ratio
double ar = (double) mVideoWidth / (double) mVideoHeight;
......@@ -479,10 +482,11 @@ public class VideoPlayerActivity extends Activity {
@Override
public boolean onTouchEvent(MotionEvent event) {
if (mAudioDisplayRange == 0)
mAudioDisplayRange = Math.min(
getWindowManager().getDefaultDisplay().getWidth(),
getWindowManager().getDefaultDisplay().getHeight());
if (mAudioDisplayRange == 0) {
Point size = new Point();
getWindowManager().getDefaultDisplay().getSize(size);
mAudioDisplayRange = Math.min(size.x, size.y);
}
switch (event.getAction()) {
......
......@@ -51,7 +51,7 @@ public class FlingViewGroup extends ViewGroup {
super(context, attrs);
this.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.FILL_PARENT));
ViewGroup.LayoutParams.MATCH_PARENT));
mScroller = new Scroller(context);
ViewConfiguration config = ViewConfiguration.get(getContext());
......
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