2 years ago

#30375

test-img

Amir Rahimian

How to implement Bottom sheet that can be Fully expend and have appBar in full view

I want to create a BottomSheet like : BottomSheet picture

and when it scrolled up : fully expend picture

here is the way i tried :

package com.amir.todone.fragments;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.amir.todone.R;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;

public class AddTaskBottomDialog extends BottomSheetDialogFragment  {
    public static AddTaskBottomDialog newInstance() {
        return new AddTaskBottomDialog();
    }
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.new_task_bottomsheet_layout,container,false);
        return v;
    }
}

and to show it :

ddTaskBottomDialog taskBottomDialog = AddTaskBottomDialog.newInstance();
        taskBottomDialog.show(getSupportFragmentManager(),"add_task_dialog_fragment");

Bottom sheet dialog fragment , result

but its not working like that . i want it to expand complete with app bar

I would really appreciate if someone could help me out with it.

android

android-bottomsheetdialog

0 Answers

Your Answer

Accepted video resources