在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):TangoAgency/material-intro-screen开源软件地址(OpenSource Url):https://github.com/TangoAgency/material-intro-screen开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Android Material Intro ScreenMaterial intro screen is inspired by Material Intro and developed with love from scratch. I decided to rewrite completely almost all features in order to make Android intro screen easy to use for everyone and extensible as possible. Features
UsageStep 1:Add gradle dependecy
Step 2:intro activity class needs to extend MaterialIntroActivity:First, yourpublic class IntroActivity extends MaterialIntroActivity Step 3:manifest with defined theme:Add activity to <activity
android:name=".IntroActivity"
android:theme="@style/Theme.Intro" /> Step 4:Add slides: @Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addSlide(new SlideFragmentBuilder()
.backgroundColor(R.color.colorPrimary)
.buttonsColor(R.color.colorAccent)
.possiblePermissions(new String[]{Manifest.permission.CALL_PHONE, Manifest.permission.READ_SMS})
.neededPermissions(new String[]{Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION})
.image(agency.tango.materialintroscreen.R.drawable.ic_next)
.title("title 3")
.description("Description 3")
.build(),
new MessageButtonBehaviour(new View.OnClickListener() {
@Override
public void onClick(View v) {
showMessage("We provide solutions to make you love your work");
}
}, "Work with love"));
} Explanation of SlideFragment usage:
Step 5:Customize Intro Activity:
Customizing view animations:You can set enter, default and exit translation for every view in intro activity. To achive this you need to get translation wrapper for chosen view (for example: getBackButtonTranslationWrapper()
.setEnterTranslation(new IViewTranslation() {
@Override
public void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage) {
view.setAlpha(percentage);
}
}); translation wrappers:Available
Custom slidesOf course you are able to implement completely custom slides. You only need to extend SlideFragment and override following functions:
If you want to use parallax in a fragment please use one of the below views:app:layout_parallaxFactor attribute:And set there the<agency.tango.materialintroscreen.parallax.ParallaxLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:id="@+id/image_slide"
app:layout_parallaxFactor="0.6"/> All features which are not available in simple Slide Fragment are shown here: Custom Slide Things I have used to create this
Getting HelpTo report a specific problem or feature request, open a new issue on Github. CompanyHere you can see open source work developed by Tango Agency. Whether you're searching for a new partner or trusted team for creating your new great product we are always ready to start work with you. You can contact us via [email protected]. Thanks in advance. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论