Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
1d52dfe1
Commit
1d52dfe1
authored
Dec 25, 2019
by
王宇航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模塊搭建完成,登陸功能未完善
parent
121e4351
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
194 additions
and
39 deletions
+194
-39
public-base/src/main/java/com/joe/base/utils/screen/ConvertDpAndPx.java
+46
-0
public-base/src/main/java/com/joe/base/widget/view/MyEditText.java
+0
-0
public-base/src/main/res/values/styles.xml
+55
-13
user-login/build.gradle
+0
-1
user-login/src/main/AndroidManifest.xml
+0
-6
user-login/src/main/debug/AndroidManifest.xml
+6
-0
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
+30
-1
user-login/src/main/res/layout/user_login_activity_login.xml
+57
-18
user-login/src/main/res/mipmap-xhdpi/ic_clear_text.png
+0
-0
user-login/src/main/res/mipmap-xhdpi/ic_pwd.png
+0
-0
No files found.
public-base/src/main/java/com/joe/base/utils/screen/ConvertDpAndPx.java
0 → 100644
View file @
1d52dfe1
/**
* @company: JOE工作室
* @Copyright: Copyright © 2013 - 2016 joe.All Rights Reserved.
* @Filename: ConvertDpAndPx.java
* @Description: TODO(用一句话描述该文件做什么)
* @Author: JOE
* @Date: 2016-9-2 下午6:16:29
**/
package
com
.
joe
.
base
.
utils
.
screen
;
/**
* @company: JOE工作室
* @ClassName: ConvertDpAndPx
* @Description: TODO(这里用一句话描述这个类的作用)
* @Author: JOE
* @Date: 2016-9-2 下午6:16:29
*/
import
android.content.Context
;
public
class
ConvertDpAndPx
{
/**
* dp转换成px,代码写的是像素,而XML中写的是单位密度
* @param context
* @param dp
* @return
*/
public
static
int
Dp2Px
(
Context
context
,
float
dp
)
{
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
return
(
int
)
(
dp
*
scale
+
0.5f
);
}
/**
* px转换成dp,代码写的是像素,而XML中(dp)写的是单位密度
* @param context
* @param px
* @return
*/
public
static
int
Px2Dp
(
Context
context
,
float
px
)
{
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
return
(
int
)
(
px
/
scale
+
0.5f
);
}
}
public-base/src/main/java/com/joe/base/widget/view/MyEditText.java
View file @
1d52dfe1
This diff is collapsed.
Click to expand it.
public-base/src/main/res/values/styles.xml
View file @
1d52dfe1
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
<item
name=
"colorPrimaryDark"
>
@color/theme_color
</item>
<item
name=
"colorPrimaryDark"
>
@color/theme_color
</item>
<item
name=
"colorAccent"
>
@color/theme_color
</item>
<item
name=
"colorAccent"
>
@color/theme_color
</item>
<!--<item name="android:alertDialogTheme">@style/Theme.AppCompat.Light.Dialog.Alert.Self</item>-->
<!--<item name="android:alertDialogTheme">@style/Theme.AppCompat.Light.Dialog.Alert.Self</item>-->
<item
name=
"android:windowAnimationStyle"
>
@style/activityAnimation
</item>
<!-- 设置activity切换动画 -->
<item
name=
"android:windowAnimationStyle"
>
@style/activityAnimation
</item>
<!-- 设置activity切换动画 -->
</style>
</style>
<!-- animation 样式 -->
<!-- animation 样式 -->
...
@@ -18,8 +19,6 @@
...
@@ -18,8 +19,6 @@
</style>
</style>
<declare-styleable
name=
"MyEditText"
>
<declare-styleable
name=
"MyEditText"
>
<!-- 最大長度-->
<!-- 最大長度-->
<attr
name=
"ed_MaxLength"
format=
"integer"
/>
<attr
name=
"ed_MaxLength"
format=
"integer"
/>
...
@@ -36,16 +35,17 @@
...
@@ -36,16 +35,17 @@
<attr
name=
"ed_maxLengthMarginLeft"
format=
"dimension"
/>
<attr
name=
"ed_maxLengthMarginLeft"
format=
"dimension"
/>
<attr
name=
"ed_maxLengthMarginRight"
format=
"dimension"
/>
<attr
name=
"ed_maxLengthMarginRight"
format=
"dimension"
/>
<attr
name=
"ed_maxLengthMarginBottom"
format=
"dimension"
/>
<attr
name=
"ed_maxLengthMarginBottom"
format=
"dimension"
/>
<!-- <attr name="ed_maxLengthLocation" format="enum">-->
<attr
name=
"ed_btn_marginTop"
format=
"dimension"
/>
<!-- <enum name="ALIGN_PARENT_BOTTOM">12</enum>-->
<attr
name=
"ed_btn_marginRight"
format=
"dimension"
/>
<!-- <enum name="ALIGN_PARENT_LEFT">9</enum>-->
<attr
name=
"ed_btn_marginBottom"
format=
"dimension"
/>
<!-- <enum name="ALIGN_PARENT_RIGHT">11</enum>-->
<attr
name=
"ed_btn_marginLeft"
format=
"dimension"
/>
<!-- <enum name="ALIGN_PARENT_TOP">10</enum>-->
<!-- <enum name="ALIGN_RIGHT">7</enum>-->
<attr
name=
"ed_hint"
format=
"string"
/>
<!-- <enum name="ALIGN_TOP">6</enum>-->
<attr
name=
"ed_hintColor"
format=
"color"
/>
<!-- <enum name="ALIGN_LEFT">5</enum>-->
<attr
name=
"ed_textColor"
format=
"color"
/>
<!-- <enum name="ALIGN_BOTTOM">8</enum>-->
<attr
name=
"ed_text"
format=
"string"
/>
<!-- </attr>-->
<attr
name=
"ed_textSize"
format=
"dimension"
/>
<!-- 是否能輸入表情-->
<!-- 是否能輸入表情-->
<attr
name=
"ed_isInputIcon"
format=
"boolean"
/>
<attr
name=
"ed_isInputIcon"
format=
"boolean"
/>
<!-- 輸入表情時提示的內容-->
<!-- 輸入表情時提示的內容-->
...
@@ -67,6 +67,48 @@
...
@@ -67,6 +67,48 @@
<attr
name=
"ed_singLeLine"
format=
"boolean"
/>
<attr
name=
"ed_singLeLine"
format=
"boolean"
/>
<attr
name=
"ed_clear_gravity"
>
<flag
name=
"rightTop"
value=
"1"
/>
<flag
name=
"rightCenter"
value=
"2"
/>
<flag
name=
"rightBottom"
value=
"3"
/>
</attr>
<attr
name=
"ed_gravity"
>
<!-- Push object to the top of its container, not changing its size. -->
<flag
name=
"top"
value=
"0x30"
/>
<!-- Push object to the bottom of its container, not changing its size. -->
<flag
name=
"bottom"
value=
"0x50"
/>
<!-- Push object to the left of its container, not changing its size. -->
<flag
name=
"left"
value=
"0x03"
/>
<!-- Push object to the right of its container, not changing its size. -->
<flag
name=
"right"
value=
"0x05"
/>
<!-- Place object in the vertical center of its container, not changing its size. -->
<flag
name=
"center_vertical"
value=
"0x10"
/>
<!-- Grow the vertical size of the object if needed so it completely fills its container. -->
<flag
name=
"fill_vertical"
value=
"0x70"
/>
<!-- Place object in the horizontal center of its container, not changing its size. -->
<flag
name=
"center_horizontal"
value=
"0x01"
/>
<!-- Grow the horizontal size of the object if needed so it completely fills its container. -->
<flag
name=
"fill_horizontal"
value=
"0x07"
/>
<!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. -->
<flag
name=
"center"
value=
"0x11"
/>
<!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. -->
<flag
name=
"fill"
value=
"0x77"
/>
<!-- Additional option that can be set to have the top and/or bottom edges of
the child clipped to its container's bounds.
The clip will be based on the vertical gravity: a top gravity will clip the bottom
edge, a bottom gravity will clip the top edge, and neither will clip both edges. -->
<flag
name=
"clip_vertical"
value=
"0x80"
/>
<!-- Additional option that can be set to have the left and/or right edges of
the child clipped to its container's bounds.
The clip will be based on the horizontal gravity: a left gravity will clip the right
edge, a right gravity will clip the left edge, and neither will clip both edges. -->
<flag
name=
"clip_horizontal"
value=
"0x08"
/>
<!-- Push object to the beginning of its container, not changing its size. -->
<flag
name=
"start"
value=
"0x00800003"
/>
<!-- Push object to the end of its container, not changing its size. -->
<flag
name=
"end"
value=
"0x00800005"
/>
</attr>
<attr
name=
"inputType"
>
<attr
name=
"inputType"
>
<!-- There is no content type. The text is not editable. -->
<!-- There is no content type. The text is not editable. -->
...
...
user-login/build.gradle
View file @
1d52dfe1
...
@@ -43,7 +43,6 @@ dependencies {
...
@@ -43,7 +43,6 @@ dependencies {
implementation
rootProject
.
ext
.
dependencies
[
"constraintlayout"
]
implementation
rootProject
.
ext
.
dependencies
[
"constraintlayout"
]
implementation
rootProject
.
ext
.
dependencies
[
"retrofit-url-manager"
]
implementation
rootProject
.
ext
.
dependencies
[
"retrofit-url-manager"
]
// annotationProcessor rootProject.ext.dependencies["butterknife-compiler"] //Butterknife 插件, 很多人因为没加这个而报错, 切记!!!
// annotationProcessor rootProject.ext.dependencies["butterknife-compiler"] //Butterknife 插件, 很多人因为没加这个而报错, 切记!!!
annotationProcessor
rootProject
.
ext
.
dependencies
[
"dagger2-compiler"
]
//依赖插件
annotationProcessor
rootProject
.
ext
.
dependencies
[
"dagger2-compiler"
]
//依赖插件
implementation
rootProject
.
ext
.
dependencies
[
"autosize"
]
implementation
rootProject
.
ext
.
dependencies
[
"autosize"
]
...
...
user-login/src/main/AndroidManifest.xml
View file @
1d52dfe1
...
@@ -8,12 +8,6 @@
...
@@ -8,12 +8,6 @@
<meta-data
<meta-data
android:name=
"network.config.GlobalConfiguration"
android:name=
"network.config.GlobalConfiguration"
android:value=
"ConfigModule"
/>
android:value=
"ConfigModule"
/>
<meta-data
android:name=
"design_width_in_dp"
android:value=
"400"
/>
<meta-data
android:name=
"design_height_in_dp"
android:value=
"705"
/>
</application>
</application>
</manifest>
</manifest>
user-login/src/main/debug/AndroidManifest.xml
View file @
1d52dfe1
...
@@ -16,6 +16,12 @@
...
@@ -16,6 +16,12 @@
</intent-filter>
</intent-filter>
</activity>
</activity>
<meta-data
android:name=
"design_width_in_dp"
android:value=
"360"
/>
<meta-data
android:name=
"design_height_in_dp"
android:value=
"540"
/>
</application>
</application>
</manifest>
</manifest>
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
View file @
1d52dfe1
...
@@ -2,6 +2,9 @@ package com.gingersoft.gsa.cloud.user.login.mvp.ui.activity;
...
@@ -2,6 +2,9 @@ package com.gingersoft.gsa.cloud.user.login.mvp.ui.activity;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.user.login.R
;
import
com.gingersoft.gsa.cloud.user.login.R
;
import
com.gingersoft.gsa.cloud.user.login.di.component.DaggerLoginComponent
;
import
com.gingersoft.gsa.cloud.user.login.di.component.DaggerLoginComponent
;
...
@@ -12,10 +15,14 @@ import com.jess.arms.utils.ArmsUtils;
...
@@ -12,10 +15,14 @@ import com.jess.arms.utils.ArmsUtils;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.presenter.LoginPresenter
;
import
com.gingersoft.gsa.cloud.user.login.mvp.presenter.LoginPresenter
;
import
com.joe.base.widget.view.MyEditText
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
...
@@ -32,7 +39,11 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
...
@@ -32,7 +39,11 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
* ================================================
*/
*/
public
class
LoginActivity
extends
BaseActivity
<
LoginPresenter
>
implements
LoginContract
.
View
{
public
class
LoginActivity
extends
BaseActivity
<
LoginPresenter
>
implements
LoginContract
.
View
,
View
.
OnClickListener
{
@BindView
(
R
.
id
.
ed_login_user_account
)
MyEditText
edAccount
;
@BindView
(
R
.
id
.
ed_login_user_pwd
)
MyEditText
edPwd
;
@Override
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
...
@@ -46,11 +57,16 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
...
@@ -46,11 +57,16 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
@Override
@Override
public
int
initView
(
@Nullable
Bundle
savedInstanceState
)
{
public
int
initView
(
@Nullable
Bundle
savedInstanceState
)
{
return
R
.
layout
.
user_login_activity_login
;
//如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
return
R
.
layout
.
user_login_activity_login
;
//如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
}
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
ButterKnife
.
bind
(
this
);
findViewById
(
R
.
id
.
tv_gsa_user_login
).
setOnClickListener
(
this
);
edAccount
=
findViewById
(
R
.
id
.
ed_login_user_account
);
edPwd
=
findViewById
(
R
.
id
.
ed_login_user_pwd
);
}
}
...
@@ -85,4 +101,17 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
...
@@ -85,4 +101,17 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
public
void
loginOut
()
{
public
void
loginOut
()
{
}
}
@OnClick
({
R
.
id
.
tv_gsa_user_login
})
@Override
public
void
onClick
(
View
v
)
{
switch
(
v
.
getId
())
{
case
R
.
id
.
tv_gsa_user_login
:
//登陸
if
(
edAccount
.
getText
()
!=
null
&&
edPwd
.
getText
()
!=
null
)
{
mPresenter
.
login
(
edAccount
.
getText
().
toString
(),
edPwd
.
getText
().
toString
());
}
break
;
}
}
}
}
user-login/src/main/res/layout/user_login_activity_login.xml
View file @
1d52dfe1
...
@@ -24,39 +24,78 @@
...
@@ -24,39 +24,78 @@
android:layout_width=
"40dp"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:layout_height=
"40dp"
android:layout_marginLeft=
"10dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"100dp"
android:background=
"@color/theme_color"
android:background=
"@color/theme_color"
android:padding=
"8dp"
android:padding=
"8dp"
android:layout_marginTop=
"100dp"
android:src=
"@mipmap/ic_user"
android:src=
"@mipmap/ic_user"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/login_title"
/>
app:layout_constraintTop_toBottomOf=
"@id/login_title"
/>
<com.joe.base.widget.view.MyEditText
<EditText
android:id=
"@+id/ed_login_user_account"
android:id=
"@+id/ed_login_user_account"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:hint=
"請輸入賬戶"
android:padding=
"10dp"
android:padding=
"10dp"
android:textColorHint=
"@color/user_login_edit_color"
app:ed_MaxLength=
"11"
app:layout_constraintTop_toTopOf=
"@id/login_icon"
app:ed_clearIconSize=
"30dp"
app:ed_clearRes=
"@mipmap/ic_clear_text"
app:ed_hint=
"請輸入賬戶"
app:ed_hintColor=
"@color/user_login_edit_color"
app:ed_isInputIcon=
"false"
app:ed_singLeLine=
"true"
app:ed_text=
"admin"
app:ed_textColor=
"#333"
app:ed_textSize=
"@dimen/edit_text_size"
app:layout_constraintBottom_toBottomOf=
"@id/login_icon"
app:layout_constraintBottom_toBottomOf=
"@id/login_icon"
android:textSize=
"@dimen/edit_text_size"
app:layout_constraintLeft_toRightOf=
"@id/login_icon"
app:layout_constraintLeft_toRightOf=
"@id/login_icon"
app:layout_constraintRight_toRightOf=
"parent"
/>
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/login_icon"
/>
<ImageView
android:id=
"@+id/iv_login_pwd_icon"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"10dp"
android:background=
"@color/theme_color"
android:padding=
"8dp"
android:src=
"@mipmap/ic_pwd"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/ed_login_user_account"
/>
<EditText
<
com.joe.base.widget.view.My
EditText
android:id=
"@+id/ed_login_user_pwd"
android:id=
"@+id/ed_login_user_pwd"
android:layout_width=
"
match_parent
"
android:layout_width=
"
0dp
"
android:layout_height=
"
5
0dp"
android:layout_height=
"0dp"
android:background=
"#00000000"
android:background=
"#00000000"
android:hint=
"請輸入密碼"
android:padding=
"10dp"
android:padding=
"10dp"
android:textColor=
"#333"
app:ed_MaxLength=
"16"
android:textColorHint=
"@color/user_login_edit_color"
app:ed_clearIconSize=
"30dp"
android:textSize=
"@dimen/edit_text_size"
app:ed_clearRes=
"@mipmap/ic_clear_text"
app:layout_constraintTop_toBottomOf=
"@id/ed_login_user_account"
/>
app:ed_hint=
"請輸入密碼"
app:ed_hintColor=
"@color/user_login_edit_color"
app:ed_isInputIcon=
"false"
app:ed_singLeLine=
"true"
app:ed_text=
"123456"
app:ed_textColor=
"#333"
app:ed_textSize=
"@dimen/edit_text_size"
app:inputType=
"numberPassword"
app:layout_constraintBottom_toBottomOf=
"@id/iv_login_pwd_icon"
app:layout_constraintLeft_toRightOf=
"@id/iv_login_pwd_icon"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/iv_login_pwd_icon"
/>
<TextView
android:id=
"@+id/tv_forget_pwd"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"忘記密碼?"
android:textSize=
"14dp"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/ed_login_user_pwd"
/>
<TextView
<TextView
android:id=
"@+id/tv_gsa_user_login"
android:id=
"@+id/tv_gsa_user_login"
...
@@ -71,6 +110,6 @@
...
@@ -71,6 +110,6 @@
android:text=
"登陸"
android:text=
"登陸"
android:textColor=
"#fff"
android:textColor=
"#fff"
android:textSize=
"16dp"
android:textSize=
"16dp"
app:layout_constraintTop_toBottomOf=
"@id/
ed_login_user
_pwd"
/>
app:layout_constraintTop_toBottomOf=
"@id/
tv_forget
_pwd"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
user-login/src/main/res/mipmap-xhdpi/ic_clear_text.png
0 → 100644
View file @
1d52dfe1
5.94 KB
user-login/src/main/res/mipmap-xhdpi/ic_pwd.png
0 → 100644
View file @
1d52dfe1
4.1 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment