Extension help required with layouts

Hey, Everyone I very much confused while creating extensions. Actually I have learnt java and android studio but when I use to make extension which work with UI it make confused very much. Earlier I was having problem which was solved by great extension developer. But know I was working on creating an sidebar (custom one) using java and making extension.

*But It make me confused that how I can make a view(sidebar) with the help of java code *.
If I have done any mistake. I apologise for it.

First of all you must change category…
And this can only be solved by some extension developer…
Also show what you have tried…

Soory, But I have not even clue to make view (sidebar custom one) using java.

Have you tried anything so far? If yes, please specify.

@Shreyash

Soory, But I know that no one is goona help out if I have not tried anything actually I searched a lot and even read your article about making extensions it helped if I have not to work with UI.
Actually I am stuck on the first place on how to make views(Like sidebar) which works with UI.
I would have done something but now I not even starting clue. If you have free time can you provide me that starting clue.

You’ll have to use a DrawerLayout to create a navigation drawer. I’m not going to show you how to create it, but here’s an example of how to create a LinearLayout programmatically:

// Creating a Linear Layout
LinearLayout linearLayout = new LinearLayout(context);

// Setting layout params for the newly created Linear Layout
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
linearLayout.setOrientation(LinearLayout.HORIZONTAL);

// Adding it to some parent view
someParentView.addView(linearLayout);

Note: This is just an example showing how to create views programmatically. The code is totally untested and may or may not work.

4 Likes

Thanks, for helping me