@@ -0,0 +1,3470 @@
+/*%0A * Copyright 2016 Michael Bel%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.app.application.ui;%0A%0Aimport android.os.Bundle;%0Aimport android.support.v4.app.Fragment;%0Aimport android.view.Gravity;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.Button;%0Aimport android.widget.FrameLayout;%0Aimport android.widget.Toast;%0A%0Aimport org.app.application.R;%0Aimport org.app.material.widget.BottomPickerLayout;%0Aimport org.app.material.widget.LayoutHelper;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class BottomsFragment extends Fragment implements View.OnClickListener %7B%0A%0A    private Button mButton1;%0A    private Button mButton2;%0A    private Button mButton3;%0A    private List%3CButton%3E buttons = new ArrayList%3C%3E();%0A%0A    private boolean plVisible = false;%0A%0A    private BottomPickerLayout pickerLayout;%0A%0A    @Override%0A    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) %7B%0A        FrameLayout layout = new FrameLayout(getActivity());%0A        layout.setBackgroundColor(0xFFECEFF1);%0A%0A        mButton1 = new Button(getActivity());%0A        mButton1.setText(R.string.BottomPickerLayout);%0A        layout.addView(mButton1);%0A%0A        mButton2 = new Button(getActivity());%0A        mButton2.setText(%22%22);%0A        //layout.addView(mButton2);%0A%0A        mButton3 = new Button(getActivity());%0A        mButton3.setText(%22%22);%0A        //layout.addView(mButton3);%0A%0A        buttons.add(mButton1);%0A        buttons.add(mButton2);%0A        buttons.add(mButton3);%0A%0A        for (Button button : buttons) %7B%0A            button.setOnClickListener(this);%0A            button.setLayoutParams(LayoutHelper.makeFrame(getActivity(), LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL));%0A        %7D%0A%0A        pickerLayout = new BottomPickerLayout(getActivity());%0A        pickerLayout.setLayoutParams(LayoutHelper.makeFrame(getActivity(), LayoutHelper.MATCH_PARENT, 48, Gravity.BOTTOM));%0A        pickerLayout.setPositiveButton(R.string.Done, new BottomPickerLayout.ClickListener() %7B%0A            @Override%0A            public void onClick(View v) %7B%0A                Toast.makeText(getActivity(), %22Cancel%22, Toast.LENGTH_SHORT).show();%0A            %7D%0A        %7D);%0A        pickerLayout.setNegativeButton(R.string.Cancel, new BottomPickerLayout.ClickListener() %7B%0A            @Override%0A            public void onClick(View v) %7B%0A                Toast.makeText(getActivity(), %22Done%22, Toast.LENGTH_SHORT).show();%0A            %7D%0A        %7D);%0A%0A        layout.addView(pickerLayout);%0A        return layout;%0A    %7D%0A%0A    @Override%0A    public void onClick(View v) %7B%0A        if (v == mButton1) %7B%0A            plVisible = !plVisible;%0A%0A            if (plVisible) %7B%0A                pickerLayout.hide();%0A            %7D else %7B%0A                pickerLayout.show();%0A            %7D%0A        %7D else if (v == mButton2) %7B%0A%0A        %7D else if (v == mButton3) %7B%0A%0A        %7D%0A    %7D%0A%7D

Update demo app