diff --git a/briar-android/artwork/transfer_data.svg b/briar-android/artwork/transfer_data.svg new file mode 100644 index 000000000..af653ac7e --- /dev/null +++ b/briar-android/artwork/transfer_data.svg @@ -0,0 +1,35 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/briar-android/artwork/transfer_data_receive.svg b/briar-android/artwork/transfer_data_receive.svg new file mode 100644 index 000000000..2280b7453 --- /dev/null +++ b/briar-android/artwork/transfer_data_receive.svg @@ -0,0 +1,36 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/briar-android/artwork/transfer_data_send.svg b/briar-android/artwork/transfer_data_send.svg new file mode 100644 index 000000000..4cbdb88f9 --- /dev/null +++ b/briar-android/artwork/transfer_data_send.svg @@ -0,0 +1,37 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/briar-android/src/main/java/org/briarproject/briar/android/fragment/FinalFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/fragment/FinalFragment.java index d95bc7a46..0cb4b4a8a 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/fragment/FinalFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/fragment/FinalFragment.java @@ -7,6 +7,7 @@ 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; @@ -23,6 +24,8 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.core.widget.ImageViewCompat; import androidx.fragment.app.Fragment; +import static android.view.View.FOCUS_DOWN; + /** * A fragment to be used at the end of a user flow * where the user should not have the option to go back. @@ -55,6 +58,7 @@ public class FinalFragment extends Fragment { return f; } + private ScrollView scrollView; protected Button buttonView; @Nullable @@ -65,6 +69,7 @@ public class FinalFragment extends Fragment { View v = inflater .inflate(R.layout.fragment_final, container, false); + scrollView = (ScrollView) v; ImageView iconView = v.findViewById(R.id.iconView); TextView titleView = v.findViewById(R.id.titleView); TextView textView = v.findViewById(R.id.textView); @@ -97,6 +102,13 @@ public class FinalFragment extends Fragment { return v; } + @Override + public void onStart() { + super.onStart(); + // Scroll down in case the screen is small, so the button is visible + scrollView.post(() -> scrollView.fullScroll(FOCUS_DOWN)); + } + /** * This is the action that the system back button * and the button at the bottom will perform. diff --git a/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/ChooserFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/ChooserFragment.java index 01c19a8de..d4aa38173 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/ChooserFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/ChooserFragment.java @@ -6,6 +6,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.ScrollView; import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault; import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault; @@ -18,6 +19,7 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.lifecycle.ViewModelProvider; +import static android.view.View.FOCUS_DOWN; import static org.briarproject.briar.android.AppModule.getAndroidComponent; @MethodsNotNullByDefault @@ -30,6 +32,7 @@ public class ChooserFragment extends Fragment { ViewModelProvider.Factory viewModelFactory; private RemovableDriveViewModel viewModel; + private ScrollView scrollView; @Override public void onAttach(Context context) { @@ -47,6 +50,7 @@ public class ChooserFragment extends Fragment { View v = inflater.inflate(R.layout.fragment_transfer_data_chooser, container, false); + scrollView = (ScrollView) v; Button sendButton = v.findViewById(R.id.sendButton); sendButton.setOnClickListener(i -> viewModel.startSendData()); @@ -65,6 +69,9 @@ public class ChooserFragment extends Fragment { // we can't come back here now to start another task // as we only support one per ViewModel instance requireActivity().supportFinishAfterTransition(); + } else { + // Scroll down in case the screen is small, so the button is visible + scrollView.post(() -> scrollView.fullScroll(FOCUS_DOWN)); } } 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 26df80ed3..76db99280 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,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ProgressBar; -import android.widget.TextView; +import android.widget.ScrollView; import android.widget.Toast; import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault; @@ -24,6 +24,7 @@ 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; @@ -41,10 +42,10 @@ public class ReceiveFragment extends Fragment { @Inject ViewModelProvider.Factory viewModelFactory; - RemovableDriveViewModel viewModel; - TextView introTextView; - Button button; - ProgressBar progressBar; + private RemovableDriveViewModel viewModel; + private ScrollView scrollView; + private Button button; + private ProgressBar progressBar; @Override public void onAttach(Context context) { @@ -62,7 +63,7 @@ public class ReceiveFragment extends Fragment { View v = inflater.inflate(R.layout.fragment_transfer_data_receive, container, false); - introTextView = v.findViewById(R.id.introTextView); + scrollView = (ScrollView) v; progressBar = v.findViewById(R.id.progressBar); button = v.findViewById(R.id.fileButton); button.setOnClickListener(view -> @@ -79,6 +80,8 @@ 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)); } private void onOldTaskResumed(boolean resumed) { diff --git a/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/SendFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/SendFragment.java index 53a478235..22ab9c895 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/SendFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/removabledrive/SendFragment.java @@ -8,6 +8,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 android.widget.Toast; @@ -26,6 +27,7 @@ import androidx.fragment.app.FragmentActivity; import androidx.lifecycle.ViewModelProvider; import static android.os.Build.VERSION.SDK_INT; +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; @@ -43,10 +45,11 @@ public class SendFragment extends Fragment { @Inject ViewModelProvider.Factory viewModelFactory; - RemovableDriveViewModel viewModel; - TextView introTextView; - Button button; - ProgressBar progressBar; + private RemovableDriveViewModel viewModel; + private ScrollView scrollView; + private TextView introTextView; + private Button button; + private ProgressBar progressBar; @Override public void onAttach(Context context) { @@ -64,6 +67,7 @@ public class SendFragment extends Fragment { View v = inflater.inflate(R.layout.fragment_transfer_data_send, container, false); + scrollView = (ScrollView) v; introTextView = v.findViewById(R.id.introTextView); progressBar = v.findViewById(R.id.progressBar); button = v.findViewById(R.id.fileButton); @@ -83,6 +87,8 @@ public class SendFragment extends Fragment { public void onStart() { super.onStart(); requireActivity().setTitle(R.string.removable_drive_title_send); + // Scroll down in case the screen is small, so the button is visible + scrollView.post(() -> scrollView.fullScroll(FOCUS_DOWN)); } private void onOldTaskResumed(boolean resumed) { diff --git a/briar-android/src/main/res/drawable/ic_arrow_forward.xml b/briar-android/src/main/res/drawable/ic_arrow_forward.xml deleted file mode 100644 index bfd99a659..000000000 --- a/briar-android/src/main/res/drawable/ic_arrow_forward.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/briar-android/src/main/res/drawable/ic_flash_drive.xml b/briar-android/src/main/res/drawable/ic_flash_drive.xml deleted file mode 100644 index 78bb75e71..000000000 --- a/briar-android/src/main/res/drawable/ic_flash_drive.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/briar-android/src/main/res/drawable/ic_phone_android.xml b/briar-android/src/main/res/drawable/ic_phone_android.xml deleted file mode 100644 index d22dd9941..000000000 --- a/briar-android/src/main/res/drawable/ic_phone_android.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - 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 new file mode 100644 index 000000000..87d43457f --- /dev/null +++ b/briar-android/src/main/res/drawable/ic_transfer_data_receive.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/briar-android/src/main/res/drawable/ic_transfer_data_send.xml b/briar-android/src/main/res/drawable/ic_transfer_data_send.xml new file mode 100644 index 000000000..59b6f35ba --- /dev/null +++ b/briar-android/src/main/res/drawable/ic_transfer_data_send.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/briar-android/src/main/res/layout/fragment_final.xml b/briar-android/src/main/res/layout/fragment_final.xml index c821d2ba2..1139a6ab6 100644 --- a/briar-android/src/main/res/layout/fragment_final.xml +++ b/briar-android/src/main/res/layout/fragment_final.xml @@ -1,66 +1,73 @@ - + android:layout_height="match_parent" + android:fillViewport="true"> - + - + - + -