Git Product home page Git Product logo

expandable-layout's People

Contributors

chuross avatar kibotu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

expandable-layout's Issues

Unable to set dynamic layout in your ExpandableLayout on runtime.

I am unable to set dynamic layout in your ExpandableLayout. Please send some thing so that I can implement it.

                        LinearLayout lllistcontener = (LinearLayout) view.findViewById(R.id.lllistcontener);
                        lllistcontener.removeAllViews();
                        LinearLayout parent = new LinearLayout(view.getContext());
                        parent.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
                        parent.setOrientation(LinearLayout.HORIZONTAL);

                        //children of parent linearlayout

                        ImageView iv = new ImageView(view.getContext());
                        iv.setBackgroundResource(R.drawable.prson);
                        LinearLayout layout2 = new LinearLayout(view.getContext());
                        layout2.setBackgroundColor(Color.parseColor("#d3d3d3"));
                        layout2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
                        parent.setOrientation(LinearLayout.VERTICAL);
                        parent.addView(iv);
                        parent.addView(layout2);
                        //children of layout2 LinearLayout
                        TextView tv1 = new TextView(view.getContext());
                        tv1.setText("Sadadasdasd");
                        TextView tv2 = new TextView(view.getContext());
                        tv2.setText("Sadadasdasd");
                        TextView tv3 = new TextView(view.getContext());
                        tv3.setText("Sadadasdasd");
                        TextView tv4 = new TextView(view.getContext());
                        tv4.setText("Sadadasdasd");
                        layout2.addView(tv1);
                        layout2.addView(tv2);
                        layout2.addView(tv3);
                        layout2.addView(tv4);
                        lllistcontener.removeAllViews();
                        lllistcontener.addView(layout2);
                       /* ViewGroup.LayoutParams params = subcommentlist.getLayoutParams();
                        params.height = 800;
                        subcommentlist.setLayoutParams(params);
                        subcommentlist.requestLayout();*/
                        expandableLayout.setCollapseHeight(300);
                        expandableLayout.expand();
                        expandMap.put(position, true); 

Does not show dynamic views on first expand

On first expand, the expandable layout does not show anything but after next click it will show the view.

Sample Code

`
ArrayList categorySubItemModels =
categoryMainItemModel.getCategorySubItemModelList();
subCategoryButtons = new ArrayList<>();
for (int i = 0; i < categorySubItemModels.size(); i++) {
CategorySubItemModel categorySub = categorySubItemModels.get(i);

LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
AppCompatButton button = (AppCompatButton) layoutInflater.inflate(R.layout.row_category_button_item, null);

ConstraintLayout.LayoutParams lp = new ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.WRAP_CONTENT, ConstraintLayout.LayoutParams.WRAP_CONTENT);
int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,8,context.getResources().getDisplayMetrics());
lp.setMargins(0, 0, margin, margin);
button.setLayoutParams(lp);

button.setTag("tagSubButton" + i);
button.setText(categorySub.getSubCategoryName());

button.setOnClickListener(v -> {
    clearActivatedSubCategoryBtn();
    v.setActivated(true);
    if (categorySub.getSubSubCategoryNameList() != null){
        tvSubTitle.setText(categorySub.getSubCategoryName());
        flSubSubCategoryBtnContainer.removeAllViews();
        subSubCategoryButtons = new ArrayList<>();

        for (int x = 0; x < categorySub.getSubSubCategoryNameList().size(); x++){
            String subSubCategoryName = categorySub.getSubSubCategoryNameList().get(x);

            LayoutInflater layoutInflaterSub = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            AppCompatButton buttonSub = (AppCompatButton) layoutInflaterSub.inflate(R.layout.row_category_button_item, null);

            ConstraintLayout.LayoutParams lpSub = new ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.WRAP_CONTENT, ConstraintLayout.LayoutParams.WRAP_CONTENT);
            int marginSub = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,8,context.getResources().getDisplayMetrics());
            lpSub.setMargins(0, 0, marginSub, marginSub);
            buttonSub.setLayoutParams(lpSub);

            buttonSub.setTag("tagSubSubButton" + x);
            buttonSub.setText(subSubCategoryName);

            buttonSub.setOnClickListener(v2 -> {
                clearActivatedSubSubCategoryBtn();
                v2.setActivated(true);
            });

            flSubSubCategoryBtnContainer.addView(buttonSub);
            subSubCategoryButtons.add(buttonSub);
        }
        elSubSubCategoryContainer.expand();
    }
});

flSubCategoryBtnContainer.addView(button);
subCategoryButtons.add(button);

}`

weird scrolling on creating view

i have a recyclerview that contains a list of expandable-layouts which contain each another recyclerview

and when i create the fragment it scrolls automatically:

https://imgur.com/9l0nZZK

i have set the recyclerviews to fixed size and removed all animators/animations still this happens

weirdly it happens only in release builds, in debug builds everything works perfectly fine, i'm using latest support library 27.1.0, build tools 27.0.3, gradle build tools 3.1.0, kotlin 1.2.31

any idea how i can fix this?

any help is highly appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.