Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
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
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
bp
ShenghuoquanBusiness
Commits
2406e9bb
Commit
2406e9bb
authored
Jun 15, 2021
by
shiyuelong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add选择职业标签页面
parent
3aa39181
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
243 additions
and
2 deletions
+243
-2
XRouterPathConstants.kt
...n/src/main/java/com/yidian/common/XRouterPathConstants.kt
+2
-0
layout_common_toolbar.xml
...nLib/Common/src/main/res/layout/layout_common_toolbar.xml
+1
-1
AndroidManifest.xml
Components/newscontent/src/main/AndroidManifest.xml
+3
-0
FirstCareerListAdapter.kt
...henghuoquan/newscontent/adapter/FirstCareerListAdapter.kt
+35
-0
SecondCareerListAdapter.kt
...enghuoquan/newscontent/adapter/SecondCareerListAdapter.kt
+32
-0
NewsContentApplication.kt
...an/shenghuoquan/newscontent/app/NewsContentApplication.kt
+12
-0
ChooseCareerActivity.kt
.../shenghuoquan/newscontent/ui/auth/ChooseCareerActivity.kt
+72
-0
LifeAccountAuthActivity.kt
...enghuoquan/newscontent/ui/auth/LifeAccountAuthActivity.kt
+1
-1
activity_choose_career.xml
...ewscontent/src/main/res/layout/activity_choose_career.xml
+39
-0
item_career_first_list.xml
...ewscontent/src/main/res/layout/item_career_first_list.xml
+22
-0
item_career_second_list.xml
...wscontent/src/main/res/layout/item_career_second_list.xml
+23
-0
strings.xml
Components/newscontent/src/main/res/values/strings.xml
+1
-0
No files found.
CommonLib/Common/src/main/java/com/yidian/common/XRouterPathConstants.kt
View file @
2406e9bb
...
...
@@ -25,6 +25,8 @@ class XRouterPathConstants {
const
val
LIFE_ACCOUNT_ENTERPRISE_AUTH_COMPLETE
=
"/lifeAccountEnterpriseAuthComplete"
const
val
LIFE_ACCOUNT_ENTERPRISE_AUTH
=
"/lifeAccountEnterpriseAuth"
const
val
LIFE_NUMBER
=
"/lifeNumberActivity"
// 选择职业标签
const
val
CHOOSE_CAREER
=
"/chooseCareerActivity"
// 人员管理 —— 我的员工
const
val
PERSONAL_MY_STAFF
=
"/personal/myStaffActivity"
...
...
CommonLib/Common/src/main/res/layout/layout_common_toolbar.xml
View file @
2406e9bb
...
...
@@ -5,13 +5,13 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"?attr/colorPrimary"
android:fitsSystemWindows=
"true"
android:minHeight=
"50dp"
...
...
Components/newscontent/src/main/AndroidManifest.xml
View file @
2406e9bb
...
...
@@ -135,6 +135,9 @@
<activity
android:name=
".ui.center.MerchantAuthInfoActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.auth.ChooseCareerActivity"
android:theme=
"@style/Transparent"
/>
</application>
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/adapter/FirstCareerListAdapter.kt
0 → 100644
View file @
2406e9bb
package
com.yidian.shenghuoquan.newscontent.adapter
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.yidian.shenghuoquan.newscontent.R
/**
* 选择职业数据适配器
*/
class
FirstCareerListAdapter
:
BaseQuickAdapter
<
String
,
BaseViewHolder
>(
R
.
layout
.
item_career_first_list
)
{
//记录当前选中的条目索引
private
var
selectedIndex
=
0
fun
setSelectedIndex
(
position
:
Int
)
{
selectedIndex
=
position
notifyDataSetChanged
()
}
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
String
)
{
val
position
=
holder
.
adapterPosition
val
firstCareer
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_first_career
)
firstCareer
.
text
=
item
if
(
selectedIndex
==
position
)
{
holder
.
itemView
.
setBackgroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
white
))
firstCareer
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_1852F1
))
}
else
{
holder
.
itemView
.
setBackgroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFF2F2F2
))
firstCareer
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_333333
))
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/adapter/SecondCareerListAdapter.kt
0 → 100644
View file @
2406e9bb
package
com.yidian.shenghuoquan.newscontent.adapter
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.yidian.shenghuoquan.newscontent.R
class
SecondCareerListAdapter
:
BaseQuickAdapter
<
String
,
BaseViewHolder
>(
R
.
layout
.
item_career_second_list
)
{
//记录当前选中的条目索引
private
var
selectedIndex
=
0
fun
setSelectedIndex
(
position
:
Int
)
{
selectedIndex
=
position
notifyDataSetChanged
()
}
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
String
)
{
val
position
=
holder
.
adapterPosition
val
secondCareer
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_second_career
)
secondCareer
.
text
=
item
if
(
selectedIndex
==
position
)
{
secondCareer
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_1852F1
))
}
else
{
secondCareer
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_333333
))
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/app/NewsContentApplication.kt
View file @
2406e9bb
...
...
@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.newscontent.app
import
android.content.Intent
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants.Companion.CHOOSE_CAREER
import
com.yidian.common.XRouterPathConstants.Companion.FLASH
import
com.yidian.common.XRouterPathConstants.Companion.GALLERY
import
com.yidian.common.XRouterPathConstants.Companion.ID_CARD_TEST
...
...
@@ -255,6 +256,17 @@ class NewsContentApplication : YdBaseApplication() {
context
.
startActivity
(
intent
)
}
}),
XPageNode
(
CHOOSE_CAREER
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
val
intent
=
Intent
()
if
(
params
!=
null
)
{
intent
.
putExtra
(
XRouterPathConstants
.
ParamsKey
,
params
as
HashMap
)
}
intent
.
setClass
(
context
,
ChooseCareerActivity
::
class
.
java
)
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
context
.
startActivity
(
intent
)
}
}),
// 人员管理 —— 我的员工
XPageNode
(
PERSONAL_MY_STAFF
,
XPageNodePageType
.
NATIVE
,
object
:
XPageHandler
{
override
fun
handler
(
params
:
Map
<
String
,
Any
?
>?)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/ChooseCareerActivity.kt
0 → 100644
View file @
2406e9bb
package
com.yidian.shenghuoquan.newscontent.ui.auth
import
android.os.Bundle
import
com.yidian.common.XRouterPathConstants.Companion.CHOOSE_CAREER
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.extensions.initTitleBar
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.adapter.FirstCareerListAdapter
import
com.yidian.shenghuoquan.newscontent.adapter.SecondCareerListAdapter
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityChooseCareerBinding
import
com.yidian.utils.ToastUtil
/**
* 选择职业标签
*/
class
ChooseCareerActivity
:
BaseActivity
<
ActivityChooseCareerBinding
>()
{
var
secondCareer1
=
arrayListOf
(
"第一职业1"
,
"第一职业2"
,
"第一职业3"
,
"第一职业4"
,
"第一职业5"
)
var
secondCareer2
=
arrayListOf
(
"第二职业1"
,
"第二职业2"
,
"第二职业3"
,
"第二职业4"
,
"第二职业5"
)
var
secondCareer3
=
arrayListOf
(
"第三职业1"
,
"第三职业2"
,
"第三职业3"
,
"第三职业4"
,
"第三职业5"
)
var
secondCareer4
=
arrayListOf
(
"第四职业1"
,
"第四职业2"
,
"第四职业3"
,
"第四职业4"
,
"第四职业5"
)
var
firstCareer
=
arrayListOf
(
"互联网"
,
"金融类"
,
"公务员"
,
"自由职业"
)
private
val
firstListAdapter
:
FirstCareerListAdapter
by
lazy
{
FirstCareerListAdapter
()
}
private
val
secondListAdapter
:
SecondCareerListAdapter
by
lazy
{
SecondCareerListAdapter
()
}
override
fun
createViewBinding
():
ActivityChooseCareerBinding
{
return
ActivityChooseCareerBinding
.
inflate
(
layoutInflater
)
}
override
fun
getXPageName
():
String
{
return
CHOOSE_CAREER
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
initView
()
}
private
fun
initView
()
{
initTitleBar
(
viewBind
.
include
.
toolbar
,
viewBind
.
include
.
tvTitle
,
resources
.
getString
(
R
.
string
.
choose_career
))
viewBind
.
rvListFirst
.
adapter
=
firstListAdapter
viewBind
.
rvListSecond
.
adapter
=
secondListAdapter
firstListAdapter
.
setList
(
firstCareer
)
secondListAdapter
.
setList
(
secondCareer1
)
firstListAdapter
.
setOnItemClickListener
{
_
,
_
,
position
->
when
(
position
)
{
0
->
{
secondListAdapter
.
setList
(
secondCareer1
)
}
1
->
{
secondListAdapter
.
setList
(
secondCareer2
)
}
2
->
{
secondListAdapter
.
setList
(
secondCareer3
)
}
3
->
{
secondListAdapter
.
setList
(
secondCareer4
)
}
}
firstListAdapter
.
setSelectedIndex
(
position
)
}
secondListAdapter
.
setOnItemClickListener
{
adapter
,
_
,
position
->
secondListAdapter
.
setSelectedIndex
(
position
)
val
secondCareer
=
adapter
.
data
[
position
]
as
String
// todo 回传选择的职业
ToastUtil
.
showToast
(
this
,
"选择的职业:$secondCareer"
)
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountAuthActivity.kt
View file @
2406e9bb
...
...
@@ -110,4 +110,4 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
"request auth merchant check failure, message: $message"
)
}
}
\ No newline at end of file
}
Components/newscontent/src/main/res/layout/activity_choose_career.xml
0 → 100644
View file @
2406e9bb
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_F5F6F7"
android:orientation=
"vertical"
>
<include
android:id=
"@+id/include"
layout=
"@layout/layout_common_toolbar"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_list_first"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:background=
"@color/color_FFF2F2F2"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount=
"6"
tools:listitem=
"@layout/item_career_first_list"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_list_second"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount=
"6"
tools:listitem=
"@layout/item_career_second_list"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Components/newscontent/src/main/res/layout/item_career_first_list.xml
0 → 100644
View file @
2406e9bb
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"@dimen/dp136"
android:layout_height=
"@dimen/dp60"
android:paddingStart=
"@dimen/dp15"
android:paddingEnd=
"@dimen/dp15"
>
<TextView
android:id=
"@+id/tv_first_career"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"职业一级列表"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Components/newscontent/src/main/res/layout/item_career_second_list.xml
0 → 100644
View file @
2406e9bb
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:paddingStart=
"@dimen/dp15"
android:paddingEnd=
"@dimen/dp15"
>
<TextView
android:id=
"@+id/tv_second_career"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"职业二级列表"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Components/newscontent/src/main/res/values/strings.xml
View file @
2406e9bb
...
...
@@ -144,6 +144,7 @@
<string
name=
"apply_auth_merchant_description"
>
通过即享更多曝光 · 权威认证 · 服务能力
</string>
<string
name=
"modify_auth"
>
修改认证
</string>
<string
name=
"choose_career"
>
选择职业标签
</string>
<string
name=
"my_staff"
>
我的员工
</string>
<string
name=
"manager_account_change_tips"
>
管理员账号替换后,原账户将无法操作生活号所有功能,同时将自动退出当前登录状态,新账号将继承原账号所有权益。
</string>
<string
name=
"manager_register_tips"
>
未注册生活圈的手机号,登录时将自动注册,且代表你已经同意《用户协议》《隐私政策》。
</string>
...
...
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