Skip to content Skip to sidebar Skip to footer

Android Floating Profile Image Outside Fragment/activity In Xml

I am trying to build a profile ui such that the user image is just outside/floating on top of the remaining content like in this image. I have used a bottom sheet dialog fragment

Solution 1:

Take the answer: Add to your style this:

<stylename="CustomBottomSheetDialogTheme"parent="Theme.Design.Light.BottomSheetDialog"><itemname="bottomSheetStyle">@style/CustomBottomSheetStyle</item></style><stylename="CustomBottomSheetStyle"parent="Widget.Design.BottomSheet.Modal"><itemname="android:background">@android:color/transparent</item></style>

and to your java class CustomDialogFragment extends BottomSheetDialogFragment this:

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setStyle(BottomSheetDialogFragment.STYLE_NORMAL, R.style.CustomBottomSheetDialogTheme);
}

Post a Comment for "Android Floating Profile Image Outside Fragment/activity In Xml"