Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set/Remove padding, shadow etc #26

Closed
bhapps opened this issue Mar 3, 2017 · 8 comments
Closed

Set/Remove padding, shadow etc #26

bhapps opened this issue Mar 3, 2017 · 8 comments

Comments

@bhapps
Copy link

bhapps commented Mar 3, 2017

Hi @jrvansuita nice librarie.

I wish to see implemented the ability to remove padding from the view.
Cant see where this being set in my app.
Does the about view always stretch full width?
Does padding get added by default?

if not, would like to see something like the below;

AboutBuilder.with(activity)
.setPadding(-10)//padding
.setElevation(1) //shadow
.setMargin(-1) //margin
...
...
build();

@jrvansuita
Copy link
Owner

Thanks my friend. Feel free to help me with this. Try me a pull request, or give me some time to do it.

@bhapps
Copy link
Author

bhapps commented Mar 3, 2017

Thanks for quick response. Will see how I go.
So it does get padding added by default?

Please see main/res/layout/xab_about_layout.xml which has all the padding, margin settings for the libraries I believe

@jrvansuita
Copy link
Owner

Yes, It should be set by the Builder, but it's not. Today, I have it fixed in the layout xml. We need to bring this configurations to java, and set it programmatically.

@bhapps
Copy link
Author

bhapps commented Mar 3, 2017

Yes, It should be set by the Builder, but it's not. Today, I have it fixed in the layout xml. We need to bring this configurations to java, and set it programmatically.

Yes is see this for other .set() - like divider line height etc values done in the java files, which in turn edit the layout xmls as such yeah.

@jrvansuita
Copy link
Owner

ok, will be done for the next couple days. If you are rushed, you can create a pull request.

@bhapps
Copy link
Author

bhapps commented Mar 3, 2017

no, thats ok, just like to see features added to the library which may make this awesome lib even better.

@bhapps
Copy link
Author

bhapps commented Mar 3, 2017

** See Updates **
Was able to remove Margin on the CardView inside the build(); using below
Was able to remove Margin & padding to have view spread full width on the CardView inside the build(); using below

    public void onCreate(Bundle savedInstanceState) {
       //...
      //...

      try {

    CardView layout = (CardView)findViewById(R.id.card_holder);
    CardView.LayoutParams params = new CardView.LayoutParams(CardView.LayoutParams.MATCH_PARENT, CardView.LayoutParams.WRAP_CONTENT);
    params.setMargins(0,0,0,0);

        //updates
        //remove Shadow
        layout.setCardElevation(0);
        //remove radius
        layout.setRadius(0);
        //remove further padding
        layout.setUseCompatPadding(false);
        layout.setMaxCardElevation(0);
        layout.setPreventCornerOverlap(false);


        layout.setLayoutParams(params);

   }catch(Exception error_about) {

         //show my error in the ui
         //log error via error_about

     }
    //...
    //..

}

Should wrap this in try{//the card view}catch(){//error, hide ui stuff, show error}; just incase the card_holder of other elements are not found/exception ...

jrvansuita added a commit that referenced this issue Mar 10, 2017
…ard(false));

#26 - .build() method now, returns an AboutView instance. Use aboutView.getHolder() to set padding, margin, elevation...;
jrvansuita added a commit that referenced this issue Mar 10, 2017
…ard(false));

#26 - .build() method now, returns an AboutView instance. Use aboutView.getHolder() to set padding, margin, elevation...;
#28 - Same as described above;
#30 - Getting instances of links and actions.
@jrvansuita
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants