From: <Rol...@us...> - 2011-03-30 22:44:49
|
Revision: 4158 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4158&view=rev Author: Rollsroyc3 Date: 2011-03-30 22:44:42 +0000 (Wed, 30 Mar 2011) Log Message: ----------- start of moving pictures plugin Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/plugins.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Plugins.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_menu_skin1_movingpictures.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_icon.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_movie.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures_movie.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2011-03-30 22:42:55 UTC (rev 4157) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2011-03-30 22:44:42 UTC (rev 4158) @@ -6,15 +6,14 @@ android:theme="@android:style/Theme.NoTitleBar" android:debuggable="true"> <activity android:label="@string/app_name" - android:launchMode="singleInstance" android:name=".Main"> + android:launchMode="singleInstance" android:name=".main"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <activity android:launchMode="singleInstance" android:name=".Splash"></activity> + <activity android:launchMode="singleInstance" android:name=".splash"></activity> <activity android:launchMode="singleInstance" android:name=".control.Remote_01"></activity> - <activity android:launchMode="singleInstance" android:name=".control.Remote_03"></activity> <activity android:launchMode="singleInstance" android:name=".pictures.Pictures"></activity> <activity android:launchMode="singleInstance" android:name=".pictures.Picturesfullscreen"></activity> @@ -29,12 +28,13 @@ <activity android:launchMode="singleInstance" android:name=".music.MusicTab"></activity> <activity android:launchMode="singleInstance" android:name=".music.MusicResults"></activity> <activity android:launchMode="singleInstance" android:name=".multimedia.Webradio"></activity> - <activity android:name=".MediaPlayerControl" android:launchMode="singleInstance"></activity> + <activity android:name=".multimedia.MediaPlayerControl" android:launchMode="singleInstance"></activity> <activity android:name=".movies.Movies" android:launchMode="singleInstance"></activity> <activity android:launchMode="singleInstance" android:name=".setup.SelectSkin"></activity> <activity android:launchMode="singleInstance" android:name=".plugins.Plugins"></activity> <activity android:launchMode="singleInstance" android:name=".plugins.Weather"></activity> <activity android:launchMode="singleInstance" android:name=".plugins.Radio"></activity> + <activity android:launchMode="singleInstance" android:name=".plugins.Movingpictures"></activity> </application> <uses-sdk android:minSdkVersion="3" /> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_menu_skin1_movingpictures.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_menu_skin1_movingpictures.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures.xml 2011-03-30 22:44:42 UTC (rev 4158) @@ -0,0 +1,17 @@ +<LinearLayout android:id="@+id/lay_movingpictures" + android:layout_width="fill_parent" android:layout_height="fill_parent" + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical"> + + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="" android:textColor="#FFFFFFFF" + android:textSize="20dip" + android:id="@+id/txtMovingPicturesTitle" android:paddingBottom="5dip"></TextView> + + <GridView android:layout_y="0dip" android:layout_x="0dip" + android:id="@+id/MovingpicturesGrid" android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:numColumns="auto_fit"> + </GridView> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_icon.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_icon.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_icon.xml 2011-03-30 22:44:42 UTC (rev 4158) @@ -0,0 +1,11 @@ +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/llmpicon" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:orientation="vertical"> + <ImageView android:id="@+id/icon_movingpicturesimage" android:layout_height="250dip" + android:layout_width="150dip" android:gravity="center"> + </ImageView> +<!-- <TextView android:id="@+id/icon_text" android:layout_width="wrap_content"--> +<!-- android:layout_height="wrap_content" android:text="TextView"--> +<!-- android:gravity="center_horizontal" android:textColorHighlight="#656565">--> +<!-- </TextView>--> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_movie.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_movie.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_movie.xml 2011-03-30 22:44:42 UTC (rev 4158) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" android:layout_height="fill_parent" + android:orientation="vertical"> + <LinearLayout android:orientation="horizontal" + android:layout_width="fill_parent" android:layout_height="fill_parent" + android:gravity="center"> + <ImageView android:layout_width="wrap_content" + android:layout_height="wrap_content" android:id="@+id/ivMovingPicturesMovie" + android:width="150px" android:height="250px" + android:layout_gravity="left" /> + <LinearLayout android:orientation="vertical" + android:layout_width="fill_parent" android:layout_height="fill_parent" + android:gravity="center"> + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="" + android:textColor="#FFFFFFFF" android:textSize="20dip" + android:id="@+id/txtMovieDescription" android:paddingBottom="5dip"></TextView> + </LinearLayout> + </LinearLayout> +</LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2011-03-30 22:42:55 UTC (rev 4157) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2011-03-30 22:44:42 UTC (rev 4158) @@ -11,9 +11,9 @@ <GridView android:layout_y="0dip" android:layout_x="0dip" android:id="@+id/GridView01" android:layout_width="fill_parent" - android:layout_height="fill_parent" android:columnWidth="90dp" - android:numColumns="auto_fit" android:verticalSpacing="10dp" - android:horizontalSpacing="10dp" android:stretchMode="columnWidth" + android:layout_height="fill_parent" android:columnWidth="150dp" + android:numColumns="auto_fit" + android:stretchMode="columnWidth" android:gravity="center"> </GridView> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/plugins.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/plugins.xml 2011-03-30 22:42:55 UTC (rev 4157) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/plugins.xml 2011-03-30 22:44:42 UTC (rev 4158) @@ -48,7 +48,31 @@ android:textColor="#FFFFFFFF"></TextView> </LinearLayout> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="40dip" android:layout_height="wrap_content" + android:orientation="vertical"> + </LinearLayout> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:orientation="vertical"> + + <Button android:scaleType="fitXY" android:layout_height="80dip" + android:layout_width="80dip" android:id="@+id/btn_plugins_movingpictures" + android:background="@drawable/ic_menu_skin1_movingpictures"> + </Button> + + <TextView android:layout_height="wrap_content" + android:layout_width="wrap_content" android:layout_gravity="center_horizontal" + android:textSize="14dip" android:textStyle="bold" android:text="Moving Pictures" + android:textColor="#FFFFFFFF"></TextView> + + </LinearLayout> + + + </LinearLayout> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2011-03-30 22:42:55 UTC (rev 4157) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2011-03-30 22:44:42 UTC (rev 4158) @@ -60,7 +60,7 @@ import android.view.WindowManager; import android.widget.*; -public class Main extends Activity { +public class main extends Activity { private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; @@ -121,7 +121,7 @@ firstRunDone = true; chkStatus(); - Intent myIntent = new Intent(this, Splash.class); + Intent myIntent = new Intent(this, splash.class); startActivity(myIntent); } @@ -230,25 +230,25 @@ final CharSequence[] items = { "Global settings", "IP settings", "Switch HTPC", "Exit" }; - AlertDialog.Builder builder = new AlertDialog.Builder(Main.this); + AlertDialog.Builder builder = new AlertDialog.Builder(main.this); builder.setTitle("Select option"); builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { switch (item) { case 0: // global settings - Intent myIntent1 = new Intent(Main.this, Setup.class); + Intent myIntent1 = new Intent(main.this, Setup.class); startActivityForResult(myIntent1, 0); break; case 1: // ip settings - Intent myIntent2 = new Intent(Main.this, Setup_ip.class); + Intent myIntent2 = new Intent(main.this, Setup_ip.class); startActivityForResult(myIntent2, 0); break; case 2: // switch instance final CharSequence[] items2 = AppSettings.getNames(); AlertDialog.Builder builder = new AlertDialog.Builder( - Main.this); + main.this); builder.setTitle("Select instance"); builder.setItems(items2, @@ -593,7 +593,7 @@ protected void onPostExecute(final Void unused) { active = false; if (result == false) - Toast.makeText(Main.this, + Toast.makeText(main.this, "Warning : Webserver not respoding !", Toast.LENGTH_SHORT).show(); } Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures.java 2011-03-30 22:44:42 UTC (rev 4158) @@ -0,0 +1,427 @@ +package mediaportal.remote.plugins; + +import java.io.InputStream; +import java.text.DecimalFormat; +import java.util.ArrayList; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import mediaportal.remote.R; +import mediaportal.remote.communication.HttpHandler; +import mediaportal.remote.utils.AppSettings; +import mediaportal.remote.utils.Vibration; +import android.app.Activity; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.ParseException; +import android.os.AsyncTask; +import android.os.Bundle; +import android.util.Log; +import android.view.Display; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.AdapterView; +import android.widget.BaseAdapter; +import android.widget.GridView; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.AdapterView.OnItemClickListener; + +public class Movingpictures extends Activity { + + private static ArrayList<objMovie> MovieList = new ArrayList<objMovie>(); + public static objMovie objSelectedMovie; + private TextView title; + private BaseAdapter adapter; + private update taskFetchData; + private String actualDir = "/movingpictures"; + private String server = AppSettings.getWebServer(); + private double W; + private double H; + private double DefaultImageWidth = 150; + private double DefaultImageHeight = 250; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.movingpictures); + + title = (TextView) findViewById(R.id.txtMovingPicturesTitle); + title.setText("Moving Pictures"); + adapter = new ImageAdapter2(Movingpictures.this); + + + // get optimal image width and height + getImageWidth(DefaultImageWidth); + H = (DefaultImageHeight / DefaultImageWidth) * W; + + Log.e("ar:h", String.valueOf(H)); + Log.e("ar:w", String.valueOf(W)); + + GridView gridview = (GridView) findViewById(R.id.MovingpicturesGrid); + + if (MovieList.isEmpty() == true) { + taskFetchData = new update(); + taskFetchData.execute(); + Log.e("ar", "on create, movie list is empty"); + } + + gridview.setAdapter(adapter); + adapter.notifyDataSetChanged(); + + gridview.setOnItemClickListener(new OnItemClickListener() { + public void onItemClick(AdapterView<?> parent, View v, + int position, long id) { + + taskFetchData.cancel(true); + + // ImageView iv = (ImageView) v + // .findViewById(R.id.icon_movingpicturesimage); + // objMovie mov = (objMovie) iv.getTag(); + + Vibration.vibrateShort(); + + // Intent myIntent = new Intent(Movingpictures.this, + // Movingpictures_movie.class); + // startActivityForResult(myIntent, 0); + } + }); + } + + public void onResume() { + super.onResume(); + + // if (MovieList.isEmpty() == true) { + // Log.e("ar","on resume, movie list is empty"); + // taskFetchData = new update(); + // taskFetchData.execute(); + // } + // else + // { + // Log.e("ar","on resume, movie list is not empty"); + // GridView gridview = (GridView) findViewById(R.id.MovingpicturesGrid); + // gridview.setAdapter(adapter); + // adapter.notifyDataSetChanged(); + // } + } + + private class update extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog( + Movingpictures.this); + + // can use UI thread here + protected void onPreExecute() { + try { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + + } catch (Exception ex) { + } + } + + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + HttpHandler h = new HttpHandler(); + InputStream stream = h.openHttpConnection(server + actualDir + + "/allmovies.xml"); + + if (stream != null) { + parsestream(stream); + } else { + Log.e("ar", "input stream is null"); + } + + return null; + } + + // can use UI thread here + protected void onPostExecute(final Void unused) { + + if (MovieList == null) { + Log.e("ar", "Movielist is null"); + } else if (MovieList.size() == 0) { + Log.e("ar", "Movielist has zero"); + } else { + GridView gridview = (GridView) findViewById(R.id.MovingpicturesGrid); + gridview.setAdapter(adapter); + + fetchPictures(); + } + + if (this.dialog.isShowing()) { + try { + this.dialog.dismiss(); + } catch (Exception ex) { + } + } + + } + } + + private void fetchPictures() { + HttpHandler http = new HttpHandler(); + int iCount = 0; + + while (iCount < MovieList.size()) { + objMovie mov = MovieList.get(iCount); + + if (mov != null) { + String file = server + actualDir + "/getthumb?id=" + + String.valueOf(mov.ID); + + mov.BitmapImage = http.DownloadImage(file); + + if (mov.BitmapImage == null) { + Log.e("ar", "Bitmap is null"); + } + + // if (picNo < pictureList.size()) // very strange exeption + // happens here 10/10 + // pictureList.set(picNo, item); + // picNo++; + // break; + } else { + Log.e("ar", "movie object is null"); + } + iCount++; + } + + try { + Thread.sleep(10); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + adapter.notifyDataSetChanged(); + http = null; + } + + public class ImageAdapter2 extends BaseAdapter { + private Context mContext; + public static final int ACTIVITY_CREATE = 10; + + public ImageAdapter2(Context c) { + mContext = c; + } + + public int getCount() { + if (MovieList != null) + return MovieList.size(); + else + return 0; + } + + public Object getItem(int position) { + return null; + } + + public long getItemId(int position) { + return 0; + } + + // @Override + // create a new ImageView for each item referenced by the Adapter + public View getView(int position, View convertView, ViewGroup parent) { + // View v; + + int skin = AppSettings.getActualSkin(); + ImageView iv; + + //if (convertView == null) { // if it's not recycled, initialize some + // attributes + iv = new ImageView(mContext); + iv.setLayoutParams(new GridView.LayoutParams((int) W, (int) H)); + // imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + // imageView.setPadding(8, 8, 8, 8); + + //} else { + // v = convertView; + // iv = (ImageView) convertView; + + //} + + if (MovieList != null) { + + objMovie mov = MovieList.get(position); + + if (mov.BitmapImage == null) + switch (skin) { + case 0: + iv.setImageResource(R.drawable.ic_skin1_file_picture); + break; + case 1: + iv.setImageResource(R.drawable.ic_skin2_file_picture); + break; + } + else + iv.setImageBitmap(mov.BitmapImage); + + objMovie movie = new objMovie(); + iv.setTag(movie); + } + // } + + return iv; + } + } + + private class objMovie { + protected int ID; + protected String title; + protected String description; + protected String Rating; + protected String Runtime; + protected String Image; + protected Bitmap BitmapImage; + } + + public void parsestream(InputStream is) { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder dBuilder; + try { + + dBuilder = dbFactory.newDocumentBuilder(); + Document doc = dBuilder.parse(is); + + String MovieID = "N/A"; + String MovieTitle = "N/A"; + String MovieDescription = "N/A"; + String MovieRating = "N/A"; + String MovieRuntime = "N/A"; + String MovieImage = "N/A"; + Bitmap BitmapImage = null; + + NodeList nList = doc.getElementsByTagName("Movie"); + for (int temp = 0; temp < nList.getLength(); temp++) { + + Node nNode = nList.item(temp); + + if (nNode.getNodeType() == Node.ELEMENT_NODE) { + + Element item = (Element) nNode; + + NodeList list = item.getElementsByTagName("ID"); + Element entry = (Element) list.item(0); + NodeList text = entry.getChildNodes(); + MovieID = ((Node) text.item(0)).getNodeValue(); + + list = item.getElementsByTagName("Title"); + entry = (Element) list.item(0); + text = entry.getChildNodes(); + MovieTitle = ((Node) text.item(0)).getNodeValue(); + + list = item.getElementsByTagName("Description"); + entry = (Element) list.item(0); + text = entry.getChildNodes(); + MovieDescription = ((Node) text.item(0)).getNodeValue(); + + list = item.getElementsByTagName("Rating"); + entry = (Element) list.item(0); + text = entry.getChildNodes(); + MovieRating = ((Node) text.item(0)).getNodeValue(); + + list = item.getElementsByTagName("Runtime"); + entry = (Element) list.item(0); + text = entry.getChildNodes(); + MovieRuntime = ((Node) text.item(0)).getNodeValue(); + + list = item.getElementsByTagName("Image"); + entry = (Element) list.item(0); + text = entry.getChildNodes(); + MovieImage = ((Node) text.item(0)).getNodeValue(); + + try { + objMovie mv = new objMovie(); + mv.ID = Integer.parseInt(MovieID); + mv.title = MovieTitle; + mv.description = MovieDescription; + mv.Rating = MovieRating; + mv.Runtime = MovieRuntime; + mv.Image = MovieImage; + MovieList.add(mv); + + } catch (ParseException e) { + e.printStackTrace(); + Log.e("ar:", "trying parse stream ERROR"); + } + } + + // if (i0 != null) { + // int resID = getResources().getIdentifier( + // "ic_weather_" + ico, "drawable", + // "mediaportal.remote"); + // if (resID != 0) + // i0.setBackgroundResource(resID); + // else + // i0.setBackgroundResource(R.drawable.ic_weather_na); + // } + + } + + } catch (Exception ex) { + // TODO Auto-generated catch block + ex.printStackTrace(); + } + dbFactory = null; + dBuilder = null; + } + + private void getImageWidth(double DefaultWidth) { + + //Log.e("ar:new decimals", String.valueOf(DefaultWidth)); + Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)) + .getDefaultDisplay(); + double ViewWidth = display.getWidth(); + + //Log.e("ar:ViewWidth", String.valueOf(ViewWidth)); + + double dblNewImageWidth = ViewWidth / DefaultWidth; + //Log.e("ar:dblNewImageWidth", String.valueOf(dblNewImageWidth)); + + if (dblNewImageWidth == Math.round(dblNewImageWidth)) // whole number + { + //Log.e("ar:info", "double is round number"); + W = (int) DefaultWidth; + + } + else // not a whole number + { + //Log.e("ar:info", "double is not round number"); + dblNewImageWidth = roundTwoDecimals(dblNewImageWidth); // round to two decimals + //Log.e("ar:rounded", String.valueOf(dblNewImageWidth)); + + int intWholeImageWidth = (int) dblNewImageWidth; // get int to subtract from double, leaving decimals + //Log.e("ar:int of double", String.valueOf(intWholeImageWidth)); + + dblNewImageWidth = dblNewImageWidth - intWholeImageWidth; + //Log.e("ar:new decimals", String.valueOf(dblNewImageWidth)); + + if (dblNewImageWidth <= .10 || dblNewImageWidth >= .90) + { // close enough + W = (int) DefaultWidth; + } + else if (dblNewImageWidth <= .49) + { + getImageWidth(DefaultWidth + 1); + } + else + { + getImageWidth(DefaultWidth - 1); + } + } + + } + + double roundTwoDecimals(double d) { + DecimalFormat twoDForm = new DecimalFormat("#.##"); + return Double.valueOf(twoDForm.format(d)); + + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures_movie.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures_movie.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures_movie.java 2011-03-30 22:44:42 UTC (rev 4158) @@ -0,0 +1,5 @@ +package mediaportal.remote.plugins; + +public class Movingpictures_movie { + +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Plugins.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Plugins.java 2011-03-30 22:42:55 UTC (rev 4157) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Plugins.java 2011-03-30 22:44:42 UTC (rev 4158) @@ -21,6 +21,7 @@ package mediaportal.remote.plugins; + import mediaportal.remote.R; import mediaportal.remote.utils.AppSettings; import mediaportal.remote.utils.Vibration; @@ -41,6 +42,7 @@ private Button btnRadio; private Button btnWeather; + private Button btnMovingPictures; @Override public void onCreate(Bundle savedInstanceState) { @@ -52,6 +54,7 @@ btnRadio = (Button) findViewById(R.id.btn_plugins_radio); btnWeather = (Button) findViewById(R.id.btn_plugins_weather); + btnMovingPictures = (Button) findViewById(R.id.btn_plugins_movingpictures); btnWeather.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { @@ -71,6 +74,19 @@ .show(); } }); + + + btnMovingPictures.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Vibration.vibrateShort(); + Intent myIntent = new Intent(view.getContext(), + Movingpictures.class); + startActivity(myIntent); + } + }); + + + } @Override Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2011-03-30 22:42:55 UTC (rev 4157) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2011-03-30 22:44:42 UTC (rev 4158) @@ -29,7 +29,7 @@ import android.os.Handler; import android.widget.ImageView; -public class Splash extends Activity { +public class splash extends Activity { private final int SPLASH_DISPLAY_LENGHT = 3000; @@ -43,9 +43,9 @@ // @Override public void run() { /* Create an Intent that will start the main-Activity. */ - Intent mainIntent = new Intent(Splash.this, Main.class); - Splash.this.startActivity(mainIntent); - Splash.this.finish(); + Intent mainIntent = new Intent(splash.this, main.class); + splash.this.startActivity(mainIntent); + splash.this.finish(); } }, SPLASH_DISPLAY_LENGHT); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |