Commit 1a939f9b22670d16a2104abccca8c22e2c09121a
1 parent
b8ae7038
1 修复"我的记录"页面点击跑过的路线,在路线详情页用户昵称和头像不显示的问题
Showing
5 changed files
with
20 additions
and
7 deletions
app/src/main/java/com/example/modulepedometer/MainActivity.java
| @@ -31,8 +31,8 @@ public class MainActivity extends AppCompatActivity { | @@ -31,8 +31,8 @@ public class MainActivity extends AppCompatActivity { | ||
| 31 | super.onCreate(savedInstanceState); | 31 | super.onCreate(savedInstanceState); |
| 32 | setContentView(R.layout.activity_main); | 32 | setContentView(R.layout.activity_main); |
| 33 | 33 | ||
| 34 | - String uid = "10535072"; | ||
| 35 | -// String uid = "358916"; | 34 | +// String uid = "10535072"; |
| 35 | + String uid = "358916"; | ||
| 36 | // String uid = "358689"; | 36 | // String uid = "358689"; |
| 37 | 37 | ||
| 38 | findViewById(R.id.recordd).setOnClickListener(new View.OnClickListener() { | 38 | findViewById(R.id.recordd).setOnClickListener(new View.OnClickListener() { |
config.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/ALLScoreDetailFragmentView.java
| @@ -9,10 +9,12 @@ import android.widget.LinearLayout; | @@ -9,10 +9,12 @@ import android.widget.LinearLayout; | ||
| 9 | import com.baidu.mapapi.map.BaiduMap; | 9 | import com.baidu.mapapi.map.BaiduMap; |
| 10 | import com.baidu.mapapi.map.MapView; | 10 | import com.baidu.mapapi.map.MapView; |
| 11 | import com.baidu.mapapi.map.UiSettings; | 11 | import com.baidu.mapapi.map.UiSettings; |
| 12 | +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | ||
| 12 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; | 13 | import com.cnlive.moudle.pedometer.model.RunningFinishBean; |
| 13 | import com.cnlive.moudle.pedometer.ui.fragment.ALLScoreDetailFragment; | 14 | import com.cnlive.moudle.pedometer.ui.fragment.ALLScoreDetailFragment; |
| 14 | import com.cnlive.moudle.pedometer.utils.ScreenUtil; | 15 | import com.cnlive.moudle.pedometer.utils.ScreenUtil; |
| 15 | import com.cnlive.moudle.pedometer.utils.TimeUtil; | 16 | import com.cnlive.moudle.pedometer.utils.TimeUtil; |
| 17 | +import com.cnlive.strike.application.GlideApp; | ||
| 16 | import com.example.moudle_pedometer.R; | 18 | import com.example.moudle_pedometer.R; |
| 17 | import com.hannesdorfmann.mosby3.mvp.MvpView; | 19 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 18 | 20 | ||
| @@ -42,6 +44,17 @@ public class ALLScoreDetailFragmentView implements MvpView { | @@ -42,6 +44,17 @@ public class ALLScoreDetailFragmentView implements MvpView { | ||
| 42 | ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) fragment.binding.scrollView.getLayoutParams(); | 44 | ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) fragment.binding.scrollView.getLayoutParams(); |
| 43 | params.bottomMargin = ScreenUtil.dip2px(getContext(), 20); | 45 | params.bottomMargin = ScreenUtil.dip2px(getContext(), 20); |
| 44 | fragment.binding.scrollView.setLayoutParams(params); | 46 | fragment.binding.scrollView.setLayoutParams(params); |
| 47 | + //设置用户头像 | ||
| 48 | + //设置用户昵称 | ||
| 49 | + String nickName = CommonInfo.getUserNickName(getContext()); | ||
| 50 | + fragment.binding.includeFinishUserInfo.tvUserNickName.setText(nickName); | ||
| 51 | + //设置用户头像 | ||
| 52 | + String faceUrl = CommonInfo.getUserIcon(getContext()); | ||
| 53 | + if (!TextUtils.isEmpty(faceUrl)) { | ||
| 54 | + GlideApp.with(getContext()).load(faceUrl).into(fragment.binding.includeFinishUserInfo.qmIvIcon); | ||
| 55 | + }else { | ||
| 56 | + GlideApp.with(getContext()).load(getContext().getResources().getString(R.string.default_face_url)).into(fragment.binding.includeFinishUserInfo.qmIvIcon); | ||
| 57 | + } | ||
| 45 | //隐藏开始按钮 | 58 | //隐藏开始按钮 |
| 46 | fragment.binding.rlScrollViewStartBtn.setVisibility(View.GONE); | 59 | fragment.binding.rlScrollViewStartBtn.setVisibility(View.GONE); |
| 47 | //设置标题 | 60 | //设置标题 |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/KeepLiveService.java
| @@ -38,8 +38,8 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion | @@ -38,8 +38,8 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion | ||
| 38 | public static MediaPlayer mMediaPlayer; | 38 | public static MediaPlayer mMediaPlayer; |
| 39 | //广播 | 39 | //广播 |
| 40 | private static ServiceReceiver myReceiver; | 40 | private static ServiceReceiver myReceiver; |
| 41 | - private String CHANNEL_ONE_ID = "com.cnlive.keep"; | ||
| 42 | - private String CHANNEL_ONE_NAME = "KeepLive"; | 41 | + private String CHANNEL_ONE_ID = "com.cnlive.run.keep"; |
| 42 | + private String CHANNEL_ONE_NAME = "runKeepLive"; | ||
| 43 | private NotificationManager mNM; | 43 | private NotificationManager mNM; |
| 44 | private Notification notification = null; | 44 | private Notification notification = null; |
| 45 | //是否在后台运行 | 45 | //是否在后台运行 |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/StepService.java
| @@ -80,8 +80,8 @@ public class StepService extends Service implements SensorEventListener { | @@ -80,8 +80,8 @@ public class StepService extends Service implements SensorEventListener { | ||
| 80 | /** | 80 | /** |
| 81 | * 通知栏相关 | 81 | * 通知栏相关 |
| 82 | */ | 82 | */ |
| 83 | - private String CHANNEL_ONE_ID = "com.cnlive.step"; | ||
| 84 | - private String CHANNEL_ONE_NAME = "Step"; | 83 | + private String CHANNEL_ONE_ID = "com.cnlive.run.step"; |
| 84 | + private String CHANNEL_ONE_NAME = "runStep"; | ||
| 85 | private NotificationManager mNM; | 85 | private NotificationManager mNM; |
| 86 | private Notification notification = null; | 86 | private Notification notification = null; |
| 87 | private RemoteViews remoteViews; | 87 | private RemoteViews remoteViews; |