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
67cd831c
Commit
67cd831c
authored
Oct 30, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人中心优化
parent
84e5c9a2
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1574 additions
and
125 deletions
+1574
-125
HomeFragment.java
...java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
+3
-2
MineFragment.java
module_mine/src/main/java/com/rv/rvmine/MineFragment.java
+5
-1
BindPhoneSecondFragment.java
.../java/com/rv/rvmine/fragment/BindPhoneSecondFragment.java
+2
-2
BindPhoneThirdFragment.java
...n/java/com/rv/rvmine/fragment/BindPhoneThirdFragment.java
+2
-2
AccountSafeActivity.java
...main/java/com/rv/rvmine/traveler/AccountSafeActivity.java
+13
-13
AlterNickNameActivity.java
...in/java/com/rv/rvmine/traveler/AlterNickNameActivity.java
+1
-0
PersonalInformationActivity.java
...a/com/rv/rvmine/traveler/PersonalInformationActivity.java
+137
-105
DateItem.java
module_mine/src/main/java/com/rv/rvmine/view/DateItem.java
+78
-0
DateTimeWheelDialog.java
...src/main/java/com/rv/rvmine/view/DateTimeWheelDialog.java
+309
-0
IWheel.java
module_mine/src/main/java/com/rv/rvmine/view/IWheel.java
+6
-0
IWheelViewSetting.java
...e/src/main/java/com/rv/rvmine/view/IWheelViewSetting.java
+28
-0
WheelItem.java
module_mine/src/main/java/com/rv/rvmine/view/WheelItem.java
+15
-0
WheelItemView.java
..._mine/src/main/java/com/rv/rvmine/view/WheelItemView.java
+115
-0
WheelMaskView.java
..._mine/src/main/java/com/rv/rvmine/view/WheelMaskView.java
+70
-0
WheelView.java
module_mine/src/main/java/com/rv/rvmine/view/WheelView.java
+722
-0
activity_mine.xml
module_mine/src/main/res/layout/activity_mine.xml
+1
-0
wheel_dialog_base.xml
module_mine/src/main/res/layout/wheel_dialog_base.xml
+41
-0
styles.xml
module_mine/src/main/res/values/styles.xml
+9
-0
wheel_attrs.xml
module_mine/src/main/res/values/wheel_attrs.xml
+17
-0
No files found.
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
View file @
67cd831c
...
...
@@ -1077,15 +1077,16 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
case
3
:
rvTourLatitude
=
lat
;
rvTourLongitude
=
lon
;
if
(
tvRvCity
!=
null
)
{
if
(
tvRvCity
!=
null
&&
!
TextUtils
.
isEmpty
(
data
)
)
{
tvRvCity
.
setText
(
data
);
}
break
;
case
4
:
if
(
travelCityText
!=
null
&&
!
TextUtils
.
isEmpty
(
data
))
travelCityText
.
setText
(
data
);
// headTvGetCity.setText(data);
// headTvOutCity.setText(data);
if
(
tvRvCity
!=
null
)
{
if
(
tvRvCity
!=
null
&&
!
TextUtils
.
isEmpty
(
data
)
)
{
tvRvCity
.
setText
(
data
);
}
getShopList
(
false
);
...
...
module_mine/src/main/java/com/rv/rvmine/MineFragment.java
View file @
67cd831c
...
...
@@ -550,7 +550,11 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
if
(
info
!=
null
)
{
GlideManager
.
getInstance
(
_mActivity
).
loadImage
(
info
.
getHeadimgurl
(),
ivAvatar
);
tvNickname
.
setText
(
info
.
getNickname
());
tvCapacity
.
setText
(
info
.
getPositionName
());
if
(!
TextUtils
.
isEmpty
(
info
.
getPositionName
())){
tvCapacity
.
setText
(
info
.
getPositionName
());
tvCapacity
.
setVisibility
(
View
.
VISIBLE
);
}
//更新实名信息
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_USERINFO
,
JSON
.
toJSONString
(
info
)).
commit
();
if
(
info
.
getCertificationStatus
()
==
0
)
{
//实名认证状态:0-未认证,1-已认证
...
...
module_mine/src/main/java/com/rv/rvmine/fragment/BindPhoneSecondFragment.java
View file @
67cd831c
...
...
@@ -192,8 +192,8 @@ public class BindPhoneSecondFragment extends BaseFragment<CommonPresenter> {
}
@Override
public
void
on
Stop
()
{
super
.
on
Stop
();
public
void
on
DestroyView
()
{
super
.
on
DestroyView
();
stopCarousel
();
}
...
...
module_mine/src/main/java/com/rv/rvmine/fragment/BindPhoneThirdFragment.java
View file @
67cd831c
...
...
@@ -205,8 +205,8 @@ public class BindPhoneThirdFragment extends BaseFragment<CommonPresenter> {
}
@Override
public
void
on
Stop
()
{
super
.
on
Stop
();
public
void
on
DestroyView
()
{
super
.
on
DestroyView
();
stopCarousel
();
}
...
...
module_mine/src/main/java/com/rv/rvmine/traveler/AccountSafeActivity.java
View file @
67cd831c
...
...
@@ -224,18 +224,6 @@ public class AccountSafeActivity extends BaseStatusActivity<CommonPresenter> imp
}
private
void
setQqInfo
()
{
hasBindWX
=
bean
.
getData
().
isBindWx
();
if
(
hasBindWX
)
{
String
wx
=
bean
.
getData
().
getWxNickname
();
tvWx
.
setTextColor
(
Color
.
parseColor
(
"#171413"
));
tvWx
.
setText
(!
TextUtils
.
isEmpty
(
wx
)
?
wx
:
"已绑定"
);
}
else
{
tvWx
.
setTextColor
(
Color
.
parseColor
(
"#cccccc"
));
tvWx
.
setText
(
"去授权绑定QQ"
);
}
}
private
void
setWxInfo
()
{
hasBindQQ
=
bean
.
getData
().
isBindQQ
();
if
(
hasBindQQ
)
{
String
qq
=
bean
.
getData
().
getQqNickname
();
...
...
@@ -243,7 +231,19 @@ public class AccountSafeActivity extends BaseStatusActivity<CommonPresenter> imp
tvQQ
.
setText
(!
TextUtils
.
isEmpty
(
qq
)
?
qq
:
"已绑定"
);
}
else
{
tvQQ
.
setTextColor
(
Color
.
parseColor
(
"#cccccc"
));
tvQQ
.
setText
(
"去授权绑定微信"
);
tvQQ
.
setText
(
"去授权绑定QQ"
);
}
}
private
void
setWxInfo
()
{
hasBindWX
=
bean
.
getData
().
isBindWx
();
if
(
hasBindWX
)
{
String
wx
=
bean
.
getData
().
getWxNickname
();
tvWx
.
setTextColor
(
Color
.
parseColor
(
"#171413"
));
tvWx
.
setText
(!
TextUtils
.
isEmpty
(
wx
)
?
wx
:
"已绑定"
);
}
else
{
tvWx
.
setTextColor
(
Color
.
parseColor
(
"#cccccc"
));
tvWx
.
setText
(
"去授权绑定微信"
);
}
}
...
...
module_mine/src/main/java/com/rv/rvmine/traveler/AlterNickNameActivity.java
View file @
67cd831c
...
...
@@ -53,6 +53,7 @@ public class AlterNickNameActivity extends BaseStatusActivity<CommonPresenter> {
private
void
upUserinfo
()
{
if
(
TextUtils
.
isEmpty
(
getNickName
()))
{
showToast
(
"昵称不能为空"
);
return
;
}
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
"nick"
,
getNickName
());
...
...
module_mine/src/main/java/com/rv/rvmine/traveler/PersonalInformationActivity.java
View file @
67cd831c
This diff is collapsed.
Click to expand it.
module_mine/src/main/java/com/rv/rvmine/view/DateItem.java
0 → 100644
View file @
67cd831c
package
com
.
rv
.
rvmine
.
view
;
import
android.support.annotation.IntDef
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.util.Locale
;
/**
* <br>Email:1006368252@qq.com
* <br>QQ:1006368252
* <br><a href="https://github.com/JustinRoom/WheelViewDemo" target="_blank">https://github.com/JustinRoom/WheelViewDemo</a>
*
* @author jiangshicheng
*/
public
class
DateItem
implements
IWheel
{
public
static
final
int
TYPE_YEAR
=
0
;
public
static
final
int
TYPE_MONTH
=
1
;
public
static
final
int
TYPE_DAY
=
2
;
public
static
final
int
TYPE_HOUR
=
3
;
public
static
final
int
TYPE_MINUTE
=
4
;
@IntDef
({
TYPE_YEAR
,
TYPE_MONTH
,
TYPE_DAY
,
TYPE_HOUR
,
TYPE_MINUTE
})
@Retention
(
RetentionPolicy
.
SOURCE
)
public
@interface
DateType
{
}
private
int
type
;
private
int
value
;
public
DateItem
()
{
}
public
DateItem
(
int
value
)
{
this
(
TYPE_YEAR
,
value
);
}
public
DateItem
(
@DateType
int
type
,
int
value
)
{
this
.
type
=
type
;
this
.
value
=
value
;
}
public
int
getValue
()
{
return
value
;
}
public
void
setValue
(
int
value
)
{
this
.
value
=
value
;
}
@Override
public
String
getShowText
()
{
return
String
.
format
(
Locale
.
CHINA
,
getFormatStringByType
(),
(
value
<
10
?
"0"
+
value
:
""
+
value
));
}
private
String
getFormatStringByType
()
{
String
result
=
""
;
switch
(
type
)
{
case
TYPE_YEAR:
result
=
"%s年"
;
break
;
case
TYPE_MONTH:
result
=
"%s月"
;
break
;
case
TYPE_DAY:
result
=
"%s日"
;
break
;
case
TYPE_HOUR:
result
=
"%s时"
;
break
;
case
TYPE_MINUTE:
result
=
"%s分"
;
break
;
}
return
result
;
}
}
module_mine/src/main/java/com/rv/rvmine/view/DateTimeWheelDialog.java
0 → 100644
View file @
67cd831c
This diff is collapsed.
Click to expand it.
module_mine/src/main/java/com/rv/rvmine/view/IWheel.java
0 → 100644
View file @
67cd831c
package
com
.
rv
.
rvmine
.
view
;
public
interface
IWheel
{
String
getShowText
();
}
module_mine/src/main/java/com/rv/rvmine/view/IWheelViewSetting.java
0 → 100644
View file @
67cd831c
package
com
.
rv
.
rvmine
.
view
;
import
android.support.annotation.ColorInt
;
public
interface
IWheelViewSetting
{
void
setTextSize
(
float
textSize
);
void
setTextColor
(
@ColorInt
int
textColor
);
void
setShowCount
(
int
showCount
);
void
setTotalOffsetX
(
int
totalOffsetX
);
void
setItemVerticalSpace
(
int
itemVerticalSpace
);
void
setItems
(
IWheel
[]
items
);
int
getSelectedIndex
();
void
setSelectedIndex
(
int
targetIndexPosition
);
void
setSelectedIndex
(
int
targetIndexPosition
,
boolean
withAnimation
);
void
setOnSelectedListener
(
WheelView
.
OnSelectedListener
onSelectedListener
);
boolean
isScrolling
();
}
module_mine/src/main/java/com/rv/rvmine/view/WheelItem.java
0 → 100644
View file @
67cd831c
package
com
.
rv
.
rvmine
.
view
;
public
class
WheelItem
implements
IWheel
{
String
label
;
public
WheelItem
(
String
label
)
{
this
.
label
=
label
;
}
@Override
public
String
getShowText
()
{
return
label
;
}
}
module_mine/src/main/java/com/rv/rvmine/view/WheelItemView.java
0 → 100644
View file @
67cd831c
package
com
.
rv
.
rvmine
.
view
;
import
android.content.Context
;
import
android.support.annotation.ColorInt
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
import
android.util.AttributeSet
;
import
android.view.ViewGroup
;
import
android.widget.FrameLayout
;
public
class
WheelItemView
extends
FrameLayout
implements
IWheelViewSetting
{
private
WheelView
wheelView
;
private
WheelMaskView
wheelMaskView
;
public
WheelItemView
(
@NonNull
Context
context
)
{
super
(
context
);
initAttr
(
context
,
null
,
0
);
}
public
WheelItemView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
initAttr
(
context
,
attrs
,
0
);
}
public
WheelItemView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
initAttr
(
context
,
attrs
,
defStyleAttr
);
}
private
void
initAttr
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
wheelView
=
new
WheelView
(
context
);
wheelView
.
initAttr
(
context
,
attrs
,
defStyleAttr
);
wheelMaskView
=
new
WheelMaskView
(
context
);
wheelMaskView
.
initAttr
(
context
,
attrs
,
defStyleAttr
);
addView
(
wheelView
,
new
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
));
addView
(
wheelMaskView
,
new
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
));
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
ViewGroup
.
LayoutParams
params
=
wheelMaskView
.
getLayoutParams
();
params
.
height
=
wheelView
.
getMeasuredHeight
();
wheelMaskView
.
setLayoutParams
(
params
);
wheelMaskView
.
updateMask
(
wheelView
.
getShowCount
(),
wheelView
.
getItemHeight
());
}
@Override
public
void
setTextSize
(
float
textSize
)
{
wheelView
.
setTextSize
(
textSize
);
}
@Override
public
void
setTextColor
(
@ColorInt
int
textColor
)
{
wheelView
.
setTextColor
(
textColor
);
}
@Override
public
void
setShowCount
(
int
showCount
)
{
wheelView
.
setShowCount
(
showCount
);
}
@Override
public
void
setTotalOffsetX
(
int
totalOffsetX
)
{
wheelView
.
setTotalOffsetX
(
totalOffsetX
);
}
@Override
public
void
setItemVerticalSpace
(
int
itemVerticalSpace
)
{
wheelView
.
setItemVerticalSpace
(
itemVerticalSpace
);
}
@Override
public
void
setItems
(
IWheel
[]
items
)
{
wheelView
.
setItems
(
items
);
}
@Override
public
int
getSelectedIndex
()
{
return
wheelView
.
getSelectedIndex
();
}
@Override
public
void
setSelectedIndex
(
int
targetIndexPosition
)
{
setSelectedIndex
(
targetIndexPosition
,
true
);
}
@Override
public
void
setSelectedIndex
(
int
targetIndexPosition
,
boolean
withAnimation
)
{
wheelView
.
setSelectedIndex
(
targetIndexPosition
,
withAnimation
);
}
@Override
public
void
setOnSelectedListener
(
WheelView
.
OnSelectedListener
onSelectedListener
)
{
wheelView
.
setOnSelectedListener
(
onSelectedListener
);
}
public
void
setMaskLineColor
(
@ColorInt
int
color
)
{
wheelMaskView
.
setLineColor
(
color
);
}
@Override
public
boolean
isScrolling
()
{
return
wheelView
.
isScrolling
();
}
public
WheelView
getWheelView
()
{
return
wheelView
;
}
public
WheelMaskView
getWheelMaskView
()
{
return
wheelMaskView
;
}
}
module_mine/src/main/java/com/rv/rvmine/view/WheelMaskView.java
0 → 100644
View file @
67cd831c
package
com
.
rv
.
rvmine
.
view
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.Canvas
;
import
android.graphics.Paint
;
import
android.support.annotation.ColorInt
;
import
android.support.annotation.Nullable
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
com.rv.rvmine.R
;
public
class
WheelMaskView
extends
View
{
private
Paint
paint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
private
int
top
=
0
;
private
int
bottom
=
0
;
private
int
lineColor
=
0xFFEEEEEE
;
public
WheelMaskView
(
Context
context
)
{
super
(
context
);
initAttr
(
context
,
null
,
0
);
}
public
WheelMaskView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
initAttr
(
context
,
attrs
,
0
);
}
public
WheelMaskView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
initAttr
(
context
,
attrs
,
defStyleAttr
);
}
public
void
initAttr
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
TypedArray
a
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
WheelMaskView
,
defStyleAttr
,
0
);
lineColor
=
a
.
getColor
(
R
.
styleable
.
WheelMaskView_wheelMaskLineColor
,
0xFFEEEEEE
);
a
.
recycle
();
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setStrokeWidth
(
1
);
}
public
void
updateMask
(
int
heightCount
,
int
itemHeight
)
{
if
(
heightCount
>
0
)
{
int
centerIndex
=
heightCount
/
2
;
top
=
centerIndex
*
itemHeight
;
bottom
=
top
+
itemHeight
;
}
else
{
top
=
0
;
bottom
=
0
;
}
invalidate
();
}
public
void
setLineColor
(
@ColorInt
int
lineColor
)
{
this
.
lineColor
=
lineColor
;
invalidate
();
}
@Override
protected
void
onDraw
(
Canvas
canvas
)
{
if
(
top
>
0
&&
bottom
>
0
)
{
paint
.
setColor
(
lineColor
);
canvas
.
drawLine
(
0
,
top
,
getWidth
(),
top
,
paint
);
canvas
.
drawLine
(
0
,
bottom
,
getWidth
(),
bottom
,
paint
);
}
}
}
module_mine/src/main/java/com/rv/rvmine/view/WheelView.java
0 → 100644
View file @
67cd831c
This diff is collapsed.
Click to expand it.
module_mine/src/main/res/layout/activity_mine.xml
View file @
67cd831c
...
...
@@ -161,6 +161,7 @@
</LinearLayout>
<TextView
android:visibility=
"gone"
android:id=
"@+id/tv_capacity"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
module_mine/src/main/res/layout/wheel_dialog_base.xml
0 → 100644
View file @
67cd831c
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/size_30"
android:layout_marginRight=
"@dimen/size_30"
android:background=
"@drawable/shape_rv_bg_write"
android:orientation=
"vertical"
>
<TextView
android:textStyle=
"bold"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
android:gravity=
"center"
android:text=
"生日"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_20"
/>
<include
layout=
"@layout/common_line"
/>
<LinearLayout
android:id=
"@+id/wheel_id_picker_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
/>
<Button
android:id=
"@+id/btn_confirm"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_40"
android:layout_marginLeft=
"@dimen/size_20"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginRight=
"@dimen/size_20"
android:layout_marginBottom=
"@dimen/size_20"
android:background=
"@drawable/shape_rv_bg_fdc349"
android:gravity=
"center"
android:text=
"确定"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_16"
/>
</LinearLayout>
\ No newline at end of file
module_mine/src/main/res/values/styles.xml
View file @
67cd831c
...
...
@@ -8,4 +8,13 @@
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
</style>
<style
name=
"WheelDialog"
parent=
"android:style/Theme.Dialog"
>
<item
name=
"android:windowFrame"
>
@null
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
<item
name=
"android:windowBackground"
>
@android:color/transparent
</item>
<item
name=
"android:background"
>
@android:color/transparent
</item>
<item
name=
"android:windowIsFloating"
>
true
</item>
<item
name=
"android:windowContentOverlay"
>
@null
</item>
</style>
</resources>
module_mine/src/main/res/values/wheel_attrs.xml
0 → 100644
View file @
67cd831c
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"WheelView"
>
<attr
name=
"wheelTextColor"
format=
"color"
/>
<attr
name=
"wheelTextSize"
format=
"dimension"
/>
<attr
name=
"wheelShowCount"
format=
"integer"
/>
<attr
name=
"wheelTotalOffsetX"
format=
"dimension"
/>
<attr
name=
"wheelItemVerticalSpace"
format=
"dimension"
/>
<attr
name=
"wheelRotationX"
format=
"float"
/>
<attr
name=
"wheelVelocityUnits"
format=
"integer"
/>
</declare-styleable>
<declare-styleable
name=
"WheelMaskView"
>
<attr
name=
"wheelMaskLineColor"
format=
"color"
/>
</declare-styleable>
</resources>
\ No newline at end of file
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