From: <kro...@us...> - 2010-11-30 12:17:40
|
Revision: 3988 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3988&view=rev Author: kroko_koenig Date: 2010-11-30 12:17:31 +0000 (Tue, 30 Nov 2010) Log Message: ----------- better structure and code cleanup Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 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/ReceiveDbHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.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/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.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/Android/MediaPortalRemote/src/mediaportal/remote/splash.java Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java Removed Paths: ------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ScrollView.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musichandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturehandler.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-30 12:17:31 UTC (rev 3988) @@ -3,13 +3,13 @@ package="mediaportal.remote" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar" android:debuggable="true"> - <activity android:name=".splash" android:label="@string/app_name"> + <activity android:name=".Splash" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <activity android:name=".main" android:label="@string/app_name"> + <activity android:label="@string/app_name" android:name=".Main"> <intent-filter> <action android:name="android.intent.action.DEFAULT" /> <category android:name="android.intent.category.VIEW" /> @@ -17,17 +17,17 @@ </activity> <activity android:name=".Remote_01"></activity> <activity android:name=".Remote_02"></activity> - <activity android:name=".pictures"></activity> + <activity android:name=".Pictures"></activity> <activity android:name=".picturesfullscreen"></activity> - <activity android:name=".music"></activity> - <activity android:name=".setup"></activity> + <activity android:name=".MusicDir"></activity> + <activity android:name=".Setup"></activity> <activity android:name=".nowplaying"></activity> <activity android:name=".nowplaylist"></activity> - <activity android:name=".musicArtist"></activity> - <activity android:name=".musicAlbum"></activity> - <activity android:name=".musicSong"></activity> - <activity android:name=".musicTab"></activity> - <activity android:name=".musicResults"></activity> + <activity android:name=".MusicArtist"></activity> + <activity android:name=".MusicAlbum"></activity> + <activity android:name=".MusicSong"></activity> + <activity android:name=".MusicTab"></activity> + <activity android:name=".MusicResults"></activity> </application> <uses-sdk android:minSdkVersion="3" /> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -74,7 +74,6 @@ public static final int btnOk=0x7f050033; public static final int btnPause=0x7f05002b; public static final int btnPlay=0x7f050026; - public static final int btnReturnSetup=0x7f05003b; public static final int btnRight=0x7f050034; public static final int btnSkipBack=0x7f050029; public static final int btnSkipForw=0x7f05002c; @@ -104,6 +103,7 @@ public static final int now_stop=0x7f05001d; public static final int now_title=0x7f05001a; public static final int server_ip=0x7f050039; + public static final int server_macid=0x7f05003b; public static final int server_port=0x7f05003a; public static final int title=0x7f05003c; public static final int widget0=0x7f05000a; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-11-30 12:17:31 UTC (rev 3988) @@ -13,7 +13,10 @@ <EditText android:id="@+id/server_port" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="8200" android:inputType="number|numberSigned"></EditText> - <Button android:id="@+id/btnReturnSetup" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:text="Return"></Button> + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="MediaPortal MAC Adress"></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> </LinearLayout> Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,136 +0,0 @@ -package mediaportal.remote; - -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; - -import android.content.Context; -import android.graphics.Bitmap; -import android.view.View; -import android.view.ViewGroup; -import android.widget.*; - -import mediaportal.remote.httpHandler; - -public class ImageAdapter extends BaseAdapter { - private Context mContext; - - public ImageAdapter(Context c) { - mContext = c; - } - - public int getCount() { - directoryItems myItems = directoryXmlHandler.getSitesList(); - return myItems.gettitle().size(); - } - - public Object getItem(int position) { - return null; - } - - public long getItemId(int position) { - return 0; - } - - // create a new ImageView for each item referenced by the Adapter - public View getView(int position, View convertView, ViewGroup parent) { - ImageView imageView; - if (convertView == null) { // if it's not recycled, initialize some - // attributes - imageView = new ImageView(mContext); - imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); - imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); - imageView.setPadding(8, 8, 8, 8); - } else { - imageView = (ImageView) convertView; - } - - imageView.setImageBitmap(bmImg[position]); - return imageView; - } - - public static Bitmap[] bmImg; - - public static Bitmap downloadFile(String fileUrl) { - URL myFileUrl = null; - try { - myFileUrl = new URL(fileUrl); - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - try { - HttpURLConnection conn = (HttpURLConnection) myFileUrl - .openConnection(); - conn.setReadTimeout(3000); - conn.setDoInput(true); - conn.connect(); - // int length = conn.getContentLength(); - InputStream is = conn.getInputStream(); - - SAXParserFactory spf = SAXParserFactory.newInstance(); - SAXParser sp = null; - try { - sp = spf.newSAXParser(); - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - XMLReader reader = null; - try { - reader = sp.getXMLReader(); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - directoryXmlHandler handler = new directoryXmlHandler(); - - reader.setContentHandler(handler); - try { - reader.parse(new InputSource(is)); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - is.close(); - sp.reset(); - - directoryItems myItems = directoryXmlHandler.getSitesList(); - bmImg = new Bitmap[myItems.gettitle().size()]; - - httpHandler h = new httpHandler(); - - for (int i = 0; i < myItems.gettitle().size(); i++) { - String tit = myItems.gettitle().get(i); - // Boolean fold = myItems.getIsFolder().get(i); - - tit = tit + ".thb"; - - bmImg[i] = h.DownloadImage("http://192.6.10.182:8200/pictures/" - + tit); - } - - // bmImg = BitmapFactory.decodeStream(is); - return null; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } -} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -0,0 +1,205 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package mediaportal.remote; + +import java.util.ArrayList; +import mediaportal.remote.R; +import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.os.Handler; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.GridView; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +public class MusicDir extends Activity { + + private Handler mHandler = new Handler(); + private String actualDir = ""; + + private static ArrayList<ReceiveDirectoryXmlHandler.DirItems> musicList; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.music); + + GridView gridview = (GridView) findViewById(R.id.music_grid); + gridview.setAdapter(new ImageAdapter2(MusicDir.this)); + + /* + * gridview.setOnItemClickListener(new OnItemClickListener() { public + * void onItemClick(AdapterView<?> parent, View v, int position, long + * id) { + * + * // TextView tv = (TextView) v.findViewById(R.id.icon_text); ImageView + * iv = (ImageView) v.findViewById(R.id.icon_image); musicItem item = + * (musicItem) iv.getTag(); + * + * if (item.typ == "item") { ReceiveDirHandler h = + * ReceiveDirHandler.getinstance(); h.selectedMusic = position - 1; } + * + * if (item.typ == "folder") { + * + * musichandler h = musichandler.getinstance(); h.gotodir(item.title); + * + * GridView gridview = (GridView) findViewById(R.id.music_grid); + * gridview.setAdapter(new ImageAdapter2(parent.getContext())); + * + * parent.invalidate(); } + * + * if (item.typ == "oneup") { musichandler h = + * musichandler.getinstance(); h.oneup(); + * + * GridView gridview = (GridView) findViewById(R.id.music_grid); + * gridview.setAdapter(new ImageAdapter2(parent.getContext())); + * + * parent.invalidate(); } + * + * } }); + */ + } + + @Override + public void onStart() { + super.onStart(); + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 100); + } + + private Runnable mUpdateTimeTask = new Runnable() { + public void run() { + update(); + } + }; + + private void update() { + + Log.d("update music dir", "do update"); + + ReceiveDirHandler h = ReceiveDirHandler.getinstance(); + musicList = h.getMusicDir(actualDir); + + if (musicList.size() == 0) { + Toast.makeText(MusicDir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) + .show(); + } + + GridView gridview = (GridView) findViewById(R.id.music_grid); + gridview.invalidateViews(); + } + + 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 (musicList != null) + return musicList.size() + 1; + 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; + if (convertView == null) { // if it's not recycled, initialize some + // attributes + + if (position > 0) { + position = position - 1; + + DirItems item1 = musicList.get(position); + + String txtName = item1.File; + Boolean isFolder = item1.isFolder; + + LayoutInflater li = LayoutInflater.from(mContext); + v = li.inflate(R.layout.icon, null); + + TextView tv = (TextView) v.findViewById(R.id.icon_text); + tv.setText(txtName); + + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + if (isFolder) { + iv.setImageResource(R.drawable.folder); + musicItem item = new musicItem(); + item.title = txtName; + item.typ = "folder"; + iv.setTag(item); + } else { + iv.setImageResource(R.drawable.audio); + musicItem item = new musicItem(); + item.title = txtName; + item.typ = "item"; + iv.setTag(item); + } + } else { + LayoutInflater li = LayoutInflater.from(mContext); + v = li.inflate(R.layout.icon, null); + + TextView tv = (TextView) v.findViewById(R.id.icon_text); + tv.setText(".."); + + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + iv.setImageResource(R.drawable.folderback); + musicItem item = new musicItem(); + item.title = ".."; + item.typ = "oneup"; + iv.setTag(item); + } + + } else { + v = convertView; + } + + return v; + } + } + + public class musicItem { + public String title; + public String typ; + } + +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; import java.io.IOException; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,34 +1,33 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLEncoder; import java.util.ArrayList; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; - import mediaportal.remote.ReceiveDbXmlHandler.DbItems; public class ReceiveDbHandler { - public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - - private static ArrayList<DbItems> Result; private static ReceiveDbHandler instance; - private String _server; - private String _port; - public int selectedMusic; public static ReceiveDbHandler getinstance() { @@ -37,104 +36,28 @@ return instance; } - public void setconnection(String server, String port) { - _server = server; - _port = port; + public ArrayList<DbItems> GetAlbums() { + return fetchData("album.xml"); } - public boolean GetAlbums() { - fetchData("album.xml"); - return true; + public ArrayList<DbItems> GetArtist() { + return fetchData("artist.xml"); } - public boolean GetArtist() { - fetchData("artist.xml"); - return true; + public ArrayList<DbItems> GetSongs() { + return fetchData("song.xml"); } - public boolean GetSongs() { - fetchData("song.xml"); - return true; + public ArrayList<DbItems> GetSongsByArtist(String Artist) { + return fetchData("song.xml?artist=" + Artist); } - - public boolean GetSongsByArtist(String Artist) { - fetchData("song.xml?artist=" + Artist); - return true; - } - public ArrayList<DbItems> GetResult() { - return Result; - } + private ArrayList<DbItems> fetchData(String Data) { - private void fetchData(String Data) { + ReceiveDbXmlHandler handler = new ReceiveDbXmlHandler(); + ReceiveHandler hand = new ReceiveHandler(handler); + hand.readValues("/db_music/" + Data); - Result = new ArrayList<DbItems>(); - - try { - Data = URLEncoder.encode(Data, "UTF-8"); - } catch (UnsupportedEncodingException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - String fileUrl = "http://" + _server + ":" + _port + "/db_music/" - + Data; - - URL myFileUrl = null; - try { - myFileUrl = new URL(fileUrl); - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - try { - HttpURLConnection conn = (HttpURLConnection) myFileUrl - .openConnection(); - conn.setConnectTimeout(3000); - conn.setReadTimeout(10000); - conn.setDoInput(true); - conn.connect(); - - InputStream is = conn.getInputStream(); - - SAXParserFactory spf = SAXParserFactory.newInstance(); - SAXParser sp = null; - try { - sp = spf.newSAXParser(); - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - XMLReader reader = null; - try { - reader = sp.getXMLReader(); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - ReceiveDbXmlHandler handler = new ReceiveDbXmlHandler(); - - reader.setContentHandler(handler); - try { - reader.parse(new InputSource(is)); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - is.close(); - sp.reset(); - - Result = ReceiveDbXmlHandler.DbList; - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + return handler.DbList; } - } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; import java.util.ArrayList; @@ -10,7 +31,8 @@ Boolean currentElement = false; String currentValue = null; - public static ArrayList<DbItems> DbList = new ArrayList<DbItems>(); + public ArrayList<DbItems> DbList = new ArrayList<DbItems>(); + public static class DbItems { public String Title = ""; @@ -18,8 +40,7 @@ public String Album= ""; public String AlbumArtist= ""; public String Track= ""; - public String Rating= ""; - + public String Rating= ""; } private DbItems currentDbItem; Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package mediaportal.remote; + +import java.util.ArrayList; +import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; + +public class ReceiveDirHandler { + + private static ReceiveDirHandler instance; + private static String actualDir; + + public static ReceiveDirHandler getinstance() { + if (instance == null) + instance = new ReceiveDirHandler(); + return instance; + } + + public ArrayList<DirItems> getMusicDir(String Dir) { + + return fetchData("/music/" + Dir); + } + + public ArrayList<DirItems> getPictureDir(String Dir) { + + return fetchData("/pictures/" + Dir); + } + + public ArrayList<DirItems> gotodir(String dir) { + actualDir += "/" + dir; + return fetchData(actualDir); + } + + public ArrayList<DirItems> oneup() { + int x = actualDir.lastIndexOf("/"); + if (x >= 0) { + actualDir = actualDir.substring(0, x); + } + return fetchData(actualDir); + } + + private ArrayList<DirItems> fetchData(String Data) { + + ReceiveDirectoryXmlHandler handler = new ReceiveDirectoryXmlHandler(); + ReceiveHandler hand = new ReceiveHandler(handler); + hand.readValues(Data); + + return handler.DirList; + } +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package mediaportal.remote; + +import java.util.ArrayList; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class ReceiveDirectoryXmlHandler extends DefaultHandler { + Boolean currentElement = false; + String currentValue = null; + + public ArrayList<DirItems> DirList = new ArrayList<DirItems>(); + + public static class DirItems + { + public boolean isFolder = false; + public String File= ""; + } + private DirItems currentdirItem; + + /** + * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) + */ + @Override + public void startElement(String uri, String localName, String qName, + Attributes attributes) throws SAXException { + currentElement = true; + + currentValue = ""; + if (localName == "Directory") {DirList = new ArrayList<DirItems>(); } + if (localName == "Folder") {currentdirItem = new DirItems(); } + if (localName == "File") {currentdirItem = new DirItems(); } + } + + /** + * Called when tag closing ( example:- <name>AndroidPeople</name> -- </name> ) + */ + @Override + public void endElement(String uri, String localName, String qName) + throws SAXException { + + currentElement = false; + + /** set value */ + if (localName == "Folder") { + currentdirItem.isFolder = true; + currentdirItem.File = currentValue; + DirList.add(currentdirItem); + } + if (localName == "File") { + currentdirItem.isFolder = true; + currentdirItem.File = currentValue; + DirList.add(currentdirItem); + } + } + + /** + * Called to get tag characters ( example:- <name>AndroidPeople</name> -- to get + * AndroidPeople Character ) + */ + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + if (currentElement) { + currentValue = new String(ch, start, length); + currentElement = false; + } + + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +public class ReceiveHandler { + + private org.xml.sax.ContentHandler _handler; + + public ReceiveHandler(org.xml.sax.ContentHandler Handler) { + _handler = Handler; + } + + public void readValues(String Url) + { + String fileUrl = "http://" + Settings.Server + ":" + Settings.Port + Url; + + URL myFileUrl = null; + try { + myFileUrl = new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn = (HttpURLConnection) myFileUrl + .openConnection(); + conn.setConnectTimeout(5000); + conn.setReadTimeout(10000); + conn.setDoInput(true); + conn.connect(); + + InputStream is = conn.getInputStream(); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser sp = null; + try { + sp = spf.newSAXParser(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + XMLReader reader = null; + try { + reader = sp.getXMLReader(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + reader.setContentHandler((org.xml.sax.ContentHandler) _handler); + try { + reader.parse(new InputSource(is)); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + is.close(); + sp.reset(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + } + +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; import java.io.IOException; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; import java.io.IOException; @@ -2,5 +23,3 @@ import java.io.InputStream; - import mediaportal.remote.R; - import android.app.Activity; @@ -12,9 +31,7 @@ import android.os.Bundle; import android.view.GestureDetector; import android.view.MotionEvent; -import android.view.View; import android.view.GestureDetector.OnGestureListener; -import android.widget.Button; public class Remote_02 extends Activity implements OnGestureListener { Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ScrollView.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ScrollView.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ScrollView.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,38 +0,0 @@ -package mediaportal.remote; - -import android.content.Context; -import android.graphics.Rect; -import android.util.AttributeSet; -import android.widget.TextView; - -public class ScrollView extends TextView { - - public ScrollView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - - public ScrollView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public ScrollView(Context context) { - super(context); - } - - @Override - protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { - if(focused) - super.onFocusChanged(focused, direction, previouslyFocusedRect); - } - - @Override - public void onWindowFocusChanged(boolean focused) { - if(focused) - super.onWindowFocusChanged(focused); - } - - @Override - public boolean isFocused() { - return true; - } -} \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; public class Settings{ @@ -2,8 +23,6 @@ - public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - - public Settings() - { - - } + public static String Server = "192.168.0.30"; + public static String Port = "8200"; + public static String MacId = "11-22-33-44-55-66"; + } Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,26 +0,0 @@ -package mediaportal.remote; - -import java.util.ArrayList; - -/** Contains getter and setter method for variables */ -public class directoryItems { - - /** Variables */ - private ArrayList<String> title = new ArrayList<String>(); - private ArrayList<Boolean> isFolder = new ArrayList<Boolean>(); - - public ArrayList<String> gettitle() { - return title; - } - public void settitle(String title) { - this.title.add(title); - } - - public ArrayList<Boolean> getIsFolder() { - return isFolder; - } - public void setIsFolder(Boolean isFolder) { - this.isFolder.add(isFolder); - } - -} Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,68 +0,0 @@ -package mediaportal.remote; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -public class directoryXmlHandler extends DefaultHandler { - Boolean currentElement = false; - String currentValue = null; - - public static directoryItems itemList = null; - - public static directoryItems getSitesList() { - return itemList; - } - - public static void setSitesList(directoryItems directoryList) { - directoryXmlHandler.itemList = directoryList; - } - - /** - * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) - */ - @Override - public void startElement(String uri, String localName, String qName, - Attributes attributes) throws SAXException { - currentElement = true; - - if (localName == "Directory") { - itemList = new directoryItems(); - } - } - - /** - * Called when tag closing ( example:- <name>AndroidPeople</name> -- </name> ) - */ - @Override - public void endElement(String uri, String localName, String qName) - throws SAXException { - - currentElement = false; - - /** set value */ - if (localName == "Folder") { - itemList.setIsFolder(true); - itemList.settitle(currentValue); - } - if (localName == "File") { - itemList.setIsFolder(false); - itemList.settitle(currentValue); - } - } - - /** - * Called to get tag characters ( example:- <name>AndroidPeople</name> -- to get - * AndroidPeople Character ) - */ - @Override - public void characters(char[] ch, int start, int length) - throws SAXException { - if (currentElement) { - currentValue = new String(ch, start, length); - currentElement = false; - } - - } - -} \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -17,7 +17,6 @@ import android.graphics.BitmapFactory; import android.os.Environment; - public class httpHandler { String extStorageDirectory; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; import mediaportal.remote.R; @@ -3,4 +24,5 @@ import android.app.Activity; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Bundle; import android.view.Menu; @@ -9,18 +31,25 @@ import android.view.View; import android.widget.*; -public class main extends Activity { +public class Main extends Activity { - /** Called when the activity is first created. */ + private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); + + 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"); + Button btnPictures = (Button) findViewById(R.id.MainButton1); btnPictures.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), pictures.class); + Intent myIntent = new Intent(view.getContext(), Pictures.class); startActivityForResult(myIntent, 0); } }); @@ -28,7 +57,7 @@ Button btnMusic = (Button) findViewById(R.id.MainButton2); btnMusic.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), musicTab.class); + Intent myIntent = new Intent(view.getContext(), MusicTab.class); startActivityForResult(myIntent, 0); } }); @@ -61,7 +90,7 @@ public boolean onOptionsItemSelected (MenuItem item){ switch (item.getItemId()){ case 111: - Intent myIntent = new Intent(this, setup.class); + Intent myIntent = new Intent(this, Setup.class); startActivityForResult(myIntent, 0); return true; case 112: Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,193 +0,0 @@ -package mediaportal.remote; - -import mediaportal.remote.R; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.view.Window; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemSelectedListener; -import android.widget.BaseAdapter; -import android.widget.GridView; -import android.widget.ImageView; -import android.widget.TextView; -import android.widget.AdapterView.OnItemClickListener; - -public class music extends Activity { - - public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.music); - /* - requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); - setContentView(R.layout.music); - getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title); - - ((TextView) findViewById(R.id.title)).setText("Music"); - */ - - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, - MODE_PRIVATE); - - String HttpServer = settings.getString("Server", "192.168.0.30"); - String HttpPort = settings.getString("Port", "8200"); - - musichandler h = musichandler.getinstance(); - h.setconnection(HttpServer, HttpPort); - h.getrootdirectory(); - - GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.setAdapter(new ImageAdapter2(music.this)); - - /* - gridview.setOnItemSelectedListener(new OnItemSelectedListener() { - public void onItemSelected(AdapterView<?> arg0, View arg1, - int arg2, long arg3) { - ImageView iv = (ImageView) arg1.findViewById(R.id.icon_image); - musicItem item = (musicItem) iv.getTag(); - - ((TextView) findViewById(R.id.title)).setText(item.title); - } - - public void onNothingSelected(AdapterView<?> arg0) { - // TODO Auto-generated method stub - } - }); - */ - - gridview.setOnItemClickListener(new OnItemClickListener() { - public void onItemClick(AdapterView<?> parent, View v, - int position, long id) { - - // TextView tv = (TextView) v.findViewById(R.id.icon_text); - ImageView iv = (ImageView) v.findViewById(R.id.icon_image); - musicItem item = (musicItem) iv.getTag(); - - if (item.typ == "item") { - musichandler h = musichandler.getinstance(); - h.selectedMusic = position - 1; - - // todo play or transfer - // Intent myIntent = new Intent(v.getContext(), - // picturesfullscreen.class); - // startActivityForResult(myIntent, 0); - } - - if (item.typ == "folder") { - - musichandler h = musichandler.getinstance(); - h.gotodir(item.title); - - GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.setAdapter(new ImageAdapter2(parent.getContext())); - - parent.invalidate(); - } - - if (item.typ == "oneup") { - musichandler h = musichandler.getinstance(); - h.oneup(); - - GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.setAdapter(new ImageAdapter2(parent.getContext())); - - parent.invalidate(); - } - - } - }); - } - - public class ImageAdapter2 extends BaseAdapter { - private Context mContext; - public static final int ACTIVITY_CREATE = 10; - - public ImageAdapter2(Context c) { - mContext = c; - } - - public int getCount() { - musichandler h = musichandler.getinstance(); - return h.getmusicItems().gettitle().size() + 1; - } - - 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; - if (convertView == null) { // if it's not recycled, initialize some - // attributes - - if (position > 0) { - position = position - 1; - - musichandler h = musichandler.getinstance(); - String txtName = h.getmusicItems().gettitle().get(position); - Boolean isFolder = h.getmusicItems().getIsFolder() - .get(position); - - LayoutInflater li = LayoutInflater.from(mContext); - v = li.inflate(R.layout.icon, null); - TextView tv = (TextView) v.findViewById(R.id.icon_text); - tv.setText(txtName); - ImageView iv = (ImageView) v.findViewById(R.id.icon_image); - - if (isFolder) { - iv.setImageResource(R.drawable.folder); - musicItem item = new musicItem(); - item.title = txtName; - item.typ = "folder"; - iv.setTag(item); - } else { - iv.setImageResource(R.drawable.audio); - musicItem item = new musicItem(); - item.title = txtName; - item.typ = "item"; - iv.setTag(item); - } - } else { - LayoutInflater li = LayoutInflater.from(mContext); - v = li.inflate(R.layout.icon, null); - TextView tv = (TextView) v.findViewById(R.id.icon_text); - tv.setText(".."); - ImageView iv = (ImageView) v.findViewById(R.id.icon_image); - iv.setImageResource(R.drawable.folderback); - musicItem item = new musicItem(); - item.title = ".."; - item.typ = "oneup"; - iv.setTag(item); - } - - } else { - v = convertView; - } - - // imageView.setImageBitmap(bmImg[position]); - return v; - } - } - - public class musicItem { - public String title; - public String typ; - } - -} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; import java.util.ArrayList; @@ -4,40 +25,32 @@ import android.app.Activity; import android.content.Context; -import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.os.Handler; import android.util.Log; -import android.view.ContextMenu; -import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.ListView; -import android.widget.TabHost; import android.widget.TextView; import android.widget.Toast; -public class musicAlbum extends Activity { +public class MusicAlbum extends Activity { - public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); private static ArrayList<ReceiveDbXmlHandler.DbItems> albumList; - private View menuInstance = null; - public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.music_album); ListView l1 = (ListView) findViewById(R.id.list_album); - l1.setAdapter(new EfficientAdapter(musicAlbum.this)); + l1.setAdapter(new EfficientAdapter(MusicAlbum.this)); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); @@ -57,7 +70,7 @@ super.onStart(); mHandler.removeCallbacks(mUpdateTimeTask); - mHandler.postDelayed(mUpdateTimeTask, 1000); + mHandler.postDelayed(mUpdateTimeTask, 100); } private Runnable mUpdateTimeTask = new Runnable() { @@ -70,23 +83,14 @@ Log.d("update album", "do update"); - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, - MODE_PRIVATE); - - String HttpServer = settings.getString("Server", "192.168.0.30"); - String HttpPort = settings.getString("Port", "8200"); - ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); - handler.setconnection(HttpServer, HttpPort); - boolean result = handler.GetAlbums(); + albumList = handler.GetAlbums(); - if (!result) { - Toast.makeText(musicAlbum.this, "TIME OUT SERVER", + if (albumList.size() == 0) { + Toast.makeText(MusicAlbum.this, "TIME OUT SERVER", Toast.LENGTH_LONG).show(); } - albumList = handler.GetResult(); - ListView l1 = (ListView) findViewById(R.id.list_album); l1.invalidateViews(); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-11-30 07:11:25 UTC (rev 3987) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-11-30 12:17:31 UTC (rev 3988) @@ -1,11 +1,30 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + package mediaportal.remote; import java.util.ArrayList; - import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; import android.graphics.Color; import android.graphic... [truncated message content] |
From: <kro...@us...> - 2010-12-03 07:03:17
|
Revision: 3990 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3990&view=rev Author: kroko_koenig Date: 2010-12-03 07:03:11 +0000 (Fri, 03 Dec 2010) Log Message: ----------- pictures fixed and slightshow, single instance Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-01 18:50:41 UTC (rev 3989) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-03 07:03:11 UTC (rev 3990) @@ -3,13 +3,13 @@ package="mediaportal.remote" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar" android:debuggable="true"> - <activity android:name=".Splash" android:label="@string/app_name"> + <activity android:name=".Splash" android:label="@string/app_name" android:launchMode="singleInstance"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <activity android:label="@string/app_name" android:name=".Main"> + <activity android:label="@string/app_name" android:name=".Main" android:launchMode="singleInstance"> <intent-filter> <action android:name="android.intent.action.DEFAULT" /> <category android:name="android.intent.category.VIEW" /> @@ -17,17 +17,17 @@ </activity> <activity android:name=".Remote_01" android:launchMode="singleInstance"></activity> <activity android:name=".Remote_02" android:launchMode="singleInstance"></activity> - <activity android:name=".Pictures"></activity> - <activity android:name=".Picturesfullscreen"></activity> - <activity android:name=".MusicDir"></activity> + <activity android:name=".Pictures" android:launchMode="singleInstance"></activity> + <activity android:name=".Picturesfullscreen" android:launchMode="singleInstance"></activity> + <activity android:name=".MusicDir" android:launchMode="singleInstance"></activity> <activity android:name=".Setup" android:launchMode="singleInstance"></activity> - <activity android:name=".nowplaying"></activity> - <activity android:name=".nowplaylist"></activity> - <activity android:name=".MusicArtist"></activity> - <activity android:name=".MusicAlbum"></activity> - <activity android:name=".MusicSong"></activity> - <activity android:name=".MusicTab"></activity> - <activity android:name=".MusicResults"></activity> + <activity android:name=".nowplaying" android:launchMode="singleInstance"></activity> + <activity android:name=".nowplaylist" android:launchMode="singleInstance"></activity> + <activity android:name=".MusicArtist" android:launchMode="singleInstance"></activity> + <activity android:name=".MusicAlbum" android:launchMode="singleInstance"></activity> + <activity android:name=".MusicSong" android:launchMode="singleInstance"></activity> + <activity android:name=".MusicTab" android:launchMode="singleInstance"></activity> + <activity android:name=".MusicResults" android:launchMode="singleInstance"></activity> </application> <uses-sdk android:minSdkVersion="3" /> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-01 18:50:41 UTC (rev 3989) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-03 07:03:11 UTC (rev 3990) @@ -74,7 +74,6 @@ } return bitmap; - } public void DownloadFile() { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-01 18:50:41 UTC (rev 3989) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-03 07:03:11 UTC (rev 3990) @@ -45,8 +45,10 @@ private Handler mHandler = new Handler(); public static String actualDir = ""; + public static ArrayList<ReceiveDirectoryXmlHandler.DirItems> pictureList; - + public static int selectedPicture; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -66,7 +68,7 @@ picItem pic = (picItem) iv.getTag(); if (pic.typ == "item") { - Picturesfullscreen.selectedPicture = position - 1; + selectedPicture = position - 1; Intent myIntent = new Intent(Pictures.this, Picturesfullscreen.class); startActivityForResult(myIntent, 0); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-01 18:50:41 UTC (rev 3989) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-03 07:03:11 UTC (rev 3990) @@ -24,8 +24,16 @@ import mediaportal.remote.R; import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; import android.app.Activity; +import android.content.Intent; +import android.graphics.Bitmap; import android.os.Bundle; +import android.os.Handler; +import android.view.ContextMenu; import android.view.GestureDetector; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.ContextMenu.ContextMenuInfo; import android.view.GestureDetector.OnGestureListener; import android.view.MotionEvent; import android.widget.ImageView; @@ -39,8 +47,11 @@ private static final int SWIPE_THRESHOLD_VELOCITY = 200; private GestureDetector gestureScanner; - public static int selectedPicture = 0; + private Handler mHandler = new Handler(); + private boolean slideShow; + private boolean randomShow; + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { @@ -49,12 +60,21 @@ gestureScanner = new GestureDetector(this); + setPicture(); + Toast.makeText(Picturesfullscreen.this, "left/right swipe possible", + Toast.LENGTH_SHORT).show(); + + // ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + // registerForContextMenu(imagev); + } + + private void setPicture() { ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + DirItems item = Pictures.pictureList.get(Pictures.selectedPicture); - DirItems item = Pictures.pictureList.get(selectedPicture); - httpHandler http = new httpHandler(); - String file = "http://" + Settings.Server + ":" + Settings.Port + "/pictures/"; + String file = "http://" + Settings.Server + ":" + Settings.Port + + "/pictures/"; file += Pictures.actualDir + item.File; item.Picture = http.DownloadImage(file); imagev.setImageBitmap(item.Picture); @@ -64,6 +84,77 @@ } @Override + public boolean onCreateOptionsMenu(Menu menu) { + menu.add(0, 101, 0, "Slide show"); + menu.add(0, 102, 1, "Random slide show"); + menu.add(0, 103, 2, "Stop slide show"); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case 101: + slideShow = true; + randomShow = false; + return true; + case 102: + slideShow = true; + randomShow = true; + return true; + case 103: + slideShow = false; + randomShow = false; + return true; + } + return true; + } + + @Override + public void onStart() { + super.onStart(); + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 2000); + } + + private Runnable mUpdateTimeTask = new Runnable() { + public void run() { + + if (slideShow) { + if(!randomShow) + { + int max = Pictures.pictureList.size(); + + if (Pictures.selectedPicture < max - 1) + Pictures.selectedPicture++; + else + Pictures.selectedPicture = 0; + setPicture(); + } + else + { + String req = "http://" + Settings.Server + ":" + Settings.Port +"/random/pictures/random.jpg"; + httpHandler handler = new httpHandler(); + + Bitmap pic = handler.DownloadImage(req); + + ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + imagev.setImageBitmap(pic); + } + } + + mHandler.postDelayed(mUpdateTimeTask, 2000); + } + }; + + @Override + public void onPause() { + super.onPause(); + mHandler.removeCallbacks(mUpdateTimeTask); + } + + @Override public boolean onTouchEvent(MotionEvent me) { return gestureScanner.onTouchEvent(me); } @@ -71,36 +162,32 @@ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { try { + + int max = Pictures.pictureList.size(); + if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) return false; // right to left swipe if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - Toast.makeText(Picturesfullscreen.this, "Left Swipe", - Toast.LENGTH_SHORT).show(); - // picturehandler pic = picturehandler.getinstance(); - // pic.selectedPicture += 1; - // if(pic.selectedPicture>=pic.getpictures().gettitle().size()) - // pic.selectedPicture = 0; - // ImageView imagev = (ImageView) - // findViewById(R.id.ImageView01); - // imagev.setImageBitmap(pic.getselectedPicture()); - // TextView txt = (TextView) findViewById(R.id.full_text); - // txt.setText(pic.selectedPictureName); + if (Pictures.selectedPicture < max - 1) { + Pictures.selectedPicture++; + setPicture(); + } else + Toast.makeText(Picturesfullscreen.this, "reached end +", + Toast.LENGTH_SHORT).show(); + } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - Toast.makeText(Picturesfullscreen.this, "Right Swipe", + + if (Pictures.selectedPicture > 0) { + Pictures.selectedPicture--; + setPicture(); + } + Toast.makeText(Picturesfullscreen.this, "reached end -", Toast.LENGTH_SHORT).show(); - // picturehandler pic = picturehandler.getinstance(); - // pic.selectedPicture -= 1; - // if(pic.selectedPicture<=0) - // pic.selectedPicture = pic.getpictures().gettitle().size(); - // ImageView imagev = (ImageView) - // findViewById(R.id.ImageView01); - // imagev.setImageBitmap(pic.getselectedPicture()); - // TextView txt = (TextView) findViewById(R.id.full_text); - // txt.setText(pic.selectedPictureName); + } } catch (Exception e) { // nothing This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rol...@us...> - 2010-12-06 12:45:26
|
Revision: 4010 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4010&view=rev Author: rollsroyc3 Date: 2010-12-06 12:45:19 +0000 (Mon, 06 Dec 2010) Log Message: ----------- updated filenames and references to lowercase, few small fixes in pictures Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.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/Remote_02.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/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.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/Android/MediaPortalRemote/src/mediaportal/remote/splash.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-06 12:45:19 UTC (rev 4010) @@ -3,31 +3,31 @@ package="mediaportal.remote" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar" android:debuggable="true"> - <activity android:name=".Splash" android:label="@string/app_name" android:launchMode="singleInstance"> + <activity android:name=".splash" android:label="@string/app_name" android:launchMode="singleInstance"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <activity android:label="@string/app_name" android:name=".Main" android:launchMode="singleInstance"> + <activity android:label="@string/app_name" android:name=".main" android:launchMode="singleInstance"> <intent-filter> <action android:name="android.intent.action.DEFAULT" /> <category android:name="android.intent.category.VIEW" /> </intent-filter> </activity> - <activity android:name=".Remote_01" android:launchMode="singleInstance"></activity> - <activity android:name=".Remote_02" android:launchMode="singleInstance"></activity> - <activity android:name=".Pictures" android:launchMode="singleInstance"></activity> - <activity android:name=".Picturesfullscreen" android:launchMode="singleInstance"></activity> - <activity android:name=".MusicDir" android:launchMode="singleInstance"></activity> - <activity android:name=".Setup" android:launchMode="singleInstance"></activity> + <activity android:name=".remote_01" android:launchMode="singleInstance"></activity> + <activity android:name=".remote_02" android:launchMode="singleInstance"></activity> + <activity android:name=".pictures" android:launchMode="singleInstance"></activity> + <activity android:name=".picturesfullscreen" android:launchMode="singleInstance"></activity> + <activity android:name=".musicdir" android:launchMode="singleInstance"></activity> + <activity android:name=".setup" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaying" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaylist" android:launchMode="singleInstance"></activity> - <activity android:name=".MusicArtist" android:launchMode="singleInstance"></activity> - <activity android:name=".MusicAlbum" android:launchMode="singleInstance"></activity> - <activity android:name=".MusicSong" android:launchMode="singleInstance"></activity> - <activity android:name=".MusicTab" android:launchMode="singleInstance"></activity> - <activity android:name=".MusicResults" android:launchMode="singleInstance"></activity> + <activity android:name=".musicartist" android:launchMode="singleInstance"></activity> + <activity android:name=".musicalbum" android:launchMode="singleInstance"></activity> + <activity android:name=".musicsong" android:launchMode="singleInstance"></activity> + <activity android:name=".musictab" android:launchMode="singleInstance"></activity> + <activity android:name=".musicresults" android:launchMode="singleInstance"></activity> </application> <uses-sdk android:minSdkVersion="3" /> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -4,16 +4,16 @@ import android.media.MediaPlayer; -public class MediaPlayerControl { +public class mediaplayercontrol { - private static MediaPlayerControl instance; + private static mediaplayercontrol instance; private static MediaPlayer mp; - public static MediaPlayerControl getinstance() { + public static mediaplayercontrol getinstance() { if (mp == null) mp = new MediaPlayer(); if (instance == null) - instance = new MediaPlayerControl(); + instance = new mediaplayercontrol(); return instance; } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -23,7 +23,7 @@ import java.util.ArrayList; import mediaportal.remote.R; -import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; +import mediaportal.remote.receivedirectoryxmlhandler.DirItems; import android.app.Activity; import android.content.Context; import android.os.Bundle; @@ -40,11 +40,11 @@ import android.widget.AdapterView.OnItemClickListener; import android.widget.Toast; -public class MusicDir extends Activity { +public class musicdir extends Activity { private Handler mHandler = new Handler(); private String actualDir = ""; - private static ArrayList<ReceiveDirectoryXmlHandler.DirItems> musicList; + private static ArrayList<receivedirectoryxmlhandler.DirItems> musicList; @Override public void onCreate(Bundle savedInstanceState) { @@ -55,7 +55,7 @@ mHandler.postDelayed(mUpdateTimeTask, 100); GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.setAdapter(new ImageAdapter2(MusicDir.this)); + gridview.setAdapter(new ImageAdapter2(musicdir.this)); gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { @@ -116,11 +116,11 @@ Log.d("update music dir", "do update folder : " + actualDir); - ReceiveDirHandler h = ReceiveDirHandler.getinstance(); + receivedirhandler h = receivedirhandler.getinstance(); musicList = h.getMusicDir(actualDir); if (musicList.size() == 0) { - Toast.makeText(MusicDir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) + Toast.makeText(musicdir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) .show(); } else { GridView gridview = (GridView) findViewById(R.id.music_grid); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -32,12 +32,12 @@ import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; -public class PostWebserver { +public class postwebserver { public String httpServer = ""; public String httpPort = ""; - public PostWebserver(String Server, String Port) { + public postwebserver(String Server, String Port) { httpServer = Server; httpPort = Port; } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -24,17 +24,17 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; -import mediaportal.remote.ReceiveDbXmlHandler.DbItems; +import mediaportal.remote.receivedbxmlhandler.DbItems; -public class ReceiveDbHandler { +public class receivedbhandler { - private static ReceiveDbHandler instance; + private static receivedbhandler instance; public int selectedMusic; - public static ReceiveDbHandler getinstance() { + public static receivedbhandler getinstance() { if (instance == null) - instance = new ReceiveDbHandler(); + instance = new receivedbhandler(); return instance; } @@ -56,8 +56,8 @@ private ArrayList<DbItems> fetchData(String Data) { - ReceiveDbXmlHandler handler = new ReceiveDbXmlHandler(); - ReceiveHandler hand = new ReceiveHandler(handler); + receivedbxmlhandler handler = new receivedbxmlhandler(); + receivehandler hand = new receivehandler(handler); try { Data = URLEncoder.encode(Data, "UTF-8"); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -27,7 +27,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -public class ReceiveDbXmlHandler extends DefaultHandler { +public class receivedbxmlhandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -22,16 +22,16 @@ package mediaportal.remote; import java.util.ArrayList; -import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; +import mediaportal.remote.receivedirectoryxmlhandler.DirItems; -public class ReceiveDirHandler { +public class receivedirhandler { - private static ReceiveDirHandler instance; + private static receivedirhandler instance; private static String actualDir; - public static ReceiveDirHandler getinstance() { + public static receivedirhandler getinstance() { if (instance == null) - instance = new ReceiveDirHandler(); + instance = new receivedirhandler(); return instance; } @@ -60,8 +60,8 @@ private ArrayList<DirItems> fetchData(String Data) { - ReceiveDirectoryXmlHandler handler = new ReceiveDirectoryXmlHandler(); - ReceiveHandler hand = new ReceiveHandler(handler); + receivedirectoryxmlhandler handler = new receivedirectoryxmlhandler(); + receivehandler hand = new receivehandler(handler); hand.readValues(Data); return handler.DirList; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -28,7 +28,7 @@ import android.graphics.Bitmap; -public class ReceiveDirectoryXmlHandler extends DefaultHandler { +public class receivedirectoryxmlhandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -34,11 +34,11 @@ import org.xml.sax.SAXException; import org.xml.sax.XMLReader; -public class ReceiveHandler { +public class receivehandler { private org.xml.sax.ContentHandler _handler; - public ReceiveHandler(org.xml.sax.ContentHandler Handler) { + public receivehandler(org.xml.sax.ContentHandler Handler) { _handler = Handler; } 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-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -37,7 +37,7 @@ import android.view.GestureDetector.OnGestureListener; import android.widget.Button; -public class Remote_01 extends Activity implements OnGestureListener { +public class remote_01 extends Activity implements OnGestureListener { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private String HttpServer = ""; @@ -177,7 +177,7 @@ public void PostCommand(String button) { - PostWebserver post = new PostWebserver(HttpServer, HttpPort); + postwebserver post = new postwebserver(HttpServer, HttpPort); AssetManager assetManager = getAssets(); String xml = ""; @@ -210,7 +210,7 @@ // right to left swipe if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - Intent myIntent = new Intent(this, Remote_02.class); + Intent myIntent = new Intent(this, remote_02.class); startActivityForResult(myIntent, 0); } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -35,7 +35,7 @@ import android.view.GestureDetector.OnGestureListener; import android.widget.Button; -public class Remote_02 extends Activity implements OnGestureListener { +public class remote_02 extends Activity implements OnGestureListener { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private String HttpServer = ""; @@ -134,7 +134,7 @@ public void PostCommand(String button) { - PostWebserver post = new PostWebserver(HttpServer, HttpPort); + postwebserver post = new postwebserver(HttpServer, HttpPort); AssetManager assetManager = getAssets(); String xml = ""; @@ -171,7 +171,7 @@ } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - Intent myIntent = new Intent(this, Remote_01.class); + Intent myIntent = new Intent(this, remote_01.class); startActivityForResult(myIntent, 0); } } catch (Exception e) { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -17,11 +17,11 @@ import android.graphics.BitmapFactory; import android.os.Environment; -public class httpHandler { +public class httphandler { String extStorageDirectory; - public httpHandler() { + public httphandler() { } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -34,7 +34,7 @@ import android.view.View; import android.widget.*; -public class Main extends Activity { +public class main extends Activity { private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; @@ -56,7 +56,7 @@ Button btnPictures = (Button) findViewById(R.id.MainButton1); btnPictures.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), Pictures.class); + Intent myIntent = new Intent(view.getContext(), pictures.class); startActivityForResult(myIntent, 0); } }); @@ -64,7 +64,7 @@ Button btnMusic = (Button) findViewById(R.id.MainButton2); btnMusic.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), MusicTab.class); + Intent myIntent = new Intent(view.getContext(), musictab.class); startActivityForResult(myIntent, 0); } }); @@ -97,7 +97,7 @@ Button btnRemote = (Button) findViewById(R.id.MainButton4); btnRemote.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), Remote_01.class); + Intent myIntent = new Intent(view.getContext(), remote_01.class); startActivityForResult(myIntent, 0); } }); @@ -123,7 +123,7 @@ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case 111: - Intent myIntent = new Intent(this, Setup.class); + Intent myIntent = new Intent(this, setup.class); startActivityForResult(myIntent, 0); return true; case 112: Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -39,18 +39,18 @@ import android.widget.TextView; import android.widget.Toast; -public class MusicAlbum extends Activity { +public class musicalbum extends Activity { private Handler mHandler = new Handler(); - private static ArrayList<ReceiveDbXmlHandler.DbItems> albumList; + private static ArrayList<receivedbxmlhandler.DbItems> albumList; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.music_album); ListView l1 = (ListView) findViewById(R.id.list_album); - l1.setAdapter(new EfficientAdapter(MusicAlbum.this)); + l1.setAdapter(new EfficientAdapter(musicalbum.this)); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); @@ -83,11 +83,11 @@ Log.d("update album", "do update"); - ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + receivedbhandler handler = receivedbhandler.getinstance(); albumList = handler.GetAlbums(); if (albumList.size() == 0) { - Toast.makeText(MusicAlbum.this, "TIME OUT SERVER", + Toast.makeText(musicalbum.this, "TIME OUT SERVER", Toast.LENGTH_LONG).show(); } @@ -134,7 +134,7 @@ holder = (ViewHolder) convertView.getTag(); } - ReceiveDbXmlHandler.DbItems item = albumList.get(position); + receivedbxmlhandler.DbItems item = albumList.get(position); holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Album + " - " + item.Artist); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -39,19 +39,19 @@ import android.widget.TextView; import android.widget.Toast; -public class MusicArtist extends Activity{ +public class musicartist extends Activity{ public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); - private static ArrayList<ReceiveDbXmlHandler.DbItems> artistList; + private static ArrayList<receivedbxmlhandler.DbItems> artistList; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.music_artist); ListView l1 = (ListView) findViewById(R.id.list_artist); - l1.setAdapter(new EfficientAdapter(MusicArtist.this)); + l1.setAdapter(new EfficientAdapter(musicartist.this)); l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { @@ -59,9 +59,9 @@ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { - ReceiveDbXmlHandler.DbItems item = artistList.get(arg2); - MusicResults.Select = item.Artist; - Intent myIntent = new Intent(arg1.getContext(), MusicResults.class); + receivedbxmlhandler.DbItems item = artistList.get(arg2); + musicresults.Select = item.Artist; + Intent myIntent = new Intent(arg1.getContext(), musicresults.class); startActivityForResult(myIntent, 0); } } @@ -89,11 +89,11 @@ Log.d("update artist", "do update"); - ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + receivedbhandler handler = receivedbhandler .getinstance(); artistList = handler.GetArtist(); if (artistList.size() == 0) { - Toast.makeText(MusicArtist.this, "TIME OUT SERVER", + Toast.makeText(musicartist.this, "TIME OUT SERVER", Toast.LENGTH_LONG).show(); } @@ -138,7 +138,7 @@ holder = (ViewHolder) convertView.getTag(); } - ReceiveDbXmlHandler.DbItems item = artistList.get(position); + receivedbxmlhandler.DbItems item = artistList.get(position); holder.text.setText(String.valueOf(position +1)); holder.text2.setText(item.Artist); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -40,12 +40,12 @@ import android.widget.TextView; import android.widget.Toast; -public class MusicResults extends Activity { +public class musicresults extends Activity { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); - private static ArrayList<ReceiveDbXmlHandler.DbItems> itemList; + private static ArrayList<receivedbxmlhandler.DbItems> itemList; public static String Select = ""; @@ -54,7 +54,7 @@ setContentView(R.layout.music_results); ListView l1 = (ListView) findViewById(R.id.list_result); - l1.setAdapter(new EfficientAdapter(MusicResults.this)); + l1.setAdapter(new EfficientAdapter(musicresults.this)); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); @@ -80,9 +80,9 @@ if (x == -1) x = 0; if (itemList.size() > 0) { - ReceiveDbXmlHandler.DbItems itm = itemList.get(x); + receivedbxmlhandler.DbItems itm = itemList.get(x); - httpHandler http = new httpHandler(); + httphandler http = new httphandler(); http.DownloadFile(); } x = 1; @@ -112,11 +112,11 @@ Log.d("update search", "do update"); - ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + receivedbhandler handler = receivedbhandler.getinstance(); itemList = handler.GetSongsByArtist(Select); if (itemList.size() == 0) { - Toast.makeText(MusicResults.this, "TIME OUT SERVER", + Toast.makeText(musicresults.this, "TIME OUT SERVER", Toast.LENGTH_LONG).show(); } @@ -163,7 +163,7 @@ holder = (ViewHolder) convertView.getTag(); } - ReceiveDbXmlHandler.DbItems item = itemList.get(position); + receivedbxmlhandler.DbItems item = itemList.get(position); holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Title + " - " + item.Artist); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -39,11 +39,11 @@ import android.widget.TextView; import android.widget.Toast; -public class MusicSong extends Activity { +public class musicsong extends Activity { private Handler mHandler = new Handler(); - private static ArrayList<ReceiveDbXmlHandler.DbItems> songList; + private static ArrayList<receivedbxmlhandler.DbItems> songList; public static String Select = ""; @@ -52,7 +52,7 @@ setContentView(R.layout.music_song); ListView l1 = (ListView) findViewById(R.id.list_song); - l1.setAdapter(new EfficientAdapter(MusicSong.this)); + l1.setAdapter(new EfficientAdapter(musicsong.this)); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); @@ -63,7 +63,7 @@ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { - MediaPlayerControl mp = MediaPlayerControl.getinstance(); + mediaplayercontrol mp = mediaplayercontrol.getinstance(); mp.Play("http://" + Settings.Server + ":" + Settings.Port + "/music/" + "song-marianne-plays-on-piano-sense-and-sensibilit.mp3"); } }); @@ -87,11 +87,11 @@ Log.d("update song", "do update"); - ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + receivedbhandler handler = receivedbhandler.getinstance(); songList = handler.GetSongs(); if (songList.size() == 0) { - Toast.makeText(MusicSong.this, "TIME OUT SERVER", Toast.LENGTH_LONG) + Toast.makeText(musicsong.this, "TIME OUT SERVER", Toast.LENGTH_LONG) .show(); } @@ -138,7 +138,7 @@ holder = (ViewHolder) convertView.getTag(); } - ReceiveDbXmlHandler.DbItems item = songList.get(position); + receivedbxmlhandler.DbItems item = songList.get(position); holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Title + " - " + item.Artist); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -27,7 +27,7 @@ import android.os.Bundle; import android.widget.TabHost; -public class MusicTab extends TabActivity { +public class musictab extends TabActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.musictab); @@ -38,7 +38,7 @@ Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab (to be reused) - intent = new Intent().setClass(this, MusicArtist.class); + intent = new Intent().setClass(this, musicartist.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("artists") .setIndicator("Artists", res.getDrawable(R.drawable.ic_tab1)) @@ -46,19 +46,19 @@ tabHost.addTab(spec); // Do the same for the other tabs - intent = new Intent().setClass(this, MusicAlbum.class); + intent = new Intent().setClass(this, musicalbum.class); spec = tabHost.newTabSpec("albums") .setIndicator("Albums", res.getDrawable(R.drawable.ic_tab2)) .setContent(intent); tabHost.addTab(spec); - intent = new Intent().setClass(this, MusicSong.class); + intent = new Intent().setClass(this, musicsong.class); spec = tabHost.newTabSpec("songs") .setIndicator("Songs", res.getDrawable(R.drawable.ic_tab3)) .setContent(intent); tabHost.addTab(spec); - intent = new Intent().setClass(this, MusicDir.class); + intent = new Intent().setClass(this, musicdir.class); spec = tabHost.newTabSpec("music") .setIndicator("Music", res.getDrawable(R.drawable.ic_tab4)) .setContent(intent); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -149,7 +149,7 @@ if (nowplayinghandler.Cover.equals("True")) { if (!lastTitle.equals(nowplayinghandler.Title)) { - httpHandler h = new httpHandler(); + httphandler h = new httphandler(); Bitmap bitmap = h.DownloadImage("http://" + HttpServer + ":" + HttpPort + "/nowplaying/cover"); if (bitmap != null) { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -4,7 +4,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -public class nowplayingXmlHandler extends DefaultHandler { +public class nowplayingxmlhandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -93,7 +93,7 @@ e.printStackTrace(); } - nowplayingXmlHandler handler = new nowplayingXmlHandler(); + nowplayingxmlhandler handler = new nowplayingxmlhandler(); reader.setContentHandler(handler); try { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -4,7 +4,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -public class nowplaylistXmlHandler extends DefaultHandler { +public class nowplaylistxmlhandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; nowplaylisthandler.PlayListItem item = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -95,7 +95,7 @@ e.printStackTrace(); } - nowplaylistXmlHandler handler = new nowplaylistXmlHandler(); + nowplaylistxmlhandler handler = new nowplaylistxmlhandler(); reader.setContentHandler(handler); try { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -23,8 +23,9 @@ import java.util.ArrayList; import mediaportal.remote.R; -import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; +import mediaportal.remote.receivedirectoryxmlhandler.DirItems; import android.app.Activity; +import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -41,12 +42,12 @@ import android.widget.AdapterView.OnItemClickListener; import android.widget.Toast; -public class Pictures extends Activity { +public class pictures extends Activity { private Handler mHandler = new Handler(); public static String actualDir = ""; - public static ArrayList<ReceiveDirectoryXmlHandler.DirItems> pictureList; + public static ArrayList<receivedirectoryxmlhandler.DirItems> pictureList; public static int selectedPicture; @Override @@ -69,13 +70,13 @@ if (pic.typ == "item") { selectedPicture = position - 1; - Intent myIntent = new Intent(Pictures.this, - Picturesfullscreen.class); + Intent myIntent = new Intent(pictures.this, + picturesfullscreen.class); startActivityForResult(myIntent, 0); } if (pic.typ == "folder") { - actualDir += pic.title + "/"; + actualDir += pic.title.replaceAll(" ", "%20") + "/"; mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 0); @@ -116,18 +117,26 @@ private void update() { + ProgressDialog dialog = new ProgressDialog(this); + dialog.setCancelable(true); + dialog.setMessage("Loading..."); + dialog.show(); + + Log.d("update pictures", "do update folder : " + actualDir); - ReceiveDirHandler h = ReceiveDirHandler.getinstance(); + receivedirhandler h = receivedirhandler.getinstance(); pictureList = h.getPictureDir(actualDir); if (pictureList.size() == 0) { - Toast.makeText(Pictures.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) + Toast.makeText(pictures.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) .show(); } else { GridView gridview = (GridView) findViewById(R.id.GridView01); gridview.setAdapter(new ImageAdapter2(this)); } + + dialog.cancel(); } public class ImageAdapter2 extends BaseAdapter { @@ -189,12 +198,12 @@ iv.setTag(pic); } else { - httpHandler http = new httpHandler(); + httphandler http = new httphandler(); String file = "http://" + Settings.Server + ":" + Settings.Port + "/pictures/"; file += actualDir + item.File + ".thb"; - item.Picture = http.DownloadImage(file); + item.Picture = http.DownloadImage(file.replaceAll(" ", "%20")); 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-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -22,7 +22,7 @@ package mediaportal.remote; import mediaportal.remote.R; -import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; +import mediaportal.remote.receivedirectoryxmlhandler.DirItems; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; @@ -33,6 +33,8 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.view.Window; +import android.view.WindowManager; import android.view.ContextMenu.ContextMenuInfo; import android.view.GestureDetector.OnGestureListener; import android.view.MotionEvent; @@ -40,7 +42,7 @@ import android.widget.TextView; import android.widget.Toast; -public class Picturesfullscreen extends Activity implements OnGestureListener { +public class picturesfullscreen extends Activity implements OnGestureListener { private static final int SWIPE_MIN_DISTANCE = 120; private static final int SWIPE_MAX_OFF_PATH = 250; @@ -56,12 +58,19 @@ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + requestWindowFeature(Window.FEATURE_NO_TITLE); + getWindow().setFlags + (WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + setContentView(R.layout.picturesfullscreen); + setContentView(R.layout.picturesfullscreen); gestureScanner = new GestureDetector(this); setPicture(); - Toast.makeText(Picturesfullscreen.this, "left/right swipe possible", + Toast.makeText(picturesfullscreen .this, "left/right swipe possible", Toast.LENGTH_SHORT).show(); // ImageView imagev = (ImageView) findViewById(R.id.ImageView01); @@ -70,17 +79,19 @@ private void setPicture() { ImageView imagev = (ImageView) findViewById(R.id.ImageView01); - DirItems item = Pictures.pictureList.get(Pictures.selectedPicture); - - httpHandler http = new httpHandler(); - String file = "http://" + Settings.Server + ":" + Settings.Port - + "/pictures/"; - file += Pictures.actualDir + item.File; - item.Picture = http.DownloadImage(file); - imagev.setImageBitmap(item.Picture); - - TextView txt = (TextView) findViewById(R.id.full_text); - txt.setText(item.File); + DirItems item = pictures.pictureList.get(pictures.selectedPicture); + if (!item.isFolder) + { + httphandler http = new httphandler(); + String file = "http://" + Settings.Server + ":" + Settings.Port + + "/pictures/"; + file += pictures.actualDir + item.File; + item.Picture = http.DownloadImage(file.replaceAll(" ", "%20")); + imagev.setImageBitmap(item.Picture); + + TextView txt = (TextView) findViewById(R.id.full_text); + txt.setText(item.File); + } } @Override @@ -124,18 +135,18 @@ if (slideShow) { if(!randomShow) { - int max = Pictures.pictureList.size(); + int max = pictures.pictureList.size(); - if (Pictures.selectedPicture < max - 1) - Pictures.selectedPicture++; + if (pictures.selectedPicture < max - 1) + pictures.selectedPicture++; else - Pictures.selectedPicture = 0; + pictures.selectedPicture = 0; setPicture(); } else { String req = "http://" + Settings.Server + ":" + Settings.Port +"/random/pictures/random.jpg"; - httpHandler handler = new httpHandler(); + httphandler handler = new httphandler(); Bitmap pic = handler.DownloadImage(req); @@ -163,7 +174,7 @@ float velocityY) { try { - int max = Pictures.pictureList.size(); + int max = pictures.pictureList.size(); if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) return false; @@ -171,21 +182,21 @@ if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - if (Pictures.selectedPicture < max - 1) { - Pictures.selectedPicture++; + if (pictures.selectedPicture < max - 1) { + pictures.selectedPicture++; setPicture(); } else - Toast.makeText(Picturesfullscreen.this, "reached end +", + Toast.makeText(picturesfullscreen.this, "reached end +", Toast.LENGTH_SHORT).show(); } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - if (Pictures.selectedPicture > 0) { - Pictures.selectedPicture--; + if (pictures.selectedPicture > 0) { + pictures.selectedPicture--; setPicture(); - } - Toast.makeText(Picturesfullscreen.this, "reached end -", + } else + Toast.makeText(picturesfullscreen.this, "reached end -", Toast.LENGTH_SHORT).show(); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -27,7 +27,7 @@ import android.os.Bundle; import android.widget.EditText; -public class Setup extends Activity { +public class setup extends Activity { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2010-12-05 21:44:07 UTC (rev 4009) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2010-12-06 12:45:19 UTC (rev 4010) @@ -27,7 +27,7 @@ import android.os.Bundle; import android.os.Handler; -public class Splash extends Activity { +public class splash extends Activity { private final int SPLASH_DISPLAY_LENGHT = 1500; @@ -41,9 +41,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. |
From: <Rol...@us...> - 2010-12-06 23:02:02
|
Revision: 4015 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4015&view=rev Author: Rollsroyc3 Date: 2010-12-06 23:01:55 +0000 (Mon, 06 Dec 2010) Log Message: ----------- Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.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/Remote_02.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/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-06 23:01:55 UTC (rev 4015) @@ -15,19 +15,19 @@ <category android:name="android.intent.category.VIEW" /> </intent-filter> </activity> - <activity android:name=".remote_01" android:launchMode="singleInstance"></activity> - <activity android:name=".remote_02" android:launchMode="singleInstance"></activity> + <activity android:name=".Remote_01" android:launchMode="singleInstance"></activity> + <activity android:name=".Remote_02" android:launchMode="singleInstance"></activity> <activity android:name=".pictures" android:launchMode="singleInstance"></activity> <activity android:name=".picturesfullscreen" android:launchMode="singleInstance"></activity> - <activity android:name=".musicdir" android:launchMode="singleInstance"></activity> + <activity android:name=".MusicDir" android:launchMode="singleInstance"></activity> <activity android:name=".setup" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaying" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaylist" android:launchMode="singleInstance"></activity> - <activity android:name=".musicartist" android:launchMode="singleInstance"></activity> - <activity android:name=".musicalbum" android:launchMode="singleInstance"></activity> - <activity android:name=".musicsong" android:launchMode="singleInstance"></activity> - <activity android:name=".musictab" android:launchMode="singleInstance"></activity> - <activity android:name=".musicresults" android:launchMode="singleInstance"></activity> + <activity android:name=".musicArtist" android:launchMode="singleInstance"></activity> + <activity android:name=".musicAlbum" android:launchMode="singleInstance"></activity> + <activity android:name=".musicSong" android:launchMode="singleInstance"></activity> + <activity android:name=".musicTab" android:launchMode="singleInstance"></activity> + <activity android:name=".musicResults" android:launchMode="singleInstance"></activity> </application> <uses-sdk android:minSdkVersion="3" /> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -4,16 +4,16 @@ import android.media.MediaPlayer; -public class mediaplayercontrol { +public class MediaPlayerControl { - private static mediaplayercontrol instance; + private static MediaPlayerControl instance; private static MediaPlayer mp; - public static mediaplayercontrol getinstance() { + public static MediaPlayerControl getinstance() { if (mp == null) mp = new MediaPlayer(); if (instance == null) - instance = new mediaplayercontrol(); + instance = new MediaPlayerControl(); return instance; } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -23,7 +23,7 @@ import java.util.ArrayList; import mediaportal.remote.R; -import mediaportal.remote.receivedirectoryxmlhandler.DirItems; +import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; import android.app.Activity; import android.content.Context; import android.os.Bundle; @@ -40,11 +40,11 @@ import android.widget.AdapterView.OnItemClickListener; import android.widget.Toast; -public class musicdir extends Activity { +public class MusicDir extends Activity { private Handler mHandler = new Handler(); private String actualDir = ""; - private static ArrayList<receivedirectoryxmlhandler.DirItems> musicList; + private static ArrayList<ReceiveDirectoryXmlHandler.DirItems> musicList; @Override public void onCreate(Bundle savedInstanceState) { @@ -55,7 +55,7 @@ mHandler.postDelayed(mUpdateTimeTask, 100); GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.setAdapter(new ImageAdapter2(musicdir.this)); + gridview.setAdapter(new ImageAdapter2(MusicDir.this)); gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { @@ -116,11 +116,11 @@ Log.d("update music dir", "do update folder : " + actualDir); - receivedirhandler h = receivedirhandler.getinstance(); + ReceiveDirHandler h = ReceiveDirHandler.getinstance(); musicList = h.getMusicDir(actualDir); if (musicList.size() == 0) { - Toast.makeText(musicdir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) + Toast.makeText(MusicDir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) .show(); } else { GridView gridview = (GridView) findViewById(R.id.music_grid); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -32,12 +32,12 @@ import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; -public class postwebserver { +public class PostWebserver { public String httpServer = ""; public String httpPort = ""; - public postwebserver(String Server, String Port) { + public PostWebserver(String Server, String Port) { httpServer = Server; httpPort = Port; } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -24,17 +24,17 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; -import mediaportal.remote.receivedbxmlhandler.DbItems; +import mediaportal.remote.ReceiveDbXmlHandler.DbItems; -public class receivedbhandler { +public class ReceiveDbHandler { - private static receivedbhandler instance; + private static ReceiveDbHandler instance; public int selectedMusic; - public static receivedbhandler getinstance() { + public static ReceiveDbHandler getinstance() { if (instance == null) - instance = new receivedbhandler(); + instance = new ReceiveDbHandler(); return instance; } @@ -56,8 +56,8 @@ private ArrayList<DbItems> fetchData(String Data) { - receivedbxmlhandler handler = new receivedbxmlhandler(); - receivehandler hand = new receivehandler(handler); + ReceiveDbXmlHandler handler = new ReceiveDbXmlHandler(); + ReceiveHandler hand = new ReceiveHandler(handler); try { Data = URLEncoder.encode(Data, "UTF-8"); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -27,7 +27,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -public class receivedbxmlhandler extends DefaultHandler { +public class ReceiveDbXmlHandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirHandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -22,16 +22,16 @@ package mediaportal.remote; import java.util.ArrayList; -import mediaportal.remote.receivedirectoryxmlhandler.DirItems; +import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; -public class receivedirhandler { +public class ReceiveDirHandler { - private static receivedirhandler instance; + private static ReceiveDirHandler instance; private static String actualDir; - public static receivedirhandler getinstance() { + public static ReceiveDirHandler getinstance() { if (instance == null) - instance = new receivedirhandler(); + instance = new ReceiveDirHandler(); return instance; } @@ -60,8 +60,8 @@ private ArrayList<DirItems> fetchData(String Data) { - receivedirectoryxmlhandler handler = new receivedirectoryxmlhandler(); - receivehandler hand = new receivehandler(handler); + ReceiveDirectoryXmlHandler handler = new ReceiveDirectoryXmlHandler(); + ReceiveHandler hand = new ReceiveHandler(handler); hand.readValues(Data); return handler.DirList; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -28,7 +28,7 @@ import android.graphics.Bitmap; -public class receivedirectoryxmlhandler extends DefaultHandler { +public class ReceiveDirectoryXmlHandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveHandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -34,11 +34,11 @@ import org.xml.sax.SAXException; import org.xml.sax.XMLReader; -public class receivehandler { +public class ReceiveHandler { private org.xml.sax.ContentHandler _handler; - public receivehandler(org.xml.sax.ContentHandler Handler) { + public ReceiveHandler(org.xml.sax.ContentHandler Handler) { _handler = Handler; } 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-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -37,7 +37,7 @@ import android.view.GestureDetector.OnGestureListener; import android.widget.Button; -public class remote_01 extends Activity implements OnGestureListener { +public class Remote_01 extends Activity implements OnGestureListener { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private String HttpServer = ""; @@ -177,7 +177,7 @@ public void PostCommand(String button) { - postwebserver post = new postwebserver(HttpServer, HttpPort); + PostWebserver post = new PostWebserver(HttpServer, HttpPort); AssetManager assetManager = getAssets(); String xml = ""; @@ -210,7 +210,7 @@ // right to left swipe if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - Intent myIntent = new Intent(this, remote_02.class); + Intent myIntent = new Intent(this, Remote_02.class); startActivityForResult(myIntent, 0); } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -35,7 +35,7 @@ import android.view.GestureDetector.OnGestureListener; import android.widget.Button; -public class remote_02 extends Activity implements OnGestureListener { +public class Remote_02 extends Activity implements OnGestureListener { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private String HttpServer = ""; @@ -134,7 +134,7 @@ public void PostCommand(String button) { - postwebserver post = new postwebserver(HttpServer, HttpPort); + PostWebserver post = new PostWebserver(HttpServer, HttpPort); AssetManager assetManager = getAssets(); String xml = ""; @@ -171,7 +171,7 @@ } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - Intent myIntent = new Intent(this, remote_01.class); + Intent myIntent = new Intent(this, Remote_01.class); startActivityForResult(myIntent, 0); } } catch (Exception e) { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -17,11 +17,11 @@ import android.graphics.BitmapFactory; import android.os.Environment; -public class httphandler { +public class httpHandler { String extStorageDirectory; - public httphandler() { + public httpHandler() { } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -64,7 +64,7 @@ Button btnMusic = (Button) findViewById(R.id.MainButton2); btnMusic.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), musictab.class); + Intent myIntent = new Intent(view.getContext(), musicTab.class); startActivityForResult(myIntent, 0); } }); @@ -97,7 +97,7 @@ Button btnRemote = (Button) findViewById(R.id.MainButton4); btnRemote.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), remote_01.class); + Intent myIntent = new Intent(view.getContext(), Remote_01.class); startActivityForResult(myIntent, 0); } }); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -39,18 +39,18 @@ import android.widget.TextView; import android.widget.Toast; -public class musicalbum extends Activity { +public class musicAlbum extends Activity { private Handler mHandler = new Handler(); - private static ArrayList<receivedbxmlhandler.DbItems> albumList; + private static ArrayList<ReceiveDbXmlHandler.DbItems> albumList; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.music_album); ListView l1 = (ListView) findViewById(R.id.list_album); - l1.setAdapter(new EfficientAdapter(musicalbum.this)); + l1.setAdapter(new EfficientAdapter(musicAlbum.this)); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); @@ -83,11 +83,11 @@ Log.d("update album", "do update"); - receivedbhandler handler = receivedbhandler.getinstance(); + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); albumList = handler.GetAlbums(); if (albumList.size() == 0) { - Toast.makeText(musicalbum.this, "TIME OUT SERVER", + Toast.makeText(musicAlbum.this, "TIME OUT SERVER", Toast.LENGTH_LONG).show(); } @@ -134,7 +134,7 @@ holder = (ViewHolder) convertView.getTag(); } - receivedbxmlhandler.DbItems item = albumList.get(position); + ReceiveDbXmlHandler.DbItems item = albumList.get(position); holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Album + " - " + item.Artist); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -39,19 +39,19 @@ import android.widget.TextView; import android.widget.Toast; -public class musicartist extends Activity{ +public class musicArtist extends Activity{ public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); - private static ArrayList<receivedbxmlhandler.DbItems> artistList; + private static ArrayList<ReceiveDbXmlHandler.DbItems> artistList; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.music_artist); ListView l1 = (ListView) findViewById(R.id.list_artist); - l1.setAdapter(new EfficientAdapter(musicartist.this)); + l1.setAdapter(new EfficientAdapter(musicArtist.this)); l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { @@ -59,9 +59,9 @@ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { - receivedbxmlhandler.DbItems item = artistList.get(arg2); - musicresults.Select = item.Artist; - Intent myIntent = new Intent(arg1.getContext(), musicresults.class); + ReceiveDbXmlHandler.DbItems item = artistList.get(arg2); + musicResults.Select = item.Artist; + Intent myIntent = new Intent(arg1.getContext(), musicResults.class); startActivityForResult(myIntent, 0); } } @@ -89,11 +89,11 @@ Log.d("update artist", "do update"); - receivedbhandler handler = receivedbhandler .getinstance(); + ReceiveDbHandler handler = ReceiveDbHandler .getinstance(); artistList = handler.GetArtist(); if (artistList.size() == 0) { - Toast.makeText(musicartist.this, "TIME OUT SERVER", + Toast.makeText(musicArtist.this, "TIME OUT SERVER", Toast.LENGTH_LONG).show(); } @@ -138,7 +138,7 @@ holder = (ViewHolder) convertView.getTag(); } - receivedbxmlhandler.DbItems item = artistList.get(position); + ReceiveDbXmlHandler.DbItems item = artistList.get(position); holder.text.setText(String.valueOf(position +1)); holder.text2.setText(item.Artist); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -40,12 +40,12 @@ import android.widget.TextView; import android.widget.Toast; -public class musicresults extends Activity { +public class musicResults extends Activity { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); - private static ArrayList<receivedbxmlhandler.DbItems> itemList; + private static ArrayList<ReceiveDbXmlHandler.DbItems> itemList; public static String Select = ""; @@ -54,7 +54,7 @@ setContentView(R.layout.music_results); ListView l1 = (ListView) findViewById(R.id.list_result); - l1.setAdapter(new EfficientAdapter(musicresults.this)); + l1.setAdapter(new EfficientAdapter(musicResults.this)); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); @@ -80,9 +80,9 @@ if (x == -1) x = 0; if (itemList.size() > 0) { - receivedbxmlhandler.DbItems itm = itemList.get(x); + ReceiveDbXmlHandler.DbItems itm = itemList.get(x); - httphandler http = new httphandler(); + httpHandler http = new httpHandler(); http.DownloadFile(); } x = 1; @@ -112,11 +112,11 @@ Log.d("update search", "do update"); - receivedbhandler handler = receivedbhandler.getinstance(); + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); itemList = handler.GetSongsByArtist(Select); if (itemList.size() == 0) { - Toast.makeText(musicresults.this, "TIME OUT SERVER", + Toast.makeText(musicResults.this, "TIME OUT SERVER", Toast.LENGTH_LONG).show(); } @@ -163,7 +163,7 @@ holder = (ViewHolder) convertView.getTag(); } - receivedbxmlhandler.DbItems item = itemList.get(position); + ReceiveDbXmlHandler.DbItems item = itemList.get(position); holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Title + " - " + item.Artist); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -39,11 +39,11 @@ import android.widget.TextView; import android.widget.Toast; -public class musicsong extends Activity { +public class musicSong extends Activity { private Handler mHandler = new Handler(); - private static ArrayList<receivedbxmlhandler.DbItems> songList; + private static ArrayList<ReceiveDbXmlHandler.DbItems> songList; public static String Select = ""; @@ -52,7 +52,7 @@ setContentView(R.layout.music_song); ListView l1 = (ListView) findViewById(R.id.list_song); - l1.setAdapter(new EfficientAdapter(musicsong.this)); + l1.setAdapter(new EfficientAdapter(musicSong.this)); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); @@ -63,7 +63,7 @@ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { - mediaplayercontrol mp = mediaplayercontrol.getinstance(); + MediaPlayerControl mp = MediaPlayerControl.getinstance(); mp.Play("http://" + Settings.Server + ":" + Settings.Port + "/music/" + "song-marianne-plays-on-piano-sense-and-sensibilit.mp3"); } }); @@ -87,11 +87,11 @@ Log.d("update song", "do update"); - receivedbhandler handler = receivedbhandler.getinstance(); + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); songList = handler.GetSongs(); if (songList.size() == 0) { - Toast.makeText(musicsong.this, "TIME OUT SERVER", Toast.LENGTH_LONG) + Toast.makeText(musicSong.this, "TIME OUT SERVER", Toast.LENGTH_LONG) .show(); } @@ -138,7 +138,7 @@ holder = (ViewHolder) convertView.getTag(); } - receivedbxmlhandler.DbItems item = songList.get(position); + ReceiveDbXmlHandler.DbItems item = songList.get(position); holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Title + " - " + item.Artist); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -27,7 +27,7 @@ import android.os.Bundle; import android.widget.TabHost; -public class musictab extends TabActivity { +public class musicTab extends TabActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.musictab); @@ -38,7 +38,7 @@ Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab (to be reused) - intent = new Intent().setClass(this, musicartist.class); + intent = new Intent().setClass(this, musicArtist.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("artists") .setIndicator("Artists", res.getDrawable(R.drawable.ic_tab1)) @@ -46,19 +46,19 @@ tabHost.addTab(spec); // Do the same for the other tabs - intent = new Intent().setClass(this, musicalbum.class); + intent = new Intent().setClass(this, musicAlbum.class); spec = tabHost.newTabSpec("albums") .setIndicator("Albums", res.getDrawable(R.drawable.ic_tab2)) .setContent(intent); tabHost.addTab(spec); - intent = new Intent().setClass(this, musicsong.class); + intent = new Intent().setClass(this, musicSong.class); spec = tabHost.newTabSpec("songs") .setIndicator("Songs", res.getDrawable(R.drawable.ic_tab3)) .setContent(intent); tabHost.addTab(spec); - intent = new Intent().setClass(this, musicdir.class); + intent = new Intent().setClass(this, MusicDir.class); spec = tabHost.newTabSpec("music") .setIndicator("Music", res.getDrawable(R.drawable.ic_tab4)) .setContent(intent); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -149,7 +149,7 @@ if (nowplayinghandler.Cover.equals("True")) { if (!lastTitle.equals(nowplayinghandler.Title)) { - httphandler h = new httphandler(); + httpHandler h = new httpHandler(); Bitmap bitmap = h.DownloadImage("http://" + HttpServer + ":" + HttpPort + "/nowplaying/cover"); if (bitmap != null) { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -4,7 +4,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -public class nowplayingxmlhandler extends DefaultHandler { +public class nowplayingXmlHandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -93,7 +93,7 @@ e.printStackTrace(); } - nowplayingxmlhandler handler = new nowplayingxmlhandler(); + nowplayingXmlHandler handler = new nowplayingXmlHandler(); reader.setContentHandler(handler); try { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -4,7 +4,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -public class nowplaylistxmlhandler extends DefaultHandler { +public class nowplaylistXmlHandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; nowplaylisthandler.PlayListItem item = null; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -95,7 +95,7 @@ e.printStackTrace(); } - nowplaylistxmlhandler handler = new nowplaylistxmlhandler(); + nowplaylistXmlHandler handler = new nowplaylistXmlHandler(); reader.setContentHandler(handler); try { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -23,7 +23,7 @@ import java.util.ArrayList; import mediaportal.remote.R; -import mediaportal.remote.receivedirectoryxmlhandler.DirItems; +import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; @@ -47,7 +47,7 @@ private Handler mHandler = new Handler(); public static String actualDir = ""; - public static ArrayList<receivedirectoryxmlhandler.DirItems> pictureList; + public static ArrayList<ReceiveDirectoryXmlHandler.DirItems> pictureList; public static int selectedPicture; @Override @@ -125,7 +125,7 @@ Log.d("update pictures", "do update folder : " + actualDir); - receivedirhandler h = receivedirhandler.getinstance(); + ReceiveDirHandler h = ReceiveDirHandler.getinstance(); pictureList = h.getPictureDir(actualDir); if (pictureList.size() == 0) { @@ -198,7 +198,7 @@ iv.setTag(pic); } else { - httphandler http = new httphandler(); + httpHandler http = new httpHandler(); String file = "http://" + Settings.Server + ":" + Settings.Port + "/pictures/"; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-06 18:45:27 UTC (rev 4014) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-06 23:01:55 UTC (rev 4015) @@ -22,7 +22,7 @@ package mediaportal.remote; import mediaportal.remote.R; -import mediaportal.remote.receivedirectoryxmlhandler.DirItems; +import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; @@ -82,7 +82,7 @@ DirItems item = pictures.pictureList.get(pictures.selectedPicture); if (!item.isFolder) { - httphandler http = new httphandler(); + httpHandler http = new httpHandler(); String file = "http://" + Settings.Server + ":" + Settings.Port + "/pictures/"; file += pictures.actualDir + item.File; @@ -146,7 +146,7 @@ else { String req = "http://" + Settings.Server + ":" + Settings.Port +"/random/pictures/random.jpg"; - httphandler handler = new httphandler(); + httpHandler handler = new httpHandler(); Bitmap pic = handler.DownloadImage(req); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Rol...@us...> - 2010-12-07 21:55:20
|
Revision: 4018 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4018&view=rev Author: Rollsroyc3 Date: 2010-12-07 21:55:14 +0000 (Tue, 07 Dec 2010) Log Message: ----------- added contextmenu to picturefullscreen.java made picturefullscreen actually fullscreen. Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/picturefullscreenmenu.xml Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-07 13:21:51 UTC (rev 4017) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-07 21:55:14 UTC (rev 4018) @@ -65,78 +65,81 @@ public static final int videos_logo=0x7f020033; } public static final class id { - public static final int GridView01=0x7f050010; - public static final int ImageView01=0x7f050012; - public static final int LinearLayout01=0x7f050013; - public static final int ListView01=0x7f050022; - public static final int MainButton1=0x7f050005; - public static final int MainButton2=0x7f050006; - public static final int MainButton3=0x7f050007; - public static final int MainButton4=0x7f050008; - public static final int MainButton5=0x7f050009; - public static final int TextView01=0x7f050003; - public static final int TextView02=0x7f050004; - public static final int btnBack=0x7f050038; - public static final int btnChannelDown=0x7f05003d; - public static final int btnChannelUp=0x7f05003a; - public static final int btnDown=0x7f050037; - public static final int btnExit=0x7f05003e; - public static final int btnFBack=0x7f050025; - public static final int btnFForw=0x7f050027; - public static final int btnHibernate=0x7f050040; - public static final int btnHome=0x7f05002e; - public static final int btnInfo=0x7f050030; - public static final int btnLeft=0x7f050032; - public static final int btnMenu=0x7f050036; - public static final int btnOk=0x7f050033; - public static final int btnPause=0x7f05002b; - public static final int btnPlay=0x7f050026; - public static final int btnRestart=0x7f050041; - public static final int btnRight=0x7f050034; - public static final int btnShutOff=0x7f050042; - public static final int btnSkipBack=0x7f050029; - public static final int btnSkipForw=0x7f05002c; - public static final int btnStop=0x7f05002a; - public static final int btnSuspend=0x7f05003f; - public static final int btnUp=0x7f05002f; - public static final int btnVolumeDown=0x7f05003c; - public static final int btnVolumeMute=0x7f05003b; - public static final int btnVolumeUp=0x7f050039; - public static final int btnWakeOnLan=0x7f050043; - public static final int full_text=0x7f050011; - public static final int icon_image=0x7f050001; - public static final int icon_text=0x7f050002; - public static final int list_album=0x7f05000c; - public static final int list_artist=0x7f05000d; - public static final int list_result=0x7f05000e; - public static final int list_song=0x7f05000f; - public static final int music_grid=0x7f05000b; - public static final int naviRemote_text=0x7f050023; - public static final int now_album=0x7f050015; - public static final int now_artist=0x7f05001b; - public static final int now_cd=0x7f050016; - public static final int now_list=0x7f050021; - public static final int now_next=0x7f050020; - public static final int now_pause=0x7f05001e; - public static final int now_play=0x7f05001f; - public static final int now_playing=0x7f050014; - public static final int now_playing_right=0x7f050019; - public static final int now_playing_t_left=0x7f050018; - public static final int now_prev=0x7f05001c; - public static final int now_progress=0x7f050017; - public static final int now_stop=0x7f05001d; - public static final int now_title=0x7f05001a; - public static final int server_ip=0x7f050044; - public static final int server_macid=0x7f050046; - public static final int server_port=0x7f050045; - public static final int title=0x7f050047; - public static final int widget0=0x7f05000a; - public static final int widget00=0x7f050024; - public static final int widget01=0x7f050028; - public static final int widget02=0x7f05002d; - public static final int widget03=0x7f050031; - public static final int widget04=0x7f050035; - public static final int widget44=0x7f050000; + public static final int GridView01=0x7f060010; + public static final int ImageView01=0x7f060012; + public static final int LinearLayout01=0x7f060013; + public static final int ListView01=0x7f060022; + public static final int MainButton1=0x7f060005; + public static final int MainButton2=0x7f060006; + public static final int MainButton3=0x7f060007; + public static final int MainButton4=0x7f060008; + public static final int MainButton5=0x7f060009; + public static final int TextView01=0x7f060003; + public static final int TextView02=0x7f060004; + public static final int btnBack=0x7f060038; + public static final int btnChannelDown=0x7f06003d; + public static final int btnChannelUp=0x7f06003a; + public static final int btnDown=0x7f060037; + public static final int btnExit=0x7f06003e; + public static final int btnFBack=0x7f060025; + public static final int btnFForw=0x7f060027; + public static final int btnHibernate=0x7f060040; + public static final int btnHome=0x7f06002e; + public static final int btnInfo=0x7f060030; + public static final int btnLeft=0x7f060032; + public static final int btnMenu=0x7f060036; + public static final int btnOk=0x7f060033; + public static final int btnPause=0x7f06002b; + public static final int btnPlay=0x7f060026; + public static final int btnRestart=0x7f060041; + public static final int btnRight=0x7f060034; + public static final int btnShutOff=0x7f060042; + public static final int btnSkipBack=0x7f060029; + public static final int btnSkipForw=0x7f06002c; + public static final int btnStop=0x7f06002a; + public static final int btnSuspend=0x7f06003f; + public static final int btnUp=0x7f06002f; + public static final int btnVolumeDown=0x7f06003c; + public static final int btnVolumeMute=0x7f06003b; + public static final int btnVolumeUp=0x7f060039; + public static final int btnWakeOnLan=0x7f060043; + public static final int full_text=0x7f060011; + public static final int icon_image=0x7f060001; + public static final int icon_text=0x7f060002; + public static final int list_album=0x7f06000c; + public static final int list_artist=0x7f06000d; + public static final int list_result=0x7f06000e; + public static final int list_song=0x7f06000f; + public static final int music_grid=0x7f06000b; + public static final int naviRemote_text=0x7f060023; + public static final int now_album=0x7f060015; + public static final int now_artist=0x7f06001b; + public static final int now_cd=0x7f060016; + public static final int now_list=0x7f060021; + public static final int now_next=0x7f060020; + public static final int now_pause=0x7f06001e; + public static final int now_play=0x7f06001f; + public static final int now_playing=0x7f060014; + public static final int now_playing_right=0x7f060019; + public static final int now_playing_t_left=0x7f060018; + public static final int now_prev=0x7f06001c; + public static final int now_progress=0x7f060017; + public static final int now_stop=0x7f06001d; + public static final int now_title=0x7f06001a; + public static final int open=0x7f060049; + public static final int save=0x7f060048; + public static final int send=0x7f06004a; + public static final int server_ip=0x7f060044; + public static final int server_macid=0x7f060046; + public static final int server_port=0x7f060045; + public static final int title=0x7f060047; + public static final int widget0=0x7f06000a; + public static final int widget00=0x7f060024; + public static final int widget01=0x7f060028; + public static final int widget02=0x7f06002d; + public static final int widget03=0x7f060031; + public static final int widget04=0x7f060035; + public static final int widget44=0x7f060000; } public static final class layout { public static final int icon=0x7f030000; @@ -158,6 +161,9 @@ public static final int splash=0x7f030010; public static final int title=0x7f030011; } + public static final class menu { + public static final int picturefullscreenmenu=0x7f050000; + } public static final class string { public static final int app_name=0x7f040000; } Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/picturefullscreenmenu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/picturefullscreenmenu.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/picturefullscreenmenu.xml 2010-12-07 21:55:14 UTC (rev 4018) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/save" + android:title="Save to sd card" /> + <item android:id="@+id/open" + android:title="Open in browser" /> + <item android:id="@+id/send" + android:title="Send Picture" /> +</menu> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-07 13:21:51 UTC (rev 4017) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-07 21:55:14 UTC (rev 4018) @@ -21,16 +21,26 @@ package mediaportal.remote; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + import mediaportal.remote.R; import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; +import android.net.Uri; import android.os.Bundle; +import android.os.Environment; import android.os.Handler; +import android.util.Log; import android.view.ContextMenu; import android.view.GestureDetector; import android.view.Menu; +import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.Window; @@ -64,17 +74,16 @@ (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.picturesfullscreen); - - setContentView(R.layout.picturesfullscreen); - + + //ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + //registerForContextMenu(imagev); + gestureScanner = new GestureDetector(this); setPicture(); Toast.makeText(picturesfullscreen .this, "left/right swipe possible", Toast.LENGTH_SHORT).show(); - // ImageView imagev = (ImageView) findViewById(R.id.ImageView01); - // registerForContextMenu(imagev); } private void setPicture() { @@ -83,14 +92,14 @@ if (!item.isFolder) { httpHandler http = new httpHandler(); - String file = "http://" + Settings.Server + ":" + Settings.Port - + "/pictures/"; - file += pictures.actualDir + item.File; - item.Picture = http.DownloadImage(file.replaceAll(" ", "%20")); - imagev.setImageBitmap(item.Picture); - - TextView txt = (TextView) findViewById(R.id.full_text); - txt.setText(item.File); + String file = "http://" + Settings.Server + ":" + Settings.Port + + "/pictures/"; + file += pictures.actualDir + item.File; + item.Picture = http.DownloadImage(file.replaceAll(" ", "%20")); + imagev.setImageBitmap(item.Picture); + + TextView txt = (TextView) findViewById(R.id.full_text); + txt.setText(item.File); } } @@ -169,6 +178,7 @@ public boolean onTouchEvent(MotionEvent me) { return gestureScanner.onTouchEvent(me); } + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { @@ -207,7 +217,7 @@ } public boolean onDown(MotionEvent arg0) { - return true; + return false; } public void onLongPress(MotionEvent arg0) { @@ -224,4 +234,105 @@ public boolean onSingleTapUp(MotionEvent arg0) { return false; } + + + public void onCreateContextMenu(ContextMenu menu, View v, + ContextMenuInfo menuInfo) { + super.onCreateContextMenu(menu, v, menuInfo); + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.picturefullscreenmenu, menu); + } + + @Override + public boolean onContextItemSelected(MenuItem item) { + if(item.getTitle()=="Save to sd card"){ + SavetoSDCard(); + } + else if(item.getTitle()=="Open in browser"){ + OpenURL(); + } + else if(item.getTitle()=="Send Picture"){ + SendPicture(); + } + else { + return false; + } + return false; + } + + + //**************** + //Menu Functions + //****************** + private void OpenURL(){ + DirItems item = pictures.pictureList.get(pictures.selectedPicture); + String file = "http://" + Settings.Server + ":" + Settings.Port + + "/pictures/"; + file += pictures.actualDir + item.File; + String url = file.replaceAll(" ", "%20"); + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(url)); + startActivity(i); + } + + private void SavetoSDCard(){ + try{ + DirItems item = pictures.pictureList.get(pictures.selectedPicture); + Bitmap bMap = item.Picture; + File fPath = Environment.getExternalStorageDirectory(); + OutputStream outStream = null; + try { + + outStream = new FileOutputStream(fPath + "/" + item.File.toString()); + + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); + } + bMap.compress(Bitmap.CompressFormat.JPEG, 100, outStream); + try { + outStream.flush(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); + } + try { + outStream.close(); + + Toast.makeText(picturesfullscreen.this, "File saved.", + Toast.LENGTH_SHORT).show(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); + } + } + catch (Exception e) + { + Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); + //e.printStackTrace(); + } + + } + + + + 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) + { + Log.e("Debug", "SendPicture " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); + //e.printStackTrace(); + } + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Rol...@us...> - 2010-12-11 06:13:03
|
Revision: 4027 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4027&view=rev Author: Rollsroyc3 Date: 2010-12-11 06:12:57 +0000 (Sat, 11 Dec 2010) Log Message: ----------- Just updated case of musicdir filename so my project could compile. Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-10 11:12:42 UTC (rev 4026) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-11 06:12:57 UTC (rev 4027) @@ -19,7 +19,7 @@ <activity android:launchMode="singleInstance" android:name=".Remote_02"></activity> <activity android:name=".pictures" android:launchMode="singleInstance"></activity> <activity android:name=".picturesfullscreen" android:launchMode="singleInstance"></activity> - <activity android:launchMode="singleInstance" android:name=".musicDir"></activity> + <activity android:launchMode="singleInstance" android:name=".MusicDir"></activity> <activity android:name=".setup" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaying" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaylist" android:launchMode="singleInstance"></activity> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-10 11:12:42 UTC (rev 4026) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-11 06:12:57 UTC (rev 4027) @@ -40,7 +40,7 @@ import android.widget.AdapterView.OnItemClickListener; import android.widget.Toast; -public class musicDir extends Activity { +public class MusicDir extends Activity { private Handler mHandler = new Handler(); private String actualDir = ""; @@ -55,7 +55,7 @@ mHandler.postDelayed(mUpdateTimeTask, 100); GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.setAdapter(new ImageAdapter2(musicDir.this)); + gridview.setAdapter(new ImageAdapter2(MusicDir.this)); gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { @@ -120,7 +120,7 @@ musicList = h.getMusicDir(actualDir); if (musicList.size() == 0) { - Toast.makeText(musicDir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) + Toast.makeText(MusicDir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) .show(); } else { GridView gridview = (GridView) findViewById(R.id.music_grid); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java 2010-12-10 11:12:42 UTC (rev 4026) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java 2010-12-11 06:12:57 UTC (rev 4027) @@ -58,7 +58,7 @@ .setContent(intent); tabHost.addTab(spec); - intent = new Intent().setClass(this, musicDir.class); + intent = new Intent().setClass(this, MusicDir.class); spec = tabHost.newTabSpec("music") .setIndicator("Music", res.getDrawable(R.drawable.ic_tab4)) .setContent(intent); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2011-01-21 11:52:55
|
Revision: 4074 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4074&view=rev Author: kroko_koenig Date: 2011-01-21 11:52:48 +0000 (Fri, 21 Jan 2011) Log Message: ----------- play mp3s locally on the phone settings in menu now, play video stream Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_asr.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_full.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_menu.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_osd.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_sub.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote01.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicSong.java Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/empty.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/plugins.png Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2011-01-20 21:59:40 UTC (rev 4073) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2011-01-21 11:52:48 UTC (rev 4074) @@ -27,65 +27,67 @@ public static final int channel_p=0x7f02000a; public static final int document=0x7f02000b; public static final int down=0x7f02000c; - public static final int exit=0x7f02000d; - public static final int folder=0x7f02000e; - public static final int folderback=0x7f02000f; - public static final int foldertab=0x7f020010; - public static final int foldertab_off=0x7f020011; - public static final int forward=0x7f020012; - public static final int hibernate=0x7f020013; - public static final int home=0x7f020014; - public static final int ic_tab=0x7f020015; - public static final int ic_tab1=0x7f020016; - public static final int ic_tab2=0x7f020017; - public static final int ic_tab3=0x7f020018; - public static final int ic_tab4=0x7f020019; - public static final int icon=0x7f02001a; - public static final int info=0x7f02001b; - public static final int left=0x7f02001c; - public static final int main_music=0x7f02001d; - public static final int main_now_playing=0x7f02001e; - public static final int main_pictures=0x7f02001f; - public static final int main_remote=0x7f020020; - public static final int main_settings=0x7f020021; - public static final int main_video=0x7f020022; - public static final int menu=0x7f020023; - public static final int music=0x7f020024; - public static final int mute=0x7f020025; - public static final int n_asr=0x7f020026; - public static final int n_full=0x7f020027; - public static final int n_menu=0x7f020028; - public static final int n_osd=0x7f020029; - public static final int n_sub=0x7f02002a; - public static final int now_playing=0x7f02002b; - public static final int pause=0x7f02002c; - public static final int picture=0x7f02002d; - public static final int pictures=0x7f02002e; - public static final int play=0x7f02002f; - public static final int power_off=0x7f020030; - public static final int remote=0x7f020031; - public static final int restart=0x7f020032; - public static final int rewind=0x7f020033; - public static final int right=0x7f020034; - public static final int sel_play=0x7f020035; - public static final int sel_skp_back=0x7f020036; - public static final int sel_skp_forw=0x7f020037; - public static final int select=0x7f020038; - public static final int select2=0x7f020039; - public static final int settings=0x7f02003a; - public static final int skip_back=0x7f02003b; - public static final int skip_forward=0x7f02003c; - public static final int song=0x7f02003d; - public static final int song_off=0x7f02003e; - public static final int splash=0x7f02003f; - public static final int splash02=0x7f020040; - public static final int stop=0x7f020041; - public static final int suspend=0x7f020042; - public static final int up=0x7f020043; - public static final int video=0x7f020044; - public static final int volume_m=0x7f020045; - public static final int volume_p=0x7f020046; - public static final int wake_on_lan=0x7f020047; + public static final int empty=0x7f02000d; + public static final int exit=0x7f02000e; + public static final int folder=0x7f02000f; + public static final int folderback=0x7f020010; + public static final int foldertab=0x7f020011; + public static final int foldertab_off=0x7f020012; + public static final int forward=0x7f020013; + public static final int hibernate=0x7f020014; + public static final int home=0x7f020015; + public static final int ic_tab=0x7f020016; + public static final int ic_tab1=0x7f020017; + public static final int ic_tab2=0x7f020018; + public static final int ic_tab3=0x7f020019; + public static final int ic_tab4=0x7f02001a; + public static final int icon=0x7f02001b; + public static final int info=0x7f02001c; + public static final int left=0x7f02001d; + public static final int main_music=0x7f02001e; + public static final int main_now_playing=0x7f02001f; + public static final int main_pictures=0x7f020020; + public static final int main_remote=0x7f020021; + public static final int main_settings=0x7f020022; + public static final int main_video=0x7f020023; + public static final int menu=0x7f020024; + public static final int music=0x7f020025; + public static final int mute=0x7f020026; + public static final int n_asr=0x7f020027; + public static final int n_full=0x7f020028; + public static final int n_menu=0x7f020029; + public static final int n_osd=0x7f02002a; + public static final int n_sub=0x7f02002b; + public static final int now_playing=0x7f02002c; + public static final int pause=0x7f02002d; + public static final int picture=0x7f02002e; + public static final int pictures=0x7f02002f; + public static final int play=0x7f020030; + public static final int plugins=0x7f020031; + public static final int power_off=0x7f020032; + public static final int remote=0x7f020033; + public static final int restart=0x7f020034; + public static final int rewind=0x7f020035; + public static final int right=0x7f020036; + public static final int sel_play=0x7f020037; + public static final int sel_skp_back=0x7f020038; + public static final int sel_skp_forw=0x7f020039; + public static final int select=0x7f02003a; + public static final int select2=0x7f02003b; + public static final int settings=0x7f02003c; + public static final int skip_back=0x7f02003d; + public static final int skip_forward=0x7f02003e; + public static final int song=0x7f02003f; + public static final int song_off=0x7f020040; + public static final int splash=0x7f020041; + public static final int splash02=0x7f020042; + public static final int stop=0x7f020043; + public static final int suspend=0x7f020044; + public static final int up=0x7f020045; + public static final int video=0x7f020046; + public static final int volume_m=0x7f020047; + public static final int volume_p=0x7f020048; + public static final int wake_on_lan=0x7f020049; } public static final class id { public static final int GridView01=0x7f07001b; Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/empty.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/empty.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_asr.png =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_full.png =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_menu.png =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_osd.png =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/n_sub.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/plugins.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/plugins.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2011-01-20 21:59:40 UTC (rev 4073) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2011-01-21 11:52:48 UTC (rev 4074) @@ -47,7 +47,7 @@ </Button> <Button android:layout_height="80dip" android:layout_width="80dip" - android:scaleType="fitXY" android:padding="5dip" android:background="@drawable/main_settings" android:id="@+id/btn_main_settings"> + android:scaleType="fitXY" android:padding="5dip" android:id="@+id/btn_main_settings" android:background="@drawable/plugins"> </Button> </TableRow> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote01.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote01.xml 2011-01-20 21:59:40 UTC (rev 4073) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote01.xml 2011-01-21 11:52:48 UTC (rev 4074) @@ -9,7 +9,7 @@ android:layout_width="wrap_content"> <ImageButton android:id="@+id/crtl_mp" - android:layout_height="60dip" android:layout_width="100dip"> + android:layout_height="60dip" android:layout_width="100dip" android:background="@drawable/icon"> </ImageButton> <ImageButton android:id="@+id/crtl_up" android:layout_width="100dip" android:layout_height="60dip" @@ -44,7 +44,7 @@ android:layout_gravity="center_vertical"> <ImageButton android:id="@+id/crtl_parent" - android:layout_height="60dip" android:layout_width="100dip"> + android:layout_height="60dip" android:layout_width="100dip" android:background="@drawable/home"> </ImageButton> <ImageButton android:id="@+id/crtl_down" android:layout_height="60dip" android:layout_width="100dip" @@ -111,7 +111,7 @@ android:layout_width="60dip"> </ImageButton> <ImageButton android:id="@+id/crtl_menu" - android:layout_height="60dip" android:layout_width="60dip"> + android:layout_height="60dip" android:layout_width="60dip" android:background="@drawable/menu"> </ImageButton> <ImageButton android:id="@+id/crtl_ch_m" android:layout_height="60dip" android:background="@drawable/channel_m" @@ -123,13 +123,13 @@ android:layout_height="wrap_content"> <ImageButton android:id="@+id/crtl_sub" - android:layout_height="60dip" android:layout_width="60dip"> + android:layout_height="60dip" android:layout_width="60dip" android:background="@drawable/n_sub"> </ImageButton> <ImageButton android:id="@+id/crtl_ratio" - android:layout_height="60dip" android:layout_width="60dip"> + android:layout_height="60dip" android:layout_width="60dip" android:background="@drawable/n_asr"> </ImageButton> <ImageButton android:id="@+id/crtl_osd" - android:layout_height="60dip" android:layout_width="60dip"> + android:layout_height="60dip" android:layout_width="60dip" android:background="@drawable/n_osd"> </ImageButton> <ImageButton android:id="@+id/crtl_info" android:layout_height="60dip" android:background="@drawable/info" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2011-01-20 21:59:40 UTC (rev 4073) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2011-01-21 11:52:48 UTC (rev 4074) @@ -46,6 +46,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.net.ConnectivityManager; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Environment; @@ -147,13 +148,16 @@ public void onClick(View view) { Vibration.vibrateShort(); - Toast.makeText(view.getContext(), - "not implemented yet. Sorry !", Toast.LENGTH_SHORT) - .show(); + //Toast.makeText(view.getContext(), + // "not implemented yet. Sorry !", Toast.LENGTH_SHORT) + // .show(); // Intent myIntent = new Intent(view.getContext(), // MediaPlayerControl.class); // startActivity(myIntent); + + startActivity(new Intent(Intent.ACTION_VIEW, + Uri.parse("rtsp://" + AppSettings.getServer() + ":5554/android.sdp"))); } }); @@ -180,8 +184,10 @@ btnSettings.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Vibration.vibrateShort(); - Intent myIntent = new Intent(view.getContext(), Setup.class); - startActivity(myIntent); + + Toast.makeText(view.getContext(), + "not implemented yet. Sorry !", Toast.LENGTH_SHORT) + .show(); } }); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicDir.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicDir.java 2011-01-20 21:59:40 UTC (rev 4073) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicDir.java 2011-01-21 11:52:48 UTC (rev 4074) @@ -28,6 +28,7 @@ import mediaportal.remote.directory.ReceiveDirHandler; import mediaportal.remote.directory.ReceiveDirectoryXmlHandler; import mediaportal.remote.directory.ReceiveDirectoryXmlHandler.DirItems; +import mediaportal.remote.utils.AppSettings; import mediaportal.remote.utils.MediaScannerNotifier; import mediaportal.remote.utils.Vibration; import android.app.Activity; @@ -35,6 +36,8 @@ import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Environment; @@ -64,9 +67,9 @@ private static ReceiveDirectoryXmlHandler.DirItems selectedItem; final CharSequence[] items = { "Add to playlist", "Clear playlist", - "Save to SD card", "Cancel" }; + "Save to SD card", "Play locally" }; - final CharSequence[] itemsLong = { "Add folder to playlist", "Clear playlist", "Cancel" }; + final CharSequence[] itemsLong = { "Add folder to playlist", "Clear playlist" }; @Override public void onCreate(Bundle savedInstanceState) { @@ -119,6 +122,17 @@ case 2: SavetoSDCard(selectedItem.File); break; + case 3: + + String link = "http://" + AppSettings.getServer() + + ":" + AppSettings.getPort() + "/music/" + actualDir + + selectedItem.File.replaceAll(" ", "%20"); + + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setDataAndType(Uri.parse(link), "audio/mp3"); + + startActivity(intent); + break; } } }); @@ -181,9 +195,6 @@ "Playlist has been cleared", Toast.LENGTH_SHORT).show(); break; - case 2: - // cancel - break; } } }); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicResults.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicResults.java 2011-01-20 21:59:40 UTC (rev 4073) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicResults.java 2011-01-21 11:52:48 UTC (rev 4074) @@ -43,6 +43,7 @@ import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Environment; @@ -81,7 +82,7 @@ ReceiveDbXmlHandler.DbItems selectedItem = null; final CharSequence[] items = { "Add to playlist", "Clear playlist", - "Save to SD card", "Cancel" }; + "Save to SD card", "Play locally" }; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -127,6 +128,15 @@ case 2: SavetoSDCard(selectedItem); break; + case 3: + String link = "http://" + AppSettings.getServer() + + ":" + AppSettings.getPort() + "/db_music/getfile?id=" + selectedItem.ID; + + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setDataAndType(Uri.parse(link), "audio/mp3"); + + startActivity(intent); + break; } } }); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicSong.java 2011-01-20 21:59:40 UTC (rev 4073) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicSong.java 2011-01-21 11:52:48 UTC (rev 4074) @@ -43,6 +43,7 @@ import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Environment; @@ -72,7 +73,7 @@ ReceiveDbXmlHandler.DbItems selectedItem = null; final CharSequence[] items = { "Add to playlist", "Clear playlist", - "Save to SD card", "Cancel" }; + "Save to SD card", "Play locally" }; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -115,6 +116,15 @@ selectedItem.Title + " has been transferd", Toast.LENGTH_SHORT).show(); break; + case 3: + String link = "http://" + AppSettings.getServer() + + ":" + AppSettings.getPort() + "/db_music/getfile?id=" + selectedItem.ID; + + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setDataAndType(Uri.parse(link), "audio/mp3"); + + startActivity(intent); + break; } } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2011-02-08 12:25:55
|
Revision: 4101 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4101&view=rev Author: kroko_koenig Date: 2011-02-08 12:25:43 +0000 (Tue, 08 Feb 2011) Log Message: ----------- more skins and so on Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movies.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup_ip.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/skin.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/PostWebserver.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/SendCommand.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/control/Remote_01.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/movies/Movies.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures/Pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup/SelectSkin.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup/Setup.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup/Setup_ip.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/utils/SAX_Parser.java Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-land/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-land/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-large-land/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-large-land/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small-land/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small-land/main.xml Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2011-02-08 12:25:43 UTC (rev 4101) @@ -175,33 +175,33 @@ } public static final class id { public static final int GridView01=0x7f060015; - public static final int ImageView01=0x7f06002a; - public static final int LinearLayout00=0x7f060060; - public static final int LinearLayout01=0x7f060031; - public static final int LinearLayout02=0x7f06006b; - public static final int LinearLayout03=0x7f060075; - public static final int LinearLayout04=0x7f06007f; - public static final int LinearLayout05=0x7f060085; - public static final int ListView01=0x7f06003f; - public static final int RadioGroup01=0x7f060099; - public static final int Spinner01=0x7f060091; - public static final int SurfaceView01=0x7f060030; + public static final int ImageView01=0x7f06002c; + public static final int LinearLayout00=0x7f060063; + public static final int LinearLayout01=0x7f060033; + public static final int LinearLayout02=0x7f06006e; + public static final int LinearLayout03=0x7f060078; + public static final int LinearLayout04=0x7f060082; + public static final int LinearLayout05=0x7f060088; + public static final int ListView01=0x7f060041; + public static final int RadioGroup01=0x7f0600a5; + public static final int Spinner01=0x7f060097; + public static final int SurfaceView01=0x7f060032; public static final int TableLayout01=0x7f060007; - public static final int TableLayout02=0x7f060051; + public static final int TableLayout02=0x7f060053; public static final int TableRow01=0x7f060008; - public static final int TableRow02=0x7f060056; - public static final int TableRow03=0x7f06005b; + public static final int TableRow02=0x7f060058; + public static final int TableRow03=0x7f06005d; public static final int TextView01=0x7f060003; public static final int TextView02=0x7f060004; - public static final int btnAlbumSelDown=0x7f060019; - public static final int btnAlbumSelUp=0x7f06001b; - public static final int btnArtistSelDown=0x7f06001d; - public static final int btnArtistSelUp=0x7f06001f; - public static final int btnResultSelDown=0x7f060021; - public static final int btnResultSelUp=0x7f060023; - public static final int btnSelectSkin=0x7f060093; - public static final int btnSongSelDown=0x7f060025; - public static final int btnSongSelUp=0x7f060027; + public static final int btnAlbumSelDown=0x7f06001a; + public static final int btnAlbumSelUp=0x7f06001c; + public static final int btnArtistSelDown=0x7f06001e; + public static final int btnArtistSelUp=0x7f060020; + public static final int btnResultSelDown=0x7f060022; + public static final int btnResultSelUp=0x7f060024; + public static final int btnSelectSkin=0x7f060099; + public static final int btnSongSelDown=0x7f060026; + public static final int btnSongSelUp=0x7f060028; public static final int btn_main_music=0x7f06000a; public static final int btn_main_now_playing=0x7f06000d; public static final int btn_main_pictures=0x7f060009; @@ -211,172 +211,184 @@ public static final int btn_main_skp_back=0x7f060010; public static final int btn_main_skp_forw=0x7f060012; public static final int btn_main_video=0x7f06000b; - public static final int btn_plugins_radio=0x7f060041; - public static final int btn_plugins_weather=0x7f060040; - public static final int btnkey01=0x7f060061; - public static final int btnkey02=0x7f060062; - public static final int btnkey03=0x7f060063; - public static final int btnkey04=0x7f060064; - public static final int btnkey05=0x7f060065; - public static final int btnkey06=0x7f060066; - public static final int btnkey07=0x7f060067; - public static final int btnkey08=0x7f060068; - public static final int btnkey09=0x7f060069; - public static final int btnkey10=0x7f06006a; - public static final int btnkey11=0x7f06006c; - public static final int btnkey12=0x7f06006d; - public static final int btnkey13=0x7f06006e; - public static final int btnkey14=0x7f06006f; - public static final int btnkey15=0x7f060070; - public static final int btnkey16=0x7f060071; - public static final int btnkey17=0x7f060072; - public static final int btnkey18=0x7f060073; - public static final int btnkey19=0x7f060074; - public static final int btnkey20=0x7f060076; - public static final int btnkey21=0x7f060077; - public static final int btnkey22=0x7f060078; - public static final int btnkey23=0x7f060079; - public static final int btnkey24=0x7f06007a; - public static final int btnkey25=0x7f06007b; - public static final int btnkey26=0x7f06007c; - public static final int btnkey27=0x7f06007d; - public static final int btnkey28=0x7f06007e; - public static final int btnkey29=0x7f060080; - public static final int btnkey30=0x7f060081; - public static final int btnkey31=0x7f060082; - public static final int btnkey32=0x7f060083; - public static final int btnkey33=0x7f060084; - public static final int btnkey41=0x7f060086; - public static final int btnkey42=0x7f060087; - public static final int btnkey43=0x7f060088; - public static final int btnkey44=0x7f060089; - public static final int btnkey45=0x7f06008a; - public static final int btnkey46=0x7f06008b; - public static final int btnkey47=0x7f06008c; - public static final int btnkey48=0x7f06008d; - public static final int btnkey49=0x7f06008e; - public static final int btnkey50=0x7f06008f; - public static final int button_open=0x7f06002d; - public static final int button_stream=0x7f06002e; - public static final int button_stream_stop=0x7f06002f; - public static final int crtl_back=0x7f06004e; - public static final int crtl_ch_m=0x7f06005a; - public static final int crtl_ch_p=0x7f060055; - public static final int crtl_down=0x7f06004d; - public static final int crtl_full=0x7f060057; - public static final int crtl_info=0x7f06005f; - public static final int crtl_left=0x7f060048; - public static final int crtl_menu=0x7f060059; - public static final int crtl_mp=0x7f060044; - public static final int crtl_osd=0x7f06005e; - public static final int crtl_parent=0x7f06004c; - public static final int crtl_play=0x7f060058; - public static final int crtl_power=0x7f060046; - public static final int crtl_ratio=0x7f06005d; - public static final int crtl_right=0x7f06004a; - public static final int crtl_select=0x7f060049; - public static final int crtl_skip_back=0x7f060052; - public static final int crtl_skip_forw=0x7f060054; - public static final int crtl_stop=0x7f060053; - public static final int crtl_sub=0x7f06005c; - public static final int crtl_up=0x7f060045; - public static final int crtl_vol_m=0x7f060050; - public static final int crtl_vol_p=0x7f06004f; - public static final int full_text=0x7f060029; + public static final int btn_plugins_radio=0x7f060043; + public static final int btn_plugins_weather=0x7f060042; + public static final int btnkey01=0x7f060064; + public static final int btnkey02=0x7f060065; + public static final int btnkey03=0x7f060066; + public static final int btnkey04=0x7f060067; + public static final int btnkey05=0x7f060068; + public static final int btnkey06=0x7f060069; + public static final int btnkey07=0x7f06006a; + public static final int btnkey08=0x7f06006b; + public static final int btnkey09=0x7f06006c; + public static final int btnkey10=0x7f06006d; + public static final int btnkey11=0x7f06006f; + public static final int btnkey12=0x7f060070; + public static final int btnkey13=0x7f060071; + public static final int btnkey14=0x7f060072; + public static final int btnkey15=0x7f060073; + public static final int btnkey16=0x7f060074; + public static final int btnkey17=0x7f060075; + public static final int btnkey18=0x7f060076; + public static final int btnkey19=0x7f060077; + public static final int btnkey20=0x7f060079; + public static final int btnkey21=0x7f06007a; + public static final int btnkey22=0x7f06007b; + public static final int btnkey23=0x7f06007c; + public static final int btnkey24=0x7f06007d; + public static final int btnkey25=0x7f06007e; + public static final int btnkey26=0x7f06007f; + public static final int btnkey27=0x7f060080; + public static final int btnkey28=0x7f060081; + public static final int btnkey29=0x7f060083; + public static final int btnkey30=0x7f060084; + public static final int btnkey31=0x7f060085; + public static final int btnkey32=0x7f060086; + public static final int btnkey33=0x7f060087; + public static final int btnkey41=0x7f060089; + public static final int btnkey42=0x7f06008a; + public static final int btnkey43=0x7f06008b; + public static final int btnkey44=0x7f06008c; + public static final int btnkey45=0x7f06008d; + public static final int btnkey46=0x7f06008e; + public static final int btnkey47=0x7f06008f; + public static final int btnkey48=0x7f060090; + public static final int btnkey49=0x7f060091; + public static final int btnkey50=0x7f060092; + public static final int button_open=0x7f06002f; + public static final int button_stream=0x7f060030; + public static final int button_stream_stop=0x7f060031; + public static final int crtl_back=0x7f060050; + public static final int crtl_ch_m=0x7f06005c; + public static final int crtl_ch_p=0x7f060057; + public static final int crtl_down=0x7f06004f; + public static final int crtl_full=0x7f060059; + public static final int crtl_info=0x7f060061; + public static final int crtl_left=0x7f06004a; + public static final int crtl_menu=0x7f06005b; + public static final int crtl_mp=0x7f060046; + public static final int crtl_osd=0x7f060060; + public static final int crtl_parent=0x7f06004e; + public static final int crtl_play=0x7f06005a; + public static final int crtl_power=0x7f060048; + public static final int crtl_ratio=0x7f06005f; + public static final int crtl_right=0x7f06004c; + public static final int crtl_select=0x7f06004b; + public static final int crtl_skip_back=0x7f060054; + public static final int crtl_skip_forw=0x7f060056; + public static final int crtl_stop=0x7f060055; + public static final int crtl_sub=0x7f06005e; + public static final int crtl_up=0x7f060047; + public static final int crtl_vol_m=0x7f060052; + public static final int crtl_vol_p=0x7f060051; + public static final int full_text=0x7f06002b; public static final int icon_image=0x7f060001; public static final int icon_text=0x7f060002; + public static final int lay_IPsettings=0x7f06009a; + public static final int lay_global=0x7f060093; public static final int lay_main=0x7f060005; - public static final int lay_pictures=0x7f060028; - public static final int lay_remote01=0x7f060042; - public static final int list_album=0x7f060018; - public static final int list_artist=0x7f06001c; - public static final int list_result=0x7f060020; - public static final int list_song=0x7f060024; + public static final int lay_movies=0x7f060013; + public static final int lay_music=0x7f060016; + public static final int lay_pictures=0x7f060029; + public static final int lay_remote01=0x7f060044; + public static final int lay_selectSkin=0x7f0600a3; + public static final int list_album=0x7f060019; + public static final int list_artist=0x7f06001d; + public static final int list_result=0x7f060021; + public static final int list_song=0x7f060025; public static final int main_instance=0x7f060006; public static final int main_now_playing=0x7f06000f; - public static final int music_grid=0x7f060017; - public static final int now_album=0x7f060033; - public static final int now_artist=0x7f060039; - public static final int now_cd=0x7f060034; - public static final int now_list=0x7f06003e; - public static final int now_next=0x7f06003d; - public static final int now_play=0x7f06003c; - public static final int now_playing=0x7f060032; - public static final int now_playing_right=0x7f060037; - public static final int now_playing_t_left=0x7f060036; - public static final int now_prev=0x7f06003a; - public static final int now_progress=0x7f060035; - public static final int now_stop=0x7f06003b; - public static final int now_title=0x7f060038; - public static final int radio01=0x7f0600c7; - public static final int radio02=0x7f0600c8; - public static final int radio03=0x7f0600c9; - public static final int radio04=0x7f0600ca; - public static final int radioStop=0x7f0600cb; - public static final int selectSkin1=0x7f06009a; - public static final int selectSkin2=0x7f06009c; - public static final int selectSkin3=0x7f06009e; - public static final int server_ip=0x7f060096; - public static final int server_macid=0x7f060098; - public static final int server_name=0x7f060095; - public static final int server_port=0x7f060097; - public static final int splash=0x7f0600a0; - public static final int text_kb_streamed=0x7f06002b; - public static final int title=0x7f0600a1; - public static final int txtDbAlbum=0x7f06001a; - public static final int txtDbArtist=0x7f06001e; - public static final int txtDbResult=0x7f060022; - public static final int txtDbSong=0x7f060026; - public static final int txtDirMusic=0x7f060016; - public static final int txtDirectory=0x7f060014; - public static final int txtFile=0x7f06002c; - public static final int txtIntanceName=0x7f060094; - public static final int txtVersion=0x7f060090; - public static final int vibration=0x7f060092; - public static final int visitHome1=0x7f06009b; - public static final int visitHome2=0x7f06009d; - public static final int visitHome3=0x7f06009f; - public static final int weather_0_cond=0x7f0600c2; - public static final int weather_0_date=0x7f0600a9; - public static final int weather_0_day=0x7f0600ae; - public static final int weather_0_hi=0x7f0600b3; - public static final int weather_0_img=0x7f0600bd; - public static final int weather_0_lo=0x7f0600b8; - public static final int weather_1_cond=0x7f0600c3; - public static final int weather_1_date=0x7f0600aa; - public static final int weather_1_day=0x7f0600af; - public static final int weather_1_hi=0x7f0600b4; - public static final int weather_1_img=0x7f0600be; - public static final int weather_1_lo=0x7f0600b9; - public static final int weather_2_cond=0x7f0600c4; - public static final int weather_2_date=0x7f0600ab; - public static final int weather_2_day=0x7f0600b0; - public static final int weather_2_hi=0x7f0600b5; - public static final int weather_2_img=0x7f0600bf; - public static final int weather_2_lo=0x7f0600ba; - public static final int weather_3_cond=0x7f0600c5; - public static final int weather_3_date=0x7f0600ac; - public static final int weather_3_day=0x7f0600b1; - public static final int weather_3_hi=0x7f0600b6; - public static final int weather_3_img=0x7f0600c0; - public static final int weather_3_lo=0x7f0600bb; - public static final int weather_4_cond=0x7f0600c6; - public static final int weather_4_date=0x7f0600ad; - public static final int weather_4_day=0x7f0600b2; - public static final int weather_4_hi=0x7f0600b7; - public static final int weather_4_img=0x7f0600c1; - public static final int weather_4_lo=0x7f0600bc; - public static final int weather_actFeel=0x7f0600a7; - public static final int weather_actImage=0x7f0600a2; - public static final int weather_actPlace=0x7f0600a5; - public static final int weather_actTemp=0x7f0600a6; - public static final int weather_actText=0x7f0600a3; - public static final int weather_actTime=0x7f0600a4; - public static final int weather_actWind=0x7f0600a8; - public static final int widget0=0x7f060013; - public static final int widget00=0x7f060043; - public static final int widget01=0x7f060047; - public static final int widget02=0x7f06004b; + public static final int music_grid=0x7f060018; + public static final int now_album=0x7f060035; + public static final int now_artist=0x7f06003b; + public static final int now_cd=0x7f060036; + public static final int now_list=0x7f060040; + public static final int now_next=0x7f06003f; + public static final int now_play=0x7f06003e; + public static final int now_playing=0x7f060034; + public static final int now_playing_right=0x7f060039; + public static final int now_playing_t_left=0x7f060038; + public static final int now_prev=0x7f06003c; + public static final int now_progress=0x7f060037; + public static final int now_stop=0x7f06003d; + public static final int now_title=0x7f06003a; + public static final int radio01=0x7f0600d3; + public static final int radio02=0x7f0600d4; + public static final int radio03=0x7f0600d5; + public static final int radio04=0x7f0600d6; + public static final int radioStop=0x7f0600d7; + public static final int selectSkin1=0x7f0600a6; + public static final int selectSkin2=0x7f0600a8; + public static final int selectSkin3=0x7f0600aa; + public static final int server_ip=0x7f06009e; + public static final int server_macid=0x7f0600a2; + public static final int server_name=0x7f06009c; + public static final int server_port=0x7f0600a0; + public static final int splash=0x7f0600ac; + public static final int text_kb_streamed=0x7f06002d; + public static final int title=0x7f0600ad; + public static final int txtDbAlbum=0x7f06001b; + public static final int txtDbArtist=0x7f06001f; + public static final int txtDbResult=0x7f060023; + public static final int txtDbSong=0x7f060027; + public static final int txtDirectoryMovies=0x7f060014; + public static final int txtDirectoryMusic=0x7f060017; + public static final int txtDirectoryPictures=0x7f06002a; + public static final int txtFile=0x7f06002e; + public static final int txtGlobal=0x7f060094; + public static final int txtIntanceName=0x7f06009b; + public static final int txtMediaPortalIP=0x7f06009d; + public static final int txtMediaPortalMAC=0x7f0600a1; + public static final int txtMediaPortalPort=0x7f06009f; + public static final int txtPowerMode=0x7f060096; + public static final int txtSelectSkin=0x7f0600a4; + public static final int txtVersion=0x7f060095; + public static final int vibration=0x7f060098; + public static final int visitHome1=0x7f0600a7; + public static final int visitHome2=0x7f0600a9; + public static final int visitHome3=0x7f0600ab; + public static final int weather_0_cond=0x7f0600ce; + public static final int weather_0_date=0x7f0600b5; + public static final int weather_0_day=0x7f0600ba; + public static final int weather_0_hi=0x7f0600bf; + public static final int weather_0_img=0x7f0600c9; + public static final int weather_0_lo=0x7f0600c4; + public static final int weather_1_cond=0x7f0600cf; + public static final int weather_1_date=0x7f0600b6; + public static final int weather_1_day=0x7f0600bb; + public static final int weather_1_hi=0x7f0600c0; + public static final int weather_1_img=0x7f0600ca; + public static final int weather_1_lo=0x7f0600c5; + public static final int weather_2_cond=0x7f0600d0; + public static final int weather_2_date=0x7f0600b7; + public static final int weather_2_day=0x7f0600bc; + public static final int weather_2_hi=0x7f0600c1; + public static final int weather_2_img=0x7f0600cb; + public static final int weather_2_lo=0x7f0600c6; + public static final int weather_3_cond=0x7f0600d1; + public static final int weather_3_date=0x7f0600b8; + public static final int weather_3_day=0x7f0600bd; + public static final int weather_3_hi=0x7f0600c2; + public static final int weather_3_img=0x7f0600cc; + public static final int weather_3_lo=0x7f0600c7; + public static final int weather_4_cond=0x7f0600d2; + public static final int weather_4_date=0x7f0600b9; + public static final int weather_4_day=0x7f0600be; + public static final int weather_4_hi=0x7f0600c3; + public static final int weather_4_img=0x7f0600cd; + public static final int weather_4_lo=0x7f0600c8; + public static final int weather_actFeel=0x7f0600b3; + public static final int weather_actImage=0x7f0600ae; + public static final int weather_actPlace=0x7f0600b1; + public static final int weather_actTemp=0x7f0600b2; + public static final int weather_actText=0x7f0600af; + public static final int weather_actTime=0x7f0600b0; + public static final int weather_actWind=0x7f0600b4; + public static final int widget0=0x7f060062; + public static final int widget00=0x7f060045; + public static final int widget01=0x7f060049; + public static final int widget02=0x7f06004d; public static final int widget44=0x7f060000; } public static final class layout { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -4,7 +4,11 @@ android:id="@+id/lay_main" android:layout_height="fill_parent"> -<TextView android:layout_height="wrap_content" android:text="HTPC" android:textColor="#FF000000" android:textStyle="bold" android:textSize="20dip" android:gravity="center_horizontal" android:background="#FFA9A9A9" android:layout_width="fill_parent" android:id="@+id/main_instance"></TextView> +<TextView android:layout_height="wrap_content" android:text="HTPC" + android:textColor="#FF000000" android:textStyle="bold" + android:textSize="20dip" android:gravity="center_horizontal" + android:background="#FFA9A9A9" android:layout_width="fill_parent" + android:id="@+id/main_instance"></TextView> <TableLayout android:id="@+id/TableLayout01" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movies.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movies.xml 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movies.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -1,12 +1,12 @@ -<LinearLayout android:id="@+id/widget0" - android:layout_width="fill_parent" android:layout_height="wrap_content" +<LinearLayout android:id="@+id/lay_movies" + 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="Actual: ..." android:textColor="#FFFFFFFF" android:textSize="20dip" - android:id="@+id/txtDirectory" android:paddingBottom="5dip"></TextView> + android:id="@+id/txtDirectoryMovies" android:paddingBottom="5dip"></TextView> <GridView android:layout_y="0dip" android:layout_x="0dip" android:id="@+id/GridView01" android:layout_width="fill_parent" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -1,11 +1,11 @@ -<LinearLayout android:id="@+id/widget0" - android:layout_width="fill_parent" android:layout_height="wrap_content" +<LinearLayout android:id="@+id/lay_music" + 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="Actual: ..." - android:textColor="#FFFFFFFF" android:textSize="20dip" android:id="@+id/txtDirMusic" + android:textColor="#FFFFFFFF" android:textSize="20dip" android:id="@+id/txtDirectoryMusic" android:paddingBottom="5dip"></TextView> <GridView android:layout_y="0dip" android:layout_x="0dip" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -1,5 +1,5 @@ <LinearLayout android:id="@+id/lay_pictures" - android:layout_width="fill_parent" android:layout_height="wrap_content" + android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"> @@ -7,7 +7,7 @@ android:layout_height="wrap_content" android:text="Actual: ..." android:textColor="#FFFFFFFF" android:textSize="20dip" - android:id="@+id/txtDirectory" android:paddingBottom="5dip"></TextView> + android:id="@+id/txtDirectoryPictures" android:paddingBottom="5dip"></TextView> <GridView android:layout_y="0dip" android:layout_x="0dip" android:id="@+id/GridView01" android:layout_width="fill_parent" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -1,15 +1,15 @@ <?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" android:padding="15dip"> + android:orientation="vertical" android:padding="15dip" android:id="@+id/lay_global"> <TextView android:layout_width="fill_parent" - android:layout_height="wrap_content" android:textSize="24dip" android:text="Global settings" android:paddingBottom="10dip" android:textColor="#FFFFFFFF"></TextView> + android:layout_height="wrap_content" android:textSize="24dip" android:text="Global settings" android:paddingBottom="10dip" android:textColor="#FFFFFFFF" android:id="@+id/txtGlobal"></TextView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFFFF" android:text="Version" android:id="@+id/txtVersion"></TextView> <TextView android:layout_width="fill_parent" - android:layout_height="wrap_content" android:textSize="18dip" android:text="Power Mode" android:textColor="#FFFFFFFF" android:layout_marginTop="10dip"></TextView> + android:layout_height="wrap_content" android:textSize="18dip" android:text="Power Mode" android:textColor="#FFFFFFFF" android:layout_marginTop="10dip" android:id="@+id/txtPowerMode"></TextView> <Spinner android:id="@+id/Spinner01" android:layout_width="fill_parent" android:layout_height="wrap_content"></Spinner> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup_ip.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup_ip.xml 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup_ip.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -1,26 +1,26 @@ <?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" android:padding="15dip"> + android:orientation="vertical" android:padding="15dip" android:id="@+id/lay_IPsettings"> - <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/txtIntanceName" android:text="Instance Name : 0" android:textSize="20dip" android:textColor="#FFFFFFFF"></TextView> + <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/txtIntanceName" android:text="Instance Name : 0" android:textSize="20dip"></TextView> <EditText android:id="@+id/server_name" android:layout_height="wrap_content" android:layout_width="fill_parent" android:inputType="text" android:text="HTPC"></EditText> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="MediaPortal IP" - android:textSize="18dip" android:textColor="#FFFFFFFF"> + android:textSize="18dip" android:id="@+id/txtMediaPortalIP"> </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> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="MediaPortal Port" - android:textSize="18dip" android:textColor="#FFFFFFFF"></TextView> + android:textSize="18dip" android:id="@+id/txtMediaPortalPort"></TextView> <EditText android:id="@+id/server_port" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="8200" android:inputType="phone"></EditText> <TextView android:layout_width="fill_parent" - android:layout_height="wrap_content" android:textSize="18dip" android:text="MediaPortal MAC (WakeOnLan)" android:textColor="#FFFFFFFF"></TextView> + android:layout_height="wrap_content" android:textSize="18dip" android:text="MediaPortal MAC (WakeOnLan)" android:id="@+id/txtMediaPortalMAC"></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="text"></EditText> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/skin.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/skin.xml 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/skin.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -1,5 +1,5 @@ -<LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"> -<TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="Select skin" android:textColor="#FFFFFFFF" android:layout_marginTop="5dip" android:textSize="24dip"></TextView> +<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:id="@+id/lay_selectSkin"> +<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="Select skin" android:textColor="#FFFFFFFF" android:layout_marginTop="5dip" android:textSize="24dip" android:id="@+id/txtSelectSkin"></TextView> <RadioGroup android:id="@+id/RadioGroup01" android:layout_height="wrap_content" android:layout_width="fill_parent"> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-land/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-land/main.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-land/main.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:id="@+id/lay_main" + android:layout_height="fill_parent"> + +<TextView android:layout_height="wrap_content" android:text="HTPC" + android:textColor="#FF000000" android:textStyle="bold" + android:textSize="20dip" android:gravity="center_horizontal" + android:background="#FFA9A9A9" android:layout_width="fill_parent" + android:id="@+id/main_instance"></TextView> + +<TableLayout + android:id="@+id/TableLayout01" + xmlns:android="http://schemas.android.com/apk/res/android" + + android:layout_height="wrap_content" + android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> + + +<TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="5dip" android:layout_gravity="center_horizontal"> + + <Button android:scaleType="fitXY" + android:id="@+id/btn_main_pictures" android:background="@drawable/ic_menu_skin1_pictures" android:layout_height="60dip" android:layout_width="60dip" android:layout_marginRight="20dip"> + </Button> + + <Button android:scaleType="fitXY" android:id="@+id/btn_main_music" android:background="@drawable/ic_menu_skin1_music" android:layout_height="60dip" android:layout_width="60dip"> + </Button> + <Button android:background="@drawable/ic_menu_skin1_video" android:id="@+id/btn_main_video" android:layout_height="60dip" android:layout_width="60dip" android:layout_marginLeft="20dip"></Button> + + </TableRow> + + <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="5dip"> + + <Button android:scaleType="fitXY" android:padding="5dip" android:id="@+id/btn_main_remote" android:background="@drawable/ic_menu_skin1_remote" android:layout_height="60dip" android:layout_width="60dip" android:layout_marginRight="20dip"> + </Button> + <Button android:padding="5dip" android:background="@drawable/ic_menu_skin1_now_playing" android:id="@+id/btn_main_now_playing" android:layout_height="60dip" android:layout_width="60dip"></Button> + <Button android:padding="5dip" android:background="@drawable/ic_menu_skin1_plugins" android:id="@+id/btn_main_plugins" android:layout_height="60dip" android:layout_width="60dip" android:layout_marginLeft="20dip"></Button> + + +</TableRow> + +</TableLayout> + + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="nothing playing" + android:gravity="center_horizontal" android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:background="#FFA9A9A9" android:padding="5dip" android:id="@+id/main_now_playing"> + </TextView> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:padding="5dip"> + + + <Button android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_skp_back" android:padding="2dip" android:layout_marginRight="5dip" android:background="@drawable/ic_menu_skin1_skip_backward"></Button> + <ImageButton android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_play" android:padding="2dip" android:layout_marginRight="5dip" android:background="@drawable/ic_menu_skin1_play"></ImageButton> + <Button android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_skp_forw" android:padding="2dip" android:background="@drawable/ic_menu_skin1_skip_forward"></Button> +</LinearLayout> +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-large-land/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-large-land/main.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-large-land/main.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent"> + +<TextView android:layout_height="wrap_content" android:text="HTPC" android:textColor="#FF000000" android:textStyle="bold" android:gravity="center_horizontal" android:background="#FFA9A9A9" android:layout_width="fill_parent" android:id="@+id/main_instance" android:textSize="28dip"></TextView> + +<TableLayout + android:id="@+id/TableLayout01" + xmlns:android="http://schemas.android.com/apk/res/android" + + android:layout_height="wrap_content" + android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> + + +<TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dip" android:id="@+id/TableRow01"> + + <Button android:scaleType="fitXY" + android:layout_marginRight="40dip" android:padding="5dip" android:id="@+id/btn_main_pictures" android:background="@drawable/ic_menu_skin1_pictures" android:layout_height="110dip" android:layout_width="110dip"> + </Button> + + <Button android:scaleType="fitXY" android:padding="5dip" + android:id="@+id/btn_main_music" android:background="@drawable/ic_menu_skin1_music" android:layout_marginRight="40dip" android:layout_height="110dip" android:layout_width="110dip"> + </Button> + <Button android:layout_marginRight="40dip" android:id="@+id/btn_main_video" android:padding="5dip" android:background="@drawable/ic_menu_skin1_video" android:layout_height="110dip" android:layout_width="110dip"></Button> + + </TableRow> + + <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dip" android:id="@+id/TableRow01"> + + <Button android:scaleType="fitXY" android:padding="5dip" android:id="@+id/btn_main_remote" android:background="@drawable/ic_menu_skin1_remote" android:layout_marginRight="40dip" android:layout_height="110dip" android:layout_width="110dip"> + </Button> + <Button android:layout_marginRight="40dip" android:id="@+id/btn_main_now_playing" android:padding="5dip" android:background="@drawable/ic_menu_skin1_now_playing" android:layout_height="100dip" android:layout_width="110dip"></Button> + <Button android:id="@+id/btn_main_plugins" android:padding="5dip" android:background="@drawable/ic_menu_skin1_plugins" android:layout_marginRight="40dip" android:layout_height="110dip" android:layout_width="110dip"></Button> + + +</TableRow> + +</TableLayout> + + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="nothing playing" + android:gravity="center_horizontal" android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:background="#FFA9A9A9" android:padding="5dip" android:id="@+id/main_now_playing" android:textSize="24dip"> + </TextView> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:padding="5dip"> + + + <Button android:scaleType="fitXY" + android:id="@+id/btn_main_skp_back" android:padding="2dip" android:background="@drawable/ic_menu_skin1_skip_backward" android:layout_height="80dip" android:layout_width="80dip" android:layout_marginRight="15dip"></Button> + <ImageButton android:scaleType="fitXY" + android:id="@+id/btn_main_play" android:padding="2dip" android:background="@drawable/ic_menu_skin1_play" android:layout_height="80dip" android:layout_width="80dip" android:layout_marginRight="15dip"></ImageButton> + <Button android:scaleType="fitXY" + android:id="@+id/btn_main_skp_forw" android:padding="2dip" android:background="@drawable/ic_menu_skin1_skip_forward" android:layout_height="80dip" android:layout_width="80dip" android:layout_marginRight="15dip"></Button> +</LinearLayout> +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small-land/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small-land/main.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small-land/main.xml 2011-02-08 12:25:43 UTC (rev 4101) @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent"> + +<TextView android:layout_height="wrap_content" android:text="HTPC" android:textColor="#FF000000" android:textStyle="bold" android:textSize="20dip" android:gravity="center_horizontal" android:background="#FFA9A9A9" android:layout_width="fill_parent" android:id="@+id/main_instance"></TextView> + +<TableLayout + android:id="@+id/TableLayout01" + xmlns:android="http://schemas.android.com/apk/res/android" + + android:layout_height="wrap_content" + android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> + + +<TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="3dip"> + + <Button android:scaleType="fitXY" + android:padding="5dip" android:id="@+id/btn_main_pictures" android:background="@drawable/ic_menu_skin1_pictures" android:layout_height="70dip" android:layout_width="70dip" android:layout_marginRight="10dip"> + </Button> + + <Button android:scaleType="fitXY" android:padding="5dip" + android:id="@+id/btn_main_music" android:background="@drawable/ic_menu_skin1_music" android:layout_height="70dip" android:layout_width="70dip"> + </Button> + <Button android:padding="5dip" android:background="@drawable/ic_menu_skin1_video" android:id="@+id/btn_main_video" android:layout_height="70dip" android:layout_width="70dip" android:layout_marginLeft="10dip"></Button> + + </TableRow> + + <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="3dip"> + + <Button android:scaleType="fitXY" android:id="@+id/btn_main_remote" android:padding="5dip" android:background="@drawable/ic_menu_skin1_remote" android:layout_height="70dip" android:layout_width="70dip" android:layout_marginRight="10dip"> + </Button> + <Button android:padding="5dip" android:background="@drawable/ic_menu_skin1_now_playing" android:id="@+id/btn_main_now_playing" android:layout_height="70dip" android:layout_width="70dip"></Button> + <Button android:padding="5dip" android:background="@drawable/ic_menu_skin1_plugins" android:id="@+id/btn_main_plugins" android:layout_height="70dip" android:layout_width="70dip" android:layout_marginLeft="10dip"></Button> + + </TableRow> + +</TableLayout> + + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="nothing playing" + android:gravity="center_horizontal" android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:background="#FFA9A9A9" android:id="@+id/main_now_playing" android:padding="3dip"> + </TextView> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:padding="2dip"> + + + <Button android:scaleType="fitXY" + android:id="@+id/btn_main_skp_back" android:background="@drawable/ic_menu_skin1_skip_backward" android:layout_marginRight="5dip" android:layout_height="55dip" android:layout_width="55dip"></Button> + <ImageButton android:scaleType="fitXY" + android:id="@+id/btn_main_play" android:layout_marginRight="0dip" android:background="@drawable/ic_menu_skin1_play" android:layout_height="55dip" android:layout_width="55dip"></ImageButton> + <Button android:scaleType="fitXY" + android:id="@+id/btn_main_skp_forw" android:background="@drawable/ic_menu_skin1_skip_forward" android:layout_marginLeft="5dip" android:layout_height="55dip" android:layout_width="55dip"></Button> +</LinearLayout> +</LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/PostWebserver.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/PostWebserver.java 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/PostWebserver.java 2011-02-08 12:25:43 UTC (rev 4101) @@ -27,7 +27,9 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.Socket; +import java.net.SocketAddress; import mediaportal.remote.utils.AppSettings; @@ -60,8 +62,11 @@ try { InetAddress addr = InetAddress.getByName(AppSettings.getServer()); - Socket socket = new Socket(addr, Integer.parseInt(AppSettings.getPort())); - + + Socket socket = new Socket(); + SocketAddress adr = new InetSocketAddress(addr, Integer.parseInt(AppSettings.getPort())); + socket.connect(adr, 5000); + // Send header String String path = "/"; BufferedWriter wr = new BufferedWriter(new OutputStreamWriter( Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/SendCommand.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/SendCommand.java 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/SendCommand.java 2011-02-08 12:25:43 UTC (rev 4101) @@ -40,8 +40,10 @@ manager = asset; } - public static void PostCommandButton(String button) + public static boolean PostCommandButton(String button) { + boolean result = false; + Log.d("MediaPortal", "PostCommandButton :" + button); Vibration.vibrateShort(); @@ -59,12 +61,13 @@ xml = xml + (char) x; x = inputStream.read(); } - post.Post(xml); + result = post.Post(xml); } catch (IOException e) { e.printStackTrace(); } + return result; } - public static void PostKey(String Key) { + public static boolean PostKey(String Key) { Log.d("MediaPortal", "PostKey :" + Key); @@ -79,7 +82,7 @@ xml += "<key>" + Key + "</key>\r\n"; xml += "</message>\r\n"; - post.Post(xml); + return post.Post(xml); } public static void PostClearPlaylist() { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/control/Remote_01.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/control/Remote_01.java 2011-02-07 21:41:27 UTC (rev 4100) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/control/Remote_01.java 2011-02-08 12:25:43 UTC (rev 4101) @@ -32,6 +32,7 @@ import android.content.Intent; import android.content.res.Resources; import android.graphics.Color; +import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; @@ -43,39 +44,42 @@ public class Remote_01 extends Activity { private static String action; - + private LinearLayout layout; - + private ImageButton btnPower; - + private ImageButton btnUp; private ImageButton btnDown; private ImageButton btnLeft; private ImageButton btnRight; private ImageButton btnOk; - + private ImageButton btnVolUp; private ImageButton btnVolDown; - + private ImageButton btnBack; private ImageButton btnHome; - + private ImageButton btnSkipBack; private ImageButton btnStop; private ImageButton btnSkipForw; private ImageButton btnChannel_p; - + private ImageButton btnFull; private ImageButton btnPlay; private ImageButton btnMenu; private ImageButton btnChannel_m; - + private ImageButton btnSub; private ImageButton btnAspect; private ImageButton btnOsd; private ImageButton btnInfo; - - + + private sendKeystroke taskSendKeyStroke; + private static boolean active; + private static boolean result; + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { @@ -85,7 +89,7 @@ Log.d("MediaPortal", "start remote 1"); layout = (LinearLayout) findViewById(R.id.lay_remote01); - + btnPower = (ImageButton) findViewById(R.id.crtl_power); btnUp = (ImageButton) findViewById(R.id.crtl_up); @@ -93,93 +97,96 @@ btnLeft = (ImageButton) findViewById(R.id.crtl_left); btnRight = (ImageButton) findViewById(R.id.crtl_right); btnOk = (ImageButton) findViewById(R.id.crtl_select); - + btnVolUp = (ImageButton) findViewById(R.id.crtl_vol_p); btnVolDown = (ImageButton) findViewById(R.id.crtl_vol_m); - + btnBack = (ImageButton) findViewById(R.id.crtl_back); btnHome = (ImageButton) findViewById(R.id.crtl_parent); - + btnSkipBack = (ImageButton) findViewById(R.id.crtl_skip_back); btnStop = (ImageButton) findViewById(R.id.crtl_stop); btnSkipForw = (ImageButton) findViewById(R.id.crtl_skip_forw); btnChannel_p = (ImageButton) findViewById(R.id.crtl_ch_p); - + btnFull = (ImageButton) findViewById(R.id.crtl_full); btnPlay = (ImageButton) findViewById(R.id.crtl_play); btnMenu = (ImageButton) findViewById(R.id.crtl_menu); btnChannel_m = (ImageButton) findViewById(R.id.crtl_ch_m); - + btnSub = (ImageButton) findViewById(R.id.crtl_sub); btnAspect = (ImageButton) findViewById(R.id.crtl_ratio); btnOsd = (ImageButton) findViewById(R.id.crtl_osd); btnInfo = (ImageButton) findViewById(R.id.crtl_info); - + // buttons // first row - + btnUp.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { SendCommand.PostCommandButton("moveUp"); } }); - + ImageButton power = (ImageButton) findViewById(R.id.crtl_power); - + power.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - + Wol w = new Wol(); w.sendMagicPacket(AppSettings.getMacId(), 9); - - Toast.makeText(Remote_01.this, "power on", Toast.LENGTH_SHORT).show(); + + Toast.makeText(Remote_01.this, "power on", Toast.LENGTH_SHORT) + .show(); } }); power.setOnLongClickListener(new View.OnLongClickListener() { public boolean onLongClick(View view) { - + int x = AppSettings.getPowerMode(); - + Resources res = getResources(); String[] actions = res.getStringArray(R.array.shutdown); - + action = actions[x]; - - AlertDialog.Builder builder = new AlertDialog.Builder(Remote_01.this); - builder.setMessage("Do you really want to " + action + " ?") + + AlertDialog.Builder builder = new AlertDialog.Builder( + Remote_01.this); + builder.setMessage("Do you really want to " + action + " ?") .setTitle("Please confirm") .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { - - switch (AppSettings.getPowerMode()) - { + + switch (AppSettings.getPowerMode()) { case 0: // Exit - SendCommand.PostCommandButton("exit"); + sendKeyStroke("exit"); break; case 1: // Suspend - SendCommand.PostCommandButton("suspend"); + sendKeyStroke("suspend"); break; case 2: // Hibernate - SendCommand.PostCommandButton("hibernate"); + sendKeyStroke("hibernate"); break; case 3: // Restart - SendCommand.PostCommandButton("restart"); + sendKeyStroke("restart"); break; case 4: // Shut Off - SendCommand.PostCommandButton("shutoff"); + sendKeyStroke("shutoff"); break; } - - Toast.makeText(Remote_01.this, "Please wait , " + action, Toast.LENGTH_SHORT).show(); - + + Toast.makeText(Remote_01.this, + "Please wait , " + action, + Toast.LENGTH_SHORT).show(); + } }) .setNegativeButton("No", @@ -193,132 +200,132 @@ return true; } }); - - + // second row - + btnLeft.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("moveLeft"); + sendKeyStroke("moveLeft"); } }); - + btnOk.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("selectItem"); + sendKeyStroke("selectItem"); } }); btnRight.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("moveRight"); + sendKeyStroke("moveRight"); } }); - + // third row - + btnHome.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("parentDir"); + sendKeyStroke("parentDir"); } - }); + }); btnDown.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("moveDown"); + sendKeyStroke("moveDown"); } }); btnBack.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("previousMenu"); + sendKeyStroke("previousMenu"); } }); - + // volume btnVolUp.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("volumeUp"); + sendKeyStroke("volumeUp"); } }); btnVolDown.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("volumeDown"); + sendKeyStroke("volumeDown"); } }); - + // fourth row - + btnSkipBack.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("prevItem"); + sendKeyStroke("prevItem"); } - }); + }); btnStop.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("stop"); + sendKeyStroke("stop"); } - }); + }); btnSkipForw.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("nextItem"); + sendKeyStroke("nextItem"); } }); btnChannel_p.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("nextChannel"); + sendKeyStroke("nextChannel"); } }); - + // fifth row - + btnFull.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("fullscreen"); + sendKeyStroke("fullscreen"); } }); btnPlay.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - SendCommand.PostCommandButton("play"); + sendKeyStroke("play"); } }); btnMenu.setOnClickListener(new View.OnClickLis... [truncated message content] |
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. |
From: <Rol...@us...> - 2011-04-17 21:57:12
|
Revision: 4176 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4176&view=rev Author: Rollsroyc3 Date: 2011-04-17 21:57:06 +0000 (Sun, 17 Apr 2011) Log Message: ----------- moving pictures enhancements Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures.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-04-17 21:52:28 UTC (rev 4175) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2011-04-17 21:57:06 UTC (rev 4176) @@ -35,6 +35,7 @@ <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> + <activity android:launchMode="singleInstance" android:name=".plugins.Movingpictures_movie"></activity> </application> <uses-sdk android:minSdkVersion="3" /> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures.xml 2011-04-17 21:52:28 UTC (rev 4175) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures.xml 2011-04-17 21:57:06 UTC (rev 4176) @@ -12,6 +12,6 @@ <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 Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_movie.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_movie.xml 2011-04-17 21:52:28 UTC (rev 4175) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movingpictures_movie.xml 2011-04-17 21:57:06 UTC (rev 4176) @@ -2,20 +2,23 @@ <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"> + <ScrollView android:id="@+id/ScrollView01" + android:layout_width="fill_parent" android:layout_height="fill_parent"> + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" android:layout_height="wrap_content" + android:orientation="vertical"> + <ImageView android:layout_width="wrap_content" + android:paddingTop="5dip" android:layout_height="wrap_content" + android:id="@+id/ivMovingPicturesMovie" android:width="150dip" + android:height="250dip" android:layout_gravity="center_horizontal" /> <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> + android:id="@+id/txtMovieDescription" android:paddingBottom="5dip" /> + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="" + android:textColor="#FFFFFFFF" android:textSize="20dip" + android:id="@+id/txtMovieTagline" android:paddingBottom="5dip" /> </LinearLayout> - </LinearLayout> + </ScrollView> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures.java 2011-04-17 21:52:28 UTC (rev 4175) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures.java 2011-04-17 21:57:06 UTC (rev 4176) @@ -12,7 +12,6 @@ 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; @@ -23,7 +22,6 @@ 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; @@ -36,7 +34,7 @@ public class Movingpictures extends Activity { - private static ArrayList<objMovie> MovieList = new ArrayList<objMovie>(); + public static ArrayList<objMovie> MovieList = new ArrayList<objMovie>(); public static objMovie objSelectedMovie; private TextView title; private BaseAdapter adapter; @@ -47,71 +45,67 @@ private double H; private double DefaultImageWidth = 150; private double DefaultImageHeight = 250; + private int numColumns = 0; + public static int selectedMoviePosition = 0; @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"); } + adapter = new ImageAdapter2(Movingpictures.this); + + // get optimal image width and height + getImageWidth(DefaultImageWidth); + H = (DefaultImageHeight / DefaultImageWidth) * W; + + // set # of columns depending on width + GridView gridview = (GridView) findViewById(R.id.MovingpicturesGrid); + gridview.setNumColumns(numColumns); + gridview.setAdapter(adapter); adapter.notifyDataSetChanged(); + + objSelectedMovie = null; gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { - + selectedMoviePosition = position; taskFetchData.cancel(true); - // ImageView iv = (ImageView) v - // .findViewById(R.id.icon_movingpicturesimage); - // objMovie mov = (objMovie) iv.getTag(); + objSelectedMovie = MovieList.get(position); - Vibration.vibrateShort(); + // Vibration.vibrateShort(); - // Intent myIntent = new Intent(Movingpictures.this, - // Movingpictures_movie.class); - // startActivityForResult(myIntent, 0); + Intent myIntent = new Intent(Movingpictures.this, + Movingpictures_movie.class); + startActivity(myIntent); } }); + } + 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(); - // } + if (MovieList != null) { + taskFetchData = new update(); + taskFetchData.execute(); + } } - + + private class update extends AsyncTask<String, Void, Void> { private final ProgressDialog dialog = new ProgressDialog( Movingpictures.this); @@ -182,11 +176,6 @@ 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"); } @@ -229,23 +218,23 @@ // @Override // create a new ImageView for each item referenced by the Adapter public View getView(int position, View convertView, ViewGroup parent) { - // View v; + View v; int skin = AppSettings.getActualSkin(); ImageView iv; - //if (convertView == null) { // if it's not recycled, initialize some + 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; + } else { + v = convertView; + iv = (ImageView) convertView; - //} + } if (MovieList != null) { @@ -272,7 +261,7 @@ } } - private class objMovie { + public class objMovie { protected int ID; protected String title; protected String description; @@ -375,44 +364,46 @@ private void getImageWidth(double DefaultWidth) { - //Log.e("ar:new decimals", String.valueOf(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)); + // Log.e("ar:ViewWidth", String.valueOf(ViewWidth)); double dblNewImageWidth = ViewWidth / DefaultWidth; - //Log.e("ar:dblNewImageWidth", String.valueOf(dblNewImageWidth)); + // Log.e("ar:dblNewImageWidth", String.valueOf(dblNewImageWidth)); + numColumns = (int) Math.round(dblNewImageWidth); + if (dblNewImageWidth == Math.round(dblNewImageWidth)) // whole number { - //Log.e("ar:info", "double is round number"); + // Log.e("ar:info", "inside" + String.valueOf(dblNewImageWidth)); W = (int) DefaultWidth; - - } - else // not a whole number + } 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)); + // 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)); + 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)); + // Log.e("ar:new decimals", String.valueOf(dblNewImageWidth)); - if (dblNewImageWidth <= .10 || dblNewImageWidth >= .90) - { // close enough + if (dblNewImageWidth <= .10 || dblNewImageWidth >= .99) { // close + // enough W = (int) DefaultWidth; - } - else if (dblNewImageWidth <= .49) - { + } else if (dblNewImageWidth <= .49) { getImageWidth(DefaultWidth + 1); - } - else - { + } else { getImageWidth(DefaultWidth - 1); } } @@ -422,6 +413,7 @@ double roundTwoDecimals(double d) { DecimalFormat twoDForm = new DecimalFormat("#.##"); return Double.valueOf(twoDForm.format(d)); - + } + } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures_movie.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures_movie.java 2011-04-17 21:52:28 UTC (rev 4175) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/plugins/Movingpictures_movie.java 2011-04-17 21:57:06 UTC (rev 4176) @@ -1,5 +1,171 @@ package mediaportal.remote.plugins; -public class Movingpictures_movie { +import mediaportal.remote.R; +import android.app.Activity; +import android.app.ProgressDialog; +import android.os.AsyncTask; +import android.os.Bundle; +import android.view.GestureDetector; +import android.view.MotionEvent; +import android.view.GestureDetector.OnGestureListener; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; +public class Movingpictures_movie extends Activity implements OnGestureListener { + + 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 Movingpictures.objMovie localMov; + + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.movingpictures_movie); + + gestureScanner = new GestureDetector(Movingpictures_movie.this); + + + if (savedInstanceState == null) + new setMovie().execute(); + else + { + ImageView iv = (ImageView) findViewById(R.id.ivMovingPicturesMovie); + iv.setImageBitmap(localMov.BitmapImage); + + TextView MovieDescription = (TextView) findViewById(R.id.txtMovieDescription); + TextView MovieTagline = (TextView) findViewById(R.id.txtMovieTagline); + + String sbuildMovieDesc = ""; + sbuildMovieDesc = "Title: " + localMov.title + "\n"; + sbuildMovieDesc += "Rating: " + localMov.Rating + "\n"; + sbuildMovieDesc += "Runtime: " + localMov.Runtime + "\n"; + MovieDescription.setText(sbuildMovieDesc); + + MovieTagline.setText(localMov.description); + } + + + } + + public boolean onDown(MotionEvent e) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean onTouchEvent(MotionEvent me) { + return gestureScanner.onTouchEvent(me); + } + + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, + float velocityY) { + try { + + int max = Movingpictures.MovieList.size(); + + if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) + return false; + // right to left swipe + if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + + if (Movingpictures.selectedMoviePosition < max) { + Movingpictures.selectedMoviePosition ++; + new setMovie().execute(); + } else + Toast.makeText(this, "reached end +", Toast.LENGTH_SHORT) + .show(); + return true; + } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + + if (Movingpictures.selectedMoviePosition > 0) { + Movingpictures.selectedMoviePosition --; + new setMovie().execute(); + } else + Toast.makeText(this, "reached end -", Toast.LENGTH_SHORT) + .show(); + return true; + } + } catch (Exception e) { + // nothing + } + return false; + } + + public void onLongPress(MotionEvent e) { + // TODO Auto-generated method stub + + } + + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, + float distanceY) { + // TODO Auto-generated method stub + return false; + } + + public void onShowPress(MotionEvent e) { + // TODO Auto-generated method stub + + } + + public boolean onSingleTapUp(MotionEvent e) { + // TODO Auto-generated method stub + return false; + } + + + private class setMovie extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog( + Movingpictures_movie.this); + + // can use UI thread here + protected void onPreExecute() { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + } + + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + localMov = Movingpictures.MovieList.get(Movingpictures.selectedMoviePosition); + return null; + } + + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + try { + this.dialog.dismiss(); + } catch (Exception ex) { + } + } + + if (localMov != null) { + + ImageView iv = (ImageView) findViewById(R.id.ivMovingPicturesMovie); + iv.setImageBitmap(localMov.BitmapImage); + + TextView MovieDescription = (TextView) findViewById(R.id.txtMovieDescription); + TextView MovieTagline = (TextView) findViewById(R.id.txtMovieTagline); + + String sbuildMovieDesc = ""; + sbuildMovieDesc = "Title: " + localMov.title + "\n"; + sbuildMovieDesc += "Rating: " + localMov.Rating + "\n"; + sbuildMovieDesc += "Runtime: " + localMov.Runtime + "\n"; + MovieDescription.setText(sbuildMovieDesc); + + MovieTagline.setText(localMov.description); + } + } + } + + + + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |