Commit 26152bdb06c0849740e6de73d891f567ea478331
1 parent
d6c3ecde
1 优化基类自动解除订阅关系逻辑
Showing
66 changed files
with
184 additions
and
326 deletions
app/strike/build.gradle
| @@ -95,6 +95,7 @@ android { | @@ -95,6 +95,7 @@ android { | ||
| 95 | release { | 95 | release { |
| 96 | signingConfig signingConfigs.releaseConfig | 96 | signingConfig signingConfigs.releaseConfig |
| 97 | zipAlignEnabled true | 97 | zipAlignEnabled true |
| 98 | + debuggable = true | ||
| 98 | resValue("string", "app_name", "网家家") | 99 | resValue("string", "app_name", "网家家") |
| 99 | buildConfigField("boolean", "VERSION_AS_DEBUG", "false") | 100 | buildConfigField("boolean", "VERSION_AS_DEBUG", "false") |
| 100 | buildConfigField("String", "APP_ID", stringValue("769_jetj7bq525")) | 101 | buildConfigField("String", "APP_ID", stringValue("769_jetj7bq525")) |
app/strike/src/BaseRequest.java deleted
100644 → 0
| 1 | -package com.cnlive.strike.user.network.api; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import android.text.TextUtils; | ||
| 5 | - | ||
| 6 | -import com.cnlive.core.libs.base.application.AppConfig; | ||
| 7 | -import com.cnlive.core.network.BaseResult; | ||
| 8 | -import com.cnlive.core.network.NetBuilder; | ||
| 9 | -import com.cnlive.core.network.ServerException; | ||
| 10 | - | ||
| 11 | -import java.util.ArrayList; | ||
| 12 | -import java.util.List; | ||
| 13 | - | ||
| 14 | -import io.reactivex.Observable; | ||
| 15 | -import okhttp3.Interceptor; | ||
| 16 | - | ||
| 17 | -/** | ||
| 18 | - * 基本请求 | ||
| 19 | - * ys | ||
| 20 | - */ | ||
| 21 | -public class BaseRequest { | ||
| 22 | - private String userSetUrl; | ||
| 23 | - private static BaseRequest request; | ||
| 24 | - private long connectTimeout;//连接超时 | ||
| 25 | - private long readTimeout;//读取超时 | ||
| 26 | - private long writeTimeout;//写入超时 | ||
| 27 | - private List<Interceptor> interceptorList;//拦截器 | ||
| 28 | - private String baseUrl = "http://gank.io/api/data/"; | ||
| 29 | - private final String SP_CMS_URL_DEBUT = "http://cmstest.cnlive.com:8768/"; | ||
| 30 | - private final String SP_CMS_URL = "http://cms.cnlive.com:8768/"; | ||
| 31 | - //网++ 接口域名 | ||
| 32 | - public final String SP_BASE_URL = "https://apiwjj.cnlive.com/"; | ||
| 33 | - //网++ 测试环境 接口域名 | ||
| 34 | - public final String SP_DEBUG_URL = "http://apiwjjtest.cnlive.com/"; | ||
| 35 | - //OPEN API 接口域名 | ||
| 36 | - private final String OPEN_URL = "https://api.cnlive.com/"; | ||
| 37 | - | ||
| 38 | - /** | ||
| 39 | - * 构造函数初始化 | ||
| 40 | - */ | ||
| 41 | - public BaseRequest() { | ||
| 42 | - interceptorList = new ArrayList<>(); | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 设置连接超时 | ||
| 48 | - * | ||
| 49 | - * @param connectTimeout | ||
| 50 | - * @return | ||
| 51 | - */ | ||
| 52 | - public BaseRequest setConnectTimeout(long connectTimeout) { | ||
| 53 | - init(); | ||
| 54 | - connectTimeout = connectTimeout; | ||
| 55 | - return request; | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - /** | ||
| 59 | - * 设置读取超时 | ||
| 60 | - * | ||
| 61 | - * @param readTimeout | ||
| 62 | - * @return | ||
| 63 | - */ | ||
| 64 | - public BaseRequest setReadTimeout(long readTimeout) { | ||
| 65 | - init(); | ||
| 66 | - readTimeout = readTimeout; | ||
| 67 | - return request; | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - /** | ||
| 71 | - * 设置写入超时 | ||
| 72 | - * | ||
| 73 | - * @param writeTimeout | ||
| 74 | - * @return | ||
| 75 | - */ | ||
| 76 | - public BaseRequest setWriteTimeout(long writeTimeout) { | ||
| 77 | - init(); | ||
| 78 | - writeTimeout = writeTimeout; | ||
| 79 | - return request; | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - | ||
| 83 | - /** | ||
| 84 | - * 初始化接口地址 | ||
| 85 | - */ | ||
| 86 | - private String initBaseUrl(Class clazz) { | ||
| 87 | - if (AppConfig.isDebug()) { | ||
| 88 | - baseUrl = SP_DEBUG_URL;//还原初始地址 | ||
| 89 | - if (clazz == ApiBaseServiceOpen.class) { | ||
| 90 | - return OPEN_URL; | ||
| 91 | - } | ||
| 92 | - } | ||
| 93 | - return baseUrl; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - /** | ||
| 97 | - * 设置连接地址 | ||
| 98 | - * | ||
| 99 | - * @param url | ||
| 100 | - * @return | ||
| 101 | - */ | ||
| 102 | - public BaseRequest setUrl(String url) { | ||
| 103 | - init(); | ||
| 104 | - userSetUrl = url; | ||
| 105 | - return request; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - /** | ||
| 109 | - * 添加拦截器 | ||
| 110 | - * | ||
| 111 | - * @param interceptor | ||
| 112 | - * @return | ||
| 113 | - */ | ||
| 114 | - public BaseRequest addInterceptor(Interceptor interceptor) { | ||
| 115 | - if (null != interceptor) { | ||
| 116 | - interceptorList.add(interceptor); | ||
| 117 | - } | ||
| 118 | - return request; | ||
| 119 | - } | ||
| 120 | - | ||
| 121 | - /** | ||
| 122 | - * @return | ||
| 123 | - */ | ||
| 124 | - public static synchronized BaseRequest init() { | ||
| 125 | - if (null == request) { | ||
| 126 | - request = new BaseRequest(); | ||
| 127 | - } | ||
| 128 | - return request; | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | - public <NetService> NetService service(Class<NetService> clz) { | ||
| 132 | - NetService service = null; | ||
| 133 | - NetBuilder builder = new NetBuilder(clz); | ||
| 134 | - if (connectTimeout > 0) { | ||
| 135 | - builder.setConnectTimeout(connectTimeout); | ||
| 136 | - } | ||
| 137 | - if (readTimeout > 0) { | ||
| 138 | - builder.setReadTimeout(readTimeout); | ||
| 139 | - } | ||
| 140 | - if (writeTimeout > 0) { | ||
| 141 | - builder.setWriteTimeout(writeTimeout); | ||
| 142 | - } | ||
| 143 | - if (null != interceptorList && interceptorList.size() > 0) { | ||
| 144 | - builder.addInterceptors(interceptorList); | ||
| 145 | - } | ||
| 146 | - //设置接口请求头地址 | ||
| 147 | - if (!TextUtils.isEmpty(userSetUrl)) { | ||
| 148 | - builder.setBaseUrl(userSetUrl); | ||
| 149 | - userSetUrl = ""; | ||
| 150 | - } else { | ||
| 151 | - builder.setBaseUrl(initBaseUrl(clz)); | ||
| 152 | - } | ||
| 153 | - service = (NetService) builder.getService(); | ||
| 154 | - builder = null; | ||
| 155 | - //重置属性 | ||
| 156 | - resetData(); | ||
| 157 | - return service; | ||
| 158 | - | ||
| 159 | - } | ||
| 160 | - | ||
| 161 | - private void resetData() { | ||
| 162 | - interceptorList.clear(); | ||
| 163 | - | ||
| 164 | - connectTimeout = 0; | ||
| 165 | - readTimeout = 0; | ||
| 166 | - writeTimeout = 0; | ||
| 167 | - } | ||
| 168 | - | ||
| 169 | - | ||
| 170 | - | ||
| 171 | - | ||
| 172 | -} | ||
| 173 | \ No newline at end of file | 0 | \ No newline at end of file |
app/strike/src/main/java/com/cnlive/strike/MainActivity.java
| @@ -12,6 +12,7 @@ import android.view.View; | @@ -12,6 +12,7 @@ import android.view.View; | ||
| 12 | import com.cnlive.strike.demo.activity.DemoActivity; | 12 | import com.cnlive.strike.demo.activity.DemoActivity; |
| 13 | import com.cnlive.strike.imgutil.ImgActivity; | 13 | import com.cnlive.strike.imgutil.ImgActivity; |
| 14 | import com.cnlive.strike.user.ui.activity.LoginActivity; | 14 | import com.cnlive.strike.user.ui.activity.LoginActivity; |
| 15 | +import com.cnlive.strike.xiaojiaspeaker.ui.activity.AllDeviceActivity; | ||
| 15 | 16 | ||
| 16 | import androidx.annotation.NonNull; | 17 | import androidx.annotation.NonNull; |
| 17 | import androidx.annotation.Nullable; | 18 | import androidx.annotation.Nullable; |
| @@ -24,8 +25,14 @@ public class MainActivity extends AppCompatActivity { | @@ -24,8 +25,14 @@ public class MainActivity extends AppCompatActivity { | ||
| 24 | protected void onCreate(@Nullable Bundle savedInstanceState) { | 25 | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| 25 | super.onCreate(savedInstanceState); | 26 | super.onCreate(savedInstanceState); |
| 26 | setContentView(R.layout.activity_main); | 27 | setContentView(R.layout.activity_main); |
| 27 | - findViewById(R.id.go_to).setOnClickListener(view -> startActivity(new Intent(this, DemoActivity.class)) ); | ||
| 28 | - findViewById(R.id.to_img).setOnClickListener(view -> startActivity(new Intent(this, ImgActivity.class)) ); | 28 | + findViewById(R.id.go_to).setOnClickListener(new View.OnClickListener() { |
| 29 | + @Override | ||
| 30 | + public void onClick(View v) { | ||
| 31 | + startActivity(new Intent(MainActivity.this, MyActivity.class)); | ||
| 32 | +// finish(); | ||
| 33 | + } | ||
| 34 | + }); | ||
| 35 | + findViewById(R.id.to_img).setOnClickListener(view -> startActivity(new Intent(this, ImgActivity.class))); | ||
| 29 | } | 36 | } |
| 30 | 37 | ||
| 31 | @Nullable | 38 | @Nullable |
app/strike/src/main/res/layout/activity_my.xml
| @@ -5,10 +5,15 @@ | @@ -5,10 +5,15 @@ | ||
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
| 7 | tools:context="com.cnlive.strike.MyActivity"> | 7 | tools:context="com.cnlive.strike.MyActivity"> |
| 8 | + | ||
| 8 | <RelativeLayout | 9 | <RelativeLayout |
| 9 | android:id="@+id/fragment_container" | 10 | android:id="@+id/fragment_container" |
| 10 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
| 11 | android:layout_height="match_parent"> | 12 | android:layout_height="match_parent"> |
| 12 | 13 | ||
| 14 | + <TextView | ||
| 15 | + android:layout_width="wrap_content" | ||
| 16 | + android:layout_height="wrap_content" | ||
| 17 | + android:text="sfwerfwef" /> | ||
| 13 | </RelativeLayout> | 18 | </RelativeLayout> |
| 14 | </RelativeLayout> | 19 | </RelativeLayout> |
app/strike/src/main/res/mipmap-hdpi/timgs.png
build.gradle
| @@ -97,10 +97,14 @@ allprojects { | @@ -97,10 +97,14 @@ allprojects { | ||
| 97 | keyPassword "www.cnlive.com" | 97 | keyPassword "www.cnlive.com" |
| 98 | } | 98 | } |
| 99 | releaseConfig { | 99 | releaseConfig { |
| 100 | - if (store_file != null) storeFile file(store_file) | ||
| 101 | - if (store_password != null) storePassword store_password | ||
| 102 | - if (key_alias != null) keyAlias key_alias | ||
| 103 | - if (key_password != null) keyPassword key_password | 100 | +// if (store_file != null) storeFile file(store_file) |
| 101 | +// if (store_password != null) storePassword store_password | ||
| 102 | +// if (key_alias != null) keyAlias key_alias | ||
| 103 | +// if (key_password != null) keyPassword key_password | ||
| 104 | + storeFile file("www.cnlive.com.key") | ||
| 105 | + storePassword "www.cnlive.comPassw0rd" | ||
| 106 | + keyAlias "strike" | ||
| 107 | + keyPassword "www.cnlive.com" | ||
| 104 | } | 108 | } |
| 105 | } | 109 | } |
| 106 | } | 110 | } |
cloud/user/src/main/java/com/cnlive/strike/user/frame/presenter/QuickLoginPresenter.java
| @@ -65,12 +65,8 @@ public class QuickLoginPresenter extends BasePresenter<QuickLoginView> { | @@ -65,12 +65,8 @@ public class QuickLoginPresenter extends BasePresenter<QuickLoginView> { | ||
| 65 | Account account = accounts.length > 0 ? accounts[0] : null; | 65 | Account account = accounts.length > 0 ? accounts[0] : null; |
| 66 | String name = account == null ? "" : account.name; | 66 | String name = account == null ? "" : account.name; |
| 67 | //页面填充数据 | 67 | //页面填充数据 |
| 68 | - if (!TextUtils.isEmpty(name)) { | ||
| 69 | ifViewAttached(view -> view.uploadInputData(name)); | 68 | ifViewAttached(view -> view.uploadInputData(name)); |
| 70 | - } | ||
| 71 | - if (null != accounts) { | ||
| 72 | ifViewAttached(view -> view.uploadListData(accounts)); | 69 | ifViewAttached(view -> view.uploadListData(accounts)); |
| 73 | - } | ||
| 74 | } | 70 | } |
| 75 | 71 | ||
| 76 | private void startTimer() { | 72 | private void startTimer() { |
| @@ -168,9 +164,9 @@ public class QuickLoginPresenter extends BasePresenter<QuickLoginView> { | @@ -168,9 +164,9 @@ public class QuickLoginPresenter extends BasePresenter<QuickLoginView> { | ||
| 168 | } else { | 164 | } else { |
| 169 | //友盟账号登录统计,暂时只有平台登录,后续对接三方登录 | 165 | //友盟账号登录统计,暂时只有平台登录,后续对接三方登录 |
| 170 | // MobclickAgent.onProfileSignIn("CNLive", user.getUid()); | 166 | // MobclickAgent.onProfileSignIn("CNLive", user.getUid()); |
| 171 | -// ifViewAttached(view -> view.showMainView(false, false)); | 167 | + ifViewAttached(view -> view.showMainView(false, false)); |
| 172 | //todo 测试首次用户 | 168 | //todo 测试首次用户 |
| 173 | - ifViewAttached(view -> view.showEditView(false)); | 169 | +// ifViewAttached(view -> view.showEditView(false)); |
| 174 | } | 170 | } |
| 175 | AppConfig.setCountryCode(""); | 171 | AppConfig.setCountryCode(""); |
| 176 | AppConfig.setVerificationCode(""); | 172 | AppConfig.setVerificationCode(""); |
cloud/user/src/main/java/com/cnlive/strike/user/frame/view/QuickLoginView.java
| @@ -78,7 +78,6 @@ public class QuickLoginView extends BaseView { | @@ -78,7 +78,6 @@ public class QuickLoginView extends BaseView { | ||
| 78 | } | 78 | } |
| 79 | String contryCode = AppConfig.getCountryCode(); | 79 | String contryCode = AppConfig.getCountryCode(); |
| 80 | //设置区号 | 80 | //设置区号 |
| 81 | -// CNLiveUserInfo userInfo = UserService.getInstance(fragment.getActivity()).getAppAccount(); | ||
| 82 | if (!TextUtils.isEmpty(contryCode)) { | 81 | if (!TextUtils.isEmpty(contryCode)) { |
| 83 | fragment.binding.tvCountry.setText("+ " + contryCode); | 82 | fragment.binding.tvCountry.setText("+ " + contryCode); |
| 84 | } else { | 83 | } else { |
| @@ -209,6 +208,7 @@ public class QuickLoginView extends BaseView { | @@ -209,6 +208,7 @@ public class QuickLoginView extends BaseView { | ||
| 209 | successInfo.setClickAd(fragment.clickAd); | 208 | successInfo.setClickAd(fragment.clickAd); |
| 210 | successInfo.setTagShare(fragment.tagShare); | 209 | successInfo.setTagShare(fragment.tagShare); |
| 211 | successInfo.setTagMsg(fragment.tagMsg); | 210 | successInfo.setTagMsg(fragment.tagMsg); |
| 211 | + | ||
| 212 | if (isNewUser) { | 212 | if (isNewUser) { |
| 213 | // HelperUtil.isNewUser(fragment.getActivity(), successInfo, isHasOtherUserInfo); | 213 | // HelperUtil.isNewUser(fragment.getActivity(), successInfo, isHasOtherUserInfo); |
| 214 | } else { | 214 | } else { |
cloud/user/src/release/res/mipmap-hdpi/icon_account.png
0 → 100644
3.87 KB
cloud/user/src/release/res/mipmap-mdpi/icon_account.png
0 → 100644
2.94 KB
cloud/user/src/release/res/mipmap-xhdpi/icon_account.png
0 → 100644
5.19 KB
cloud/user/src/release/res/mipmap-xxhdpi/icon_account.png
0 → 100644
7.91 KB
cloud/user/src/release/res/mipmap-xxxhdpi/icon_account.png
0 → 100644
10.6 KB
core/base/src/main/java/com/cnlive/core/libs/base/frame/activity/BaseActivity.java
| @@ -266,8 +266,8 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | @@ -266,8 +266,8 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | ||
| 266 | 266 | ||
| 267 | @Override | 267 | @Override |
| 268 | protected void onDestroy() { | 268 | protected void onDestroy() { |
| 269 | - mDelegate.onDestroy(); | ||
| 270 | super.onDestroy(); | 269 | super.onDestroy(); |
| 270 | + mDelegate.onDestroy(); | ||
| 271 | if (null != baseBinding) { | 271 | if (null != baseBinding) { |
| 272 | baseBinding.unbind(); | 272 | baseBinding.unbind(); |
| 273 | } | 273 | } |
| @@ -275,6 +275,7 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | @@ -275,6 +275,7 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | ||
| 275 | AppManager.getInstance().deleteActivity(me); | 275 | AppManager.getInstance().deleteActivity(me); |
| 276 | //清除当前订阅 | 276 | //清除当前订阅 |
| 277 | SubscriptionManager.getInstance().cancel(TAG); | 277 | SubscriptionManager.getInstance().cancel(TAG); |
| 278 | + | ||
| 278 | } | 279 | } |
| 279 | 280 | ||
| 280 | /** | 281 | /** |
core/base/src/main/java/com/cnlive/core/libs/base/frame/fragment/BaseFragment.java
| @@ -65,6 +65,8 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V | @@ -65,6 +65,8 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V | ||
| 65 | public void onCreate(Bundle savedInstanceState) { | 65 | public void onCreate(Bundle savedInstanceState) { |
| 66 | super.onCreate(savedInstanceState); | 66 | super.onCreate(savedInstanceState); |
| 67 | if (getActivity() == null) return; | 67 | if (getActivity() == null) return; |
| 68 | + //创建订阅映射 | ||
| 69 | + SubscriptionManager.getInstance().setCurrentDisposables(TAG); | ||
| 68 | me = (BaseActivity) getActivity(); | 70 | me = (BaseActivity) getActivity(); |
| 69 | mDelegate.onCreate(savedInstanceState); | 71 | mDelegate.onCreate(savedInstanceState); |
| 70 | mSwipeDelegate.onCreate(savedInstanceState); | 72 | mSwipeDelegate.onCreate(savedInstanceState); |
| @@ -98,8 +100,6 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V | @@ -98,8 +100,6 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V | ||
| 98 | @Override | 100 | @Override |
| 99 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 101 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 100 | super.onViewCreated(view, savedInstanceState); | 102 | super.onViewCreated(view, savedInstanceState); |
| 101 | - //创建订阅映射 | ||
| 102 | - SubscriptionManager.getInstance().setCurrentDisposables(TAG); | ||
| 103 | mSwipeDelegate.onViewCreated(view, savedInstanceState); | 103 | mSwipeDelegate.onViewCreated(view, savedInstanceState); |
| 104 | if (null != getMvpView() && null != getPresenter()) { | 104 | if (null != getMvpView() && null != getPresenter()) { |
| 105 | initBindingData(); | 105 | initBindingData(); |
| @@ -199,14 +199,14 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V | @@ -199,14 +199,14 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V | ||
| 199 | 199 | ||
| 200 | @Override | 200 | @Override |
| 201 | public void onDestroy() { | 201 | public void onDestroy() { |
| 202 | - mDelegate.onDestroy(); | ||
| 203 | - mSwipeDelegate.onDestroyView(); | ||
| 204 | - //清除当前订阅 | ||
| 205 | - SubscriptionManager.getInstance().cancel(TAG); | ||
| 206 | super.onDestroy(); | 202 | super.onDestroy(); |
| 207 | if (null != baseBinding) { | 203 | if (null != baseBinding) { |
| 208 | baseBinding.unbind(); | 204 | baseBinding.unbind(); |
| 209 | } | 205 | } |
| 206 | + mDelegate.onDestroy(); | ||
| 207 | + mSwipeDelegate.onDestroyView(); | ||
| 208 | + //清除当前订阅 | ||
| 209 | + SubscriptionManager.getInstance().cancel(TAG); | ||
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | /** | 212 | /** |
| @@ -333,6 +333,8 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V | @@ -333,6 +333,8 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V | ||
| 333 | public void onDestroyView() { | 333 | public void onDestroyView() { |
| 334 | mDelegate.onDestroyView(); | 334 | mDelegate.onDestroyView(); |
| 335 | super.onDestroyView(); | 335 | super.onDestroyView(); |
| 336 | + //清除当前订阅 | ||
| 337 | + SubscriptionManager.getInstance().cancel(TAG); | ||
| 336 | } | 338 | } |
| 337 | 339 | ||
| 338 | @Override | 340 | @Override |
core/base/src/main/java/com/cnlive/core/libs/base/network/manager/SubscriptionManager.java
| @@ -18,18 +18,22 @@ public class SubscriptionManager { | @@ -18,18 +18,22 @@ public class SubscriptionManager { | ||
| 18 | public static SubscriptionManager instance; | 18 | public static SubscriptionManager instance; |
| 19 | public HashMap<String, CompositeDisposable> hashDisposable;//所有订阅关系 | 19 | public HashMap<String, CompositeDisposable> hashDisposable;//所有订阅关系 |
| 20 | public HashMap<Integer, String> hashTag;//当前activity | 20 | public HashMap<Integer, String> hashTag;//当前activity |
| 21 | + public HashMap<String, Integer> hashTagIndex;//当前activity | ||
| 21 | private String currentClassName; | 22 | private String currentClassName; |
| 22 | 23 | ||
| 23 | /** | 24 | /** |
| 24 | * 构造函数 new CompositeDisposable对象 | 25 | * 构造函数 new CompositeDisposable对象 |
| 25 | */ | 26 | */ |
| 26 | - public SubscriptionManager() { | 27 | + public SubscriptionManager() { |
| 27 | if (null == hashDisposable) { | 28 | if (null == hashDisposable) { |
| 28 | hashDisposable = new HashMap<>(); | 29 | hashDisposable = new HashMap<>(); |
| 29 | } | 30 | } |
| 30 | if (null == hashTag) { | 31 | if (null == hashTag) { |
| 31 | hashTag = new HashMap<>(); | 32 | hashTag = new HashMap<>(); |
| 32 | } | 33 | } |
| 34 | + if (null == hashTagIndex) { | ||
| 35 | + hashTagIndex = new HashMap<>(); | ||
| 36 | + } | ||
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | /** | 39 | /** |
| @@ -48,27 +52,44 @@ public class SubscriptionManager { | @@ -48,27 +52,44 @@ public class SubscriptionManager { | ||
| 48 | return instance; | 52 | return instance; |
| 49 | } | 53 | } |
| 50 | 54 | ||
| 51 | - public void setCurrentDisposables(String TAG) { | 55 | + public synchronized void setCurrentDisposables(String TAG) { |
| 52 | if (null == hashDisposable.get(TAG)) { | 56 | if (null == hashDisposable.get(TAG)) { |
| 53 | currentClassName = TAG; | 57 | currentClassName = TAG; |
| 54 | hashDisposable.put(TAG, new CompositeDisposable()); | 58 | hashDisposable.put(TAG, new CompositeDisposable()); |
| 55 | //存放当前class映射 | 59 | //存放当前class映射 |
| 56 | hashTag.put(hashDisposable.size() - 1, TAG); | 60 | hashTag.put(hashDisposable.size() - 1, TAG); |
| 61 | + hashTagIndex.put(TAG, hashTag.size() - 1); | ||
| 62 | + Log.e(TAG, "初始化: "); | ||
| 57 | } | 63 | } |
| 58 | } | 64 | } |
| 59 | 65 | ||
| 60 | /** | 66 | /** |
| 61 | * 取消订阅事件 | 67 | * 取消订阅事件 |
| 62 | */ | 68 | */ |
| 63 | - public void cancel(String TAG) { | ||
| 64 | - if (null != hashDisposable && hashDisposable.size() > 0) { | ||
| 65 | - if (null != hashDisposable.get(TAG) && hashDisposable.get(TAG).size() > 0) { | ||
| 66 | - CompositeDisposable mDisposables = hashDisposable.get(TAG); | ||
| 67 | - if (!mDisposables.isDisposed()) { | ||
| 68 | - Log.e(TAG, "cancel: 解除订阅"); | ||
| 69 | - mDisposables.clear(); | 69 | + public synchronized void cancel(String TAG) { |
| 70 | + try { | ||
| 71 | + if (null != hashDisposable && hashDisposable.size() > 0) { | ||
| 72 | + if (null != hashDisposable.get(TAG) && hashDisposable.get(TAG).size() > 0) { | ||
| 73 | + CompositeDisposable mDisposables = hashDisposable.get(TAG); | ||
| 74 | + if (!mDisposables.isDisposed()) { | ||
| 75 | + Log.e(TAG, "cancel: 解除订阅"); | ||
| 76 | + mDisposables.clear(); | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | + //移除 | ||
| 80 | + hashDisposable.remove(TAG); | ||
| 81 | + } | ||
| 82 | + if (null != hashTagIndex.get(TAG)) { | ||
| 83 | + int currentIndex = hashTagIndex.get(TAG); | ||
| 84 | + //移除 | ||
| 85 | + if (null != hashTag.get(currentIndex)) { | ||
| 86 | + Log.e(TAG, "cancel: " + hashTag.get(currentIndex)); | ||
| 87 | + hashTag.remove(currentIndex); | ||
| 70 | } | 88 | } |
| 89 | + hashTagIndex.remove(TAG); | ||
| 71 | } | 90 | } |
| 91 | + } catch (Exception e) { | ||
| 92 | + Log.e(TAG, "cancel: " + e.getMessage()); | ||
| 72 | } | 93 | } |
| 73 | } | 94 | } |
| 74 | 95 | ||
| @@ -77,7 +98,7 @@ public class SubscriptionManager { | @@ -77,7 +98,7 @@ public class SubscriptionManager { | ||
| 77 | * | 98 | * |
| 78 | * @param disposable 订阅事件 | 99 | * @param disposable 订阅事件 |
| 79 | */ | 100 | */ |
| 80 | - public void add(Disposable disposable) { | 101 | + public synchronized void add(Disposable disposable) { |
| 81 | if (disposable == null) return; | 102 | if (disposable == null) return; |
| 82 | //每次去除最新的activity进行存放 | 103 | //每次去除最新的activity进行存放 |
| 83 | if (null != hashDisposable && hashDisposable.size() > 0) { | 104 | if (null != hashDisposable && hashDisposable.size() > 0) { |
| @@ -85,7 +106,7 @@ public class SubscriptionManager { | @@ -85,7 +106,7 @@ public class SubscriptionManager { | ||
| 85 | if (null != hashDisposable.get(currentClassName)) { | 106 | if (null != hashDisposable.get(currentClassName)) { |
| 86 | //存放当前activity对应的订阅 | 107 | //存放当前activity对应的订阅 |
| 87 | hashDisposable.get(currentClassName).add(disposable); | 108 | hashDisposable.get(currentClassName).add(disposable); |
| 88 | - Log.e(currentClassName, "add: 添加订阅关系"); | 109 | + Log.e(currentClassName, "add: 添加订阅关系" + hashDisposable.size()); |
| 89 | } | 110 | } |
| 90 | } | 111 | } |
| 91 | } | 112 | } |
| @@ -105,7 +126,7 @@ public class SubscriptionManager { | @@ -105,7 +126,7 @@ public class SubscriptionManager { | ||
| 105 | /** | 126 | /** |
| 106 | * 清除容器所有 | 127 | * 清除容器所有 |
| 107 | */ | 128 | */ |
| 108 | - public void cancelAll() { | 129 | + public synchronized void cancelAll() { |
| 109 | //解除所有订阅 | 130 | //解除所有订阅 |
| 110 | if (null != hashDisposable && hashDisposable.size() > 0) { | 131 | if (null != hashDisposable && hashDisposable.size() > 0) { |
| 111 | if (null != hashTag && hashTag.size() > 0) { | 132 | if (null != hashTag && hashTag.size() > 0) { |
| @@ -118,5 +139,8 @@ public class SubscriptionManager { | @@ -118,5 +139,8 @@ public class SubscriptionManager { | ||
| 118 | } | 139 | } |
| 119 | } | 140 | } |
| 120 | } | 141 | } |
| 142 | + hashDisposable.clear(); | ||
| 143 | + hashTag.clear(); | ||
| 144 | + hashTagIndex.clear(); | ||
| 121 | } | 145 | } |
| 122 | } | 146 | } |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/widget/SelectDialog.java renamed to core/base/src/main/java/com/cnlive/core/libs/base/ui/widget/SelectDialog.java
| 1 | -package com.cnlive.strike.xiaojiaspeaker.ui.widget; | 1 | +package com.cnlive.core.libs.base.ui.widget; |
| 2 | 2 | ||
| 3 | import android.app.Dialog; | 3 | import android.app.Dialog; |
| 4 | import android.content.Context; | 4 | import android.content.Context; |
| @@ -15,7 +15,7 @@ import android.widget.TextView; | @@ -15,7 +15,7 @@ import android.widget.TextView; | ||
| 15 | import androidx.annotation.NonNull; | 15 | import androidx.annotation.NonNull; |
| 16 | import androidx.core.content.ContextCompat; | 16 | import androidx.core.content.ContextCompat; |
| 17 | 17 | ||
| 18 | -import com.cnlive.strike.xiaojiaspeaker.R; | 18 | +import com.cnlive.strike.base.R; |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| @@ -38,7 +38,7 @@ public class SelectDialog extends Dialog { | @@ -38,7 +38,7 @@ public class SelectDialog extends Dialog { | ||
| 38 | public SelectDialog(@NonNull Context context, String tipText, String btnCancelText, DialogInterface cancelInterface, String btnOkText, DialogInterface okInterface) { | 38 | public SelectDialog(@NonNull Context context, String tipText, String btnCancelText, DialogInterface cancelInterface, String btnOkText, DialogInterface okInterface) { |
| 39 | super(context, R.style.MyDialog); | 39 | super(context, R.style.MyDialog); |
| 40 | this.context = context; | 40 | this.context = context; |
| 41 | - view = LayoutInflater.from(context).inflate(R.layout.dialog_select, null); | 41 | + view = LayoutInflater.from(context).inflate(R.layout.my_dialog_select, null); |
| 42 | initView(view); | 42 | initView(view); |
| 43 | layoutParams = new LinearLayout.LayoutParams((int) (getScreenWidth(context) * 0.8), ViewGroup.LayoutParams.WRAP_CONTENT); | 43 | layoutParams = new LinearLayout.LayoutParams((int) (getScreenWidth(context) * 0.8), ViewGroup.LayoutParams.WRAP_CONTENT); |
| 44 | ll_child.setLayoutParams(layoutParams); | 44 | ll_child.setLayoutParams(layoutParams); |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/widget/TipDialog.java renamed to core/base/src/main/java/com/cnlive/core/libs/base/ui/widget/TipDialog.java
| 1 | -package com.cnlive.strike.xiaojiaspeaker.ui.widget; | 1 | +package com.cnlive.core.libs.base.ui.widget; |
| 2 | 2 | ||
| 3 | import android.app.Dialog; | 3 | import android.app.Dialog; |
| 4 | import android.content.Context; | 4 | import android.content.Context; |
| @@ -14,7 +14,7 @@ import android.widget.TextView; | @@ -14,7 +14,7 @@ import android.widget.TextView; | ||
| 14 | 14 | ||
| 15 | import androidx.annotation.NonNull; | 15 | import androidx.annotation.NonNull; |
| 16 | 16 | ||
| 17 | -import com.cnlive.strike.xiaojiaspeaker.R; | 17 | +import com.cnlive.strike.base.R; |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | /** | 20 | /** |
core/base/src/main/java/com/kongzue/dialog/v3/InputDialog.java
| @@ -68,7 +68,7 @@ public class InputDialog extends MessageDialog { | @@ -68,7 +68,7 @@ public class InputDialog extends MessageDialog { | ||
| 68 | inputDialog.build(inputDialog, R.layout.dialog_select_ios); | 68 | inputDialog.build(inputDialog, R.layout.dialog_select_ios); |
| 69 | break; | 69 | break; |
| 70 | case STYLE_KONGZUE: | 70 | case STYLE_KONGZUE: |
| 71 | - inputDialog.build(inputDialog, R.layout.dialog_select); | 71 | + inputDialog.build(inputDialog, R.layout.my_dialog_select); |
| 72 | break; | 72 | break; |
| 73 | case STYLE_MATERIAL: | 73 | case STYLE_MATERIAL: |
| 74 | inputDialog.build(inputDialog); | 74 | inputDialog.build(inputDialog); |
| @@ -686,7 +686,7 @@ public class InputDialog extends MessageDialog { | @@ -686,7 +686,7 @@ public class InputDialog extends MessageDialog { | ||
| 686 | build(this, R.layout.dialog_select_ios); | 686 | build(this, R.layout.dialog_select_ios); |
| 687 | break; | 687 | break; |
| 688 | case STYLE_KONGZUE: | 688 | case STYLE_KONGZUE: |
| 689 | - build(this, R.layout.dialog_select); | 689 | + build(this, R.layout.my_dialog_select); |
| 690 | break; | 690 | break; |
| 691 | case STYLE_MATERIAL: | 691 | case STYLE_MATERIAL: |
| 692 | 692 |
core/base/src/main/java/com/kongzue/dialog/v3/MessageDialog.java
| @@ -97,7 +97,7 @@ public class MessageDialog extends BaseDialog { | @@ -97,7 +97,7 @@ public class MessageDialog extends BaseDialog { | ||
| 97 | messageDialog.build(messageDialog, R.layout.dialog_select_ios); | 97 | messageDialog.build(messageDialog, R.layout.dialog_select_ios); |
| 98 | break; | 98 | break; |
| 99 | case STYLE_KONGZUE: | 99 | case STYLE_KONGZUE: |
| 100 | - messageDialog.build(messageDialog, R.layout.dialog_select); | 100 | + messageDialog.build(messageDialog, R.layout.my_dialog_select); |
| 101 | break; | 101 | break; |
| 102 | case STYLE_MATERIAL: | 102 | case STYLE_MATERIAL: |
| 103 | messageDialog.build(messageDialog); | 103 | messageDialog.build(messageDialog); |
| @@ -880,7 +880,7 @@ public class MessageDialog extends BaseDialog { | @@ -880,7 +880,7 @@ public class MessageDialog extends BaseDialog { | ||
| 880 | build(this, R.layout.dialog_select_ios); | 880 | build(this, R.layout.dialog_select_ios); |
| 881 | break; | 881 | break; |
| 882 | case STYLE_KONGZUE: | 882 | case STYLE_KONGZUE: |
| 883 | - build(this, R.layout.dialog_select); | 883 | + build(this, R.layout.my_dialog_select); |
| 884 | break; | 884 | break; |
| 885 | case STYLE_MATERIAL: | 885 | case STYLE_MATERIAL: |
| 886 | build(this); | 886 | build(this); |
module/xiaojiasoundbox/src/main/res/drawable/free_xiaojia_dialog_bg.xml renamed to core/base/src/main/res/drawable/my_dialog_bg.xml
module/xiaojiasoundbox/src/main/res/drawable/selector_xiaojia_dialog_btn_left.xml renamed to core/base/src/main/res/drawable/selector_my_dialog_btn_left.xml
module/xiaojiasoundbox/src/main/res/drawable/selector_xiaojia_dialog_btn_right.xml renamed to core/base/src/main/res/drawable/selector_my_dialog_btn_right.xml
module/xiaojiasoundbox/src/main/res/drawable/selector_xiaojia_tip_dialog_btn_bottom.xml renamed to core/base/src/main/res/drawable/selector_xiaojia_tip_dialog_btn_bottom.xml
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_tip_dialog_btn_bottom_press.xml renamed to core/base/src/main/res/drawable/shape_xiaojia_tip_dialog_btn_bottom_press.xml
| @@ -3,5 +3,5 @@ | @@ -3,5 +3,5 @@ | ||
| 3 | <corners | 3 | <corners |
| 4 | android:bottomLeftRadius="20dp" | 4 | android:bottomLeftRadius="20dp" |
| 5 | android:bottomRightRadius="20dp" /> | 5 | android:bottomRightRadius="20dp" /> |
| 6 | - <solid android:color="@color/line" /> | 6 | + <solid android:color="@color/my_dialog_line" /> |
| 7 | </shape> | 7 | </shape> |
| 8 | \ No newline at end of file | 8 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/layout/dialog_tip.xml renamed to core/base/src/main/res/layout/dialog_tip.xml
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | android:id="@+id/ll_child" | 9 | android:id="@+id/ll_child" |
| 10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| 11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
| 12 | - android:background="@drawable/free_xiaojia_dialog_bg" | 12 | + android:background="@drawable/my_dialog_bg" |
| 13 | android:orientation="vertical" | 13 | android:orientation="vertical" |
| 14 | android:paddingTop="10dp"> | 14 | android:paddingTop="10dp"> |
| 15 | 15 | ||
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | android:layout_width="match_parent" | 32 | android:layout_width="match_parent" |
| 33 | android:layout_height="1dp" | 33 | android:layout_height="1dp" |
| 34 | android:layout_marginTop="3dp" | 34 | android:layout_marginTop="3dp" |
| 35 | - android:background="@color/line" /> | 35 | + android:background="@color/my_dialog_line" /> |
| 36 | 36 | ||
| 37 | <LinearLayout | 37 | <LinearLayout |
| 38 | android:layout_width="match_parent" | 38 | android:layout_width="match_parent" |
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | android:layout_gravity="center" | 54 | android:layout_gravity="center" |
| 55 | android:background="@drawable/selector_xiaojia_tip_dialog_btn_bottom" | 55 | android:background="@drawable/selector_xiaojia_tip_dialog_btn_bottom" |
| 56 | android:text="好的" | 56 | android:text="好的" |
| 57 | - android:textColor="@color/btn_green" | 57 | + android:textColor="@color/my_dialog_btn_text_color" |
| 58 | android:textSize="15sp" /> | 58 | android:textSize="15sp" /> |
| 59 | </LinearLayout> | 59 | </LinearLayout> |
| 60 | 60 |
module/xiaojiasoundbox/src/main/res/layout/dialog_select.xml renamed to core/base/src/main/res/layout/my_dialog_select.xml
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | android:id="@+id/ll_child" | 9 | android:id="@+id/ll_child" |
| 10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| 11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
| 12 | - android:background="@drawable/free_xiaojia_dialog_bg" | 12 | + android:background="@drawable/my_dialog_bg" |
| 13 | android:orientation="vertical" | 13 | android:orientation="vertical" |
| 14 | android:paddingTop="10dp"> | 14 | android:paddingTop="10dp"> |
| 15 | 15 | ||
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | android:layout_width="match_parent" | 32 | android:layout_width="match_parent" |
| 33 | android:layout_height="1dp" | 33 | android:layout_height="1dp" |
| 34 | android:layout_marginTop="3dp" | 34 | android:layout_marginTop="3dp" |
| 35 | - android:background="@color/line" /> | 35 | + android:background="@color/my_dialog_line" /> |
| 36 | 36 | ||
| 37 | <LinearLayout | 37 | <LinearLayout |
| 38 | android:layout_width="match_parent" | 38 | android:layout_width="match_parent" |
| @@ -52,9 +52,9 @@ | @@ -52,9 +52,9 @@ | ||
| 52 | android:layout_width="match_parent" | 52 | android:layout_width="match_parent" |
| 53 | android:layout_height="match_parent" | 53 | android:layout_height="match_parent" |
| 54 | android:layout_gravity="center" | 54 | android:layout_gravity="center" |
| 55 | - android:background="@drawable/selector_xiaojia_dialog_btn_left" | 55 | + android:background="@drawable/selector_my_dialog_btn_left" |
| 56 | android:text="否" | 56 | android:text="否" |
| 57 | - android:textColor="@color/btn_green" | 57 | + android:textColor="@color/my_dialog_btn_text_color" |
| 58 | android:textSize="15sp" | 58 | android:textSize="15sp" |
| 59 | android:textStyle="bold" /> | 59 | android:textStyle="bold" /> |
| 60 | </LinearLayout> | 60 | </LinearLayout> |
| @@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
| 62 | <View | 62 | <View |
| 63 | android:layout_width="1dp" | 63 | android:layout_width="1dp" |
| 64 | android:layout_height="match_parent" | 64 | android:layout_height="match_parent" |
| 65 | - android:background="@color/line" /> | 65 | + android:background="@color/my_dialog_line" /> |
| 66 | 66 | ||
| 67 | <LinearLayout | 67 | <LinearLayout |
| 68 | android:layout_width="0dp" | 68 | android:layout_width="0dp" |
| @@ -76,9 +76,9 @@ | @@ -76,9 +76,9 @@ | ||
| 76 | android:layout_width="match_parent" | 76 | android:layout_width="match_parent" |
| 77 | android:layout_height="match_parent" | 77 | android:layout_height="match_parent" |
| 78 | android:layout_gravity="center" | 78 | android:layout_gravity="center" |
| 79 | - android:background="@drawable/selector_xiaojia_dialog_btn_right" | 79 | + android:background="@drawable/selector_my_dialog_btn_right" |
| 80 | android:text="否" | 80 | android:text="否" |
| 81 | - android:textColor="@color/btn_green" | 81 | + android:textColor="@color/my_dialog_btn_text_color" |
| 82 | android:textSize="15sp" | 82 | android:textSize="15sp" |
| 83 | android:textStyle="bold" /> | 83 | android:textStyle="bold" /> |
| 84 | </LinearLayout> | 84 | </LinearLayout> |
core/base/src/main/res/values/colors.xml
| @@ -60,4 +60,7 @@ | @@ -60,4 +60,7 @@ | ||
| 60 | <color name="tipTextColor">#8f8f8f</color> | 60 | <color name="tipTextColor">#8f8f8f</color> |
| 61 | <color name="menuSplitSpaceKongzue">#f1f2f4</color> | 61 | <color name="menuSplitSpaceKongzue">#f1f2f4</color> |
| 62 | <!-- --> | 62 | <!-- --> |
| 63 | + <color name="my_dialog_line">#80EEEEEE</color> | ||
| 64 | + <color name="my_dialog_btn_text_color">#23D41E</color> | ||
| 65 | + | ||
| 63 | </resources> | 66 | </resources> |
| 64 | \ No newline at end of file | 67 | \ No newline at end of file |
core/base/src/main/res/values/style.xml
| @@ -155,5 +155,16 @@ | @@ -155,5 +155,16 @@ | ||
| 155 | <item name="android:windowEnterAnimation">@anim/top_menu_enter</item> | 155 | <item name="android:windowEnterAnimation">@anim/top_menu_enter</item> |
| 156 | <item name="android:windowExitAnimation">@anim/top_menu_exit</item> | 156 | <item name="android:windowExitAnimation">@anim/top_menu_exit</item> |
| 157 | </style> | 157 | </style> |
| 158 | -<!-- --> | 158 | + <!-- --> |
| 159 | + <!-- 自定义对话框--> | ||
| 160 | + <!--自定义Dialog背景全透明无边框theme--> | ||
| 161 | + <style name="MyDialog" parent="android:style/Theme.Dialog"> | ||
| 162 | + <item name="android:windowFrame">@null</item> | ||
| 163 | + <item name="android:windowBackground">@android:color/transparent</item> | ||
| 164 | + <item name="android:windowNoTitle">true</item> | ||
| 165 | + <item name="android:windowIsFloating">true</item> | ||
| 166 | + <item name="android:windowContentOverlay">@null</item> | ||
| 167 | + <item name="android:background">@android:color/transparent</item> | ||
| 168 | + </style> | ||
| 169 | + <!-- --> | ||
| 159 | </resources> | 170 | </resources> |
| 160 | \ No newline at end of file | 171 | \ No newline at end of file |
core/network/src/main/java/com/cnlive/core/network/request/BaseRequest.java
| @@ -40,12 +40,12 @@ public class BaseRequest { | @@ -40,12 +40,12 @@ public class BaseRequest { | ||
| 40 | private String initBaseUrl(Class clazz) { | 40 | private String initBaseUrl(Class clazz) { |
| 41 | if (AppConfig.isDebug()) { | 41 | if (AppConfig.isDebug()) { |
| 42 | baseUrl = BASE_DEBUG_URL;//还原初始地址 | 42 | baseUrl = BASE_DEBUG_URL;//还原初始地址 |
| 43 | - if (clazz == ApiBaseServiceOpen.class) { | ||
| 44 | - return OPEN_URL; | ||
| 45 | - } | ||
| 46 | } else { | 43 | } else { |
| 47 | baseUrl = BASE_URL; | 44 | baseUrl = BASE_URL; |
| 48 | } | 45 | } |
| 46 | + if (clazz == ApiBaseServiceOpen.class) { | ||
| 47 | + return OPEN_URL; | ||
| 48 | + } | ||
| 49 | return baseUrl; | 49 | return baseUrl; |
| 50 | } | 50 | } |
| 51 | 51 |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/ChangeWifiFragmentView.java
| @@ -17,10 +17,9 @@ import com.cnlive.strike.xiaojiaspeaker.frame.presenter.ChangeWifiFragmentPresen | @@ -17,10 +17,9 @@ import com.cnlive.strike.xiaojiaspeaker.frame.presenter.ChangeWifiFragmentPresen | ||
| 17 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; | 17 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; |
| 18 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.WifiRecycleAdapter; | 18 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.WifiRecycleAdapter; |
| 19 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.ChangeWifiFragment; | 19 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.ChangeWifiFragment; |
| 20 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.TipDialog; | 20 | +import com.cnlive.core.libs.base.ui.widget.TipDialog; |
| 21 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.WifiPwdDialog; | 21 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.WifiPwdDialog; |
| 22 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; | 22 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 23 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | ||
| 24 | 23 | ||
| 25 | import java.util.ArrayList; | 24 | import java.util.ArrayList; |
| 26 | import java.util.List; | 25 | import java.util.List; |
| @@ -87,7 +86,7 @@ public class ChangeWifiFragmentView extends BaseView { | @@ -87,7 +86,7 @@ public class ChangeWifiFragmentView extends BaseView { | ||
| 87 | } | 86 | } |
| 88 | 87 | ||
| 89 | private void initErrorDialog() { | 88 | private void initErrorDialog() { |
| 90 | - errorDialog = new TipDialog(getContext(), "", "关闭", R.color.btn_green, new TipDialog.DialogInterface() { | 89 | + errorDialog = new TipDialog(getContext(), "", "关闭", R.color.my_dialog_btn_text_color, new TipDialog.DialogInterface() { |
| 91 | @Override | 90 | @Override |
| 92 | public void onClick(TipDialog dialog) { | 91 | public void onClick(TipDialog dialog) { |
| 93 | dialog.dismiss(); | 92 | dialog.dismiss(); |
| @@ -142,7 +141,7 @@ public class ChangeWifiFragmentView extends BaseView { | @@ -142,7 +141,7 @@ public class ChangeWifiFragmentView extends BaseView { | ||
| 142 | } | 141 | } |
| 143 | }); | 142 | }); |
| 144 | wifiPwdDialog.setLeftBtnColor(R.color.color_999999); | 143 | wifiPwdDialog.setLeftBtnColor(R.color.color_999999); |
| 145 | - wifiPwdDialog.setRightBtnColor(R.color.btn_green); | 144 | + wifiPwdDialog.setRightBtnColor(R.color.my_dialog_btn_text_color); |
| 146 | wifiPwdDialog.setCancelable(false); | 145 | wifiPwdDialog.setCancelable(false); |
| 147 | wifiPwdDialog.setCanceledOnTouchOutside(false); | 146 | wifiPwdDialog.setCanceledOnTouchOutside(false); |
| 148 | } | 147 | } |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/DeviceManagerFragmentView.java
| @@ -25,10 +25,9 @@ import com.cnlive.strike.xiaojiaspeaker.ui.activity.ChangeWifiActivity; | @@ -25,10 +25,9 @@ import com.cnlive.strike.xiaojiaspeaker.ui.activity.ChangeWifiActivity; | ||
| 25 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.DeviceInfoActivity; | 25 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.DeviceInfoActivity; |
| 26 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.FirmwareUpdateActivity; | 26 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.FirmwareUpdateActivity; |
| 27 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.DeviceManagerFragment; | 27 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.DeviceManagerFragment; |
| 28 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog; | 28 | +import com.cnlive.core.libs.base.ui.widget.SelectDialog; |
| 29 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; | 29 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; |
| 30 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; | 30 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; |
| 31 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | ||
| 32 | 31 | ||
| 33 | public class DeviceManagerFragmentView extends BaseView { | 32 | public class DeviceManagerFragmentView extends BaseView { |
| 34 | private DeviceManagerFragment fragment; | 33 | private DeviceManagerFragment fragment; |
| @@ -143,7 +142,7 @@ public class DeviceManagerFragmentView extends BaseView { | @@ -143,7 +142,7 @@ public class DeviceManagerFragmentView extends BaseView { | ||
| 143 | selectDialog.setCancelable(false); | 142 | selectDialog.setCancelable(false); |
| 144 | selectDialog.setCanceledOnTouchOutside(false); | 143 | selectDialog.setCanceledOnTouchOutside(false); |
| 145 | selectDialog.setTipTextStyle(Typeface.DEFAULT); | 144 | selectDialog.setTipTextStyle(Typeface.DEFAULT); |
| 146 | - selectDialog.setRightBtnColor(R.color.btn_green); | 145 | + selectDialog.setRightBtnColor(R.color.my_dialog_btn_text_color); |
| 147 | if (!selectDialog.isShowing()) { | 146 | if (!selectDialog.isShowing()) { |
| 148 | selectDialog.show(); | 147 | selectDialog.show(); |
| 149 | } | 148 | } |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SearchDevicefragmentView.java
| @@ -19,9 +19,8 @@ import com.cnlive.strike.xiaojiaspeaker.ui.activity.BlueToothHelpActivity; | @@ -19,9 +19,8 @@ import com.cnlive.strike.xiaojiaspeaker.ui.activity.BlueToothHelpActivity; | ||
| 19 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.SelectWifiActivity; | 19 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.SelectWifiActivity; |
| 20 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.BluetoothDeviceAdapter; | 20 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.BluetoothDeviceAdapter; |
| 21 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SearchDevicefragment; | 21 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SearchDevicefragment; |
| 22 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog; | 22 | +import com.cnlive.core.libs.base.ui.widget.SelectDialog; |
| 23 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; | 23 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 24 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | ||
| 25 | 24 | ||
| 26 | import java.util.ArrayList; | 25 | import java.util.ArrayList; |
| 27 | import java.util.List; | 26 | import java.util.List; |
| @@ -112,7 +111,7 @@ public class SearchDevicefragmentView extends BaseView { | @@ -112,7 +111,7 @@ public class SearchDevicefragmentView extends BaseView { | ||
| 112 | dialog.dismiss(); | 111 | dialog.dismiss(); |
| 113 | } | 112 | } |
| 114 | }); | 113 | }); |
| 115 | - wifiDialog.setRightBtnColor(R.color.btn_green); | 114 | + wifiDialog.setRightBtnColor(R.color.my_dialog_btn_text_color); |
| 116 | wifiDialog.setCancelable(false); | 115 | wifiDialog.setCancelable(false); |
| 117 | wifiDialog.setCanceledOnTouchOutside(false); | 116 | wifiDialog.setCanceledOnTouchOutside(false); |
| 118 | } | 117 | } |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SelectWifiFragmentView.java
| @@ -30,12 +30,11 @@ import com.cnlive.strike.xiaojiaspeaker.ui.activity.ConnBluetoothSuccessActivity | @@ -30,12 +30,11 @@ import com.cnlive.strike.xiaojiaspeaker.ui.activity.ConnBluetoothSuccessActivity | ||
| 30 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.ConnFailActivity; | 30 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.ConnFailActivity; |
| 31 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.WifiRecycleAdapter; | 31 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.WifiRecycleAdapter; |
| 32 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectWifiFragment; | 32 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectWifiFragment; |
| 33 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.TipDialog; | 33 | +import com.cnlive.core.libs.base.ui.widget.TipDialog; |
| 34 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.WifiPwdDialog; | 34 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.WifiPwdDialog; |
| 35 | import com.cnlive.strike.xiaojiaspeaker.util.BlueToothUtil; | 35 | import com.cnlive.strike.xiaojiaspeaker.util.BlueToothUtil; |
| 36 | import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil; | 36 | import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil; |
| 37 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; | 37 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 38 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | ||
| 39 | 38 | ||
| 40 | import org.greenrobot.eventbus.EventBus; | 39 | import org.greenrobot.eventbus.EventBus; |
| 41 | 40 | ||
| @@ -120,7 +119,7 @@ public class SelectWifiFragmentView extends BaseView { | @@ -120,7 +119,7 @@ public class SelectWifiFragmentView extends BaseView { | ||
| 120 | } | 119 | } |
| 121 | 120 | ||
| 122 | private void initErrorDialog() { | 121 | private void initErrorDialog() { |
| 123 | - errorDialog = new TipDialog(getContext(), "", "关闭", R.color.btn_green, new TipDialog.DialogInterface() { | 122 | + errorDialog = new TipDialog(getContext(), "", "关闭", R.color.my_dialog_btn_text_color, new TipDialog.DialogInterface() { |
| 124 | @Override | 123 | @Override |
| 125 | public void onClick(TipDialog dialog) { | 124 | public void onClick(TipDialog dialog) { |
| 126 | dialog.dismiss(); | 125 | dialog.dismiss(); |
| @@ -161,7 +160,7 @@ public class SelectWifiFragmentView extends BaseView { | @@ -161,7 +160,7 @@ public class SelectWifiFragmentView extends BaseView { | ||
| 161 | } | 160 | } |
| 162 | }); | 161 | }); |
| 163 | wifiPwdDialog.setLeftBtnColor(R.color.color_999999); | 162 | wifiPwdDialog.setLeftBtnColor(R.color.color_999999); |
| 164 | - wifiPwdDialog.setRightBtnColor(R.color.btn_green); | 163 | + wifiPwdDialog.setRightBtnColor(R.color.my_dialog_btn_text_color); |
| 165 | wifiPwdDialog.setCancelable(false); | 164 | wifiPwdDialog.setCancelable(false); |
| 166 | wifiPwdDialog.setCanceledOnTouchOutside(false); | 165 | wifiPwdDialog.setCanceledOnTouchOutside(false); |
| 167 | } | 166 | } |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/UserManagerView.java
| @@ -23,10 +23,9 @@ import com.cnlive.strike.xiaojiaspeaker.ui.activity.SelectIMFriendActivity; | @@ -23,10 +23,9 @@ import com.cnlive.strike.xiaojiaspeaker.ui.activity.SelectIMFriendActivity; | ||
| 23 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.UserManagerAdapter; | 23 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.UserManagerAdapter; |
| 24 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.UserManagerFragment; | 24 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.UserManagerFragment; |
| 25 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.EditRoleDialog; | 25 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.EditRoleDialog; |
| 26 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog; | 26 | +import com.cnlive.core.libs.base.ui.widget.SelectDialog; |
| 27 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenu; | 27 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenu; |
| 28 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenuInfo; | 28 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenuInfo; |
| 29 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | ||
| 30 | 29 | ||
| 31 | import java.util.ArrayList; | 30 | import java.util.ArrayList; |
| 32 | import java.util.List; | 31 | import java.util.List; |
| @@ -163,7 +162,7 @@ public class UserManagerView extends BaseView { | @@ -163,7 +162,7 @@ public class UserManagerView extends BaseView { | ||
| 163 | }); | 162 | }); |
| 164 | } | 163 | } |
| 165 | }); | 164 | }); |
| 166 | - deleteDialog.setRightBtnColor(R.color.btn_green); | 165 | + deleteDialog.setRightBtnColor(R.color.my_dialog_btn_text_color); |
| 167 | deleteDialog.setTipTextStyle(Typeface.DEFAULT); | 166 | deleteDialog.setTipTextStyle(Typeface.DEFAULT); |
| 168 | if (!deleteDialog.isShowing()) { | 167 | if (!deleteDialog.isShowing()) { |
| 169 | deleteDialog.show(); | 168 | deleteDialog.show(); |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/BlueToothStep2Activity.java
| @@ -7,15 +7,10 @@ import android.content.BroadcastReceiver; | @@ -7,15 +7,10 @@ import android.content.BroadcastReceiver; | ||
| 7 | import android.content.Context; | 7 | import android.content.Context; |
| 8 | import android.content.Intent; | 8 | import android.content.Intent; |
| 9 | import android.content.IntentFilter; | 9 | import android.content.IntentFilter; |
| 10 | -import android.content.pm.PackageManager; | ||
| 11 | import android.net.Uri; | 10 | import android.net.Uri; |
| 12 | -import android.os.Bundle; | ||
| 13 | import android.provider.Settings; | 11 | import android.provider.Settings; |
| 14 | import android.util.Log; | 12 | import android.util.Log; |
| 15 | import android.view.View; | 13 | import android.view.View; |
| 16 | - | ||
| 17 | -import androidx.databinding.DataBindingUtil; | ||
| 18 | - | ||
| 19 | import com.clj.fastble.BleManager; | 14 | import com.clj.fastble.BleManager; |
| 20 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; | 15 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 21 | import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; | 16 | import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; |
| @@ -24,10 +19,8 @@ import com.cnlive.core.libs.base.util.StatusBarConfig; | @@ -24,10 +19,8 @@ import com.cnlive.core.libs.base.util.StatusBarConfig; | ||
| 24 | import com.cnlive.strike.xiaojiaspeaker.R; | 19 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 25 | import com.cnlive.strike.xiaojiaspeaker.databinding.ActivityBlueToothStep2Binding; | 20 | import com.cnlive.strike.xiaojiaspeaker.databinding.ActivityBlueToothStep2Binding; |
| 26 | import com.cnlive.strike.xiaojiaspeaker.model.message.EventMsg; | 21 | import com.cnlive.strike.xiaojiaspeaker.model.message.EventMsg; |
| 27 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog; | 22 | +import com.cnlive.core.libs.base.ui.widget.SelectDialog; |
| 28 | import com.cnlive.strike.xiaojiaspeaker.util.EventBusUtil; | 23 | import com.cnlive.strike.xiaojiaspeaker.util.EventBusUtil; |
| 29 | -import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; | ||
| 30 | -import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; | ||
| 31 | 24 | ||
| 32 | import org.greenrobot.eventbus.Subscribe; | 25 | import org.greenrobot.eventbus.Subscribe; |
| 33 | import org.greenrobot.eventbus.ThreadMode; | 26 | import org.greenrobot.eventbus.ThreadMode; |
| @@ -35,7 +28,6 @@ import org.greenrobot.eventbus.ThreadMode; | @@ -35,7 +28,6 @@ import org.greenrobot.eventbus.ThreadMode; | ||
| 35 | public class BlueToothStep2Activity extends BaseActivity { | 28 | public class BlueToothStep2Activity extends BaseActivity { |
| 36 | private ActivityBlueToothStep2Binding binding; | 29 | private ActivityBlueToothStep2Binding binding; |
| 37 | private int permissionRequestCount = 0;//权限请求次数 | 30 | private int permissionRequestCount = 0;//权限请求次数 |
| 38 | - private boolean isClickNextBtn = false; | ||
| 39 | private SelectDialog selectDialog; | 31 | private SelectDialog selectDialog; |
| 40 | 32 | ||
| 41 | @Override | 33 | @Override |
| @@ -119,7 +111,7 @@ public class BlueToothStep2Activity extends BaseActivity { | @@ -119,7 +111,7 @@ public class BlueToothStep2Activity extends BaseActivity { | ||
| 119 | * 一次申请一组权限(使用拒绝弹框)点击事件 | 111 | * 一次申请一组权限(使用拒绝弹框)点击事件 |
| 120 | */ | 112 | */ |
| 121 | public void getPermissionsWithTip() { | 113 | public void getPermissionsWithTip() { |
| 122 | - String[] permissions = new String[]{ Manifest.permission.INTERNET | 114 | + String[] permissions = new String[]{Manifest.permission.INTERNET |
| 123 | , Manifest.permission.ACCESS_FINE_LOCATION | 115 | , Manifest.permission.ACCESS_FINE_LOCATION |
| 124 | , Manifest.permission.ACCESS_COARSE_LOCATION}; | 116 | , Manifest.permission.ACCESS_COARSE_LOCATION}; |
| 125 | requestPermission(permissions, "您尚未授予程序运行所需权限\n是否设置?", new OnPermissionResponseListener() { | 117 | requestPermission(permissions, "您尚未授予程序运行所需权限\n是否设置?", new OnPermissionResponseListener() { |
| @@ -178,10 +170,8 @@ public class BlueToothStep2Activity extends BaseActivity { | @@ -178,10 +170,8 @@ public class BlueToothStep2Activity extends BaseActivity { | ||
| 178 | switch (blueState) { | 170 | switch (blueState) { |
| 179 | case BluetoothAdapter.STATE_TURNING_ON: | 171 | case BluetoothAdapter.STATE_TURNING_ON: |
| 180 | Log.e(TAG, "监听到蓝牙已开启"); | 172 | Log.e(TAG, "监听到蓝牙已开启"); |
| 181 | - if (isClickNextBtn) { | ||
| 182 | - SearchDeviceActivity.startActivity(BlueToothStep2Activity.this); | ||
| 183 | - finish(); | ||
| 184 | - } | 173 | + SearchDeviceActivity.startActivity(BlueToothStep2Activity.this); |
| 174 | + finish(); | ||
| 185 | break; | 175 | break; |
| 186 | case BluetoothAdapter.STATE_ON: | 176 | case BluetoothAdapter.STATE_ON: |
| 187 | Log.e(TAG, "监听到蓝牙已启动"); | 177 | Log.e(TAG, "监听到蓝牙已启动"); |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/ChangeWifiActivity.java
| @@ -3,7 +3,6 @@ package com.cnlive.strike.xiaojiaspeaker.ui.activity; | @@ -3,7 +3,6 @@ package com.cnlive.strike.xiaojiaspeaker.ui.activity; | ||
| 3 | import android.Manifest; | 3 | import android.Manifest; |
| 4 | import android.app.Activity; | 4 | import android.app.Activity; |
| 5 | import android.content.Intent; | 5 | import android.content.Intent; |
| 6 | -import android.content.pm.PackageManager; | ||
| 7 | import android.net.Uri; | 6 | import android.net.Uri; |
| 8 | import android.os.Bundle; | 7 | import android.os.Bundle; |
| 9 | import android.os.Handler; | 8 | import android.os.Handler; |
| @@ -11,16 +10,13 @@ import android.provider.Settings; | @@ -11,16 +10,13 @@ import android.provider.Settings; | ||
| 11 | import android.text.TextUtils; | 10 | import android.text.TextUtils; |
| 12 | import android.util.Log; | 11 | import android.util.Log; |
| 13 | 12 | ||
| 14 | -import androidx.annotation.NonNull; | ||
| 15 | - | ||
| 16 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; | 13 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 17 | import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; | 14 | import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; |
| 18 | import com.cnlive.strike.xiaojiaspeaker.R; | 15 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 19 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; | 16 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; |
| 20 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.ChangeWifiFragment; | 17 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.ChangeWifiFragment; |
| 21 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog; | 18 | +import com.cnlive.core.libs.base.ui.widget.SelectDialog; |
| 22 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; | 19 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 23 | -import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; | ||
| 24 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; | 20 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; |
| 25 | 21 | ||
| 26 | public class ChangeWifiActivity extends BaseActivity { | 22 | public class ChangeWifiActivity extends BaseActivity { |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/RemoteControlActivity.java
| @@ -37,6 +37,11 @@ public class RemoteControlActivity extends BaseActivity { | @@ -37,6 +37,11 @@ public class RemoteControlActivity extends BaseActivity { | ||
| 37 | return R.layout.activity_remote_control; | 37 | return R.layout.activity_remote_control; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | + @Override | ||
| 41 | + protected void initBindingData() { | ||
| 42 | + super.initBindingData(); | ||
| 43 | + binding= (ActivityRemoteControlBinding) baseBinding; | ||
| 44 | + } | ||
| 40 | 45 | ||
| 41 | @Override | 46 | @Override |
| 42 | protected void initView() { | 47 | protected void initView() { |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/SelectWifiActivity.java
| @@ -3,9 +3,7 @@ package com.cnlive.strike.xiaojiaspeaker.ui.activity; | @@ -3,9 +3,7 @@ package com.cnlive.strike.xiaojiaspeaker.ui.activity; | ||
| 3 | import android.Manifest; | 3 | import android.Manifest; |
| 4 | import android.app.Activity; | 4 | import android.app.Activity; |
| 5 | import android.content.Intent; | 5 | import android.content.Intent; |
| 6 | -import android.content.pm.PackageManager; | ||
| 7 | import android.net.Uri; | 6 | import android.net.Uri; |
| 8 | -import android.os.Bundle; | ||
| 9 | import android.os.Handler; | 7 | import android.os.Handler; |
| 10 | import android.provider.Settings; | 8 | import android.provider.Settings; |
| 11 | import android.util.Log; | 9 | import android.util.Log; |
| @@ -14,7 +12,7 @@ import com.clj.fastble.data.BleDevice; | @@ -14,7 +12,7 @@ import com.clj.fastble.data.BleDevice; | ||
| 14 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; | 12 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 15 | import com.cnlive.strike.xiaojiaspeaker.R; | 13 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 16 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectWifiFragment; | 14 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectWifiFragment; |
| 17 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog; | 15 | +import com.cnlive.core.libs.base.ui.widget.SelectDialog; |
| 18 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; | 16 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 19 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; | 17 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; |
| 20 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; | 18 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/AllDeviceFragment.java
| @@ -87,7 +87,7 @@ public class AllDeviceFragment extends BaseFragment<AllDeviceFragmentView, AllDe | @@ -87,7 +87,7 @@ public class AllDeviceFragment extends BaseFragment<AllDeviceFragmentView, AllDe | ||
| 87 | binding.topbar.addLeftImageButton(R.drawable.icon_xiaojia_back, R.id.left_back).setOnClickListener(new View.OnClickListener() { | 87 | binding.topbar.addLeftImageButton(R.drawable.icon_xiaojia_back, R.id.left_back).setOnClickListener(new View.OnClickListener() { |
| 88 | @Override | 88 | @Override |
| 89 | public void onClick(View view) { | 89 | public void onClick(View view) { |
| 90 | - getActivity().finish(); | 90 | + finish(); |
| 91 | } | 91 | } |
| 92 | }); | 92 | }); |
| 93 | //添加设备按钮 | 93 | //添加设备按钮 |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/SelectWifiFragment.java
| @@ -50,7 +50,7 @@ public class SelectWifiFragment extends BaseFragment<SelectWifiFragmentView, Sel | @@ -50,7 +50,7 @@ public class SelectWifiFragment extends BaseFragment<SelectWifiFragmentView, Sel | ||
| 50 | @Override | 50 | @Override |
| 51 | protected void initFragmentStyle() { | 51 | protected void initFragmentStyle() { |
| 52 | super.initFragmentStyle(); | 52 | super.initFragmentStyle(); |
| 53 | - setStatusBarTextColor(StatusBarConfig.WHITE); | 53 | + setStatusBarTextColor(StatusBarConfig.BLACK); |
| 54 | setStatusBarColor(R.color.white,0); | 54 | setStatusBarColor(R.color.white,0); |
| 55 | } | 55 | } |
| 56 | 56 |
module/xiaojiasoundbox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/widget/WifiPwdDialog.java
| @@ -88,7 +88,7 @@ public class WifiPwdDialog extends Dialog { | @@ -88,7 +88,7 @@ public class WifiPwdDialog extends Dialog { | ||
| 88 | //显示视图 | 88 | //显示视图 |
| 89 | this.setContentView(view); | 89 | this.setContentView(view); |
| 90 | this.btn_ok.setClickable(false); | 90 | this.btn_ok.setClickable(false); |
| 91 | - this.btn_ok.setTextColor(ContextCompat.getColor(context, R.color.line)); | 91 | + this.btn_ok.setTextColor(ContextCompat.getColor(context, R.color.my_dialog_line)); |
| 92 | this.et_pwd.addTextChangedListener(new TextWatcher() { | 92 | this.et_pwd.addTextChangedListener(new TextWatcher() { |
| 93 | @Override | 93 | @Override |
| 94 | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { | 94 | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
| @@ -99,12 +99,12 @@ public class WifiPwdDialog extends Dialog { | @@ -99,12 +99,12 @@ public class WifiPwdDialog extends Dialog { | ||
| 99 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { | 99 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
| 100 | if (charSequence.length() < 8) { | 100 | if (charSequence.length() < 8) { |
| 101 | btn_ok.setClickable(false); | 101 | btn_ok.setClickable(false); |
| 102 | - btn_ok.setTextColor(ContextCompat.getColor(context, R.color.line)); | 102 | + btn_ok.setTextColor(ContextCompat.getColor(context, R.color.my_dialog_line)); |
| 103 | 103 | ||
| 104 | } else { | 104 | } else { |
| 105 | btn_ok.setClickable(true); | 105 | btn_ok.setClickable(true); |
| 106 | btn_ok.setTextColor(ContextCompat.getColor(context, rightColor)); | 106 | btn_ok.setTextColor(ContextCompat.getColor(context, rightColor)); |
| 107 | - btn_ok.setBackground(context.getResources().getDrawable(R.drawable.selector_xiaojia_dialog_btn_right)); | 107 | + btn_ok.setBackground(context.getResources().getDrawable(R.drawable.selector_my_dialog_btn_right)); |
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | 110 |
module/xiaojiasoundbox/src/main/res/drawable-v21/ripple_xiaojia_bg.xml
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | -<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/line"> | 2 | +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/my_dialog_line"> |
| 3 | <item android:drawable="@color/transparent"/> | 3 | <item android:drawable="@color/transparent"/> |
| 4 | </ripple> | 4 | </ripple> |
| 5 | 5 |
module/xiaojiasoundbox/src/main/res/drawable-v21/selectable_xiaojia_item_white.xml
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | -<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/line"> | 2 | +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/my_dialog_line"> |
| 3 | <item android:drawable="@color/white"/> | 3 | <item android:drawable="@color/white"/> |
| 4 | </ripple> | 4 | </ripple> |
| 5 | 5 |
module/xiaojiasoundbox/src/main/res/drawable/miui_xiaojia_back_drawable.xml
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | </item> | 9 | </item> |
| 10 | <item android:state_checked="true"> | 10 | <item android:state_checked="true"> |
| 11 | <shape> | 11 | <shape> |
| 12 | - <solid android:color="@color/btn_green" /> | 12 | + <solid android:color="@color/my_dialog_btn_text_color" /> |
| 13 | <corners android:radius="99dp" /> | 13 | <corners android:radius="99dp" /> |
| 14 | <stroke android:width="1px" android:color="#DEDEDE" /> | 14 | <stroke android:width="1px" android:color="#DEDEDE" /> |
| 15 | </shape> | 15 | </shape> |
module/xiaojiasoundbox/src/main/res/drawable/ripple_xiaojia_bg.xml
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> | 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> |
| 4 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true"/> | 4 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true"/> |
| 5 | - <item android:drawable="@color/line" android:state_focused="true" android:state_pressed="true"/> | ||
| 6 | - <item android:drawable="@color/line" android:state_focused="false" android:state_pressed="true"/> | 5 | + <item android:drawable="@color/my_dialog_line" android:state_focused="true" android:state_pressed="true"/> |
| 6 | + <item android:drawable="@color/my_dialog_line" android:state_focused="false" android:state_pressed="true"/> | ||
| 7 | <item android:drawable="@color/white"/> | 7 | <item android:drawable="@color/white"/> |
| 8 | </selector> | 8 | </selector> |
| 9 | 9 |
module/xiaojiasoundbox/src/main/res/drawable/selectable_xiaojia_background.xml
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> | 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> |
| 4 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true"/> | 4 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true"/> |
| 5 | - <item android:drawable="@color/line" android:state_focused="true" android:state_pressed="true"/> | ||
| 6 | - <item android:drawable="@color/line" android:state_focused="false" android:state_pressed="true"/> | 5 | + <item android:drawable="@color/my_dialog_line" android:state_focused="true" android:state_pressed="true"/> |
| 6 | + <item android:drawable="@color/my_dialog_line" android:state_focused="false" android:state_pressed="true"/> | ||
| 7 | <item android:drawable="@color/white"/> | 7 | <item android:drawable="@color/white"/> |
| 8 | </selector> | 8 | </selector> |
| 9 | 9 |
module/xiaojiasoundbox/src/main/res/drawable/selectable_xiaojia_item_white.xml
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> | 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> |
| 4 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true"/> | 4 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true"/> |
| 5 | - <item android:drawable="@color/line" android:state_focused="true" android:state_pressed="true"/> | ||
| 6 | - <item android:drawable="@color/line" android:state_focused="false" android:state_pressed="true"/> | 5 | + <item android:drawable="@color/my_dialog_line" android:state_focused="true" android:state_pressed="true"/> |
| 6 | + <item android:drawable="@color/my_dialog_line" android:state_focused="false" android:state_pressed="true"/> | ||
| 7 | <item android:drawable="@color/white"/> | 7 | <item android:drawable="@color/white"/> |
| 8 | </selector> | 8 | </selector> |
| 9 | 9 |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_btn_green.xml
| @@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <corners android:radius="50dp" /> | 3 | <corners android:radius="50dp" /> |
| 4 | <!-- 填充的颜色 --> | 4 | <!-- 填充的颜色 --> |
| 5 | - <solid android:color="@color/btn_green" /> | 5 | + <solid android:color="@color/my_dialog_btn_text_color" /> |
| 6 | <!--设置渐变--> | 6 | <!--设置渐变--> |
| 7 | <!--设置渐变--> | 7 | <!--设置渐变--> |
| 8 | <gradient | 8 | <gradient |
| 9 | - android:endColor="@color/btn_green" | 9 | + android:endColor="@color/my_dialog_btn_text_color" |
| 10 | android:startColor="#49EE1D" /> | 10 | android:startColor="#49EE1D" /> |
| 11 | </shape> | 11 | </shape> |
| 12 | \ No newline at end of file | 12 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_dialog_btn_left_press.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <corners android:bottomLeftRadius="20dp" /> | 3 | <corners android:bottomLeftRadius="20dp" /> |
| 4 | - <solid android:color="@color/line" /> | 4 | + <solid android:color="@color/my_dialog_line" /> |
| 5 | </shape> | 5 | </shape> |
| 6 | \ No newline at end of file | 6 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_dialog_btn_right_press.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <corners android:bottomRightRadius="20dp" /> | 3 | <corners android:bottomRightRadius="20dp" /> |
| 4 | - <solid android:color="@color/line" /> | 4 | + <solid android:color="@color/my_dialog_line" /> |
| 5 | </shape> | 5 | </shape> |
| 6 | \ No newline at end of file | 6 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_et_wifi_bg.xml
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <stroke | 3 | <stroke |
| 4 | android:width="1dp" | 4 | android:width="1dp" |
| 5 | - android:color="@color/line" /> | ||
| 6 | - <solid android:color="@color/line" /> | 5 | + android:color="@color/my_dialog_line" /> |
| 6 | + <solid android:color="@color/my_dialog_line" /> | ||
| 7 | <corners android:radius="10dp" /> | 7 | <corners android:radius="10dp" /> |
| 8 | </shape> | 8 | </shape> |
| 9 | \ No newline at end of file | 9 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_green_stroke.xml
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <stroke | 3 | <stroke |
| 4 | android:width="1dp" | 4 | android:width="1dp" |
| 5 | - android:color="@color/btn_green" /> | 5 | + android:color="@color/my_dialog_btn_text_color" /> |
| 6 | <solid android:color="@color/white" /> | 6 | <solid android:color="@color/white" /> |
| 7 | <corners android:radius="20dp" /> | 7 | <corners android:radius="20dp" /> |
| 8 | </shape> | 8 | </shape> |
| 9 | \ No newline at end of file | 9 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/layout/activity_conn_bluetooth_success.xml
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | android:layout_height="wrap_content" | 37 | android:layout_height="wrap_content" |
| 38 | android:layout_marginTop="20dp" | 38 | android:layout_marginTop="20dp" |
| 39 | android:text="@string/conn_success" | 39 | android:text="@string/conn_success" |
| 40 | - android:textColor="@color/btn_green" | 40 | + android:textColor="@color/my_dialog_btn_text_color" |
| 41 | android:textSize="20sp" | 41 | android:textSize="20sp" |
| 42 | android:textStyle="bold" /> | 42 | android:textStyle="bold" /> |
| 43 | </LinearLayout> | 43 | </LinearLayout> |
| @@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
| 70 | android:layout_marginTop="30dp" | 70 | android:layout_marginTop="30dp" |
| 71 | android:background="@drawable/shape_xiaojia_green_stroke" | 71 | android:background="@drawable/shape_xiaojia_green_stroke" |
| 72 | android:text="完成" | 72 | android:text="完成" |
| 73 | - android:textColor="@color/btn_green" | 73 | + android:textColor="@color/my_dialog_btn_text_color" |
| 74 | android:textSize="18sp" /> | 74 | android:textSize="18sp" /> |
| 75 | 75 | ||
| 76 | <TextView | 76 | <TextView |
| @@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
| 81 | android:layout_marginTop="30sp" | 81 | android:layout_marginTop="30sp" |
| 82 | android:gravity="center" | 82 | android:gravity="center" |
| 83 | android:text="给音箱取个名字吧 >>" | 83 | android:text="给音箱取个名字吧 >>" |
| 84 | - android:textColor="@color/btn_green" | 84 | + android:textColor="@color/my_dialog_btn_text_color" |
| 85 | android:textSize="13sp" /> | 85 | android:textSize="13sp" /> |
| 86 | 86 | ||
| 87 | </LinearLayout> | 87 | </LinearLayout> |
| @@ -98,7 +98,7 @@ | @@ -98,7 +98,7 @@ | ||
| 98 | android:layout_height="1dp" | 98 | android:layout_height="1dp" |
| 99 | android:layout_marginLeft="10dp" | 99 | android:layout_marginLeft="10dp" |
| 100 | android:layout_marginRight="10dp" | 100 | android:layout_marginRight="10dp" |
| 101 | - android:background="@color/line" /> | 101 | + android:background="@color/my_dialog_line" /> |
| 102 | 102 | ||
| 103 | <TextView | 103 | <TextView |
| 104 | android:layout_width="wrap_content" | 104 | android:layout_width="wrap_content" |
| @@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
| 116 | android:layout_gravity="center_horizontal" | 116 | android:layout_gravity="center_horizontal" |
| 117 | android:layout_marginTop="15dp" | 117 | android:layout_marginTop="15dp" |
| 118 | android:text="@string/go_to_liaten_china" | 118 | android:text="@string/go_to_liaten_china" |
| 119 | - android:textColor="@color/btn_green" | 119 | + android:textColor="@color/my_dialog_btn_text_color" |
| 120 | android:textSize="13sp" /> | 120 | android:textSize="13sp" /> |
| 121 | </LinearLayout> | 121 | </LinearLayout> |
| 122 | </LinearLayout> | 122 | </LinearLayout> |
module/xiaojiasoundbox/src/main/res/layout/dialog_edit_role.xml
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | android:id="@+id/ll_child" | 9 | android:id="@+id/ll_child" |
| 10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| 11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
| 12 | - android:background="@drawable/free_xiaojia_dialog_bg" | 12 | + android:background="@drawable/my_dialog_bg" |
| 13 | android:orientation="vertical" | 13 | android:orientation="vertical" |
| 14 | android:paddingTop="10dp"> | 14 | android:paddingTop="10dp"> |
| 15 | 15 | ||
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | android:layout_marginLeft="10dp" | 31 | android:layout_marginLeft="10dp" |
| 32 | android:layout_marginTop="15dp" | 32 | android:layout_marginTop="15dp" |
| 33 | android:layout_marginRight="10dp" | 33 | android:layout_marginRight="10dp" |
| 34 | - android:background="@color/line" /> | 34 | + android:background="@color/my_dialog_line" /> |
| 35 | 35 | ||
| 36 | <LinearLayout | 36 | <LinearLayout |
| 37 | android:layout_width="match_parent" | 37 | android:layout_width="match_parent" |
| @@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
| 66 | android:layout_height="1dp" | 66 | android:layout_height="1dp" |
| 67 | android:layout_marginLeft="10dp" | 67 | android:layout_marginLeft="10dp" |
| 68 | android:layout_marginRight="10dp" | 68 | android:layout_marginRight="10dp" |
| 69 | - android:background="@color/line" /> | 69 | + android:background="@color/my_dialog_line" /> |
| 70 | 70 | ||
| 71 | <LinearLayout | 71 | <LinearLayout |
| 72 | android:layout_width="match_parent" | 72 | android:layout_width="match_parent" |
| @@ -86,7 +86,7 @@ | @@ -86,7 +86,7 @@ | ||
| 86 | android:layout_width="match_parent" | 86 | android:layout_width="match_parent" |
| 87 | android:layout_height="match_parent" | 87 | android:layout_height="match_parent" |
| 88 | android:layout_gravity="center" | 88 | android:layout_gravity="center" |
| 89 | - android:background="@drawable/selector_xiaojia_dialog_btn_left" | 89 | + android:background="@drawable/selector_my_dialog_btn_left" |
| 90 | android:text="取消" | 90 | android:text="取消" |
| 91 | android:textColor="@color/color_282828" | 91 | android:textColor="@color/color_282828" |
| 92 | android:textSize="17sp" /> | 92 | android:textSize="17sp" /> |
| @@ -95,7 +95,7 @@ | @@ -95,7 +95,7 @@ | ||
| 95 | <View | 95 | <View |
| 96 | android:layout_width="1dp" | 96 | android:layout_width="1dp" |
| 97 | android:layout_height="match_parent" | 97 | android:layout_height="match_parent" |
| 98 | - android:background="@color/line" /> | 98 | + android:background="@color/my_dialog_line" /> |
| 99 | 99 | ||
| 100 | <LinearLayout | 100 | <LinearLayout |
| 101 | android:layout_width="0dp" | 101 | android:layout_width="0dp" |
| @@ -109,9 +109,9 @@ | @@ -109,9 +109,9 @@ | ||
| 109 | android:layout_width="match_parent" | 109 | android:layout_width="match_parent" |
| 110 | android:layout_height="match_parent" | 110 | android:layout_height="match_parent" |
| 111 | android:layout_gravity="center" | 111 | android:layout_gravity="center" |
| 112 | - android:background="@drawable/selector_xiaojia_dialog_btn_right" | 112 | + android:background="@drawable/selector_my_dialog_btn_right" |
| 113 | android:text="保存" | 113 | android:text="保存" |
| 114 | - android:textColor="@color/btn_green" | 114 | + android:textColor="@color/my_dialog_btn_text_color" |
| 115 | android:textSize="17sp" /> | 115 | android:textSize="17sp" /> |
| 116 | </LinearLayout> | 116 | </LinearLayout> |
| 117 | 117 |
module/xiaojiasoundbox/src/main/res/layout/dialog_wifi_pwd.xml
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | android:id="@+id/ll_child" | 9 | android:id="@+id/ll_child" |
| 10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| 11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
| 12 | - android:background="@drawable/free_xiaojia_dialog_bg" | 12 | + android:background="@drawable/my_dialog_bg" |
| 13 | android:orientation="vertical" | 13 | android:orientation="vertical" |
| 14 | android:paddingTop="10dp"> | 14 | android:paddingTop="10dp"> |
| 15 | 15 | ||
| @@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
| 71 | android:layout_width="match_parent" | 71 | android:layout_width="match_parent" |
| 72 | android:layout_height="1dp" | 72 | android:layout_height="1dp" |
| 73 | android:layout_marginTop="3dp" | 73 | android:layout_marginTop="3dp" |
| 74 | - android:background="@color/line" /> | 74 | + android:background="@color/my_dialog_line" /> |
| 75 | 75 | ||
| 76 | <LinearLayout | 76 | <LinearLayout |
| 77 | android:layout_width="match_parent" | 77 | android:layout_width="match_parent" |
| @@ -91,7 +91,7 @@ | @@ -91,7 +91,7 @@ | ||
| 91 | android:layout_width="match_parent" | 91 | android:layout_width="match_parent" |
| 92 | android:layout_height="match_parent" | 92 | android:layout_height="match_parent" |
| 93 | android:layout_gravity="center" | 93 | android:layout_gravity="center" |
| 94 | - android:background="@drawable/selector_xiaojia_dialog_btn_left" | 94 | + android:background="@drawable/selector_my_dialog_btn_left" |
| 95 | android:text="否" | 95 | android:text="否" |
| 96 | android:textColor="@color/black" | 96 | android:textColor="@color/black" |
| 97 | android:textSize="15sp" | 97 | android:textSize="15sp" |
| @@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
| 101 | <View | 101 | <View |
| 102 | android:layout_width="1dp" | 102 | android:layout_width="1dp" |
| 103 | android:layout_height="match_parent" | 103 | android:layout_height="match_parent" |
| 104 | - android:background="@color/line" /> | 104 | + android:background="@color/my_dialog_line" /> |
| 105 | 105 | ||
| 106 | <LinearLayout | 106 | <LinearLayout |
| 107 | android:layout_width="0dp" | 107 | android:layout_width="0dp" |
| @@ -115,10 +115,10 @@ | @@ -115,10 +115,10 @@ | ||
| 115 | android:layout_width="match_parent" | 115 | android:layout_width="match_parent" |
| 116 | android:layout_height="match_parent" | 116 | android:layout_height="match_parent" |
| 117 | android:layout_gravity="center" | 117 | android:layout_gravity="center" |
| 118 | - android:background="@drawable/selector_xiaojia_dialog_btn_right" | 118 | + android:background="@drawable/selector_my_dialog_btn_right" |
| 119 | android:clickable="false" | 119 | android:clickable="false" |
| 120 | android:text="否" | 120 | android:text="否" |
| 121 | - android:textColor="@color/line" | 121 | + android:textColor="@color/my_dialog_line" |
| 122 | android:textSize="15sp" | 122 | android:textSize="15sp" |
| 123 | android:textStyle="bold" /> | 123 | android:textStyle="bold" /> |
| 124 | </LinearLayout> | 124 | </LinearLayout> |
module/xiaojiasoundbox/src/main/res/layout/fragment_change_device_name.xml
| @@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
| 58 | android:layout_height="1dp" | 58 | android:layout_height="1dp" |
| 59 | android:layout_marginLeft="10dp" | 59 | android:layout_marginLeft="10dp" |
| 60 | android:layout_marginRight="10dp" | 60 | android:layout_marginRight="10dp" |
| 61 | - android:background="@color/line" /> | 61 | + android:background="@color/my_dialog_line" /> |
| 62 | 62 | ||
| 63 | <TextView | 63 | <TextView |
| 64 | android:layout_width="wrap_content" | 64 | android:layout_width="wrap_content" |
module/xiaojiasoundbox/src/main/res/layout/fragment_device_detail.xml
| @@ -121,7 +121,7 @@ | @@ -121,7 +121,7 @@ | ||
| 121 | android:layout_height="1dp" | 121 | android:layout_height="1dp" |
| 122 | android:layout_marginLeft="10dp" | 122 | android:layout_marginLeft="10dp" |
| 123 | android:layout_marginRight="10dp" | 123 | android:layout_marginRight="10dp" |
| 124 | - android:background="@color/line" /> | 124 | + android:background="@color/my_dialog_line" /> |
| 125 | </LinearLayout> | 125 | </LinearLayout> |
| 126 | 126 | ||
| 127 | 127 | ||
| @@ -173,7 +173,7 @@ | @@ -173,7 +173,7 @@ | ||
| 173 | android:layout_height="1dp" | 173 | android:layout_height="1dp" |
| 174 | android:layout_marginLeft="10dp" | 174 | android:layout_marginLeft="10dp" |
| 175 | android:layout_marginRight="10dp" | 175 | android:layout_marginRight="10dp" |
| 176 | - android:background="@color/line" /> | 176 | + android:background="@color/my_dialog_line" /> |
| 177 | <!--设备说明--> | 177 | <!--设备说明--> |
| 178 | <RelativeLayout | 178 | <RelativeLayout |
| 179 | android:id="@+id/rl_device_declare" | 179 | android:id="@+id/rl_device_declare" |
module/xiaojiasoundbox/src/main/res/layout/fragment_device_manager.xml
| @@ -308,7 +308,7 @@ | @@ -308,7 +308,7 @@ | ||
| 308 | <View | 308 | <View |
| 309 | android:layout_width="match_parent" | 309 | android:layout_width="match_parent" |
| 310 | android:layout_height="1dp" | 310 | android:layout_height="1dp" |
| 311 | - android:background="@color/line" /> | 311 | + android:background="@color/my_dialog_line" /> |
| 312 | 312 | ||
| 313 | <TextView | 313 | <TextView |
| 314 | android:id="@+id/tv_delete_device" | 314 | android:id="@+id/tv_delete_device" |
module/xiaojiasoundbox/src/main/res/layout/fragment_search_device.xml
| @@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
| 42 | android:layout_height="50dp" | 42 | android:layout_height="50dp" |
| 43 | android:clickable="false" | 43 | android:clickable="false" |
| 44 | android:focusableInTouchMode="false" | 44 | android:focusableInTouchMode="false" |
| 45 | - app:indicatorColor="@color/btn_green" | 45 | + app:indicatorColor="@color/my_dialog_btn_text_color" |
| 46 | app:indicatorName="BallSpinFadeLoaderIndicator" /> | 46 | app:indicatorName="BallSpinFadeLoaderIndicator" /> |
| 47 | </LinearLayout> | 47 | </LinearLayout> |
| 48 | <!-- 未扫描到的视图--> | 48 | <!-- 未扫描到的视图--> |
module/xiaojiasoundbox/src/main/res/layout/fragment_select_wifi.xml
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | android:layout_height="50dp" | 53 | android:layout_height="50dp" |
| 54 | android:clickable="false" | 54 | android:clickable="false" |
| 55 | android:focusableInTouchMode="false" | 55 | android:focusableInTouchMode="false" |
| 56 | - app:indicatorColor="@color/btn_green" | 56 | + app:indicatorColor="@color/my_dialog_btn_text_color" |
| 57 | app:indicatorName="BallSpinFadeLoaderIndicator" /> | 57 | app:indicatorName="BallSpinFadeLoaderIndicator" /> |
| 58 | </LinearLayout> | 58 | </LinearLayout> |
| 59 | </FrameLayout> | 59 | </FrameLayout> |
module/xiaojiasoundbox/src/main/res/layout/item_list_user_host.xml
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | android:paddingLeft="5dp" | 50 | android:paddingLeft="5dp" |
| 51 | android:paddingRight="5dp" | 51 | android:paddingRight="5dp" |
| 52 | android:text="管理员" | 52 | android:text="管理员" |
| 53 | - android:textColor="@color/btn_green" | 53 | + android:textColor="@color/my_dialog_btn_text_color" |
| 54 | android:textSize="11sp" /> | 54 | android:textSize="11sp" /> |
| 55 | </LinearLayout> | 55 | </LinearLayout> |
| 56 | 56 |
module/xiaojiasoundbox/src/main/res/layout/item_list_user_member.xml
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | android:paddingLeft="5dp" | 54 | android:paddingLeft="5dp" |
| 55 | android:paddingRight="5dp" | 55 | android:paddingRight="5dp" |
| 56 | android:text="管理员" | 56 | android:text="管理员" |
| 57 | - android:textColor="@color/btn_green" | 57 | + android:textColor="@color/my_dialog_btn_text_color" |
| 58 | android:textSize="11sp" /> | 58 | android:textSize="11sp" /> |
| 59 | </LinearLayout> | 59 | </LinearLayout> |
| 60 | 60 | ||
| @@ -143,6 +143,6 @@ | @@ -143,6 +143,6 @@ | ||
| 143 | android:id="@+id/view_line" | 143 | android:id="@+id/view_line" |
| 144 | android:layout_width="match_parent" | 144 | android:layout_width="match_parent" |
| 145 | android:layout_height="1dp" | 145 | android:layout_height="1dp" |
| 146 | - android:background="@color/line" /> | 146 | + android:background="@color/my_dialog_line" /> |
| 147 | </LinearLayout> | 147 | </LinearLayout> |
| 148 | </layout> | 148 | </layout> |
| 149 | \ No newline at end of file | 149 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/layout/list_item_wifi1.xml
| @@ -63,6 +63,6 @@ | @@ -63,6 +63,6 @@ | ||
| 63 | <LinearLayout | 63 | <LinearLayout |
| 64 | android:layout_width="match_parent" | 64 | android:layout_width="match_parent" |
| 65 | android:layout_height="1dp" | 65 | android:layout_height="1dp" |
| 66 | - android:background="@color/line" /> | 66 | + android:background="@color/my_dialog_line" /> |
| 67 | </LinearLayout> | 67 | </LinearLayout> |
| 68 | </layout> | 68 | </layout> |
| 69 | \ No newline at end of file | 69 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/layout/pop_item_menu.xml
| @@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
| 40 | android:id="@+id/view_line" | 40 | android:id="@+id/view_line" |
| 41 | android:layout_width="match_parent" | 41 | android:layout_width="match_parent" |
| 42 | android:layout_height="0.1dp" | 42 | android:layout_height="0.1dp" |
| 43 | - android:background="@color/line" /> | 43 | + android:background="@color/my_dialog_line" /> |
| 44 | 44 | ||
| 45 | </LinearLayout> | 45 | </LinearLayout> |
| 46 | </layout> | 46 | </layout> |
| 47 | \ No newline at end of file | 47 | \ No newline at end of file |
module/xiaojiasoundbox/src/main/res/values/styles.xml
| 1 | <resources xmlns:tools="http://schemas.android.com/tools"> | 1 | <resources xmlns:tools="http://schemas.android.com/tools"> |
| 2 | 2 | ||
| 3 | - <!--自定义Dialog背景全透明无边框theme--> | ||
| 4 | - <style name="MyDialog" parent="android:style/Theme.Dialog"> | ||
| 5 | - <item name="android:windowFrame">@null</item> | ||
| 6 | - <item name="android:windowBackground">@android:color/transparent</item> | ||
| 7 | - <item name="android:windowNoTitle">true</item> | ||
| 8 | - <item name="android:windowIsFloating">true</item> | ||
| 9 | - <item name="android:windowContentOverlay">@null</item> | ||
| 10 | - <item name="android:background">@android:color/transparent</item> | ||
| 11 | - </style> | 3 | + |
| 12 | <!-- 自定义checkbox--> | 4 | <!-- 自定义checkbox--> |
| 13 | <style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox"> | 5 | <style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox"> |
| 14 | <item name="android:button">@null</item> | 6 | <item name="android:button">@null</item> |