Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fastdevelop
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
高超
fastdevelop
Commits
c0611b2a
Commit
c0611b2a
authored
Feb 25, 2019
by
gao.chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WEB,起屏页
parent
853e66ed
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
504 additions
and
12 deletions
+504
-12
app/src/main/AndroidManifest.xml
+4
-1
app/src/main/java/com/mayi/demo/PageActivity.java
+6
-0
app/src/main/java/com/mayi/demo/StartActivity.java
+21
-0
app/src/main/res/layout/activity_page.xml
+6
-0
app/src/main/res/values/styles.xml
+6
-6
fastDevelop/src/main/java/com/mayi/fastdevelop/bean/HomeItem.java
+37
-0
fastDevelop/src/main/java/com/mayi/fastdevelop/bean/UserInfo.java
+271
-0
fastDevelop/src/main/java/com/mayi/fastdevelop/commonpage/BaseStartActivity.java
+70
-0
fastDevelop/src/main/java/com/mayi/fastdevelop/commonpage/WebActivity.java
+8
-5
fastDevelop/src/main/java/com/mayi/fastdevelop/comnon/Key.java
+4
-0
fastDevelop/src/main/java/com/mayi/fastdevelop/comnon/UserManager.java
+55
-0
fastDevelop/src/main/res/mipmap-xxhdpi/bg_launch.png
+0
-0
fastDevelop/src/main/res/values/styles.xml
+16
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
c0611b2a
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme
NoActionBar
"
>
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".MainActivity"
>
<activity
android:name=
".MainActivity"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
@@ -31,6 +31,9 @@
...
@@ -31,6 +31,9 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</intent-filter>
</activity>
</activity>
<activity
android:name=
".StartActivity"
android:theme=
"@style/AppThemeLaunch"
/>
<activity
android:name=
".FunctionActivity"
/>
<activity
android:name=
".FunctionActivity"
/>
<activity
android:name=
".OnMultiClickActivity"
/>
<activity
android:name=
".OnMultiClickActivity"
/>
<activity
android:name=
".PermissionActivity"
/>
<activity
android:name=
".PermissionActivity"
/>
...
...
app/src/main/java/com/mayi/demo/PageActivity.java
View file @
c0611b2a
...
@@ -52,5 +52,11 @@ public class PageActivity extends BaseActivity {
...
@@ -52,5 +52,11 @@ public class PageActivity extends BaseActivity {
gotoActivity
(
FragmentInteractiveActivity2
.
class
);
gotoActivity
(
FragmentInteractiveActivity2
.
class
);
}
}
});
});
findViewById
(
R
.
id
.
b6
).
setOnClickListener
(
new
OnMultiClickListener
()
{
@Override
public
void
onMultiClick
(
View
v
)
{
gotoActivity
(
StartActivity
.
class
);
}
});
}
}
}
}
app/src/main/java/com/mayi/demo/StartActivity.java
0 → 100644
View file @
c0611b2a
package
com
.
mayi
.
demo
;
import
com.mayi.fastdevelop.commonpage.BaseStartActivity
;
public
class
StartActivity
extends
BaseStartActivity
<
ViewActviity
,
ViewActviity
,
ViewActviity
>{
@Override
public
Class
<
ViewActviity
>
getGuideActivity
()
{
return
ViewActviity
.
class
;
}
@Override
public
Class
<
ViewActviity
>
getLoginActivity
()
{
return
ViewActviity
.
class
;
}
@Override
public
Class
<
ViewActviity
>
getMainActivity
()
{
return
ViewActviity
.
class
;
}
}
app/src/main/res/layout/activity_page.xml
View file @
c0611b2a
...
@@ -38,6 +38,12 @@
...
@@ -38,6 +38,12 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Activity与Fragment之间交互\n不可以左右滑动"
/>
android:text=
"Activity与Fragment之间交互\n不可以左右滑动"
/>
<Button
android:id=
"@+id/b6"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"起屏页"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/values/styles.xml
View file @
c0611b2a
<resources>
<resources>
<!-- Base application theme. -->
<!-- Base application theme. -->
<
style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.DarkActionBar"
>
<
!--<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">--
>
<!--
Customize your theme here.
-->
<!--
<!– Customize your theme here. –>
-->
<
item
name=
"colorPrimary"
>
@color/colorPrimary
</item
>
<
!--<item name="colorPrimary">@color/colorPrimary</item>--
>
<
item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item
>
<
!--<item name="colorPrimaryDark">@color/colorPrimaryDark</item>--
>
<
item
name=
"colorAccent"
>
@color/colorAccent
</item
>
<
!--<item name="colorAccent">@color/colorAccent</item>--
>
<
/style
>
<
!--</style>--
>
</resources>
</resources>
fastDevelop/src/main/java/com/mayi/fastdevelop/bean/HomeItem.java
0 → 100644
View file @
c0611b2a
package
com
.
mayi
.
fastdevelop
.
bean
;
import
java.io.Serializable
;
/**
* 首页表格item
*/
public
class
HomeItem
implements
Serializable
{
private
String
name
;
//item名字
private
String
img
;
//item图片
private
String
goPage
;
//点击跳转页面
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getImg
()
{
return
img
;
}
public
void
setImg
(
String
img
)
{
this
.
img
=
img
;
}
public
String
getGoPage
()
{
return
goPage
;
}
public
void
setGoPage
(
String
goPage
)
{
this
.
goPage
=
goPage
;
}
}
fastDevelop/src/main/java/com/mayi/fastdevelop/bean/UserInfo.java
0 → 100644
View file @
c0611b2a
package
com
.
mayi
.
fastdevelop
.
bean
;
import
java.io.Serializable
;
/**
* 用户信息
*/
public
class
UserInfo
implements
Serializable
{
private
String
userId
;
//用户ID
private
String
token
;
//会话token
private
String
phone
;
//手机号
private
String
upDtatUrl
;
//APP更新地址
private
String
headAddress
;
//头像地址
private
String
address
;
//详细地址
private
String
provinceCode
;
//省ID
private
String
provinceName
;
//省名称
private
String
cityCode
;
//市ID
private
String
cityName
;
//市名称
private
String
areaCode
;
//区ID
private
String
areaName
;
//区名称
private
String
email
;
// 邮箱
private
String
nickName
;
// 昵称
private
String
age
;
// 年龄
private
String
gender
;
// 性别 male(男)/female(女)
private
String
status
;
// 帐号状态
private
String
qcord
;
// 二维码字段
private
String
qcordImg
;
// 二维码图片
private
String
other1
;
//备用字段1
private
String
other2
;
//备用字段2
private
String
other3
;
//备用字段3
private
String
other4
;
//备用字段4
private
String
other5
;
//备用字段5
private
String
other6
;
//备用字段6
private
String
other7
;
//备用字段7
private
String
other8
;
//备用字段8
private
String
other9
;
//备用字段9
private
String
other10
;
//备用字段10
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getToken
()
{
return
token
;
}
public
void
setToken
(
String
token
)
{
this
.
token
=
token
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getUpDtatUrl
()
{
return
upDtatUrl
;
}
public
void
setUpDtatUrl
(
String
upDtatUrl
)
{
this
.
upDtatUrl
=
upDtatUrl
;
}
public
String
getHeadAddress
()
{
return
headAddress
;
}
public
void
setHeadAddress
(
String
headAddress
)
{
this
.
headAddress
=
headAddress
;
}
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
public
String
getProvinceCode
()
{
return
provinceCode
;
}
public
void
setProvinceCode
(
String
provinceCode
)
{
this
.
provinceCode
=
provinceCode
;
}
public
String
getProvinceName
()
{
return
provinceName
;
}
public
void
setProvinceName
(
String
provinceName
)
{
this
.
provinceName
=
provinceName
;
}
public
String
getCityCode
()
{
return
cityCode
;
}
public
void
setCityCode
(
String
cityCode
)
{
this
.
cityCode
=
cityCode
;
}
public
String
getCityName
()
{
return
cityName
;
}
public
void
setCityName
(
String
cityName
)
{
this
.
cityName
=
cityName
;
}
public
String
getAreaCode
()
{
return
areaCode
;
}
public
void
setAreaCode
(
String
areaCode
)
{
this
.
areaCode
=
areaCode
;
}
public
String
getAreaName
()
{
return
areaName
;
}
public
void
setAreaName
(
String
areaName
)
{
this
.
areaName
=
areaName
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
String
getAge
()
{
return
age
;
}
public
void
setAge
(
String
age
)
{
this
.
age
=
age
;
}
public
String
getGender
()
{
return
gender
;
}
public
void
setGender
(
String
gender
)
{
this
.
gender
=
gender
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getQcord
()
{
return
qcord
;
}
public
void
setQcord
(
String
qcord
)
{
this
.
qcord
=
qcord
;
}
public
String
getQcordImg
()
{
return
qcordImg
;
}
public
void
setQcordImg
(
String
qcordImg
)
{
this
.
qcordImg
=
qcordImg
;
}
public
String
getOther1
()
{
return
other1
;
}
public
void
setOther1
(
String
other1
)
{
this
.
other1
=
other1
;
}
public
String
getOther2
()
{
return
other2
;
}
public
void
setOther2
(
String
other2
)
{
this
.
other2
=
other2
;
}
public
String
getOther3
()
{
return
other3
;
}
public
void
setOther3
(
String
other3
)
{
this
.
other3
=
other3
;
}
public
String
getOther4
()
{
return
other4
;
}
public
void
setOther4
(
String
other4
)
{
this
.
other4
=
other4
;
}
public
String
getOther5
()
{
return
other5
;
}
public
void
setOther5
(
String
other5
)
{
this
.
other5
=
other5
;
}
public
String
getOther6
()
{
return
other6
;
}
public
void
setOther6
(
String
other6
)
{
this
.
other6
=
other6
;
}
public
String
getOther7
()
{
return
other7
;
}
public
void
setOther7
(
String
other7
)
{
this
.
other7
=
other7
;
}
public
String
getOther8
()
{
return
other8
;
}
public
void
setOther8
(
String
other8
)
{
this
.
other8
=
other8
;
}
public
String
getOther9
()
{
return
other9
;
}
public
void
setOther9
(
String
other9
)
{
this
.
other9
=
other9
;
}
public
String
getOther10
()
{
return
other10
;
}
public
void
setOther10
(
String
other10
)
{
this
.
other10
=
other10
;
}
}
fastDevelop/src/main/java/com/mayi/fastdevelop/commonpage/BaseStartActivity.java
0 → 100644
View file @
c0611b2a
package
com
.
mayi
.
fastdevelop
.
commonpage
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.support.annotation.Nullable
;
import
android.text.TextUtils
;
import
com.mayi.fastdevelop.base.BaseActivity
;
import
com.mayi.fastdevelop.comnon.Key
;
import
com.mayi.fastdevelop.comnon.UserManager
;
import
com.mayi.fastdevelop.util.SpUtil
;
import
com.tencent.smtt.sdk.WebSettings
;
import
com.tencent.smtt.sdk.WebView
;
/**
* APP启动闪屏页
*/
public
abstract
class
BaseStartActivity
<
T
extends
BaseActivity
,
T1
extends
BaseActivity
,
T2
extends
BaseActivity
>
extends
BaseActivity
{
private
Handler
mHandler
;
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
//清除浏览器缓存
WebView
webView
=
new
WebView
(
this
);
webView
.
getSettings
().
setCacheMode
(
WebSettings
.
LOAD_NO_CACHE
);
webView
.
clearCache
(
true
);
webView
.
clearHistory
();
webView
.
clearFormData
();
getCacheDir
().
delete
();
mHandler
=
new
Handler
();
mHandler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
gotoNext
();
}
},
1000
);
}
private
void
gotoNext
()
{
if
(
SpUtil
.
get
(
Key
.
FIRST_LOGIN
,
true
))
{
// 首次登录 -- 》广告页
SpUtil
.
set
(
Key
.
FIRST_LOGIN
,
false
);
gotoActivityAndFinish
(
getGuideActivity
());
}
else
{
// 非首次 --> 判断有没有缓存用户信息
if
(
TextUtils
.
isEmpty
(
SpUtil
.
get
(
Key
.
USER_INFO
,
""
)))
{
// 没有本地缓存 直接登录
gotoActivityAndFinish
(
getLoginActivity
());
}
else
{
// 有本地缓存 免登录 直接到首页
UserManager
.
getUserInfo
();
gotoActivityAndFinish
(
getMainActivity
());
}
}
}
@Override
protected
void
onDestroy
()
{
mHandler
.
removeCallbacksAndMessages
(
null
);
super
.
onDestroy
();
}
public
abstract
Class
<
T
>
getGuideActivity
();
//获取广告页Activity
public
abstract
Class
<
T1
>
getLoginActivity
();
//获取登录页Activity
public
abstract
Class
<
T2
>
getMainActivity
();
//获取首页Activity
}
fastDevelop/src/main/java/com/mayi/fastdevelop/commonpage/WebActivity.java
View file @
c0611b2a
package
com
.
mayi
.
fastdevelop
.
commonpage
;
package
com
.
mayi
.
fastdevelop
.
commonpage
;
import
android.Manifest
;
import
android.Manifest
;
import
android.app.AlertDialog
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.Intent
;
...
@@ -24,9 +23,11 @@ import android.webkit.JavascriptInterface;
...
@@ -24,9 +23,11 @@ import android.webkit.JavascriptInterface;
import
com.mayi.fastdevelop.R
;
import
com.mayi.fastdevelop.R
;
import
com.mayi.fastdevelop.base.BaseActivity
;
import
com.mayi.fastdevelop.base.BaseActivity
;
import
com.mayi.fastdevelop.comnon.Key
;
import
com.mayi.fastdevelop.comnon.RequestCode
;
import
com.mayi.fastdevelop.comnon.RequestCode
;
import
com.mayi.fastdevelop.util.BitmapUtil
;
import
com.mayi.fastdevelop.util.BitmapUtil
;
import
com.mayi.fastdevelop.util.DialogUtils
;
import
com.mayi.fastdevelop.util.DialogUtils
;
import
com.mayi.fastdevelop.util.SpUtil
;
import
com.mayi.fastdevelop.view.CustomTitleBar
;
import
com.mayi.fastdevelop.view.CustomTitleBar
;
import
com.mayi.fastdevelop.view.dialog.BaseDialog
;
import
com.mayi.fastdevelop.view.dialog.BaseDialog
;
import
com.tencent.smtt.export.external.interfaces.GeolocationPermissionsCallback
;
import
com.tencent.smtt.export.external.interfaces.GeolocationPermissionsCallback
;
...
@@ -215,7 +216,7 @@ public class WebActivity extends BaseActivity {
...
@@ -215,7 +216,7 @@ public class WebActivity extends BaseActivity {
//app调用web方法
//app调用web方法
public
void
appCallJs
(
String
method
,
String
data
)
{
public
void
appCallJs
(
String
method
,
String
data
)
{
webView
.
loadUrl
(
"javascript:appCallJs.invoking;("
+
method
+
","
+
data
+
")"
);
webView
.
loadUrl
(
"javascript:appCallJs.invoking;("
+
method
+
","
+
data
+
")"
);
}
}
...
@@ -246,6 +247,8 @@ public class WebActivity extends BaseActivity {
...
@@ -246,6 +247,8 @@ public class WebActivity extends BaseActivity {
Uri
content_url
=
Uri
.
parse
(
data
);
Uri
content_url
=
Uri
.
parse
(
data
);
intent
.
setData
(
content_url
);
intent
.
setData
(
content_url
);
startActivity
(
intent
);
startActivity
(
intent
);
}
else
if
(
TextUtils
.
equals
(
"getUserInfo"
,
method
))
{
//给web传递用户信息
appCallJs
(
"setUserInfo"
,
SpUtil
.
get
(
Key
.
USER_INFO
,
""
));
}
}
}
}
});
});
...
@@ -255,10 +258,10 @@ public class WebActivity extends BaseActivity {
...
@@ -255,10 +258,10 @@ public class WebActivity extends BaseActivity {
* 跳转原生页面
* 跳转原生页面
* 待扩展
* 待扩展
*
*
* @param
s
* @param
pageName
* @param parameter
* @param parameter
*/
*/
public
void
goPage
(
String
s
,
String
parameter
)
{
public
void
goPage
(
String
pageName
,
String
parameter
)
{
}
}
...
@@ -342,7 +345,7 @@ public class WebActivity extends BaseActivity {
...
@@ -342,7 +345,7 @@ public class WebActivity extends BaseActivity {
protected
Object
doInBackground
(
Object
[]
objects
)
{
protected
Object
doInBackground
(
Object
[]
objects
)
{
if
(!
TextUtils
.
isEmpty
(
mCurrentPhotoPath
))
{
if
(!
TextUtils
.
isEmpty
(
mCurrentPhotoPath
))
{
BitmapUtil
.
zoomsInImageFile
(
mCurrentPhotoPath
,
mCurrentPhotoPath
,
BitmapUtil
.
zoomsInImageFile
(
mCurrentPhotoPath
,
mCurrentPhotoPath
,
Bitmap
.
CompressFormat
.
JPEG
,
900
,
10
0
);
Bitmap
.
CompressFormat
.
JPEG
,
900
,
8
0
);
}
}
return
null
;
return
null
;
}
}
...
...
fastDevelop/src/main/java/com/mayi/fastdevelop/comnon/Key.java
View file @
c0611b2a
...
@@ -2,4 +2,8 @@ package com.mayi.fastdevelop.comnon;
...
@@ -2,4 +2,8 @@ package com.mayi.fastdevelop.comnon;
public
class
Key
{
public
class
Key
{
public
static
final
String
ANT_DOWNLOAD_ID
=
"ant_download_id"
;
public
static
final
String
ANT_DOWNLOAD_ID
=
"ant_download_id"
;
/* 用户信息 */
public
static
final
String
USER_INFO
=
"userinfo"
;
/*是否首次登录*/
public
static
final
String
FIRST_LOGIN
=
"first_login"
;
}
}
fastDevelop/src/main/java/com/mayi/fastdevelop/comnon/UserManager.java
0 → 100644
View file @
c0611b2a
package
com
.
mayi
.
fastdevelop
.
comnon
;
import
android.text.TextUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.mayi.fastdevelop.bean.UserInfo
;
import
com.mayi.fastdevelop.util.SpUtil
;
public
class
UserManager
{
private
static
UserInfo
userInfo
;
/**
* 获取本地的用户信息
*
* @return 用户信息
*/
public
static
UserInfo
getUserInfo
()
{
if
(
userInfo
==
null
)
{
synchronized
(
UserManager
.
class
)
{
if
(
userInfo
==
null
)
{
String
s
=
SpUtil
.
get
(
Key
.
USER_INFO
,
""
);
if
(!
TextUtils
.
isEmpty
(
s
))
{
userInfo
=
JSON
.
parseObject
(
s
,
UserInfo
.
class
);
}
}
}
}
return
userInfo
;
}
/**
* 设置用户信息
*
* @param json
*/
public
static
void
setUserInfo
(
String
json
)
{
if
(!
TextUtils
.
isEmpty
(
json
))
{
synchronized
(
UserManager
.
class
)
{
SpUtil
.
set
(
Key
.
USER_INFO
,
json
);
userInfo
=
JSON
.
parseObject
(
json
,
UserInfo
.
class
);
}
}
}
/**
* 清除用户信息
*/
public
static
void
clearUserInfo
()
{
synchronized
(
UserManager
.
class
)
{
SpUtil
.
set
(
Key
.
USER_INFO
,
null
);
userInfo
=
null
;
}
}
}
fastDevelop/src/main/res/mipmap-xxhdpi/bg_launch.png
0 → 100644
View file @
c0611b2a
130 KB
fastDevelop/src/main/res/values/styles.xml
View file @
c0611b2a
<resources>
<resources>
<style
name=
"AppThemeLaunch"
parent=
"AppTheme"
>
<item
name=
"android:windowBackground"
>
@mipmap/bg_launch
</item>
<item
name=
"android:windowFullscreen"
>
false
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
<item
name=
"windowActionBar"
>
false
</item>
</style>
<!-- Base application theme. -->
<style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.DarkActionBar"
>
<item
name=
"windowActionBar"
>
false
</item>
<item
name=
"windowNoTitle"
>
true
</item>
<!--去除滑动时 顶部和底部的阴影-->
<item
name=
"android:overScrollMode"
>
never
</item>
</style>
<!-- 自定义loading dialog -->
<!-- 自定义loading dialog -->
<style
name=
"style_common_loading_dialog"
parent=
"android:style/Theme.Dialog"
>
<style
name=
"style_common_loading_dialog"
parent=
"android:style/Theme.Dialog"
>
<item
name=
"android:backgroundDimEnabled"
>
true
</item>
<!--模糊-->
<item
name=
"android:backgroundDimEnabled"
>
true
</item>
<!--模糊-->
...
...
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