Changes ocording issue #256

* Using *settings_row_detail_layout* in user profile sound selecting to
prevent overlapping strings
* Changes to RingtoneManager to make *default notification sound*
selectable in ringtone picker
This commit is contained in:
Treborius 2014-03-03 07:01:51 +01:00
parent ea8f92441c
commit 383f420ad6
3 changed files with 18 additions and 9 deletions

View file

@ -165,7 +165,8 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
try {
Intent tmpIntent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
Uri currentSound = null;
@ -255,7 +256,9 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
if (ringtone != null && parentActivity != null) {
Ringtone rng = RingtoneManager.getRingtone(parentActivity, ringtone);
if (rng != null) {
name = rng.getTitle(parentActivity);
if(ringtone.equals(Settings.System.DEFAULT_NOTIFICATION_URI))
name = getStringEntry(R.string.Default);
else name = rng.getTitle(parentActivity);
rng.stop();
}
}
@ -656,7 +659,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
} else if (type == 3) {
if (view == null) {
LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = li.inflate(R.layout.user_profile_leftright_row_layout, viewGroup, false);
view = li.inflate(R.layout.settings_row_detail_layout, viewGroup, false);
}
TextView textView = (TextView)view.findViewById(R.id.settings_row_text);
TextView detailTextView = (TextView)view.findViewById(R.id.settings_row_text_detail);

View file

@ -106,7 +106,8 @@ public class SettingsNotificationsActivity extends BaseFragment {
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
Intent tmpIntent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
Uri currentSound = null;
String defaultPath = null;
@ -227,7 +228,9 @@ public class SettingsNotificationsActivity extends BaseFragment {
if (ringtone != null && parentActivity != null) {
Ringtone rng = RingtoneManager.getRingtone(parentActivity, ringtone);
if (rng != null) {
name = rng.getTitle(parentActivity);
if(ringtone.equals(Settings.System.DEFAULT_NOTIFICATION_URI))
name = getStringEntry(R.string.Default);
else name = rng.getTitle(parentActivity);
rng.stop();
}
}

View file

@ -143,7 +143,8 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
try {
Intent tmpIntent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
Uri currentSound = null;
@ -261,8 +262,10 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
String name = null;
if (ringtone != null) {
Ringtone rng = RingtoneManager.getRingtone(ApplicationLoader.applicationContext, ringtone);
if (rng != null) {
name = rng.getTitle(ApplicationLoader.applicationContext);
if (rng != null) {
if(ringtone.equals(Settings.System.DEFAULT_NOTIFICATION_URI))
name = getStringEntry(R.string.Default);
else name = rng.getTitle(ApplicationLoader.applicationContext);
rng.stop();
}
}
@ -775,7 +778,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
} else if (type == 4) {
if (view == null) {
LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = li.inflate(R.layout.user_profile_leftright_row_layout, viewGroup, false);
view = li.inflate(R.layout.settings_row_detail_layout, viewGroup, false);
}
TextView textView = (TextView)view.findViewById(R.id.settings_row_text);
TextView detailTextView = (TextView)view.findViewById(R.id.settings_row_text_detail);