global: Some more lint cleanup

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2018-05-02 10:50:06 +05:30 committed by Jason A. Donenfeld
parent cb6681b15a
commit 24572aa861
2 changed files with 28 additions and 31 deletions

View File

@ -18,18 +18,18 @@ import com.wireguard.android.widget.ToggleSwitch.OnBeforeCheckedChangeListener;
* Static methods for use by generated code in the Android data binding library.
*/
@SuppressWarnings({"unused"})
@SuppressWarnings("unused")
public final class BindingAdapters {
private BindingAdapters() {
// Prevent instantiation.
}
@BindingAdapter({"checked"})
@BindingAdapter("checked")
public static void setChecked(final ToggleSwitch view, final boolean checked) {
view.setCheckedInternal(checked);
}
@BindingAdapter({"filter"})
@BindingAdapter("filter")
public static void setFilter(final TextView view, final InputFilter filter) {
view.setFilters(new InputFilter[]{filter});
}
@ -85,7 +85,7 @@ public final class BindingAdapters {
adapter.setList(newList);
}
@BindingAdapter({"onBeforeCheckedChanged"})
@BindingAdapter("onBeforeCheckedChanged")
public static void setOnBeforeCheckedChanged(final ToggleSwitch view,
final OnBeforeCheckedChangeListener listener) {
view.setOnBeforeCheckedChangeListener(listener);

View File

@ -70,8 +70,7 @@ public class ZipExporterPreference extends Preference {
return;
}
CompletableFuture.allOf(futureConfigs.toArray(new CompletableFuture[futureConfigs.size()]))
.whenComplete((ignored1, exception) -> {
asyncWorker.supplyAsync(() -> {
.whenComplete((ignored1, exception) -> asyncWorker.supplyAsync(() -> {
if (exception != null)
throw exception;
final File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
@ -92,8 +91,7 @@ public class ZipExporterPreference extends Preference {
throw e;
}
return file.getAbsolutePath();
}).whenComplete(this::exportZipComplete);
});
}).whenComplete(this::exportZipComplete));
}
private void exportZipComplete(final String filePath, final Throwable throwable) {
@ -113,10 +111,9 @@ public class ZipExporterPreference extends Preference {
@Override
public CharSequence getSummary() {
if (exportedFilePath == null)
return getContext().getString(R.string.export_summary);
else
return getContext().getString(R.string.export_success, exportedFilePath);
return exportedFilePath == null ?
getContext().getString(R.string.export_summary) :
getContext().getString(R.string.export_success, exportedFilePath);
}
@Override