-2

Is it possible to create Material Design views (like button, textView, ...) programmatically? like

    AwesomeButton btnTest=new AwesomeButton (context);

i want full featured library like rey5137 but without XML usage and support old android(maybe Android 2.3 and up).

Edric
  • 18,215
  • 11
  • 68
  • 81
Dr. chamran
  • 518
  • 4
  • 11
  • I found answer in "Nicolas Tyler" post from [this](http://stackoverflow.com/questions/26604134/how-to-achieve-ripple-animation-using-support-library) page. – Dr. chamran Feb 14 '16 at 13:38

1 Answers1

0

material design is all about different combinations of items in xml. you cannot design without xml. it is not java swing don't forget, whatever you want to design their base should be on drawable or layout folder, not on java code

update for the edited question

in your example, you say AwesomeButton, in order to have something like this, you need to have a library, which also has xml design file including all those fancy visual effects. If you don't design how are you supposed to create a pre-designed button.

chamran, you are making it complicated my friend, you can't design a button via code, you have to have a xml file for your own custom materials. Even the default button has a xml.

  • can i inflate drawable in code? how can i use drawable to create material ( button for example) ? – Dr. chamran Feb 14 '16 at 09:26
  • you can inflate an xml to a view, and that's done via getView method for example. But again, can't do anything without having xml. that's the answer –  Feb 14 '16 at 09:38