开源软件名称(OpenSource Name):Yellow5A5/Material-Design-Login开源软件地址(OpenSource Url):https://github.com/Yellow5A5/Material-Design-Login开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Material-Design-loginThis is a Material-Design-login Demo. You can set the state(Sign-Up or Login) by slip events in this demo, or you can create other animations when the progress callback. How To ImplementsCatchScrollLayoutCatchScrollLayout is responsible for monitoring external sliding events. You can set the area of monitored by setting the height of CatchScrollLayout (“match_parent” usually). <yellow5a5.materialdesignlogin.View.CatchScrollLayout
android:id="@+id/catch_sroll_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:clickable="true">
<!--add the view like this-->
<yellow5a5.materialdesignlogin.View.SignUpContainer
android:id="@+id/sign_up_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</yellow5a5.materialdesignlogin.View.CatchScrollLayout> Set the IScrollCallBack do anything you want. private IScrollCallBack mIScrollCallBack;
public interface IScrollCallBack {
void onScrollProcess(int process, boolean isLeft);
}
public void setIScrollCallBack(IScrollCallBack l) {
mIScrollCallBack = l;
} UnderlineDeviderYou can change the number of segments by UnderlineDevider. Set it in xml (app:devide_count) or call the method (setDevider). UnderlineDevider is independent, you can use it in any other place. <yellow5a5.materialdesignlogin.View.UnderlineDevider
android:id="@+id/underline_v"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_gravity="bottom"
app:devide_color="#ffffff"
app:devide_count="2" /> Demo-IntroductionThis design ideas come from Material Design Sign Up / Login (by Dhanish). You can set the state(Sign-Up or Login) by slip events. SignUpContainer should contains the logic of logining and registering. It's easy to add other task you wanted or change the method in callback. mCatchScrollLayout.setIScrollCallBack(new CatchScrollLayout.IScrollCallBack() {
@Override
public void onScrollProcess(int process, boolean isLeft) {
if (!isLeft){
process = 100 - process;
}
mSignUpContainer.setAnimProportion(process);
}
});
mSignUpContainer.setIConfirmCallBack(new SignUpContainer.IConfirmCallBack() {
@Override
public void goNext() {
//TODO
}
}); License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论