Fix a few bugs
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Родитель
bce6defc89
Коммит
91ec476f9a
|
@ -144,7 +144,8 @@ public class RingtoneSelectionController extends BaseController implements Flexi
|
|||
@SuppressLint("LongLogTag")
|
||||
private void fetchNotificationSounds() {
|
||||
abstractFlexibleItemList = new ArrayList<>();
|
||||
abstractFlexibleItemList.add(new NotificationSoundItem("None", null));
|
||||
abstractFlexibleItemList.add(new NotificationSoundItem(getResources().getString(R.string.nc_settings_no_ringtone),
|
||||
null));
|
||||
|
||||
String ringtoneString;
|
||||
|
||||
|
@ -242,7 +243,7 @@ public class RingtoneSelectionController extends BaseController implements Flexi
|
|||
mediaPlayer.start();
|
||||
}
|
||||
|
||||
if (adapter.getSelectedPositions().get(0) != position) {
|
||||
if (adapter.getSelectedPositions().size() == 0 || adapter.getSelectedPositions().get(0) != position) {
|
||||
RingtoneSettings ringtoneSettings = new RingtoneSettings();
|
||||
ringtoneSettings.setRingtoneName(notificationSoundItem.getNotificationSoundName());
|
||||
ringtoneSettings.setRingtoneUri(ringtoneUri);
|
||||
|
|
|
@ -21,17 +21,26 @@
|
|||
package com.nextcloud.talk.models.json.converters;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.bluelinelabs.logansquare.typeconverters.StringBasedTypeConverter;
|
||||
|
||||
public class UriTypeConverter extends StringBasedTypeConverter<Uri> {
|
||||
@Override
|
||||
public Uri getFromString(String string) {
|
||||
return Uri.parse(string);
|
||||
if (!TextUtils.isEmpty(string)) {
|
||||
return Uri.parse(string);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertToString(Uri object) {
|
||||
return object.toString();
|
||||
if (object != null) {
|
||||
return object.toString();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
<string name="nc_settings_message_ringtone">Messages</string>
|
||||
<string name="nc_settings_message_ringtone_key">message_ringtone</string>
|
||||
<string name="nc_settings_default_ringtone" translatable="false">Librem by feandesign</string>
|
||||
<string name="nc_settings_no_ringtone">No sound</string>
|
||||
|
||||
<string name="nc_no_proxy">No proxy</string>
|
||||
<string name="nc_username">Username</string>
|
||||
|
|
Загрузка…
Ссылка в новой задаче