diff options
author | stefan-niedermann <info@niedermann.it> | 2020-02-25 00:02:43 +0300 |
---|---|---|
committer | stefan-niedermann <info@niedermann.it> | 2020-02-25 00:02:43 +0300 |
commit | 98fae6019cb1dbbd084fa96ddebc74a7d3ed8c90 (patch) | |
tree | 0dff0431e72ee0c887f4f4bde3725518bec0e6cd | |
parent | 75e6adf04eb9bca2ed5abd40aca24bf34ba63de2 (diff) |
Make image viewer background transparent
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/AttachmentDialogFragment.java | 14 | ||||
-rw-r--r-- | app/src/main/res/layout/dialog_attachment.xml | 15 |
2 files changed, 22 insertions, 7 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/AttachmentDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/AttachmentDialogFragment.java index 6aab64f9b..9af253e20 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/AttachmentDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/AttachmentDialogFragment.java @@ -1,16 +1,23 @@ package it.niedermann.nextcloud.deck.ui.card; import android.app.Dialog; +import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; import android.os.Bundle; +import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.ImageView; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import com.bumptech.glide.Glide; +import java.util.Objects; + import butterknife.BindView; import butterknife.ButterKnife; import it.niedermann.nextcloud.deck.Application; @@ -65,6 +72,13 @@ public class AttachmentDialogFragment extends DialogFragment { .create(); } + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + Objects.requireNonNull(requireDialog().getWindow()).setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); + return super.onCreateView(inflater, container, savedInstanceState); + } + public static AttachmentDialogFragment newInstance(@NonNull String url, @NonNull String alt) { Bundle bundle = new Bundle(); bundle.putString(BUNDLE_KEY_URL, url); diff --git a/app/src/main/res/layout/dialog_attachment.xml b/app/src/main/res/layout/dialog_attachment.xml index 46ef65bed..4b3f96008 100644 --- a/app/src/main/res/layout/dialog_attachment.xml +++ b/app/src/main/res/layout/dialog_attachment.xml @@ -3,15 +3,16 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"> - <ImageView + <ImageView xmlns:tools="http://schemas.android.com/tools" android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:contentDescription="@null" /> + android:contentDescription="@null" + tools:src="@drawable/ic_image_grey600_24dp" /> -<!-- <ProgressBar--> -<!-- android:id="@+id/progressBar"--> -<!-- android:visibility="visible"--> -<!-- android:layout_width="wrap_content"--> -<!-- android:layout_height="wrap_content" />--> + <!-- <ProgressBar--> + <!-- android:id="@+id/progressBar"--> + <!-- android:visibility="visible"--> + <!-- android:layout_width="wrap_content"--> + <!-- android:layout_height="wrap_content" />--> </FrameLayout>
\ No newline at end of file |