Fixed
Status Update
Comments
am...@google.com <am...@google.com>
ot...@gmail.com <ot...@gmail.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit b6c7c78f9e7476b468dafe9d5f7dec6794d47f09
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Nov 27 11:16:51 2023
Introduce DecayAnimation in AnchoredDraggable
Decay animation allows more realistic settling of a component. This is performed by now passing a `DecayAnimationSpec` parameter to AnchoredDraggable and using it when animating to the target. The new animation implementation will be added in a chain CL.
Bug: 288084801
Test: Tests will be added in a chain CL
Relnote: This change adds a `decayAnimationSpec` parameter to AnchoredDraggable allowing to use decay animation when settling to one of the anchors. The change also includes renaming the existing `animationSpec` to `snapAnimationSpec` to help understanding the use case of each spec.
Change-Id: I44ccd408d919328fd6504d31d8db59cf1d07de43
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
https://android-review.googlesource.com/2847074
Branch: androidx-main
commit b6c7c78f9e7476b468dafe9d5f7dec6794d47f09
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Nov 27 11:16:51 2023
Introduce DecayAnimation in AnchoredDraggable
Decay animation allows more realistic settling of a component. This is performed by now passing a `DecayAnimationSpec` parameter to AnchoredDraggable and using it when animating to the target. The new animation implementation will be added in a chain CL.
Bug: 288084801
Test: Tests will be added in a chain CL
Relnote: This change adds a `decayAnimationSpec` parameter to AnchoredDraggable allowing to use decay animation when settling to one of the anchors. The change also includes renaming the existing `animationSpec` to `snapAnimationSpec` to help understanding the use case of each spec.
Change-Id: I44ccd408d919328fd6504d31d8db59cf1d07de43
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
[Deleted User] <[Deleted User]> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 365993d1a90c27704b71f6bee042a1749314a4b1
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Tue Nov 28 10:49:56 2023
Add tests for Animation in AnchoredDraggable
Added tests to check for different settling behaviors.
Bug: 288084801
Test: Added tests to verify behavior.
Change-Id: I369b30c69f7c29f676ae0671fef25c38ff3c74cb
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
https://android-review.googlesource.com/2847475
Branch: androidx-main
commit 365993d1a90c27704b71f6bee042a1749314a4b1
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Tue Nov 28 10:49:56 2023
Add tests for Animation in AnchoredDraggable
Added tests to check for different settling behaviors.
Bug: 288084801
Test: Added tests to verify behavior.
Change-Id: I369b30c69f7c29f676ae0671fef25c38ff3c74cb
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
[Deleted User] <[Deleted User]> #4
Project: platform/frameworks/support
Branch: androidx-main
commit ff1a600df5f4d8ae21a75d8e3e0f24d6c5c2faee
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Nov 27 15:51:12 2023
Modify settle function to perform decay animation if possible
When settling, a check will be performed to see if natural decay animation can be used. If not so, a target animation will be used. The consumed velocity is returned to the settle function, which could be used to show an overscroll effect.
Bug: 288084801
Test: Tests will be added in a chain CL.
Relnote: This change introduces a new `animateToWithDecay` function that naturally decays if possible. It takes the target value and the initial velocity. The `animateTo` functions no longer takes a velocity, but passes the available velocity in `lastVelocity` to animation, as it is concerned with reaching the target. If users need to pass a certain velocity for animation, they can use `animateToWithDecay` function.
Change-Id: I465dbd826e3969b784d08c65425f4bbda3de8493
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
https://android-review.googlesource.com/2847576
Branch: androidx-main
commit ff1a600df5f4d8ae21a75d8e3e0f24d6c5c2faee
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Nov 27 15:51:12 2023
Modify settle function to perform decay animation if possible
When settling, a check will be performed to see if natural decay animation can be used. If not so, a target animation will be used. The consumed velocity is returned to the settle function, which could be used to show an overscroll effect.
Bug: 288084801
Test: Tests will be added in a chain CL.
Relnote: This change introduces a new `animateToWithDecay` function that naturally decays if possible. It takes the target value and the initial velocity. The `animateTo` functions no longer takes a velocity, but passes the available velocity in `lastVelocity` to animation, as it is concerned with reaching the target. If users need to pass a certain velocity for animation, they can use `animateToWithDecay` function.
Change-Id: I465dbd826e3969b784d08c65425f4bbda3de8493
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
ma...@gmail.com <ma...@gmail.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 01142ddd5b14eb33e5145c4e72e6619a5c100fe4
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Thu Dec 21 12:34:00 2023
Introduce Overscroll in AnchoredDraggable
Adding overscroll support to AnchoredDraggable by giving the ability to pass a customized overscrollEffect object to AnchoredDraggable.
Bug: 288084801
Relnote: An OverscrollEffect has been introduced to allow for custom overscroll effects in anchoredDraggable. To retrieve the consumed velocity after animation, the consumed velocity is returned from the settle function.
Test: Added tests to verify behavior
Change-Id: I100683fe7473b1e5ff317ab22245a2b0a25bd549
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/AnchoredDraggableDemo.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
A compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableOverscrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
https://android-review.googlesource.com/2888106
Branch: androidx-main
commit 01142ddd5b14eb33e5145c4e72e6619a5c100fe4
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Thu Dec 21 12:34:00 2023
Introduce Overscroll in AnchoredDraggable
Adding overscroll support to AnchoredDraggable by giving the ability to pass a customized overscrollEffect object to AnchoredDraggable.
Bug: 288084801
Relnote: An OverscrollEffect has been introduced to allow for custom overscroll effects in anchoredDraggable. To retrieve the consumed velocity after animation, the consumed velocity is returned from the settle function.
Test: Added tests to verify behavior
Change-Id: I100683fe7473b1e5ff317ab22245a2b0a25bd549
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/AnchoredDraggableDemo.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
A compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableOverscrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
da...@loylap.com <da...@loylap.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 0f071d797bccf7eff2a23e408928ca76640af782
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Nov 29 18:34:09 2023
Migrates AnchoredDraggable to Modifier.Node
Migrates AnchoredDraggable to Modifier.Node. This helps in adding Overscroll effect in AnchoredDraggable.
Bug: 288084801
Test: Added tests to verify behavior
Change-Id: I3f3338cd71763972c4b70f2e06c97e85285b0035
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2D.kt
https://android-review.googlesource.com/2852691
Branch: androidx-main
commit 0f071d797bccf7eff2a23e408928ca76640af782
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Nov 29 18:34:09 2023
Migrates AnchoredDraggable to Modifier.Node
Migrates AnchoredDraggable to Modifier.Node. This helps in adding Overscroll effect in AnchoredDraggable.
Bug: 288084801
Test: Added tests to verify behavior
Change-Id: I3f3338cd71763972c4b70f2e06c97e85285b0035
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2D.kt
am...@google.com <am...@google.com> #7
This issue is marked as fixed, but there is still no replacement for ResistanceConfig
.
How should we properly migrate it?
am...@google.com <am...@google.com> #8
Can we document this / update the migration guide?
lo...@gmail.com <lo...@gmail.com> #9
We need a better documentation about DialogFragments, AppCompatDialogFragment and BottomSheetDialogFragment. It's still unclear which method we should override when extending one of these subclasses. onCreateDialog()? onCreateView(), setupDialog()? And if using onCreateDialog(), which DialogBuilder to use? AlertDialog? Dialog? AppCompatDialog?
Please, fix the docs, it's a bit hard for an experienced developer like me (near 2 years developping daily, at work and at home) to understand the API designers original intention. I can't imagine for a newbie...
Please, fix the docs, it's a bit hard for an experienced developer like me (near 2 years developping daily, at work and at home) to understand the API designers original intention. I can't imagine for a newbie...
ro...@gmail.com <ro...@gmail.com> #10
[Comment deleted]
ro...@gmail.com <ro...@gmail.com> #11
I also got the same result. Also on setting the title using setTitle(), the title appears on the top of the screen and not on the dialog itself. It is only showing a part of my custom view.
or...@gmail.com <or...@gmail.com> #12
In process of pulling in 23.2.0 version of support library and also running in to this issue. Is there any rough estimate on when new version will be released with this fix?
ty...@gmail.com <ty...@gmail.com> #13
Using 23.2.1, my BottomSheetDialog is not fully visible until I drag it up.
ty...@gmail.com <ty...@gmail.com> #14
This my layout file.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android "
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<LinearLayout
android:paddingTop="24dp"
android:id="@+id/action_button_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/recycler_view"
>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray_divider"/>
<Button
android:clickable="true"
android:id="@+id/more_options_button"
style="@style/BigWhiteButton"
android:text="@string/more_options"
android:layout_height="52dp"
/>
</LinearLayout>
</RelativeLayout>
This is how I configure the BottomSheetDialog
@OnClick(R.id.invite_button)
public void onInviteButtonClicked() {
final View view = LayoutInflater.from(getContext()).inflate(R.layout.sharing_options, null);
Button moreSharingOptionsButton = (Button) view.findViewById(R.id.more_options_button);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
GridLayoutManager manager = new GridLayoutManager(getContext(), 3);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(manager);
recyclerView.setAdapter(new SharingOptionsAdapter(getContext(),installedPreferredApps));
moreSharingOptionsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
startActivity(Intent.createChooser(shareIntent, getString(R.string.invite_your_friends)));
}
});
bsd.setContentView(view);
bsd.show();
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<LinearLayout
android:paddingTop="24dp"
android:id="@+id/action_button_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/recycler_view"
>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray_divider"/>
<Button
android:clickable="true"
android:id="@+id/more_options_button"
style="@style/BigWhiteButton"
android:text="@string/more_options"
android:layout_height="52dp"
/>
</LinearLayout>
</RelativeLayout>
This is how I configure the BottomSheetDialog
@OnClick(R.id.invite_button)
public void onInviteButtonClicked() {
final View view = LayoutInflater.from(getContext()).inflate(R.layout.sharing_options, null);
Button moreSharingOptionsButton = (Button) view.findViewById(R.id.more_options_button);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
GridLayoutManager manager = new GridLayoutManager(getContext(), 3);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(manager);
recyclerView.setAdapter(new SharingOptionsAdapter(getContext(),installedPreferredApps));
moreSharingOptionsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
startActivity(Intent.createChooser(shareIntent, getString(R.string.invite_your_friends)));
}
});
bsd.setContentView(view);
bsd.show();
}
ul...@gmail.com <ul...@gmail.com> #15
Try following workaround (with support library v23.2.0):
public class CustomBottomSheetDialog extends BottomSheetDialog {
public CustomBottomSheetDialog(final Context context) {
super(context);
}
public CustomBottomSheetDialog(final Context context, final int theme) {
super(context, theme);
}
protected CustomBottomSheetDialog(final Context context, final boolean cancelable, final OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}
@Override
public void show() {
final View sheetView = findViewById(R.id.design_bottom_sheet);
final CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) sheetView.getLayoutParams();
final BottomSheetBehavior behavior = (BottomSheetBehavior) layoutParams.getBehavior();
super.show();
sheetView.post(new Runnable() {
@Override
public void run() {
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
});
}
}
public class CustomBottomSheetDialog extends BottomSheetDialog {
public CustomBottomSheetDialog(final Context context) {
super(context);
}
public CustomBottomSheetDialog(final Context context, final int theme) {
super(context, theme);
}
protected CustomBottomSheetDialog(final Context context, final boolean cancelable, final OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}
@Override
public void show() {
final View sheetView = findViewById(R.id.design_bottom_sheet);
final CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) sheetView.getLayoutParams();
final BottomSheetBehavior behavior = (BottomSheetBehavior) layoutParams.getBehavior();
super.show();
sheetView.post(new Runnable() {
@Override
public void run() {
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
});
}
}
[Deleted User] <[Deleted User]> #16
This previous solution fails with "java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference" because "mViewRef" in "BottomSheetBehaviour" is null.
Is there any way to set initial state of BottomSheetDialog to "BottomSheetBehavior.STATE_EXPANDED" ?
No hack worked for me so far, and I tried pretty much every one I found.
Is there any way to set initial state of BottomSheetDialog to "BottomSheetBehavior.STATE_EXPANDED" ?
No hack worked for me so far, and I tried pretty much every one I found.
ng...@gmail.com <ng...@gmail.com> #17
This is what's working for me (23.2.0):
public class ExpandedBottomSheetDialog extends BottomSheetDialog {
public ExpandedBottomSheetDialog(@NonNull Context context) {
super(context);
}
protected ExpandedBottomSheetDialog(@NonNull Context context, boolean cancelable, OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}
public ExpandedBottomSheetDialog(@NonNull Context context, @StyleRes int theme) {
super(context, theme);
}
@Override
public void show() {
super.show();
View view = findViewById(R.id.design_bottom_sheet);
view.post (() -> {
BottomSheetBehavior behavior = BottomSheetBehavior.from(view);
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
});
}
}
public class ExpandedBottomSheetDialogFragment extends BottomSheetDialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new ExpandedBottomSheetDialog(getActivity(), getTheme());
}
}
public class ExpandedBottomSheetDialog extends BottomSheetDialog {
public ExpandedBottomSheetDialog(@NonNull Context context) {
super(context);
}
protected ExpandedBottomSheetDialog(@NonNull Context context, boolean cancelable, OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}
public ExpandedBottomSheetDialog(@NonNull Context context, @StyleRes int theme) {
super(context, theme);
}
@Override
public void show() {
super.show();
View view = findViewById(R.id.design_bottom_sheet);
BottomSheetBehavior behavior = BottomSheetBehavior.from(view);
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
});
}
}
public class ExpandedBottomSheetDialogFragment extends BottomSheetDialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new ExpandedBottomSheetDialog(getActivity(), getTheme());
}
}
ra...@gmail.com <ra...@gmail.com> #18
Same issue found.
ar...@gmail.com <ar...@gmail.com> #19
I tried https://code.google.com/p/android/issues/detail?id=201793#c18 and it worked actually. But it has a drawback. When you change something in the bottom sheet when user is interacting, the bottom sheet is not redrawn.
sw...@gmail.com <sw...@gmail.com> #20
public class ExpandedBottomSheetDialog extends BottomSheetDialog {
public ExpandedBottomSheetDialog(@NonNull Context context) {
super(context);
}
protected ExpandedBottomSheetDialog(@NonNull Context context, boolean cancelable, OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}
public ExpandedBottomSheetDialog(@NonNull Context context, @StyleRes int theme) {
super(context, theme);
}
@Override
public void show() {
super.show();
final View view = findViewById(R.id.design_bottom_sheet);
view.post (new Runnable() {
@Override
public void run() {
BottomSheetBehavior behavior = BottomSheetBehavior.from(view);
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
});
}
}
this is the actual code that helped me
public ExpandedBottomSheetDialog(@NonNull Context context) {
super(context);
}
protected ExpandedBottomSheetDialog(@NonNull Context context, boolean cancelable, OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}
public ExpandedBottomSheetDialog(@NonNull Context context, @StyleRes int theme) {
super(context, theme);
}
@Override
public void show() {
super.show();
final View view = findViewById(R.id.design_bottom_sheet);
@Override
public void run() {
BottomSheetBehavior behavior = BottomSheetBehavior.from(view);
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
});
}
}
this is the actual code that helped me
me...@gmail.com <me...@gmail.com> #21
The issues can still be reproduced in material:1.0.0 - in ladscape tablet, you don't get it fully opened, user needs to drag it up.
ng...@gmail.com <ng...@gmail.com> #22
error: package android.support.design.widget does not exist
import android.support.design.widget.BottomSheetDialog;
import android.support.design.widget.BottomSheetDialog;
Description
"While BottomSheetBehavior captures the persistent bottom sheet case, this release also provides a BottomSheetDialog and BottomSheetDialogFragment to fill the modal bottom sheets use case. Simply replace AppCompatDialog or AppCompatDialogFragment with their bottom sheet equivalents to have your dialog styled as a bottom sheet."
So I changed my AppCompatDialog to BottomSheetDialog:
package my.package.ui.dialog;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.design.widget.BottomSheetDialog;
import my.package.R;
public class AccountActionsDialog extends BottomSheetDialog {
public AccountActionsDialog(Context context) {
super(context);
if (context instanceof Activity) {
setOwnerActivity((Activity) context);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(getLayoutInflater().inflate(R.layout.dialog_account_actions, null));
}
}
Here is my layout file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ff0000"
android:padding="16dp"
android:text="Delete account"
android:textColor="#ffffff" />
</LinearLayout>
Then I use the following code in my Activity:
new AccountActionsDialog(this).show();
My screen becomes dimmed but the content of my dialog is not visible. It works fine when I use AppCompatDialog instead.
I've attached a sample project which demonstrates this behavior.
Device: Nexus 5X