Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RvApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
lify
RvApp
Commits
18e6e79e
Commit
18e6e79e
authored
Oct 15, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新版 版本检测完成,修改版本检测升级逻辑
parent
25086179
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
72 additions
and
21 deletions
+72
-21
MainActivity.java
RvClient/src/main/java/com/xxfc/rv/MainActivity.java
+2
-2
VersionUpdateDialog.java
...ion/src/main/java/com/rv/version/VersionUpdateDialog.java
+13
-0
TransformationUtils.java
...rc/main/java/com/rv/version/util/TransformationUtils.java
+39
-0
bg_version.png
plugin_version/src/main/res/drawable-hdpi/bg_version.png
+0
-0
bg_version.png
plugin_version/src/main/res/drawable-xhdpi/bg_version.png
+0
-0
dialog_update_view.xml
plugin_version/src/main/res/layout/dialog_update_view.xml
+13
-16
dimens.xml
plugin_version/src/main/res/values-hdpi/dimens.xml
+1
-1
dimens.xml
plugin_version/src/main/res/values-xhdpi/dimens.xml
+3
-1
dimens.xml
plugin_version/src/main/res/values-xxhdpi/dimens.xml
+1
-1
No files found.
RvClient/src/main/java/com/xxfc/rv/MainActivity.java
View file @
18e6e79e
...
...
@@ -42,6 +42,7 @@ import com.ruiwenliu.wrapper.bean.UpdateTokenBean;
import
com.ruiwenliu.wrapper.receiver.NetWorkReceiver
;
import
com.ruiwenliu.wrapper.statusbar.StatusBarUtil
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.util.glide.GlideApp
;
import
com.ruiwenliu.wrapper.util.listener.SwitchFragment
;
import
com.ruiwenliu.wrapper.weight.CustomScrollViewPager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
...
...
@@ -218,7 +219,6 @@ public class MainActivity extends BaseActivity<CommonPresenter> implements DownL
getEffectiveTime
();
getActivityPopup
();
checkVersion
();
checkToken
();
}
...
...
@@ -542,7 +542,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> implements DownL
public
void
onResume
()
{
super
.
onResume
();
imLogin
();
if
(
hasGetVersionInfo
&&
versionCheckBean
!=
null
&&
versionCheckBean
.
getData
()
!=
null
&&
versionCheckBean
.
getData
().
getIsCompel
()
==
1
&&
!
TextUtils
.
isEmpty
(
versionCheckBean
.
getData
().
getDownloadUrl
()))
if
(
!
DownListenerManager
.
getInstance
().
isDown
()
&&
hasGetVersionInfo
&&
versionCheckBean
!=
null
&&
versionCheckBean
.
getData
()
!=
null
&&
versionCheckBean
.
getData
().
getIsCompel
()
==
1
&&
!
TextUtils
.
isEmpty
(
versionCheckBean
.
getData
().
getDownloadUrl
()))
checkUpdateInfo
();
}
...
...
plugin_version/src/main/java/com/rv/version/VersionUpdateDialog.java
View file @
18e6e79e
...
...
@@ -42,6 +42,7 @@ public class VersionUpdateDialog extends BaseDialog {
private
TextView
txtContent
;
private
TextView
tv_version_name
;
private
ImageView
imgClose
;
// private ImageView ivHeader ;
private
DownloadListener
mListener
;
private
UpdateForceDialog
forceDialog
;
...
...
@@ -82,6 +83,18 @@ public class VersionUpdateDialog extends BaseDialog {
this
.
txtContent
=
layout
.
findViewById
(
R
.
id
.
txt_content
);
this
.
btn_update
=
layout
.
findViewById
(
R
.
id
.
btn_update
);
this
.
imgClose
=
layout
.
findViewById
(
R
.
id
.
img_close
);
// ivHeader = layout.findViewById(R.id.iv_header) ;
// TransformationUtils utils = new TransformationUtils(ivHeader);
//
// GlideApp.with(mContext)
// .asBitmap()
// .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
// .load(R.drawable.icon_member_dialog_top)
// .apply(RequestOptions
// .bitmapTransform(new RoundedCorners(12)).override(ivHeader.getWidth(), ivHeader.getHeight()))
// .into(utils);
this
.
btn_update
.
setOnClickListener
(
view
->
{
if
(
mListener
!=
null
)
{
mListener
.
download
();
...
...
plugin_version/src/main/java/com/rv/version/util/TransformationUtils.java
0 → 100644
View file @
18e6e79e
package
com
.
rv
.
version
.
util
;
import
android.graphics.Bitmap
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
com.bumptech.glide.request.target.ImageViewTarget
;
public
class
TransformationUtils
extends
ImageViewTarget
<
Bitmap
>
{
private
ImageView
target
;
public
TransformationUtils
(
ImageView
target
)
{
super
(
target
);
this
.
target
=
target
;
}
@Override
protected
void
setResource
(
Bitmap
resource
)
{
target
.
setImageBitmap
(
resource
);
if
(
resource
==
null
)
return
;
//获取原图的宽高
int
width
=
resource
.
getWidth
();
int
height
=
resource
.
getHeight
();
//获取imageView的宽
int
imageViewWidth
=
target
.
getWidth
();
//计算缩放比例
float
sy
=
(
float
)
(
imageViewWidth
*
0.1
)
/
(
float
)
(
width
*
0.1
);
//计算图片等比例放大后的高
int
imageViewHeight
=
(
int
)
(
height
*
sy
);
ViewGroup
.
LayoutParams
params
=
target
.
getLayoutParams
();
params
.
height
=
imageViewHeight
;
target
.
setLayoutParams
(
params
);
}
}
\ No newline at end of file
plugin_version/src/main/res/drawable-hdpi/bg_version.png
0 → 100644
View file @
18e6e79e
21.2 KB
plugin_version/src/main/res/drawable-xhdpi/bg_version.png
View replaced file @
25086179
View file @
18e6e79e
58.2 KB
|
W:
|
H:
32.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
plugin_version/src/main/res/layout/dialog_update_view.xml
View file @
18e6e79e
...
...
@@ -10,17 +10,12 @@
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_30"
android:layout_marginRight=
"@dimen/size_30"
android:background=
"@drawable/
dialog_content_bg
"
android:background=
"@drawable/
bg_version
"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dialog_img_height"
android:scaleType=
"centerCrop"
android:src=
"@drawable/icon_dialog_top"
/>
<TextView
android:layout_marginTop=
"@dimen/dialog_img_height"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
...
...
@@ -34,7 +29,7 @@
android:id=
"@+id/tv_version_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_
5
"
android:layout_marginTop=
"@dimen/size_
3
"
android:gravity=
"center"
android:textColor=
"#171413"
android:textSize=
"@dimen/sp_14"
/>
...
...
@@ -42,12 +37,13 @@
<TextView
android:id=
"@+id/txt_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_height=
"0dp"
android:layout_marginTop=
"5dp"
android:gravity=
"left"
android:
lineSpacingMultiplier=
"1.5
"
android:padding
Left=
"1
3dp"
android:
paddingRight=
"13dp
"
android:
paddingLeft=
"33dp
"
android:padding
Right=
"3
3dp"
android:
singleLine=
"false
"
android:textColor=
"#666666"
android:textSize=
"@dimen/sp_12"
/>
...
...
@@ -55,12 +51,13 @@
android:id=
"@+id/btn_update"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_40"
android:layout_marginLeft=
"13
s
p"
android:layout_margin
Top=
"13s
p"
android:layout_margin
Right=
"13s
p"
android:layout_marginBottom=
"13
s
p"
android:layout_marginLeft=
"13
d
p"
android:layout_margin
Right=
"13d
p"
android:layout_margin
Top=
"13d
p"
android:layout_marginBottom=
"13
d
p"
android:background=
"@drawable/bg_version_btn"
android:gravity=
"center"
android:layout_gravity=
"bottom"
android:text=
"立即更新"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_16"
/>
...
...
plugin_version/src/main/res/values-hdpi/dimens.xml
View file @
18e6e79e
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen
name=
"dialog_width"
>
160dp
</dimen>
<dimen
name=
"dialog_img_height"
>
55
dp
</dimen>
<dimen
name=
"dialog_img_height"
>
90
dp
</dimen>
</resources>
plugin_version/src/main/res/values-xhdpi/dimens.xml
View file @
18e6e79e
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen
name=
"dialog_width"
>
213.33dp
</dimen>
<dimen
name=
"dialog_img_height"
>
73.33dp
</dimen>
<!--<dimen name="dialog_img_height">73.33dp</dimen>-->
<dimen
name=
"dialog_img_height"
>
120dp
</dimen>
</resources>
plugin_version/src/main/res/values-xxhdpi/dimens.xml
View file @
18e6e79e
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen
name=
"dialog_width"
>
320dp
</dimen>
<dimen
name=
"dialog_img_height"
>
1
1
0dp
</dimen>
<dimen
name=
"dialog_img_height"
>
1
5
0dp
</dimen>
</resources>
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