Merge branch '2144-graphics-size' into 'master'

Use fixed sizes and consistent layout for "hero icons"

Closes #2144

See merge request briar/briar!1525
This commit is contained in:
Torsten Grote
2021-08-20 07:43:29 +00:00
13 changed files with 318 additions and 314 deletions

View File

@@ -7,7 +7,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
@@ -22,6 +21,7 @@ import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.ImageViewCompat;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
import static android.view.View.FOCUS_DOWN;
@@ -58,7 +58,7 @@ public class FinalFragment extends Fragment {
return f;
}
private ScrollView scrollView;
private NestedScrollView scrollView;
protected Button buttonView;
@Nullable
@@ -69,7 +69,7 @@ public class FinalFragment extends Fragment {
View v = inflater
.inflate(R.layout.fragment_final, container, false);
scrollView = (ScrollView) v;
scrollView = (NestedScrollView) v;
ImageView iconView = v.findViewById(R.id.iconView);
TextView titleView = v.findViewById(R.id.titleView);
TextView textView = v.findViewById(R.id.textView);

View File

@@ -9,6 +9,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.ScrollView;
import android.widget.TextView;
import com.google.android.material.snackbar.Snackbar;
@@ -26,6 +27,7 @@ import androidx.lifecycle.ViewModelProvider;
import static android.content.pm.ApplicationInfo.FLAG_TEST_ONLY;
import static android.os.Build.VERSION.SDK_INT;
import static android.view.View.FOCUS_DOWN;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static androidx.transition.TransitionManager.beginDelayedTransition;
@@ -46,6 +48,7 @@ public class HotspotIntroFragment extends Fragment {
private Button startButton;
private ProgressBar progressBar;
private TextView progressTextView;
private ScrollView scrollView;
private final AbstractConditionManager conditionManager = SDK_INT < 29 ?
new ConditionManager(this, this::onPermissionUpdate) :
@@ -70,6 +73,7 @@ public class HotspotIntroFragment extends Fragment {
startButton = v.findViewById(R.id.startButton);
progressBar = v.findViewById(R.id.progressBar);
progressTextView = v.findViewById(R.id.progressTextView);
scrollView = v.findViewById(R.id.scrollView);
startButton.setOnClickListener(this::onButtonClick);
@@ -82,6 +86,8 @@ public class HotspotIntroFragment extends Fragment {
public void onStart() {
super.onStart();
conditionManager.onStart();
// Scroll down in case the screen is small, so the button is visible
scrollView.post(() -> scrollView.fullScroll(FOCUS_DOWN));
}
private void onButtonClick(View view) {