refactor video qualtiy selector; less technical descriptions; code cleanup

This commit is contained in:
Daniel Gultsch 2018-10-07 13:09:13 +02:00
parent 84f7aeaea0
commit 3dceb9d3ad
2 changed files with 11 additions and 14 deletions

View File

@ -40,7 +40,7 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
private final long originalFileSize;
private int currentProgress = -1;
public AttachFileToConversationRunnable(XmppConnectionService xmppConnectionService, Uri uri, String type, Message message, UiCallback<Message> callback) {
AttachFileToConversationRunnable(XmppConnectionService xmppConnectionService, Uri uri, String type, Message message, UiCallback<Message> callback) {
this.uri = uri;
this.type = type;
this.mXmppConnectionService = xmppConnectionService;
@ -52,7 +52,7 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
this.isVideoMessage = (mimeType != null && mimeType.startsWith("video/")) && originalFileSize > autoAcceptFileSize;
}
public boolean isVideoMessage() {
boolean isVideoMessage() {
return this.isVideoMessage;
}
@ -169,11 +169,8 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
}
}
public String getVideoCompression() {
return getPreferences().getString("video_compression", mXmppConnectionService.getResources().getString(R.string.video_compression));
}
protected SharedPreferences getPreferences() {
return PreferenceManager.getDefaultSharedPreferences(mXmppConnectionService.getApplicationContext());
private String getVideoCompression() {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mXmppConnectionService);
return preferences.getString("video_compression", mXmppConnectionService.getResources().getString(R.string.video_compression));
}
}

View File

@ -493,8 +493,8 @@
<string name="notify_only_when_highlighted">Notify only when mentioned</string>
<string name="notify_never">Notifications disabled</string>
<string name="notify_paused">Notifications paused</string>
<string name="pref_picture_compression">Compress Pictures</string>
<string name="pref_picture_compression_summary">Resize and compress pictures</string>
<string name="pref_picture_compression">Image Compression</string>
<string name="pref_picture_compression_summary">Resize and compress images</string>
<string name="always">Always</string>
<string name="automatically">Automatically</string>
<string name="battery_optimizations_enabled">Battery optimizations enabled</string>
@ -740,8 +740,8 @@
<string name="media_browser">Media browser</string>
<string name="export_channel_name">History export</string>
<string name="security_violation_not_attaching_file">File omitted due to security violation.</string>
<string name="pref_video_compression">Compress Videos</string>
<string name="pref_video_compression_summary">Resize and compress videos</string>
<string name="video_360p">SD (360p)</string>
<string name="video_720p">HD (720p)</string>
<string name="pref_video_compression">Video Quality</string>
<string name="pref_video_compression_summary">Lower quality means smaller files</string>
<string name="video_360p">Medium (360p)</string>
<string name="video_720p">High (720p)</string>
</resources>