mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-25 14:35:40 +03:00
Fix a few bugs
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
bce6defc89
commit
91ec476f9a
3 changed files with 15 additions and 4 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue