Improve hotspot error fragment UI

* Use different highlighting for error message
* Improve margins in fragment_hotspot_save_apk.xml
* Address some review feedback
This commit is contained in:
Sebastian Kürten
2021-06-09 17:11:46 +02:00
committed by Torsten Grote
parent 03cb1010e2
commit aecd204efe
7 changed files with 13 additions and 11 deletions

View File

@@ -60,6 +60,7 @@ public class HotspotErrorFragment extends BaseFragment {
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
requireActivity().setTitle(R.string.error);
return inflater
.inflate(R.layout.fragment_hotspot_error, container, false);
}

View File

@@ -9,12 +9,9 @@ import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
import org.briarproject.briar.R;
import javax.inject.Inject;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider;
@MethodsNotNullByDefault
@ParametersNotNullByDefault
@@ -22,9 +19,6 @@ public class HotspotHelpFragment extends Fragment {
public final static String TAG = HotspotHelpFragment.class.getName();
@Inject
ViewModelProvider.Factory viewModelFactory;
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container,

View File

@@ -42,6 +42,7 @@ import static android.os.Build.VERSION.SDK_INT;
import static android.os.Environment.DIRECTORY_DOWNLOADS;
import static android.os.Environment.getExternalStoragePublicDirectory;
import static java.util.Objects.requireNonNull;
import static java.util.logging.Level.WARNING;
import static java.util.logging.Logger.getLogger;
import static org.briarproject.bramble.util.IoUtils.copyAndClose;
import static org.briarproject.briar.BuildConfig.DEBUG;
@@ -144,7 +145,9 @@ class HotspotViewModel extends DbViewModel
@Override
public void onHotspotError(String error) {
LOG.warning("Hotspot error: " + error);
if (LOG.isLoggable(WARNING)) {
LOG.warning("Hotspot error: " + error);
}
state.postValue(new HotspotError(error));
ioExecutor.execute(webServerManager::stopWebServer);
notificationManager.clearHotspotNotification();