Skip to content

Commit 49cf440

Browse files
author
hegj
committed
1.添加广场功能
2.自己的文章-删除、查询、添加 3.可以查看他人的信息 4.个人中心界面改版
1 parent bd358d6 commit 49cf440

File tree

130 files changed

+3018
-395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+3018
-395
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
44
package="me.hegj.wandroid">
5-
6-
<uses-permission android:name="android.permission.INTERNET" /> <!-- 联网权限 -->
7-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- SD 卡读权限 -->
8-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- SD 卡写权限 -->
9-
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
10-
5+
<!-- SD 卡读权限 -->
116
<application
127
android:name="com.jess.arms.base.BaseApplication"
138
android:allowBackup="true"
@@ -19,7 +14,6 @@
1914
android:supportsRtl="true"
2015
android:theme="@style/AppTheme"
2116
tools:ignore="GoogleAppIndexingWarning">
22-
2317
<activity
2418
android:name=".mvp.ui.activity.start.SplashActivity"
2519
android:launchMode="singleTask"
@@ -93,24 +87,36 @@
9387
android:label="待办清单"
9488
android:launchMode="singleTask"
9589
android:screenOrientation="portrait" />
96-
9790
<activity
9891
android:name=".mvp.ui.activity.setting.OpenProjectActivity"
9992
android:label="开源项目"
10093
android:launchMode="singleTask"
10194
android:screenOrientation="portrait" />
95+
<activity
96+
android:name=".mvp.ui.activity.share.ShareAriticleActivity"
97+
android:label="分享文章"
98+
android:launchMode="singleTask"
99+
android:screenOrientation="portrait" />
100+
<activity
101+
android:name=".mvp.ui.activity.share.ShareListActivity"
102+
android:label="自己分享的文章列表"
103+
android:launchMode="singleTask"
104+
android:screenOrientation="portrait" />
105+
<activity
106+
android:name=".mvp.ui.activity.share.ShareByIdActivity"
107+
android:label="查看别人的信息"
108+
android:launchMode="singleTask"
109+
android:screenOrientation="portrait" />
102110
<activity
103111
android:name=".mvp.ui.activity.error.ErrorActivity"
104112
android:label="错误界面"
105-
android:process =":error_activity"
106113
android:launchMode="singleTask"
114+
android:process=":error_activity"
107115
android:screenOrientation="portrait" />
108116
<activity
109117
android:name="com.tencent.bugly.beta.ui.BetaActivity"
110118
android:configChanges="keyboardHidden|orientation|screenSize|locale"
111-
android:theme="@android:style/Theme.Translucent" />
112-
113-
<!-- Arms 配置 -->
119+
android:theme="@android:style/Theme.Translucent" /> <!-- Arms 配置 -->
114120
<meta-data
115121
android:name="design_width_in_dp"
116122
android:value="375" />
@@ -130,6 +136,11 @@
130136
android:name="android.support.FILE_PROVIDER_PATHS"
131137
android:resource="@xml/provider_paths" />
132138
</provider>
133-
</application>
139+
</application> <!-- SD 卡写权限 -->
140+
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
141+
<uses-permission android:name="android.permission.INTERNET" />
142+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
143+
144+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
134145

135146
</manifest>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package me.hegj.wandroid.app.event
2+
3+
class AddEvent() : BaseEvent(){
4+
var code = TODO_CODE
5+
6+
constructor(code: Int) : this() {
7+
this.code = code
8+
}
9+
10+
companion object{
11+
//添加清单
12+
val TODO_CODE = 1
13+
//分享文章
14+
val SHARE_CODE = 2
15+
//删除文章
16+
val DELETE_CODE = 3
17+
}
18+
19+
}
20+

app/src/main/java/me/hegj/wandroid/app/event/AddTodoEvent.kt

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/src/main/java/me/hegj/wandroid/app/utils/CacheUtil.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import com.tencent.mmkv.MMKV
77
import me.hegj.wandroid.mvp.model.entity.*
88

99
object CacheUtil {
10-
1110
/**
1211
* 获取保存的账户信息
1312
*/
@@ -76,7 +75,7 @@ object CacheUtil {
7675
val kv = MMKV.mmkvWithID("cache")
7776
val projCacheStr = kv.decodeString("proj")
7877
if (!TextUtils.isEmpty(projCacheStr)) {
79-
return Gson().fromJson<MutableList<ClassifyResponse>>(projCacheStr
78+
return Gson().fromJson(projCacheStr
8079
, object : TypeToken<MutableList<ClassifyResponse>>() {}.type)
8180
}
8281
return mutableListOf()

app/src/main/java/me/hegj/wandroid/app/utils/ColorUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object ColorUtil {
2727
Color.parseColor("#78909C"))
2828

2929
val PRIMARY_COLORS_SUB = arrayOf(
30-
intArrayOf(Color.parseColor("#EF5350"), Color.parseColor("#F44336"), Color.parseColor("#E53935"),Color.parseColor("#e10015"), Color.parseColor("#D32F2F"), Color.parseColor("#C62828"), Color.parseColor("#B71C1C")),
30+
intArrayOf(Color.parseColor("#EF5350"), Color.parseColor("#F44336"), Color.parseColor("#E53935"), Color.parseColor("#D32F2F"), Color.parseColor("#C62828"), Color.parseColor("#B71C1C")),
3131
intArrayOf(Color.parseColor("#EC407A"), Color.parseColor("#E91E63"), Color.parseColor("#D81B60"), Color.parseColor("#C2185B"), Color.parseColor("#AD1457"), Color.parseColor("#880E4F")),
3232
intArrayOf(Color.parseColor("#AB47BC"), Color.parseColor("#9C27B0"), Color.parseColor("#8E24AA"), Color.parseColor("#7B1FA2"), Color.parseColor("#6A1B9A"), Color.parseColor("#4A148C")),
3333
intArrayOf(Color.parseColor("#7E57C2"), Color.parseColor("#673AB7"), Color.parseColor("#5E35B1"), Color.parseColor("#512DA8"), Color.parseColor("#4527A0"), Color.parseColor("#311B92")),

app/src/main/java/me/hegj/wandroid/app/utils/SettingUtil.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,15 @@ object SettingUtil {
2424
* 获取主题颜色
2525
*/
2626
fun getColor(context: Context): Int {
27-
return if(isHoliDay()){
28-
ArmsUtils.getColor(context, R.color.chinaHoliDay)
29-
}else{
30-
val setting = PreferenceManager.getDefaultSharedPreferences(context)
31-
val defaultColor = ArmsUtils.getColor(context, R.color.colorPrimary)
32-
val color = setting.getInt("color", defaultColor)
33-
if (color != 0 && Color.alpha(color) != 255) {
34-
defaultColor
35-
} else color
27+
val setting = PreferenceManager.getDefaultSharedPreferences(context)
28+
val defaultColor = ArmsUtils.getColor(context, R.color.colorPrimary)
29+
val color = setting.getInt("color", defaultColor)
30+
return if (color != 0 && Color.alpha(color) != 255) {
31+
defaultColor
32+
} else {
33+
color
3634
}
35+
3736
}
3837

3938
/**
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package me.hegj.wandroid.di.component.main.tree
2+
3+
import dagger.Component
4+
import com.jess.arms.di.component.AppComponent
5+
6+
import me.hegj.wandroid.di.module.main.tree.SquareModule
7+
8+
import com.jess.arms.di.scope.FragmentScope
9+
import me.hegj.wandroid.mvp.ui.activity.main.tree.SquareFragment
10+
11+
12+
/**
13+
* ================================================
14+
* Description:
15+
* <p>
16+
* Created by MVPArmsTemplate on 10/08/2019 09:49
17+
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
18+
* <a href="https://github.com/JessYanCoding">Follow me</a>
19+
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
20+
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
21+
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
22+
* ================================================
23+
*/
24+
@FragmentScope
25+
@Component(modules = arrayOf(SquareModule::class), dependencies = arrayOf(AppComponent::class))
26+
interface SquareComponent {
27+
fun inject(fragment: SquareFragment)
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package me.hegj.wandroid.di.component.share
2+
3+
import dagger.Component
4+
import com.jess.arms.di.component.AppComponent
5+
6+
import me.hegj.wandroid.di.module.share.ShareAriticleModule
7+
8+
import com.jess.arms.di.scope.ActivityScope
9+
import me.hegj.wandroid.mvp.ui.activity.share.ShareAriticleActivity
10+
11+
12+
/**
13+
* ================================================
14+
* Description:
15+
* <p>
16+
* Created by MVPArmsTemplate on 10/08/2019 13:27
17+
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
18+
* <a href="https://github.com/JessYanCoding">Follow me</a>
19+
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
20+
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
21+
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
22+
* ================================================
23+
*/
24+
@ActivityScope
25+
@Component(modules = arrayOf(ShareAriticleModule::class), dependencies = arrayOf(AppComponent::class))
26+
interface ShareAriticleComponent {
27+
fun inject(activity: ShareAriticleActivity)
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package me.hegj.wandroid.di.component.share
2+
3+
import dagger.Component
4+
import com.jess.arms.di.component.AppComponent
5+
6+
import me.hegj.wandroid.di.module.share.ShareByIdModule
7+
8+
import com.jess.arms.di.scope.ActivityScope
9+
import me.hegj.wandroid.mvp.ui.activity.share.ShareByIdActivity
10+
11+
12+
/**
13+
* ================================================
14+
* Description:
15+
* <p>
16+
* Created by MVPArmsTemplate on 10/09/2019 13:20
17+
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
18+
* <a href="https://github.com/JessYanCoding">Follow me</a>
19+
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
20+
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
21+
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
22+
* ================================================
23+
*/
24+
@ActivityScope
25+
@Component(modules = arrayOf(ShareByIdModule::class), dependencies = arrayOf(AppComponent::class))
26+
interface ShareByIdComponent {
27+
fun inject(activity: ShareByIdActivity)
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package me.hegj.wandroid.di.component.share
2+
3+
import dagger.Component
4+
import com.jess.arms.di.component.AppComponent
5+
6+
import me.hegj.wandroid.di.module.share.ShareListModule
7+
8+
import com.jess.arms.di.scope.ActivityScope
9+
import me.hegj.wandroid.mvp.ui.activity.share.ShareListActivity
10+
11+
12+
/**
13+
* ================================================
14+
* Description:
15+
* <p>
16+
* Created by MVPArmsTemplate on 10/08/2019 13:26
17+
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
18+
* <a href="https://github.com/JessYanCoding">Follow me</a>
19+
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
20+
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
21+
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
22+
* ================================================
23+
*/
24+
@ActivityScope
25+
@Component(modules = arrayOf(ShareListModule::class), dependencies = arrayOf(AppComponent::class))
26+
interface ShareListComponent {
27+
fun inject(activity: ShareListActivity)
28+
}

0 commit comments

Comments
 (0)