2010-12-28, 12:19
Hey Guys
I just created a little fix for http://code.google.com/p/android-xbmcrem...ail?id=352. May you can use it:
With this fix, i'm able to change the default behaviour in the xbmcremote settings:
I changed the following things (i'm not a talented coder )
/XBMC Remote/res/values/arrays.xml
/XBMC Remote/res/xml/preferences.xml
/XBMC Remote/src/org/xbmc/android/remote/presentation/controller/SongListController.java
Kind regards
Milvus
I just created a little fix for http://code.google.com/p/android-xbmcrem...ail?id=352. May you can use it:
With this fix, i'm able to change the default behaviour in the xbmcremote settings:
I changed the following things (i'm not a talented coder )
/XBMC Remote/res/values/arrays.xml
Code:
[...]
<resources>
<string-array name="KeyguardPreferenceValues">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="KeyguardPreferenceEntries">
<item>Never</item>
<item>On Remote</item>
<item>Always</item>
</string-array>
[color=blue][b] <string-array name="SelectionPreferenceValues">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="SelectionPreferenceEntries">
<item>Queue Song</item>
<item>Play Song</item>
</string-array>[/b][/color]
</resources>
/XBMC Remote/res/xml/preferences.xml
Code:
<PreferenceCategory android:title="Screen Behaviour">
<ListPreference
android:key="setting_disable_keyguard"
android:title="Disable the Keyguard?"
android:summary="Click to set Keyguard (screen lock) behaviour for the app."
android:entries="@array/KeyguardPreferenceEntries"
android:entryValues="@array/KeyguardPreferenceValues"
android:defaultValue="0" />
</PreferenceCategory>
[color=blue][b] <PreferenceCategory android:title="Selection Action">
<ListPreference
android:key="setting_default_selectaction"
android:title="Default Action on selection"
android:summary="Click to set default selection action for the app."
android:entries="@array/SelectionPreferenceEntries"
android:entryValues="@array/SelectionPreferenceValues"
android:defaultValue="0" />
</PreferenceCategory>[/b][/color]
<PreferenceCategory android:title="Remote Keypress">
<CheckBoxPreference
android:key="setting_send_repeats"
android:title="Explicitly Send Repeats"
/XBMC Remote/src/org/xbmc/android/remote/presentation/controller/SongListController.java
Code:
[...]
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.BitmapFactory;
import android.os.Handler;
[color=blue][b]import android.preference.PreferenceManager;[/b][/color]
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
[...]
[...]
mList.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if(isLoading()) return;
final Song song = (Song)mList.getAdapter().getItem(((ThreeLabelsItemView)view).position);
[color=blue][b] final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mActivity.getApplicationContext());
final String SelectionType = prefs.getString("setting_default_selectaction", "");
if (SelectionType.equals("0"))
{
if (mAlbum == null)
{
mMusicManager.addToPlaylist(new QueryResponse(mActivity, "Song added to playlist.", "Error adding song!"), song, mActivity.getApplicationContext());
}
else
{
mMusicManager.addToPlaylist(new QueryResponse(mActivity, "Playlist empty, added whole album.", "Song added to playlist."), mAlbum, song, mActivity.getApplicationContext());
}
}
else if (SelectionType.equals("1"))
{[/b]
[/color] if (mAlbum == null) {
mMusicManager.play(new QueryResponse(
mActivity,
"Playing \"" + song.title + "\" by " + song.artist + "...",
"Error playing song!",
true
), song, mActivity.getApplicationContext());
} else {
mMusicManager.play(new QueryResponse(
mActivity,
"Playing album \"" + song.album + "\" starting with song \"" + song.title + "\" by " + song.artist + "...",
"Error playing song!",
true
), mAlbum, song, mActivity.getApplicationContext());
}
}
[color=blue][b] }[/b][/color]
});
[...]
Kind regards
Milvus