Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mctower
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tangguangrui
mctower
Commits
977a57c2
Commit
977a57c2
authored
Dec 06, 2022
by
tangguangrui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改闪退bug
parent
c8d4fa58
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
30 deletions
+79
-30
FileUtils.java
app/src/main/java/cn/dankal/base/utils/FileUtils.java
+32
-0
Constant.java
app/src/main/java/cn/mctower/visitor/Constant.java
+2
-2
MonthCardDetailActivity.java
...main/java/cn/mctower/visitor/MonthCardDetailActivity.java
+20
-0
activity_month_card_detail.xml
app/src/main/res/layout/activity_month_card_detail.xml
+25
-28
No files found.
app/src/main/java/cn/dankal/base/utils/FileUtils.java
View file @
977a57c2
...
...
@@ -115,4 +115,36 @@ public class FileUtils {
return
size
;
}
/**
* 获取目录长度
*
* @param dir 目录
* @return 目录长度
*/
public
static
long
getDirLength
(
final
File
dir
)
{
if
(!
isDir
(
dir
))
return
-
1
;
long
len
=
0
;
File
[]
files
=
dir
.
listFiles
();
if
(
files
!=
null
&&
files
.
length
!=
0
)
{
for
(
File
file
:
files
)
{
if
(
file
.
isDirectory
())
{
len
+=
getDirLength
(
file
);
}
else
{
len
+=
file
.
length
();
}
}
}
return
len
;
}
/**
* 判断是否是目录
*
* @param file 文件
* @return {@code true}: 是<br>{@code false}: 否
*/
public
static
boolean
isDir
(
final
File
file
)
{
return
file
!=
null
&&
file
.
exists
()
&&
file
.
isDirectory
();
}
}
app/src/main/java/cn/mctower/visitor/Constant.java
View file @
977a57c2
...
...
@@ -14,8 +14,8 @@ public class Constant {
public
static
String
BaseImagesDir
=
Utils
.
getRootFilePath
()
+
"/image/"
;
public
static
String
Host
=
"https://api-mircrosoft-building.dankal.cn/v1/"
;
//测试
//
public static String Host = "https://api.mctower.dankal.cn/v1/"; //正式
//
public static String Host = "https://api-mircrosoft-building.dankal.cn/v1/"; //测试
public
static
String
Host
=
"https://api.mctower.dankal.cn/v1/"
;
//正式
public
static
final
String
API_VISIT_RECORD_LIST
=
Host
+
"mini/visit/users"
;
public
static
final
String
API_VISIT_DETAIL
=
Host
+
"mini/visit/user/detail/"
;
public
static
final
String
API_GET_QINIU_TOKEN
=
Host
+
"cms/property/common/ignore/qiniu"
;
...
...
app/src/main/java/cn/mctower/visitor/MonthCardDetailActivity.java
View file @
977a57c2
...
...
@@ -18,7 +18,9 @@ import cn.dankal.base.http.HttpPostHelper;
import
cn.dankal.base.http.NOToastHttpCallBack
;
import
cn.dankal.base.utils.LogUtils
;
import
cn.dankal.base.utils.NetPicUtil
;
import
cn.dankal.base.utils.ScreenUtil
;
import
cn.dankal.base.utils.ToastUtils
;
import
cn.dankal.base.utils.UIUtil
;
import
cn.mctower.visitor.model.MonthCardDetailBean
;
import
cn.mctower.visitor.model.MonthCardRqCodeBean
;
import
cn.mctower.visitor.model.QiNiuTokenBean
;
...
...
@@ -164,13 +166,31 @@ public class MonthCardDetailActivity extends NetBaseAppCompatActivity {
for
(
String
url
:
bean
.
vehicleImgArray
){
if
(
i
==
0
)
{
pic1
.
setVisibility
(
View
.
VISIBLE
);
LinearLayout
.
LayoutParams
lp
=
(
LinearLayout
.
LayoutParams
)
pic1
.
getLayoutParams
();
lp
.
width
=
ScreenUtil
.
getScreenWidth
(
MonthCardDetailActivity
.
this
)
-
UIUtil
.
Dp2Px
(
MonthCardDetailActivity
.
this
,
84
);
pic1
.
setLayoutParams
(
lp
);
netPicUtil
.
display
(
pic1
,
qiNiuTokenBean
.
url
+
url
);
}
else
if
(
i
==
1
)
{
LinearLayout
.
LayoutParams
lp
=
(
LinearLayout
.
LayoutParams
)
pic1
.
getLayoutParams
();
lp
.
width
=
(
ScreenUtil
.
getScreenWidth
(
MonthCardDetailActivity
.
this
)
-
UIUtil
.
Dp2Px
(
MonthCardDetailActivity
.
this
,
84
))
/
2
;
pic1
.
setLayoutParams
(
lp
);
pic2
.
setVisibility
(
View
.
VISIBLE
);
LinearLayout
.
LayoutParams
lp2
=
(
LinearLayout
.
LayoutParams
)
pic2
.
getLayoutParams
();
lp2
.
width
=
(
ScreenUtil
.
getScreenWidth
(
MonthCardDetailActivity
.
this
)
-
UIUtil
.
Dp2Px
(
MonthCardDetailActivity
.
this
,
84
))
/
2
;
pic2
.
setLayoutParams
(
lp2
);
netPicUtil
.
display
(
pic2
,
qiNiuTokenBean
.
url
+
url
);
}
else
if
(
i
==
2
)
{
LinearLayout
.
LayoutParams
lp
=
(
LinearLayout
.
LayoutParams
)
pic1
.
getLayoutParams
();
lp
.
width
=
(
ScreenUtil
.
getScreenWidth
(
MonthCardDetailActivity
.
this
)
-
UIUtil
.
Dp2Px
(
MonthCardDetailActivity
.
this
,
84
))
/
3
;
pic1
.
setLayoutParams
(
lp
);
LinearLayout
.
LayoutParams
lp2
=
(
LinearLayout
.
LayoutParams
)
pic2
.
getLayoutParams
();
lp2
.
width
=
(
ScreenUtil
.
getScreenWidth
(
MonthCardDetailActivity
.
this
)
-
UIUtil
.
Dp2Px
(
MonthCardDetailActivity
.
this
,
84
))
/
3
;
pic2
.
setLayoutParams
(
lp2
);
LinearLayout
.
LayoutParams
lp3
=
(
LinearLayout
.
LayoutParams
)
pic3
.
getLayoutParams
();
lp3
.
width
=
(
ScreenUtil
.
getScreenWidth
(
MonthCardDetailActivity
.
this
)
-
UIUtil
.
Dp2Px
(
MonthCardDetailActivity
.
this
,
84
))
/
3
;
pic2
.
setLayoutParams
(
lp3
);
pic3
.
setVisibility
(
View
.
VISIBLE
);
netPicUtil
.
display
(
pic3
,
qiNiuTokenBean
.
url
+
url
);
}
...
...
app/src/main/res/layout/activity_month_card_detail.xml
View file @
977a57c2
...
...
@@ -210,62 +210,59 @@
android:id=
"@+id/picsFrame"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@android:color/white"
android:layout_below=
"@id/frame2"
android:translationZ=
"10dp"
android:layout_marginTop=
"12dp"
android:layout_marginLeft=
"22dp"
android:layout_marginRight=
"22dp"
>
<TextView
android:id=
"@+id/picTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:textSize=
"14sp"
android:textColor=
"#2D506B"
android:layout_marginTop=
"19dp"
android:layout_marginBottom=
"9dp"
android:background=
"@color/white"
android:text=
"相关证件"
/>
android:layout_marginRight=
"22dp"
android:layout_marginTop=
"12dp"
android:background=
"@android:color/white"
android:translationZ=
"10dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_below=
"@id/picTitle"
android:layout_marginBottom=
"22dp"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:
layout_marginBottom=
"22dp
"
android:
orientation=
"horizontal
"
android:weightSum=
"3"
>
<ImageView
android:id=
"@+id/pic1"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
100dp
"
android:layout_height=
"90dp"
android:layout_weight=
"1"
android:background=
"#eeeeee"
/>
android:background=
"#eeeeee"
/>
<ImageView
android:id=
"@+id/pic2"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
100dp
"
android:layout_height=
"90dp"
android:layout_weight=
"1"
android:background=
"#eeeeee"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
android:visibility=
"gone"
/>
android:background=
"#eeeeee"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/pic3"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
100dp
"
android:layout_height=
"90dp"
android:layout_weight=
"1"
android:background=
"#eeeeee"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
</LinearLayout>
<TextView
android:id=
"@+id/picTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"9dp"
android:layout_marginTop=
"19dp"
android:background=
"@color/white"
android:text=
"相关证件"
android:textColor=
"#2D506B"
android:textSize=
"14sp"
/>
</cn.mctower.visitor.RoundLayout>
<TextView
...
...
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