Commit ae72799257be349ef884106ed907ff071e74179b
1 parent
8b0669cf
1 新增个人资料页
Showing
6 changed files
with
175 additions
and
30 deletions
app/strike/src/main/AndroidManifest.xml
| ... | ... | @@ -22,7 +22,6 @@ |
| 22 | 22 | android:name=".LoginSuccessActivity" |
| 23 | 23 | android:label="UserAPI" |
| 24 | 24 | android:theme="@style/AppTheme.TranslucentFullScreenTheme" /> |
| 25 | - /> | |
| 26 | 25 | <activity android:name=".demo.activity.DemoActivity" /> |
| 27 | 26 | <activity android:name=".MyActivity"></activity> |
| 28 | 27 | <activity android:name=".imgutil.ImgActivity" /> | ... | ... |
app/strike/src/main/java/com/cnlive/strike/MainActivity.java
| ... | ... | @@ -37,15 +37,8 @@ public class MainActivity extends AppCompatActivity { |
| 37 | 37 | findViewById(R.id.go_to).setOnClickListener(new View.OnClickListener() { |
| 38 | 38 | @Override |
| 39 | 39 | public void onClick(View v) { |
| 40 | - if (TextUtils.isEmpty(UserService.getUid(MainActivity.this))) { | |
| 41 | - startActivity(new Intent(MainActivity.this, LoginActivity.class)); | |
| 42 | -//// finish(); | |
| 43 | - } else { | |
| 44 | - startActivity(new Intent(MainActivity.this, PersonalDataActivity.class)); | |
| 45 | - } | |
| 46 | -// Intent intent = new Intent(MainActivity.this, LoginDialogActivity.class); | |
| 47 | -// startActivity(intent); | |
| 48 | -// overridePendingTransition(R.anim.activity_in, R.anim.activity_out); | |
| 40 | + startActivity(new Intent(MainActivity.this, DemoMvpActivity.class)); | |
| 41 | +// | |
| 49 | 42 | } |
| 50 | 43 | }); |
| 51 | 44 | findViewById(R.id.to_img).setOnClickListener(view -> startActivity(new Intent(this, ImgActivity.class))); | ... | ... |
app/strike/src/main/java/com/cnlive/strike/demo/activity/DemoMvpActivity.java
| 1 | 1 | package com.cnlive.strike.demo.activity; |
| 2 | 2 | |
| 3 | -import android.graphics.Color; | |
| 4 | -import android.os.Handler; | |
| 5 | -import android.os.Message; | |
| 6 | - | |
| 7 | -import androidx.annotation.NonNull; | |
| 3 | +import android.content.Intent; | |
| 4 | +import android.text.TextUtils; | |
| 5 | +import android.view.View; | |
| 8 | 6 | |
| 9 | 7 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 10 | -import com.cnlive.core.libs.base.util.QMUITipDialogUtil; | |
| 11 | -import com.cnlive.core.network.HttpConn; | |
| 12 | -import com.cnlive.strike.MyActivity; | |
| 13 | -import com.cnlive.strike.MyFragment; | |
| 8 | +import com.cnlive.moudle.collectionTrace.ui.activity.RaceListActivity; | |
| 9 | +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | |
| 10 | +import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity; | |
| 11 | +import com.cnlive.strike.MainActivity; | |
| 12 | +import com.cnlive.strike.R; | |
| 13 | +import com.cnlive.strike.databinding.ActivityDemoMvpMainBinding; | |
| 14 | 14 | import com.cnlive.strike.demo.activity.presenter.DemoActivityPresenter; |
| 15 | 15 | import com.cnlive.strike.demo.activity.view.DemoActivityView; |
| 16 | +import com.cnlive.strike.user.auth.UserService; | |
| 17 | +import com.cnlive.strike.user.ui.activity.FirstLoginActivity; | |
| 18 | +import com.cnlive.strike.user.ui.activity.LoginActivity; | |
| 19 | +import com.cnlive.strike.user.ui.activity.LoginDialogActivity; | |
| 20 | +import com.cnlive.strike.user.ui.activity.PersonalDataActivity; | |
| 21 | +import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; | |
| 22 | +import com.cnlive.strike.xiaojiaspeaker.ui.activity.AllDeviceActivity; | |
| 16 | 23 | |
| 17 | -import org.greenrobot.eventbus.EventBus; | |
| 18 | -import org.greenrobot.eventbus.Subscribe; | |
| 19 | -import org.greenrobot.eventbus.ThreadMode; | |
| 20 | 24 | |
| 21 | -import java.util.Observable; | |
| 22 | -import java.util.Observer; | |
| 25 | +public class DemoMvpActivity extends BaseActivity<DemoActivityView, DemoActivityPresenter> { | |
| 26 | + public ActivityDemoMvpMainBinding binding; | |
| 23 | 27 | |
| 28 | + @Override | |
| 29 | + protected void initBindingData() { | |
| 30 | + super.initBindingData(); | |
| 31 | + binding = (ActivityDemoMvpMainBinding) getBaseBinding(); | |
| 32 | + } | |
| 24 | 33 | |
| 25 | -public class DemoMvpActivity extends BaseActivity<DemoActivityView, DemoActivityPresenter> { | |
| 34 | + @Override | |
| 35 | + protected int getBindLayoutId() { | |
| 36 | + return R.layout.activity_demo_mvp_main; | |
| 37 | + } | |
| 26 | 38 | |
| 27 | 39 | @Override |
| 28 | 40 | protected void initView() { |
| 29 | 41 | super.initView(); |
| 30 | - loadRootFragment(new DemoFragment()); | |
| 31 | - | |
| 42 | + //登录页 | |
| 43 | + binding.btnLogin.setOnClickListener(new View.OnClickListener() { | |
| 44 | + @Override | |
| 45 | + public void onClick(View v) { | |
| 46 | + startActivity(new Intent(me, LoginActivity.class)); | |
| 47 | + } | |
| 48 | + }); | |
| 49 | + //登录对话框 | |
| 50 | + binding.btnLoginDialog.setOnClickListener(new View.OnClickListener() { | |
| 51 | + @Override | |
| 52 | + public void onClick(View v) { | |
| 53 | + Intent intent = new Intent(me, LoginDialogActivity.class); | |
| 54 | + startActivity(intent); | |
| 55 | + overridePendingTransition(R.anim.activity_in, R.anim.activity_out); | |
| 56 | + } | |
| 57 | + }); | |
| 58 | + //新用户头像设置 | |
| 59 | + binding.btnNewUserFace.setOnClickListener(new View.OnClickListener() { | |
| 60 | + @Override | |
| 61 | + public void onClick(View v) { | |
| 62 | + startActivity(new Intent(me, FirstLoginActivity.class)); | |
| 63 | + } | |
| 64 | + }); | |
| 65 | + //个人资料页 | |
| 66 | + binding.btnPersonData.setOnClickListener(new View.OnClickListener() { | |
| 67 | + @Override | |
| 68 | + public void onClick(View v) { | |
| 69 | + startActivity(new Intent(me, PersonalDataActivity.class)); | |
| 70 | + } | |
| 71 | + }); | |
| 72 | + //小家音箱 | |
| 73 | + binding.btnXiaojia.setOnClickListener(new View.OnClickListener() { | |
| 74 | + @Override | |
| 75 | + public void onClick(View v) { | |
| 76 | + if (!TextUtils.isEmpty(UserService.getUid(me))) { | |
| 77 | + XiaoJIaCommInfo.setUserId(me, UserService.getUid(me)); | |
| 78 | + } | |
| 79 | + if (null == UserService.getInstance(me).getAppAccount()) { | |
| 80 | + return; | |
| 81 | + } | |
| 82 | + if (null != UserService.getInstance(me).getAppAccount().getMobile() && !TextUtils.isEmpty(UserService.getInstance(me).getAppAccount().getMobile())) { | |
| 83 | + XiaoJIaCommInfo.setUserPhone(me, UserService.getInstance(me).getAppAccount().getMobile()); | |
| 84 | + } | |
| 85 | + if (!TextUtils.isEmpty(UserService.getInstance(me).getAppAccount().getFaceUrl())) { | |
| 86 | + XiaoJIaCommInfo.setUserIcon(me, UserService.getInstance(me).getAppAccount().getFaceUrl()); | |
| 87 | + } | |
| 88 | + if (!TextUtils.isEmpty(UserService.getInstance(me).getAppAccount().getNickName())) { | |
| 89 | + XiaoJIaCommInfo.setUserNickName(me, UserService.getInstance(me).getAppAccount().getNickName()); | |
| 90 | + } | |
| 91 | + AllDeviceActivity.startActivity(me); | |
| 92 | + } | |
| 93 | + }); | |
| 94 | + //大众体育 | |
| 95 | + binding.btnGym.setOnClickListener(new View.OnClickListener() { | |
| 96 | + @Override | |
| 97 | + public void onClick(View v) { | |
| 98 | + if (null != UserService.getInstance(me).getAppAccount().getMobile() && !TextUtils.isEmpty(UserService.getInstance(me).getAppAccount().getMobile())) { | |
| 99 | + CommonInfo.setUserInfo(me, UserService.getUid(me), | |
| 100 | + UserService.getInstance(me).getAppAccount().getNickName(), | |
| 101 | + UserService.getInstance(me).getAppAccount().getFaceUrl(), | |
| 102 | + UserService.getInstance(me).getAppAccount().getMobile()); | |
| 103 | + } | |
| 104 | + startActivity(new Intent(me, RunLineActivity.class)); | |
| 105 | + } | |
| 106 | + }); | |
| 107 | + //路径工具 | |
| 108 | + binding.btnRoad.setOnClickListener(new View.OnClickListener() { | |
| 109 | + @Override | |
| 110 | + public void onClick(View v) { | |
| 111 | + RaceListActivity.newInstance(me, UserService.getUid(me), | |
| 112 | + UserService.getInstance(me).getAppAccount().getNickName(), | |
| 113 | + UserService.getInstance(me).getAppAccount().getFaceUrl()); | |
| 114 | + } | |
| 115 | + }); | |
| 32 | 116 | } |
| 33 | - | |
| 34 | - | |
| 35 | 117 | } | ... | ... |
app/strike/src/main/res/layout/activity_demo_mvp_main.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 3 | + | |
| 4 | + <LinearLayout | |
| 5 | + android:layout_width="match_parent" | |
| 6 | + android:layout_height="match_parent" | |
| 7 | + android:orientation="vertical"> | |
| 8 | + | |
| 9 | + <androidx.core.widget.NestedScrollView | |
| 10 | + android:layout_width="match_parent" | |
| 11 | + android:layout_height="wrap_content"> | |
| 12 | + | |
| 13 | + <LinearLayout | |
| 14 | + android:layout_width="match_parent" | |
| 15 | + android:layout_height="wrap_content" | |
| 16 | + android:orientation="vertical"> | |
| 17 | + | |
| 18 | + <Button | |
| 19 | + android:id="@+id/btn_login" | |
| 20 | + android:layout_width="match_parent" | |
| 21 | + android:layout_height="wrap_content" | |
| 22 | + android:layout_margin="5dp" | |
| 23 | + android:text="登录页" /> | |
| 24 | + | |
| 25 | + <Button | |
| 26 | + android:id="@+id/btn_login_dialog" | |
| 27 | + android:layout_width="match_parent" | |
| 28 | + android:layout_height="wrap_content" | |
| 29 | + android:layout_margin="5dp" | |
| 30 | + android:text="登录对话框" /> | |
| 31 | + | |
| 32 | + <Button | |
| 33 | + android:id="@+id/btn_new_user_face" | |
| 34 | + android:layout_width="match_parent" | |
| 35 | + android:layout_height="wrap_content" | |
| 36 | + android:layout_margin="5dp" | |
| 37 | + android:text="新用户头像设置页" /> | |
| 38 | + | |
| 39 | + <Button | |
| 40 | + android:id="@+id/btn_person_data" | |
| 41 | + android:layout_width="match_parent" | |
| 42 | + android:layout_height="wrap_content" | |
| 43 | + android:layout_margin="5dp" | |
| 44 | + android:text="个人资料页" /> | |
| 45 | + | |
| 46 | + <Button | |
| 47 | + android:id="@+id/btn_xiaojia" | |
| 48 | + android:layout_width="match_parent" | |
| 49 | + android:layout_height="wrap_content" | |
| 50 | + android:layout_margin="5dp" | |
| 51 | + android:text="小家音箱" /> | |
| 52 | + | |
| 53 | + <Button | |
| 54 | + android:id="@+id/btn_gym" | |
| 55 | + android:layout_width="match_parent" | |
| 56 | + android:layout_height="wrap_content" | |
| 57 | + android:layout_margin="5dp" | |
| 58 | + android:text="大众体育" /> | |
| 59 | + | |
| 60 | + <Button | |
| 61 | + android:id="@+id/btn_road" | |
| 62 | + android:layout_width="match_parent" | |
| 63 | + android:layout_height="wrap_content" | |
| 64 | + android:layout_margin="5dp" | |
| 65 | + android:text="路径工具" /> | |
| 66 | + </LinearLayout> | |
| 67 | + </androidx.core.widget.NestedScrollView> | |
| 68 | + </LinearLayout> | |
| 69 | +</layout> | |
| 0 | 70 | \ No newline at end of file | ... | ... |
core/base/src/main/res/layout/layout_title_toolbar.xml
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/AllDeviceActivity.java
| ... | ... | @@ -28,7 +28,7 @@ public class AllDeviceActivity extends BaseActivity { |
| 28 | 28 | super.initView(); |
| 29 | 29 | if (!TextUtils.isEmpty(XiaoJIaCommInfo.getUserId(this)) && !TextUtils.isEmpty(XiaoJIaCommInfo.getUserIcon(this)) && !TextUtils.isEmpty(XiaoJIaCommInfo.getUserPhone(this)) && !TextUtils.isEmpty(XiaoJIaCommInfo.getUserNickName(this))) { |
| 30 | 30 | // getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, AllDeviceFragment.newInstance()).commitAllowingStateLoss(); |
| 31 | - loadRootFragment(R.id.root_container, AllDeviceFragment.newInstance()); | |
| 31 | + loadRootFragment(AllDeviceFragment.newInstance()); | |
| 32 | 32 | } else { |
| 33 | 33 | AlertUtil.showDeftToast(this, "参数异常"); |
| 34 | 34 | } | ... | ... |