jrvansuita / MaterialAbout

🔖 It's a material-design about screen to use on your Android apps. A developer profile and application information easy to integrate.
MIT License
1.53k stars 208 forks source link

cant install help plz #79

Closed Photogad closed 2 years ago

Photogad commented 6 years ago

cant install help plz

i put code in my app button onclick like in the tutorial

    AboutView view = AboutBuilder.with(this)
                 .setPhoto(R.mipmap.profile_picture)
                 .setCover(R.mipmap.profile_cover)
                 .setName("Your Full Name")
                 .setSubTitle("Mobile Developer")
                 .setBrief("I'm warmed of mobile technologies. Ideas maker, curious and nature lover.")
                 .setAppIcon(R.mipmap.ic_launcher)
                 .setAppName(R.string.app_name)
                 .addGooglePlayStoreLink("8002078663318221363")
                 .addGitHubLink("user")
                 .addFacebookLink("user")
                 .addFiveStarsAction()
                 .setVersionNameAsAppSubTitle()
                 .addShareAction(R.string.app_name)
                 .setWrapScrollView(true)
                 .setLinksAnimated(true)
                 .setShowAsCard(true)
                 .build();

    addContentView(view, layoutParams);

but i get error -- layoutParams is red. what do i do with layoutparams?

maestrovsmaster commented 5 years ago

I have this problem too public class AboutAppActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

    ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT);

    AboutView view = AboutBuilder.with(this)
            .setPhoto(R.mipmap.profile_picture)
            .setCover(R.mipmap.profile_cover)
            .setName("Your Full Name")
            .setSubTitle("Mobile Developer")
            .setBrief("I'm warmed of mobile technologies. Ideas maker, curious and nature lover.")
            .setAppIcon(R.mipmap.ic_launcher)
            .setAppName(R.string.app_name)
            .addGooglePlayStoreLink("8002078663318221363")
            .addGitHubLink("user")
            .addFacebookLink("user")
            .addFiveStarsAction()
            .setVersionNameAsAppSubTitle()
            .addShareAction(R.string.app_name)
            .setWrapScrollView(true)
            .setLinksAnimated(true)
            .setShowAsCard(true)
            .build();

   // addContentView(view, layoutParams);
}

}

android.view.InflateException: Binary XML file line #36: Binary XML file line #36: You must supply a layout_width attribute.

richard-muvirimi commented 3 years ago

@Photogad and @maestrovsmaster you can optionally skip the layout parameters and load directly with

setContentView(new AboutBuilder.with(requireActivity()).build());

or create a layout file and manually add

layout.addView(new AboutBuilder.with(requireActivity()).build());

or use a fragment and return about view in onCreateView

public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    return new AboutBuilder.with(requireActivity()).build();
}

Note you will have to provide your custom options for the about view