From f4dd3c4f061c0b6591ce2b0e246fb311d4ea8686 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 27 Sep 2022 15:37:57 -0300 Subject: [PATCH] Replace illustration for receiving data from removable drive --- .../artwork/il_transfer_data_receive.svg | 47 +++++++ .../il_transfer_data_receive_night.svg | 47 +++++++ .../artwork/transfer_data_receive.svg | 36 ----- .../removabledrive/ReceiveFragment.java | 8 +- .../il_transfer_data_receive.xml | 109 ++++++++++++++++ .../res/drawable/ic_transfer_data_receive.xml | 15 --- .../res/drawable/il_transfer_data_receive.xml | 109 ++++++++++++++++ .../layout/fragment_transfer_data_receive.xml | 123 +++++++++--------- 8 files changed, 379 insertions(+), 115 deletions(-) create mode 100644 briar-android/artwork/il_transfer_data_receive.svg create mode 100644 briar-android/artwork/il_transfer_data_receive_night.svg delete mode 100644 briar-android/artwork/transfer_data_receive.svg create mode 100644 briar-android/src/main/res/drawable-night/il_transfer_data_receive.xml delete mode 100644 briar-android/src/main/res/drawable/ic_transfer_data_receive.xml create mode 100644 briar-android/src/main/res/drawable/il_transfer_data_receive.xml diff --git a/briar-android/artwork/il_transfer_data_receive.svg b/briar-android/artwork/il_transfer_data_receive.svg new file mode 100644 index 000000000..38a725152 --- /dev/null +++ b/briar-android/artwork/il_transfer_data_receive.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/briar-android/artwork/il_transfer_data_receive_night.svg b/briar-android/artwork/il_transfer_data_receive_night.svg new file mode 100644 index 000000000..4686c69ea --- /dev/null +++ b/briar-android/artwork/il_transfer_data_receive_night.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/briar-android/artwork/transfer_data_receive.svg b/briar-android/artwork/transfer_data_receive.svg deleted file mode 100644 index 2280b7453..000000000 --- a/briar-android/artwork/transfer_data_receive.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/ReceiveFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/ReceiveFragment.java index c927d26ab..b5b022a41 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/ReceiveFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/ReceiveFragment.java @@ -8,7 +8,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ProgressBar; -import android.widget.ScrollView; import android.widget.Toast; import org.briarproject.briar.R; @@ -26,10 +25,10 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.lifecycle.ViewModelProvider; -import static android.view.View.FOCUS_DOWN; import static android.view.View.VISIBLE; import static android.widget.Toast.LENGTH_LONG; import static org.briarproject.briar.android.AppModule.getAndroidComponent; +import static org.briarproject.briar.android.util.UiUtils.hideViewOnSmallScreen; import static org.briarproject.briar.android.util.UiUtils.launchActivityToOpenFile; @RequiresApi(19) @@ -50,7 +49,6 @@ public class ReceiveFragment extends Fragment { ViewModelProvider.Factory viewModelFactory; private RemovableDriveViewModel viewModel; - private ScrollView scrollView; private Button button; private ProgressBar progressBar; @@ -72,7 +70,6 @@ public class ReceiveFragment extends Fragment { View v = inflater.inflate(R.layout.fragment_transfer_data_receive, container, false); - scrollView = (ScrollView) v; progressBar = v.findViewById(R.id.progressBar); button = v.findViewById(R.id.fileButton); button.setOnClickListener(view -> @@ -93,8 +90,7 @@ public class ReceiveFragment extends Fragment { public void onStart() { super.onStart(); requireActivity().setTitle(R.string.removable_drive_title_receive); - // Scroll down in case the screen is small, so the button is visible - scrollView.post(() -> scrollView.fullScroll(FOCUS_DOWN)); + hideViewOnSmallScreen(requireView().findViewById(R.id.imageView)); } @Override diff --git a/briar-android/src/main/res/drawable-night/il_transfer_data_receive.xml b/briar-android/src/main/res/drawable-night/il_transfer_data_receive.xml new file mode 100644 index 000000000..ecaab1575 --- /dev/null +++ b/briar-android/src/main/res/drawable-night/il_transfer_data_receive.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/briar-android/src/main/res/drawable/ic_transfer_data_receive.xml b/briar-android/src/main/res/drawable/ic_transfer_data_receive.xml deleted file mode 100644 index 87d43457f..000000000 --- a/briar-android/src/main/res/drawable/ic_transfer_data_receive.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/briar-android/src/main/res/drawable/il_transfer_data_receive.xml b/briar-android/src/main/res/drawable/il_transfer_data_receive.xml new file mode 100644 index 000000000..a303a0890 --- /dev/null +++ b/briar-android/src/main/res/drawable/il_transfer_data_receive.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/briar-android/src/main/res/layout/fragment_transfer_data_receive.xml b/briar-android/src/main/res/layout/fragment_transfer_data_receive.xml index 71f87ee87..3911756c6 100644 --- a/briar-android/src/main/res/layout/fragment_transfer_data_receive.xml +++ b/briar-android/src/main/res/layout/fragment_transfer_data_receive.xml @@ -1,71 +1,78 @@ - + android:orientation="vertical"> - + android:layout_height="0dp" + android:layout_weight="1"> - + - + - + -