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
parent 052eb03c9e
commit f8b645d2b1
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();

View File

@@ -20,7 +20,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/alerts_and_states_error"
app:tint="?attr/colorControlNormal"
app:tint="@color/briar_red_500"
tools:ignore="ContentDescription" />
<TextView
@@ -42,10 +42,12 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginVertical="16dp"
android:background="@color/briar_warning_background"
android:background="@color/briar_orange_200"
android:gravity="center"
android:padding="8dp"
android:textColor="@color/briar_text_primary_inverse"
android:textColor="@color/briar_text_primary"
android:textSize="@dimen/text_size_medium"
android:typeface="monospace"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"

View File

@@ -21,7 +21,7 @@
android:id="@+id/fallbackIntro"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginVertical="16dp"
android:layout_marginTop="16dp"
android:text="@string/hotspot_help_fallback_intro"
android:textSize="@dimen/text_size_medium"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -7,6 +7,7 @@
<color name="briar_blue_600">#1b69b6</color>
<color name="briar_blue_400">#418cd8</color>
<color name="briar_orange_200">#fed69f</color>
<color name="briar_orange_500">#fc9403</color>
<color name="briar_red_500">#db3b21</color>

View File

@@ -160,6 +160,7 @@
<string name="sorry">Sorry</string>
<string name="error_start_activity">Unavailable on your system</string>
<string name="status_heading">Status:</string>
<string name="error">Error</string>
<!-- Contacts and Private Conversations-->
<string name="no_contacts">No contacts to show</string>