mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-17 22:35:08 -05:00
added 'model' to selectable resources. fixed #461
This commit is contained in:
parent
1f91ed11fa
commit
c2bc15f5ba
@ -1,20 +1,27 @@
|
|||||||
package eu.siacs.conversations.ui;
|
package eu.siacs.conversations.ui;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import eu.siacs.conversations.entities.Account;
|
import eu.siacs.conversations.entities.Account;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.ListPreference;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
public class SettingsActivity extends XmppActivity implements
|
public class SettingsActivity extends XmppActivity implements
|
||||||
OnSharedPreferenceChangeListener {
|
OnSharedPreferenceChangeListener {
|
||||||
|
private SettingsFragment mSettingsFragment;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
mSettingsFragment = new SettingsFragment();
|
||||||
getFragmentManager().beginTransaction()
|
getFragmentManager().beginTransaction()
|
||||||
.replace(android.R.id.content, new SettingsFragment()).commit();
|
.replace(android.R.id.content,mSettingsFragment).commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -27,6 +34,13 @@ public class SettingsActivity extends XmppActivity implements
|
|||||||
super.onStart();
|
super.onStart();
|
||||||
PreferenceManager.getDefaultSharedPreferences(this)
|
PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
.registerOnSharedPreferenceChangeListener(this);
|
.registerOnSharedPreferenceChangeListener(this);
|
||||||
|
ListPreference resources = (ListPreference) mSettingsFragment.findPreference("resource");
|
||||||
|
if (resources!=null) {
|
||||||
|
ArrayList<CharSequence> entries = new ArrayList<CharSequence>(Arrays.asList(resources.getEntries()));
|
||||||
|
entries.add(0,Build.MODEL);
|
||||||
|
resources.setEntries(entries.toArray(new CharSequence[entries.size()]));
|
||||||
|
resources.setEntryValues(entries.toArray(new CharSequence[entries.size()]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user