From: <kro...@us...> - 2010-12-22 11:04:09
|
Revision: 4052 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4052&view=rev Author: kroko_koenig Date: 2010-12-22 11:04:02 +0000 (Wed, 22 Dec 2010) Log Message: ----------- start work on fastscroll (artist) and some bugs fixed plus utf8 Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Entity.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml 2010-12-22 11:04:02 UTC (rev 4052) @@ -4,6 +4,6 @@ android:layout_height="fill_parent"> <ListView android:id="@+id/list_artist" android:layout_height="wrap_content" - android:layout_width="fill_parent"> + android:layout_width="fill_parent" android:fastScrollEnabled="true"> </ListView> </LinearLayout> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-12-22 11:04:02 UTC (rev 4052) @@ -9,21 +9,16 @@ </TextView> <EditText android:id="@+id/server_ip" android:layout_height="wrap_content" - android:layout_width="fill_parent" android:text="192.168.0.30" - android:inputType="text" - ></EditText> + android:layout_width="fill_parent" android:text="192.168.0.30" android:inputType="numberDecimal"></EditText> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="MediaPortal Port" android:textColor="#FF000000" android:textSize="18dip"></TextView> <EditText android:id="@+id/server_port" android:layout_width="fill_parent" - android:layout_height="wrap_content" android:text="8200" - android:inputType="number|numberSigned"></EditText> + android:layout_height="wrap_content" android:text="8200" android:inputType="phone"></EditText> <TextView android:layout_width="fill_parent" - android:layout_height="wrap_content" android:text="MediaPortal MAC Adress" - android:textColor="#FF000000" android:textSize="18dip"></TextView> + android:layout_height="wrap_content" android:textColor="#FF000000" android:textSize="18dip" android:text="MediaPortal MAC (WakeOnLan)"></TextView> <EditText android:id="@+id/server_macid" android:layout_width="fill_parent" - android:layout_height="wrap_content" android:text="12-34-56-78-90-12" - android:inputType="number|numberSigned"></EditText> + android:layout_height="wrap_content" android:text="12-34-56-78-90-12" android:inputType="text"></EditText> <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#000" android:textSize="18dip" android:id="@+id/vibration" android:text="use vibration feedback"></CheckBox> </LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Entity.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Entity.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Entity.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -0,0 +1,32 @@ +package mediaportal.remote; + +public class Entity { + + public static String AddEntity(String raw) { + if (raw == null) + return null; + char[] chars = raw.toCharArray(); + StringBuffer encoded = new StringBuffer(); + for (int i = 0; i < chars.length; i++) { + char c = chars[i]; + if (c == '&') + encoded.append("&"); + else if (c == '<') + encoded.append("<"); + else if (c == '>') + encoded.append(">"); + else if (c == '\'') + encoded.append("'"); + else if (c == '"') + encoded.append("""); + else if (c < 128) + encoded.append(c); + else { + encoded.append("&#"); + encoded.append((int) c); + encoded.append(";"); + } + } + return encoded.toString(); + } +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -64,7 +64,7 @@ socket.getOutputStream(), "UTF8")); wr.write("POST " + path + " HTTP/1.0\r\n"); wr.write("Content-Length: " + data.length() + "\r\n"); - wr.write("Content-Type: application/xml\r\n"); + wr.write("Content-Type: application/xml; charset=utf-8\r\n"); wr.write("\r\n"); // Send data Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -73,7 +73,7 @@ if (localName == "Artist") {currentDbItem.Artist =currentValue;} if (localName == "Title") {currentDbItem.Title =currentValue;} if (localName == "Album") {currentDbItem.Album =currentValue;} - if (localName == "AlbumArtist") {currentDbItem.AlbumArtist =currentValue;} + if (localName == "AlbumArtist") {currentDbItem.AlbumArtist =currentValue;} if (localName == "Track") {currentDbItem.Track =currentValue;} if (localName == "Rating") {currentDbItem.Rating =currentValue;} if (localName == "Filename") {currentDbItem.Filename =currentValue;} @@ -81,6 +81,8 @@ if (localName == "ID") {currentDbItem.ID =currentValue;} if (localName == "Item")DbList.add(currentDbItem); + + currentValue = null; } /** @@ -91,8 +93,8 @@ public void characters(char[] ch, int start, int length) throws SAXException { if (currentElement) { - currentValue = new String(ch, start, length); - currentElement = false; + String actual = new String(ch, start, length); + currentValue += actual; } } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -21,11 +21,18 @@ package mediaportal.remote; +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; +import java.net.URLDecoder; +import java.net.URLEncoder; + import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; @@ -34,6 +41,9 @@ import org.xml.sax.SAXException; import org.xml.sax.XMLReader; +import android.text.Html; +import android.util.Log; + public class ReceiveHandler { private org.xml.sax.ContentHandler _handler; @@ -104,5 +114,4 @@ } } - } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -31,6 +31,7 @@ import android.os.Bundle; import android.os.Vibrator; import android.view.GestureDetector; +import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.GestureDetector.OnGestureListener; @@ -171,6 +172,30 @@ .show(); } + public boolean onKeyDown(int keyCode, KeyEvent event) { + if (keyCode == KeyEvent.KEYCODE_MENU) + { + Intent myIntent = new Intent(this, Remote_03.class); + startActivityForResult(myIntent, 0); + + return true; + } + else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) + { + PostCommand("volumeUp"); + return true; + } + else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) + { + PostCommand("volumeDown"); + return true; + } + else + { + return false; + } + } + public void PostCommand(String button) { DoVibrate(); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -60,7 +60,7 @@ public Bitmap DownloadImage(String urlStr) { - final String url = urlStr; + final String url = urlStr.replaceAll(" ","%20"); Bitmap bitmap = null; InputStream in = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -39,6 +39,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Vibrator; +import android.view.KeyEvent; import android.view.View; import android.widget.*; @@ -86,7 +87,8 @@ Settings.Server = settings.getString("Server", "192.168.0.30"); Settings.Port = settings.getString("Port", "8200"); Settings.MacId = settings.getString("MacId", "11-22-33-44-55-66"); - + Settings.Vibrate = settings.getBoolean("Vibrate", true); + Button btnPictures = (Button) findViewById(R.id.btn_main_pictures); btnPictures.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { @@ -168,7 +170,7 @@ } }); } - + private boolean reportExist() { try { @SuppressWarnings("unused") Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -175,7 +175,7 @@ holder.text2.setText(item.Album + " - " + item.Artist); convertView.setBackgroundColor((position & 1) == 1 ? Color.WHITE - : Color.LTGRAY); + : 0xFFEEEEEE); return convertView; } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -22,6 +22,12 @@ package mediaportal.remote; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Set; + +import mediaportal.remote.ReceiveDbXmlHandler.DbItems; + import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; @@ -39,6 +45,7 @@ import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.ListView; +import android.widget.SectionIndexer; import android.widget.TextView; import android.widget.Toast; @@ -46,18 +53,21 @@ private Handler mHandler = new Handler(); private static Vibrator vibrate; - + private static ArrayList<ReceiveDbXmlHandler.DbItems> artistList; + private static HashMap<String, Integer> alphaIndexer; + private static String[] sections; + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.music_artist); mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 100); - + vibrate = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); - + ListView l1 = (ListView) findViewById(R.id.list_artist); l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { @@ -68,9 +78,9 @@ musicResults.Select = item.Artist; musicResults.Mode = musicResults.SelectMode.Artist; - + musicArtist.DoVibrate(); - + Intent myIntent = new Intent(arg1.getContext(), musicResults.class); startActivityForResult(myIntent, 0); @@ -87,9 +97,10 @@ new update().execute(); } }; - + private class update extends AsyncTask<String, Void, Void> { - private final ProgressDialog dialog = new ProgressDialog(musicArtist.this); + private final ProgressDialog dialog = new ProgressDialog( + musicArtist.this); // can use UI thread here protected void onPreExecute() { @@ -113,16 +124,33 @@ this.dialog.dismiss(); } - if (artistList.size() == 0) { + if (artistList == null) { Toast.makeText(musicArtist.this, "TIME OUT SERVER", Toast.LENGTH_SHORT).show(); } else { + // build hash map + alphaIndexer = new HashMap<String, Integer>(); + int size = artistList.size(); + + for (int x = 0; x < size; x++) { + DbItems s = artistList.get(x); + String ch = s.Artist.substring(0, 1); + ch = ch.toUpperCase(); + alphaIndexer.put(ch, x); + } + Set<String> sectionLetters = alphaIndexer.keySet(); + + // sort results + ArrayList<String> sectionList = new ArrayList<String>(sectionLetters); + Collections.sort(sectionList); + sections = new String[sectionList.size()]; + sectionList.toArray(sections); + + // update list ListView listview = (ListView) findViewById(R.id.list_artist); listview.setAdapter(new EfficientAdapter(musicArtist.this)); } } - - } private static void DoVibrate() { @@ -130,9 +158,9 @@ vibrate.vibrate(100); } } + + private static class EfficientAdapter extends BaseAdapter implements SectionIndexer { - private static class EfficientAdapter extends BaseAdapter { - private LayoutInflater mInflater; public EfficientAdapter(Context context) { @@ -176,7 +204,7 @@ holder.text2.setText(item.Artist); convertView.setBackgroundColor((position & 1) == 1 ? Color.WHITE - : Color.LTGRAY); + : 0xFFEEEEEE); return convertView; } @@ -185,6 +213,20 @@ TextView text; TextView text2; } + + /// + /// implement SectionIndexer + /// + + public int getPositionForSection(int section) { + return alphaIndexer.get(sections[section]); + } + public int getSectionForPosition(int position) { + return 1; + } + public Object[] getSections() { + return sections; + } } } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -48,7 +48,7 @@ private Handler mHandler = new Handler(); private static Vibrator vibrate; - + private static ArrayList<ReceiveDbXmlHandler.DbItems> songList; public static String Select = ""; @@ -63,9 +63,9 @@ mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 100); - + vibrate = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); - + ListView l1 = (ListView) findViewById(R.id.list_song); l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { @@ -73,7 +73,7 @@ long arg3) { selectedItem = songList.get(arg2); - + DoVibrate(); AlertDialog.Builder builder = new AlertDialog.Builder(arg0 @@ -85,16 +85,20 @@ case 0: PostAddItem(selectedItem); Toast.makeText(musicSong.this, - selectedItem.Title + " has been added", Toast.LENGTH_SHORT).show(); + selectedItem.Title + " has been added", + Toast.LENGTH_SHORT).show(); break; case 1: PostClear(); - Toast.makeText(musicSong.this, "Playlist has been cleared", Toast.LENGTH_SHORT).show(); + Toast.makeText(musicSong.this, + "Playlist has been cleared", + Toast.LENGTH_SHORT).show(); break; case 2: SavetoSDCard(selectedItem); Toast.makeText(musicSong.this, - selectedItem.Title + " has been transferd", Toast.LENGTH_SHORT).show(); + selectedItem.Title + " has been transferd", + Toast.LENGTH_SHORT).show(); break; } } @@ -103,7 +107,7 @@ alert.show(); } }); - + ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); l1.setDividerHeight(2); @@ -155,7 +159,7 @@ vibrate.vibrate(100); } } - + public void PostClear() { PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); @@ -169,6 +173,7 @@ post.Post(xml); } + public void PostAddItem(ReceiveDbXmlHandler.DbItems Item) { PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); @@ -178,24 +183,28 @@ xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xml += "<message>"; xml += "<command>ADD_MUSIC</command>"; - xml += "<filename>" + Item.Filename + "</filename>"; - xml += "<artist>" + Item.Artist + "</artist>"; - xml += "<title>" + Item.Title + "</title>"; + xml += "<filename>" + Entity.AddEntity(Item.Filename) + "</filename>"; + xml += "<artist>" + Entity.AddEntity(Item.Artist) + "</artist>"; + xml += "<title>" + Entity.AddEntity(Item.Title) + "</title>"; xml += "<duration>" + Item.Duration + "</duration>"; xml += "</message>"; post.Post(xml); } + private void SavetoSDCard(ReceiveDbXmlHandler.DbItems Item) { - + String filename = Item.Artist + " - " + Item.Title + ".mp3"; - String id = Item.ID; - - httpHandler h = new httpHandler(); - h.DownloadFileByID(filename,id); - - String sd = Environment.getExternalStorageDirectory().toString(); - MediaScannerNotifier not = new MediaScannerNotifier(this, sd + "/" + filename, "audio/mpeg"); + String id = Item.ID; + + httpHandler h = new httpHandler(); + h.DownloadFileByID(filename, id); + + String sd = Environment.getExternalStorageDirectory().toString(); + + @SuppressWarnings("unused") + MediaScannerNotifier not = new MediaScannerNotifier(this, sd + "/" + + filename, "audio/mpeg"); } private static class EfficientAdapter extends BaseAdapter { @@ -243,7 +252,7 @@ holder.text2.setText(item.Title + " - " + item.Artist); convertView.setBackgroundColor((position & 1) == 1 ? Color.WHITE - : Color.LTGRAY); + : 0xFFEEEEEE); return convertView; } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -6,7 +6,7 @@ public class nowplayingXmlHandler extends DefaultHandler { Boolean currentElement = false; - String currentValue = null; + String currentValue = ""; /** * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) @@ -15,7 +15,7 @@ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { currentElement = true; - currentValue = "..."; + currentValue = ""; } /** @@ -35,7 +35,7 @@ if (localName == "TotalTime") {nowplayinghandler.Total =currentValue;} if (localName == "ActualTime") {nowplayinghandler.Actual =currentValue;} if (localName == "Cover") {nowplayinghandler.Cover =currentValue;} - if (localName == "PlayerState") {nowplayinghandler.PlayerState =currentValue;} + if (localName == "PlayerState") {nowplayinghandler.PlayerState =currentValue;} } /** @@ -46,8 +46,8 @@ public void characters(char[] ch, int start, int length) throws SAXException { if (currentElement) { - currentValue = new String(ch, start, length); - currentElement = false; + String actual = new String(ch, start, length); + currentValue += actual; } } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -6,7 +6,7 @@ public class nowplaylistXmlHandler extends DefaultHandler { Boolean currentElement = false; - String currentValue = null; + String currentValue = ""; nowplaylisthandler.PlayListItem item = null; /** @@ -16,7 +16,7 @@ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { currentElement = true; - currentValue = "..."; + currentValue = ""; if (localName == "Item") item = new nowplaylisthandler.PlayListItem(); @@ -62,8 +62,8 @@ public void characters(char[] ch, int start, int length) throws SAXException { if (currentElement) { - currentValue = new String(ch, start, length); - currentElement = false; + String actual = new String(ch, start, length); + currentValue += actual; } } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -102,7 +102,6 @@ mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 0); } - } }); } @@ -216,8 +215,7 @@ String file = "http://" + Settings.Server + ":" + Settings.Port + "/pictures/"; file += actualDir + item.File + ".thb"; - item.Picture = http.DownloadImage(file.replaceAll(" ", - "%20")); + item.Picture = http.DownloadImage(file); iv.setImageBitmap(item.Picture); if (item.Picture == null) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -52,10 +52,12 @@ public class picturesfullscreen extends Activity implements OnGestureListener { private Handler mHandler = new Handler(); + private GestureDetector gestureScanner; private static final int SWIPE_MIN_DISTANCE = 120; private static final int SWIPE_MAX_OFF_PATH = 250; private static final int SWIPE_THRESHOLD_VELOCITY = 200; + private boolean slideShow; private boolean randomShow; public static boolean SlideshowPaused = false; @@ -95,7 +97,7 @@ String file = "http://" + Settings.Server + ":" + Settings.Port + "/pictures/"; file += pictures.actualDir + item.File; - item.Picture = http.DownloadImage(file.replaceAll(" ", "%20")); + item.Picture = http.DownloadImage(file); } return null; @@ -233,10 +235,13 @@ private void SendPicture() { try { DirItems item = pictures.pictureList.get(pictures.selectedPicture); + Intent picMessageIntent = new Intent( android.content.Intent.ACTION_SEND); + picMessageIntent.setType("image/jpeg"); picMessageIntent.putExtra(Intent.EXTRA_STREAM, item.Picture); + startActivity(Intent.createChooser(picMessageIntent, "Send picture using:")); } catch (Exception e) { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-12-21 13:26:53 UTC (rev 4051) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-12-22 11:04:02 UTC (rev 4052) @@ -72,6 +72,7 @@ txt1.setText(Settings.Server); txt2.setText(Settings.Port); txt3.setText(Settings.MacId); + chk.setChecked(Settings.Vibrate); } Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |