Răsfoiți Sursa

0.0.40.beta5

kongzue 4 ani în urmă
părinte
comite
a2b48a5b56

+ 0 - 49
DialogX/build.gradle

@@ -1,9 +1,6 @@
 apply plugin: 'com.android.library'
 apply plugin: 'android-maven'
 
-def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
-def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
-
 group = "com.kongzue.dialogx"
 version = BUILD_VERSION
 
@@ -30,36 +27,6 @@ android {
     }
 }
 
-//install {
-//    repositories.mavenInstaller {
-//        // This generates POM.xml with proper parameters
-//        pom {
-//            project {
-//                packaging 'aar'
-//                name 'dialogx'
-//                url siteUrl
-//                licenses {
-//                    license {
-//                        name 'The Apache Software License, Version 2.0'
-//                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
-//                    }
-//                }
-//                developers {
-//                    developer {
-//                        id 'myzchh'//设置自己ID
-//                        name 'myzchh'//设置自己名字
-//                        email 'myzcxhh@live.cn'//设置自己邮箱
-//                    }
-//                }
-//                scm {
-//                    connection gitUrl
-//                    developerConnection gitUrl
-//                    url siteUrl
-//                }
-//            }
-//        }
-//    }
-//}
 task sourcesJar(type: Jar) {
     from android.sourceSets.main.java.srcDirs
     classifier = 'sources'
@@ -68,22 +35,6 @@ task sourcesJar(type: Jar) {
 artifacts {
     archives sourcesJar
 }
-
-//Properties properties = new Properties()
-//properties.load(project.rootProject.file('local.properties').newDataInputStream())
-//bintray {
-//    user = properties.getProperty("bintray.user")
-//    key = properties.getProperty("bintray.apikey")
-//    configurations = ['archives']
-//    pkg {
-//        repo = "maven"
-//        name = "dialogX" //项目在JCenter的名字
-//        websiteUrl = siteUrl
-//        vcsUrl = gitUrl
-//        licenses = ["Apache-2.0"]
-//        publish = true
-//    }
-//}
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
     implementation 'androidx.appcompat:appcompat:1.2.0+'

+ 15 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -97,6 +97,20 @@ public class BottomDialog extends BaseDialog {
         return new BottomDialog();
     }
     
+    public static BottomDialog build(OnBindView<BottomDialog> onBindView) {
+        BottomDialog bottomDialog = new BottomDialog().setCustomView(onBindView);
+        if (onBindView.isPreLoading()) {
+            onBindView.setOnViewLoadFinishListener(new OnBindView.OnViewLoadFinishListener() {
+                @Override
+                public void onFinish(View view) {
+                    bottomDialog.preShow();
+                    bottomDialog.show();
+                }
+            });
+        }
+        return bottomDialog;
+    }
+    
     public BottomDialog(CharSequence title, CharSequence message) {
         this.title = title;
         this.message = message;
@@ -533,7 +547,7 @@ public class BottomDialog extends BaseDialog {
             
             if (maskColor != -1) boxRoot.setBackgroundColor(maskColor);
             
-            if (onBindView != null && onBindView.getCustomView() != null) {
+            if (onBindView != null && onBindView.getCustomView() != null && !preShowFlag) {
                 onBindView.bindParent(boxCustom, me);
             }
             

+ 14 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java

@@ -58,6 +58,20 @@ public class BottomMenu extends BottomDialog {
         return new BottomMenu();
     }
     
+    public static BottomMenu build(OnBindView<BottomDialog> onBindView) {
+        BottomMenu bottomMenu = new BottomMenu().setCustomView(onBindView);
+        if (onBindView.isPreLoading()) {
+            onBindView.setOnViewLoadFinishListener(new OnBindView.OnViewLoadFinishListener() {
+                @Override
+                public void onFinish(View view) {
+                    bottomMenu.preShow();
+                    bottomMenu.show();
+                }
+            });
+        }
+        return bottomMenu;
+    }
+    
     protected BottomMenu() {
         super();
         if (style.overrideBottomDialogRes() != null) {

+ 15 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/CustomDialog.java

@@ -67,6 +67,20 @@ public class CustomDialog extends BaseDialog {
         return new CustomDialog();
     }
     
+    public static CustomDialog build(OnBindView<CustomDialog> onBindView) {
+        CustomDialog customDialog = new CustomDialog().setCustomView(onBindView);
+        if (onBindView.isPreLoading()) {
+            onBindView.setOnViewLoadFinishListener(new OnBindView.OnViewLoadFinishListener() {
+                @Override
+                public void onFinish(View view) {
+                    customDialog.preShow();
+                    customDialog.show();
+                }
+            });
+        }
+        return customDialog;
+    }
+    
     public CustomDialog(OnBindView<CustomDialog> onBindView) {
         this.onBindView = onBindView;
     }
@@ -247,7 +261,7 @@ public class CustomDialog extends BaseDialog {
                 boxRoot.setOnClickListener(null);
             }
             
-            if (onBindView != null && onBindView.getCustomView() != null) {
+            if (onBindView != null && onBindView.getCustomView() != null && !preShowFlag) {
                 onBindView.bindParent(boxCustom, me);
             }
         }

+ 19 - 5
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -61,6 +61,20 @@ public class FullScreenDialog extends BaseDialog {
         return new FullScreenDialog();
     }
     
+    public static FullScreenDialog build(OnBindView<FullScreenDialog> onBindView) {
+        FullScreenDialog fullScreenDialog = new FullScreenDialog(onBindView);
+        if (onBindView.isPreLoading()) {
+            onBindView.setOnViewLoadFinishListener(new OnBindView.OnViewLoadFinishListener() {
+                @Override
+                public void onFinish(View view) {
+                    fullScreenDialog.preShow();
+                    fullScreenDialog.show();
+                }
+            });
+        }
+        return fullScreenDialog;
+    }
+    
     public FullScreenDialog(OnBindView<FullScreenDialog> onBindView) {
         this.onBindView = onBindView;
     }
@@ -75,7 +89,7 @@ public class FullScreenDialog extends BaseDialog {
         super.beforeShow();
         dialogView = createView(isLightTheme() ? R.layout.layout_dialogx_fullscreen : R.layout.layout_dialogx_fullscreen_dark);
         dialogImpl = new DialogImpl(dialogView);
-        if (dialogView!=null)dialogView.setTag(me);
+        if (dialogView != null) dialogView.setTag(me);
         show(dialogView);
     }
     
@@ -83,7 +97,7 @@ public class FullScreenDialog extends BaseDialog {
         super.beforeShow();
         dialogView = createView(isLightTheme() ? R.layout.layout_dialogx_fullscreen : R.layout.layout_dialogx_fullscreen_dark);
         dialogImpl = new DialogImpl(dialogView);
-        if (dialogView!=null)dialogView.setTag(me);
+        if (dialogView != null) dialogView.setTag(me);
         show(activity, dialogView);
     }
     
@@ -215,7 +229,7 @@ public class FullScreenDialog extends BaseDialog {
                 boxRoot.setOnClickListener(null);
             }
             
-            if (onBindView != null && onBindView.getCustomView() != null) {
+            if (onBindView != null && onBindView.getCustomView() != null && !preShowFlag) {
                 onBindView.bindParent(boxCustom, me);
             }
             
@@ -248,7 +262,7 @@ public class FullScreenDialog extends BaseDialog {
                 public void run() {
                     dismiss(dialogView);
                 }
-            },exitAnimDurationTemp);
+            }, exitAnimDurationTemp);
         }
         
         public void preDismiss() {
@@ -402,7 +416,7 @@ public class FullScreenDialog extends BaseDialog {
         enterAnimDuration = 0;
         dialogView = createView(isLightTheme() ? R.layout.layout_dialogx_fullscreen : R.layout.layout_dialogx_fullscreen_dark);
         dialogImpl = new DialogImpl(dialogView);
-        if (dialogView!=null)dialogView.setTag(me);
+        if (dialogView != null) dialogView.setTag(me);
         show(dialogView);
     }
 }

+ 14 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/InputDialog.java

@@ -32,6 +32,20 @@ public class InputDialog extends MessageDialog {
         return new InputDialog();
     }
     
+    public static InputDialog build(OnBindView<MessageDialog> onBindView) {
+        InputDialog inputDialog = new InputDialog().setCustomView(onBindView);
+        if (onBindView.isPreLoading()) {
+            onBindView.setOnViewLoadFinishListener(new OnBindView.OnViewLoadFinishListener() {
+                @Override
+                public void onFinish(View view) {
+                    inputDialog.preShow();
+                    inputDialog.show();
+                }
+            });
+        }
+        return inputDialog;
+    }
+    
     public InputDialog(CharSequence title, CharSequence message, CharSequence okText) {
         cancelable = DialogX.cancelable;
         this.title = title;

+ 15 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java

@@ -95,6 +95,20 @@ public class MessageDialog extends BaseDialog {
         return new MessageDialog();
     }
     
+    public static MessageDialog build(OnBindView<MessageDialog> onBindView) {
+        MessageDialog messageDialog = new MessageDialog().setCustomView(onBindView);
+        if (onBindView.isPreLoading()) {
+            onBindView.setOnViewLoadFinishListener(new OnBindView.OnViewLoadFinishListener() {
+                @Override
+                public void onFinish(View view) {
+                    messageDialog.preShow();
+                    messageDialog.show();
+                }
+            });
+        }
+        return messageDialog;
+    }
+    
     public MessageDialog(CharSequence title, CharSequence message) {
         this.title = title;
         this.message = message;
@@ -629,7 +643,7 @@ public class MessageDialog extends BaseDialog {
                 boxRoot.setOnClickListener(null);
             }
             
-            if (onBindView != null && onBindView.getCustomView() != null) {
+            if (onBindView != null && onBindView.getCustomView() != null && !preShowFlag) {
                 onBindView.bindParent(boxCustom, me);
                 boxCustom.setVisibility(View.VISIBLE);
             } else {

+ 15 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopTip.java

@@ -86,6 +86,20 @@ public class PopTip extends BaseDialog {
         return new PopTip();
     }
     
+    public static PopTip build(OnBindView<PopTip> onBindView) {
+        PopTip popTip = new PopTip().setCustomView(onBindView);
+        if (onBindView.isPreLoading()) {
+            onBindView.setOnViewLoadFinishListener(new OnBindView.OnViewLoadFinishListener() {
+                @Override
+                public void onFinish(View view) {
+                    popTip.preShow();
+                    popTip.show();
+                }
+            });
+        }
+        return popTip;
+    }
+    
     public PopTip(OnBindView<PopTip> onBindView) {
         this.onBindView = onBindView;
     }
@@ -494,7 +508,7 @@ public class PopTip extends BaseDialog {
                 tintColor(boxBody, backgroundColor);
             }
             
-            if (onBindView != null && onBindView.getCustomView() != null) {
+            if (onBindView != null && onBindView.getCustomView() != null && !preShowFlag) {
                 onBindView.bindParent(boxCustom, me);
                 boxCustom.setVisibility(View.VISIBLE);
             } else {

+ 4 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java

@@ -75,6 +75,10 @@ public class WaitDialog extends BaseDialog {
         cancelable = DialogX.cancelableTipDialog;
     }
     
+    public static WaitDialog build() {
+        return new WaitDialog();
+    }
+    
     public static WaitDialog show(CharSequence message) {
         DialogImpl dialogImpl = me().dialogImpl;
         me().message = message;

+ 38 - 0
DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java

@@ -86,6 +86,10 @@ public abstract class BaseDialog {
     protected static void show(final View view) {
         if (view == null) return;
         final BaseDialog baseDialog = (BaseDialog) view.getTag();
+        if (baseDialog.preShowFlag) {
+            preShow(view);
+            return;
+        }
         baseDialog.ownActivity = new WeakReference<>(contextWeakReference.get());
         baseDialog.dialogView = new WeakReference<>(view);
         
@@ -109,6 +113,35 @@ public abstract class BaseDialog {
         }
     }
     
+    protected boolean preShowFlag;
+    
+    protected void preShow() {
+        preShowFlag = true;
+    }
+    
+    protected static void preShow(final View view) {
+        if (view == null) return;
+        final BaseDialog baseDialog = (BaseDialog) view.getTag();
+        baseDialog.ownActivity = new WeakReference<>(contextWeakReference.get());
+        baseDialog.dialogView = new WeakReference<>(view);
+        baseDialog.preShowFlag = false;
+        
+        if (rootFrameLayout == null || rootFrameLayout.get() == null) return;
+        runOnMain(new Runnable() {
+            @Override
+            public void run() {
+                view.setLayoutParams(new ViewGroup.LayoutParams(0, 0));
+                rootFrameLayout.get().addView(view);
+                runOnMain(new Runnable() {
+                    @Override
+                    public void run() {
+                        rootFrameLayout.get().removeView(view);
+                    }
+                });
+            }
+        });
+    }
+    
     protected static void show(final Activity activity, final View view) {
         if (activity == null || view == null) return;
         if (activity.isDestroyed()) {
@@ -363,6 +396,11 @@ public abstract class BaseDialog {
         new Handler(Looper.getMainLooper()).post(runnable);
     }
     
+    protected static void runOnMainDelay(Runnable runnable, long delay) {
+        if (!DialogX.autoRunOnUIThread) runnable.run();
+        new Handler(Looper.getMainLooper()).postDelayed(runnable, delay);
+    }
+    
     public View getDialogView() {
         if (dialogView == null) return null;
         return dialogView.get();

+ 62 - 12
DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnBindView.java

@@ -8,6 +8,7 @@ import android.widget.RelativeLayout;
 import com.kongzue.dialogx.DialogX;
 
 import static com.kongzue.dialogx.DialogX.ERROR_INIT_TIPS;
+import static com.kongzue.dialogx.interfaces.BaseDialog.log;
 
 /**
  * @author: Kongzue
@@ -17,8 +18,10 @@ import static com.kongzue.dialogx.DialogX.ERROR_INIT_TIPS;
  * @createTime: 2020/10/8 17:00
  */
 public abstract class OnBindView<D> {
+    
     int layoutResId;
     View customView;
+    OnViewLoadFinishListener onViewLoadFinishListener;
     
     public OnBindView(int layoutResId) {
         if (BaseDialog.getContext() == null) {
@@ -29,6 +32,34 @@ public abstract class OnBindView<D> {
         customView = LayoutInflater.from(BaseDialog.getContext()).inflate(layoutResId, new RelativeLayout(BaseDialog.getContext()), false);
     }
     
+    private boolean preLoading;
+    
+    public OnBindView(int layoutResId, boolean preLoading) {
+        if (BaseDialog.getContext() == null) {
+            DialogX.error(ERROR_INIT_TIPS);
+            return;
+        }
+        this.layoutResId = layoutResId;
+        this.preLoading = true;
+        if (preLoading) {
+            new Thread() {
+                @Override
+                public void run() {
+                    super.run();
+                    customView = LayoutInflater.from(BaseDialog.getContext()).inflate(layoutResId, new RelativeLayout(BaseDialog.getContext()), false);
+                    int widthSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
+                    int heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
+                    customView.measure(widthSpec, heightSpec);
+                    customView.invalidate();
+                    
+                    if (onViewLoadFinishListener!=null)onViewLoadFinishListener.onFinish(customView);
+                }
+            }.start();
+        }else{
+            customView = LayoutInflater.from(BaseDialog.getContext()).inflate(layoutResId, new RelativeLayout(BaseDialog.getContext()), false);
+        }
+    }
+    
     public OnBindView(View customView) {
         this.customView = customView;
     }
@@ -45,6 +76,9 @@ public abstract class OnBindView<D> {
     }
     
     public View getCustomView() {
+        if (preLoading && customView == null) {
+            customView = LayoutInflater.from(BaseDialog.getContext()).inflate(layoutResId, new RelativeLayout(BaseDialog.getContext()), false);
+        }
         return customView;
     }
     
@@ -59,35 +93,51 @@ public abstract class OnBindView<D> {
     }
     
     public OnBindView<D> bindParent(ViewGroup parentView) {
-        if (customView == null) return this;
-        if (customView.getParent() != null) {
-            if (customView.getParent()==parentView){
+        if (getCustomView() == null) return this;
+        if (getCustomView().getParent() != null) {
+            if (getCustomView().getParent() == parentView) {
                 return this;
             }
-            ((ViewGroup) customView.getParent()).removeView(customView);
+            ((ViewGroup) getCustomView().getParent()).removeView(getCustomView());
         }
         ViewGroup.LayoutParams lp = parentView.getLayoutParams();
         if (lp == null) {
             lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         }
-        parentView.addView(customView, lp);
+        parentView.addView(getCustomView(), lp);
         return this;
     }
     
+    long loadStamp;
+    
     public OnBindView<D> bindParent(ViewGroup parentView, BaseDialog dialog) {
-        if (customView == null) return this;
-        if (customView.getParent() != null) {
-            if (customView.getParent()==parentView){
+        loadStamp = System.currentTimeMillis();
+        if (getCustomView() == null) return this;
+        if (getCustomView().getParent() != null) {
+            if (getCustomView().getParent() == parentView) {
                 return this;
             }
-            ((ViewGroup) customView.getParent()).removeView(customView);
+            ((ViewGroup) getCustomView().getParent()).removeView(getCustomView());
         }
-        ViewGroup.LayoutParams lp = customView.getLayoutParams();
+        ViewGroup.LayoutParams lp = getCustomView().getLayoutParams();
         if (lp == null) {
             lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         }
-        parentView.addView(customView, lp);
-        onBind((D) dialog, customView);
+        parentView.addView(getCustomView(), lp);
+        onBind((D) dialog, getCustomView());
+        return this;
+    }
+    
+    public boolean isPreLoading() {
+        return preLoading;
+    }
+    
+    public interface OnViewLoadFinishListener{
+        void onFinish(View view);
+    }
+    
+    public OnBindView<D> setOnViewLoadFinishListener(OnViewLoadFinishListener onViewLoadFinishListener) {
+        this.onViewLoadFinishListener = onViewLoadFinishListener;
         return this;
     }
 }

+ 1 - 1
DialogX/src/main/res/layout/layout_dialogx_fullscreen.xml

@@ -25,7 +25,7 @@
 
             <com.kongzue.dialogx.util.views.MaxRelativeLayout
                 android:id="@+id/bkg"
-                android:layout_width="wrap_content"
+                android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_alignParentBottom="true"
                 android:background="@drawable/rect_dialogx_material_bottom_bkg_light"

+ 1 - 1
app/src/main/java/com/kongzue/dialogxdemo/App.java

@@ -26,7 +26,7 @@ public class App extends BaseApp<App> {
     @Override
     public void init() {
         DialogX.init(this);
-        DialogX.implIMPLMode= DialogX.IMPL_MODE.WINDOW;
+        DialogX.implIMPLMode= DialogX.IMPL_MODE.VIEW;
         DialogX.useHaptic = false;
         DialogX.globalStyle = new MaterialStyle() {
             @Override

+ 3 - 3
app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java

@@ -568,7 +568,7 @@ public class MainActivity extends BaseActivity {
         btnFullScreenDialogLogin.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                FullScreenDialog.show(new OnBindView<FullScreenDialog>(R.layout.layout_full_login) {
+                FullScreenDialog.build(new OnBindView<FullScreenDialog>(R.layout.layout_full_login,true) {
                     @Override
                     public void onBind(FullScreenDialog dialog, View v) {
                         btnCancel = v.findViewById(R.id.btn_cancel);
@@ -577,10 +577,10 @@ public class MainActivity extends BaseActivity {
                         editUserName = v.findViewById(R.id.edit_userName);
                         boxPassword = v.findViewById(R.id.box_password);
                         editPassword = v.findViewById(R.id.edit_password);
-                        
+            
                         initFullScreenLoginDemo(dialog);
                     }
-                });
+                }).show();
             }
         });
         

+ 129 - 122
app/src/main/res/layout/layout_full_login.xml

@@ -1,159 +1,166 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="600dp"
+    android:layout_height="match_parent"
     android:gravity="center_horizontal"
     android:orientation="vertical">
 
     <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="50dp"
-        android:orientation="horizontal">
-
-        <TextView
-            android:id="@+id/btn_cancel"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:gravity="center"
-            android:paddingLeft="15dp"
-            android:paddingRight="15dp"
-            android:text="取消"
-            android:textColor="@color/dialogxIOSBlue"
-            android:textSize="18dp" />
+        android:layout_height="match_parent"
+        android:gravity="center_horizontal"
+        android:orientation="vertical">
 
-        <Space
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_weight="1" />
-
-        <TextView
-            android:id="@+id/btn_submit"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:gravity="center"
-            android:paddingLeft="15dp"
-            android:paddingRight="15dp"
-            android:text="下一步"
-            android:textColor="@color/dialogxIOSBlue"
-            android:textSize="18dp" />
-
-    </LinearLayout>
-
-    <ImageView
-        android:layout_width="80dp"
-        android:layout_height="80dp"
-        android:layout_marginTop="30dp"
-        android:src="@mipmap/img_login" />
-
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="25dp">
+            android:layout_height="50dp"
+            android:orientation="horizontal">
 
-        <RelativeLayout
-            android:id="@+id/box_userName"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:paddingLeft="25dp"
-            android:paddingRight="25dp">
+            <TextView
+                android:id="@+id/btn_cancel"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:paddingLeft="15dp"
+                android:paddingRight="15dp"
+                android:text="取消"
+                android:textColor="@color/dialogxIOSBlue"
+                android:textSize="18dp" />
 
-            <EditText
-                android:id="@+id/edit_userName"
+            <Space
                 android:layout_width="match_parent"
-                android:layout_height="50dp"
-                android:background="@drawable/ios_edit_box_bkg"
+                android:layout_height="match_parent"
+                android:layout_weight="1" />
+
+            <TextView
+                android:id="@+id/btn_submit"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
                 android:gravity="center"
-                android:hint="请输入账号"
-                android:inputType="textEmailAddress" />
+                android:paddingLeft="15dp"
+                android:paddingRight="15dp"
+                android:text="下一步"
+                android:textColor="@color/dialogxIOSBlue"
+                android:textSize="18dp" />
 
-        </RelativeLayout>
+        </LinearLayout>
 
-        <RelativeLayout
-            android:id="@+id/box_password"
+        <ImageView
+            android:layout_width="80dp"
+            android:layout_height="80dp"
+            android:layout_marginTop="30dp"
+            android:src="@mipmap/img_login" />
+
+        <FrameLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:paddingLeft="25dp"
-            android:paddingRight="25dp"
-            android:visibility="gone">
+            android:layout_marginTop="25dp">
 
-            <EditText
-                android:id="@+id/edit_password"
+            <RelativeLayout
+                android:id="@+id/box_userName"
                 android:layout_width="match_parent"
-                android:layout_height="50dp"
-                android:background="@drawable/ios_edit_box_bkg"
-                android:gravity="center"
-                android:hint="请输入密码"
-                android:inputType="textPassword" />
-
-        </RelativeLayout>
+                android:layout_height="wrap_content"
+                android:paddingLeft="25dp"
+                android:paddingRight="25dp">
+
+                <EditText
+                    android:id="@+id/edit_userName"
+                    android:layout_width="match_parent"
+                    android:layout_height="50dp"
+                    android:background="@drawable/ios_edit_box_bkg"
+                    android:gravity="center"
+                    android:hint="请输入账号"
+                    android:inputType="textEmailAddress" />
+
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:id="@+id/box_password"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingLeft="25dp"
+                android:paddingRight="25dp"
+                android:visibility="gone">
 
-    </FrameLayout>
+                <EditText
+                    android:id="@+id/edit_password"
+                    android:layout_width="match_parent"
+                    android:layout_height="50dp"
+                    android:background="@drawable/ios_edit_box_bkg"
+                    android:gravity="center"
+                    android:hint="请输入密码"
+                    android:inputType="textPassword" />
 
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="25dp"
-        android:gravity="center"
-        android:text="登录后,您可以:"
-        android:textColor="@color/black"
-        android:textSize="13dp"
-        android:textStyle="bold" />
+            </RelativeLayout>
 
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="15dp"
-        android:orientation="vertical">
+        </FrameLayout>
 
         <TextView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:text="· 使用云同步备份您的存档文件"
-            android:textColor="@color/black75"
-            android:textSize="13dp" />
+            android:layout_marginTop="25dp"
+            android:gravity="center"
+            android:text="登录后,您可以:"
+            android:textColor="@color/black"
+            android:textSize="13dp"
+            android:textStyle="bold" />
 
-        <TextView
-            android:layout_width="match_parent"
+        <LinearLayout
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="7dp"
-            android:text="· 享受随时随地的客户服务及7*24小时电话咨询服务"
-            android:textColor="@color/black75"
-            android:textSize="13dp" />
+            android:layout_marginTop="15dp"
+            android:orientation="vertical">
 
-        <TextView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="7dp"
-            android:text="· 免费的远程协助和更大的云端存储空间"
-            android:textColor="@color/black75"
-            android:textSize="13dp" />
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="· 使用云同步备份您的存档文件"
+                android:textColor="@color/black75"
+                android:textSize="13dp" />
 
-    </LinearLayout>
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="7dp"
+                android:text="· 享受随时随地的客户服务及7*24小时电话咨询服务"
+                android:textColor="@color/black75"
+                android:textSize="13dp" />
 
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="7dp"
+                android:text="· 免费的远程协助和更大的云端存储空间"
+                android:textColor="@color/black75"
+                android:textSize="13dp" />
 
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="15dp"
-        android:orientation="horizontal">
+        </LinearLayout>
 
-        <TextView
-            android:layout_width="match_parent"
+        <LinearLayout
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="25dp"
-            android:gravity="center"
-            android:text="登录代表您同意"
-            android:textColor="@color/black"
-            android:textSize="13dp" />
+            android:layout_marginTop="15dp"
+            android:orientation="horizontal">
 
-        <TextView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="25dp"
-            android:gravity="center"
-            android:text="《用户服务条款》"
-            android:textColor="@color/dialogxIOSBlue"
-            android:textSize="13dp" />
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="25dp"
+                android:gravity="center"
+                android:text="登录代表您同意"
+                android:textColor="@color/black"
+                android:textSize="13dp" />
 
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="25dp"
+                android:gravity="center"
+                android:text="《用户服务条款》"
+                android:textColor="@color/dialogxIOSBlue"
+                android:textSize="13dp" />
+
+        </LinearLayout>
     </LinearLayout>
-</LinearLayout>
+
+</RelativeLayout>

+ 1 - 1
gradle.properties

@@ -18,5 +18,5 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.40.beta4
+BUILD_VERSION=0.0.40.beta5
 BUILD_VERSION_INT=39