mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 02:38:58 +03:00
Merge pull request #12877 from nextcloud/showSnackAboveFAB
Show snackbar above FAB
This commit is contained in:
commit
20cabd4aab
4 changed files with 23 additions and 1 deletions
8
.github/workflows/screenShotTest.yml
vendored
8
.github/workflows/screenShotTest.yml
vendored
|
@ -17,7 +17,7 @@ concurrency:
|
|||
|
||||
jobs:
|
||||
screenshot:
|
||||
runs-on: macOS-latest
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
@ -48,6 +48,12 @@ jobs:
|
|||
distribution: "temurin"
|
||||
java-version: 17
|
||||
|
||||
- name: Enable KVM group perms
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
|
||||
- name: create AVD and generate snapshot for caching
|
||||
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 31 KiB |
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
@ -650,10 +650,22 @@ public final class DisplayUtils {
|
|||
*/
|
||||
public static Snackbar showSnackMessage(Activity activity, String message) {
|
||||
final Snackbar snackbar = Snackbar.make(activity.findViewById(android.R.id.content), message, Snackbar.LENGTH_LONG);
|
||||
var fab = findFABView(activity);
|
||||
if (fab != null && fab.getVisibility() == View.VISIBLE) {
|
||||
snackbar.setAnchorView(fab);
|
||||
}
|
||||
snackbar.show();
|
||||
return snackbar;
|
||||
}
|
||||
|
||||
private static View findFABView(Activity activity) {
|
||||
return activity.findViewById(R.id.fab_main);
|
||||
}
|
||||
|
||||
private static View findFABView(View view) {
|
||||
return view.findViewById(R.id.fab_main);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a temporary message in a {@link Snackbar} bound to the given view.
|
||||
*
|
||||
|
@ -663,6 +675,10 @@ public final class DisplayUtils {
|
|||
*/
|
||||
public static Snackbar showSnackMessage(View view, @StringRes int messageResource) {
|
||||
final Snackbar snackbar = Snackbar.make(view, messageResource, Snackbar.LENGTH_LONG);
|
||||
var fab = findFABView(view.getRootView());
|
||||
if (fab != null && fab.getVisibility() == View.VISIBLE) {
|
||||
snackbar.setAnchorView(fab);
|
||||
}
|
||||
snackbar.show();
|
||||
return snackbar;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue