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 | 95 | release { |
| 96 | 96 | signingConfig signingConfigs.releaseConfig |
| 97 | 97 | zipAlignEnabled true |
| 98 | + debuggable = true | |
| 98 | 99 | resValue("string", "app_name", "网家家") |
| 99 | 100 | buildConfigField("boolean", "VERSION_AS_DEBUG", "false") |
| 100 | 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 | 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 | 12 | import com.cnlive.strike.demo.activity.DemoActivity; |
| 13 | 13 | import com.cnlive.strike.imgutil.ImgActivity; |
| 14 | 14 | import com.cnlive.strike.user.ui.activity.LoginActivity; |
| 15 | +import com.cnlive.strike.xiaojiaspeaker.ui.activity.AllDeviceActivity; | |
| 15 | 16 | |
| 16 | 17 | import androidx.annotation.NonNull; |
| 17 | 18 | import androidx.annotation.Nullable; |
| ... | ... | @@ -24,8 +25,14 @@ public class MainActivity extends AppCompatActivity { |
| 24 | 25 | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| 25 | 26 | super.onCreate(savedInstanceState); |
| 26 | 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 | 38 | @Nullable | ... | ... |
app/strike/src/main/res/layout/activity_my.xml
| ... | ... | @@ -5,10 +5,15 @@ |
| 5 | 5 | android:layout_width="match_parent" |
| 6 | 6 | android:layout_height="match_parent" |
| 7 | 7 | tools:context="com.cnlive.strike.MyActivity"> |
| 8 | + | |
| 8 | 9 | <RelativeLayout |
| 9 | 10 | android:id="@+id/fragment_container" |
| 10 | 11 | android:layout_width="match_parent" |
| 11 | 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 | 18 | </RelativeLayout> |
| 14 | 19 | </RelativeLayout> | ... | ... |
app/strike/src/main/res/mipmap-hdpi/timgs.png
build.gradle
| ... | ... | @@ -97,10 +97,14 @@ allprojects { |
| 97 | 97 | keyPassword "www.cnlive.com" |
| 98 | 98 | } |
| 99 | 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 | 65 | Account account = accounts.length > 0 ? accounts[0] : null; |
| 66 | 66 | String name = account == null ? "" : account.name; |
| 67 | 67 | //页面填充数据 |
| 68 | - if (!TextUtils.isEmpty(name)) { | |
| 69 | 68 | ifViewAttached(view -> view.uploadInputData(name)); |
| 70 | - } | |
| 71 | - if (null != accounts) { | |
| 72 | 69 | ifViewAttached(view -> view.uploadListData(accounts)); |
| 73 | - } | |
| 74 | 70 | } |
| 75 | 71 | |
| 76 | 72 | private void startTimer() { |
| ... | ... | @@ -168,9 +164,9 @@ public class QuickLoginPresenter extends BasePresenter<QuickLoginView> { |
| 168 | 164 | } else { |
| 169 | 165 | //友盟账号登录统计,暂时只有平台登录,后续对接三方登录 |
| 170 | 166 | // MobclickAgent.onProfileSignIn("CNLive", user.getUid()); |
| 171 | -// ifViewAttached(view -> view.showMainView(false, false)); | |
| 167 | + ifViewAttached(view -> view.showMainView(false, false)); | |
| 172 | 168 | //todo 测试首次用户 |
| 173 | - ifViewAttached(view -> view.showEditView(false)); | |
| 169 | +// ifViewAttached(view -> view.showEditView(false)); | |
| 174 | 170 | } |
| 175 | 171 | AppConfig.setCountryCode(""); |
| 176 | 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 | 78 | } |
| 79 | 79 | String contryCode = AppConfig.getCountryCode(); |
| 80 | 80 | //设置区号 |
| 81 | -// CNLiveUserInfo userInfo = UserService.getInstance(fragment.getActivity()).getAppAccount(); | |
| 82 | 81 | if (!TextUtils.isEmpty(contryCode)) { |
| 83 | 82 | fragment.binding.tvCountry.setText("+ " + contryCode); |
| 84 | 83 | } else { |
| ... | ... | @@ -209,6 +208,7 @@ public class QuickLoginView extends BaseView { |
| 209 | 208 | successInfo.setClickAd(fragment.clickAd); |
| 210 | 209 | successInfo.setTagShare(fragment.tagShare); |
| 211 | 210 | successInfo.setTagMsg(fragment.tagMsg); |
| 211 | + | |
| 212 | 212 | if (isNewUser) { |
| 213 | 213 | // HelperUtil.isNewUser(fragment.getActivity(), successInfo, isHasOtherUserInfo); |
| 214 | 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 | 266 | |
| 267 | 267 | @Override |
| 268 | 268 | protected void onDestroy() { |
| 269 | - mDelegate.onDestroy(); | |
| 270 | 269 | super.onDestroy(); |
| 270 | + mDelegate.onDestroy(); | |
| 271 | 271 | if (null != baseBinding) { |
| 272 | 272 | baseBinding.unbind(); |
| 273 | 273 | } |
| ... | ... | @@ -275,6 +275,7 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V |
| 275 | 275 | AppManager.getInstance().deleteActivity(me); |
| 276 | 276 | //清除当前订阅 |
| 277 | 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 | 65 | public void onCreate(Bundle savedInstanceState) { |
| 66 | 66 | super.onCreate(savedInstanceState); |
| 67 | 67 | if (getActivity() == null) return; |
| 68 | + //创建订阅映射 | |
| 69 | + SubscriptionManager.getInstance().setCurrentDisposables(TAG); | |
| 68 | 70 | me = (BaseActivity) getActivity(); |
| 69 | 71 | mDelegate.onCreate(savedInstanceState); |
| 70 | 72 | mSwipeDelegate.onCreate(savedInstanceState); |
| ... | ... | @@ -98,8 +100,6 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V |
| 98 | 100 | @Override |
| 99 | 101 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 100 | 102 | super.onViewCreated(view, savedInstanceState); |
| 101 | - //创建订阅映射 | |
| 102 | - SubscriptionManager.getInstance().setCurrentDisposables(TAG); | |
| 103 | 103 | mSwipeDelegate.onViewCreated(view, savedInstanceState); |
| 104 | 104 | if (null != getMvpView() && null != getPresenter()) { |
| 105 | 105 | initBindingData(); |
| ... | ... | @@ -199,14 +199,14 @@ public abstract class BaseFragment<V extends BaseView, P extends BasePresenter<V |
| 199 | 199 | |
| 200 | 200 | @Override |
| 201 | 201 | public void onDestroy() { |
| 202 | - mDelegate.onDestroy(); | |
| 203 | - mSwipeDelegate.onDestroyView(); | |
| 204 | - //清除当前订阅 | |
| 205 | - SubscriptionManager.getInstance().cancel(TAG); | |
| 206 | 202 | super.onDestroy(); |
| 207 | 203 | if (null != baseBinding) { |
| 208 | 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 | 333 | public void onDestroyView() { |
| 334 | 334 | mDelegate.onDestroyView(); |
| 335 | 335 | super.onDestroyView(); |
| 336 | + //清除当前订阅 | |
| 337 | + SubscriptionManager.getInstance().cancel(TAG); | |
| 336 | 338 | } |
| 337 | 339 | |
| 338 | 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 | public static SubscriptionManager instance; |
| 19 | 19 | public HashMap<String, CompositeDisposable> hashDisposable;//所有订阅关系 |
| 20 | 20 | public HashMap<Integer, String> hashTag;//当前activity |
| 21 | + public HashMap<String, Integer> hashTagIndex;//当前activity | |
| 21 | 22 | private String currentClassName; |
| 22 | 23 | |
| 23 | 24 | /** |
| 24 | 25 | * 构造函数 new CompositeDisposable对象 |
| 25 | 26 | */ |
| 26 | - public SubscriptionManager() { | |
| 27 | + public SubscriptionManager() { | |
| 27 | 28 | if (null == hashDisposable) { |
| 28 | 29 | hashDisposable = new HashMap<>(); |
| 29 | 30 | } |
| 30 | 31 | if (null == hashTag) { |
| 31 | 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 | 52 | return instance; |
| 49 | 53 | } |
| 50 | 54 | |
| 51 | - public void setCurrentDisposables(String TAG) { | |
| 55 | + public synchronized void setCurrentDisposables(String TAG) { | |
| 52 | 56 | if (null == hashDisposable.get(TAG)) { |
| 53 | 57 | currentClassName = TAG; |
| 54 | 58 | hashDisposable.put(TAG, new CompositeDisposable()); |
| 55 | 59 | //存放当前class映射 |
| 56 | 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 | 98 | * |
| 78 | 99 | * @param disposable 订阅事件 |
| 79 | 100 | */ |
| 80 | - public void add(Disposable disposable) { | |
| 101 | + public synchronized void add(Disposable disposable) { | |
| 81 | 102 | if (disposable == null) return; |
| 82 | 103 | //每次去除最新的activity进行存放 |
| 83 | 104 | if (null != hashDisposable && hashDisposable.size() > 0) { |
| ... | ... | @@ -85,7 +106,7 @@ public class SubscriptionManager { |
| 85 | 106 | if (null != hashDisposable.get(currentClassName)) { |
| 86 | 107 | //存放当前activity对应的订阅 |
| 87 | 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 | 126 | /** |
| 106 | 127 | * 清除容器所有 |
| 107 | 128 | */ |
| 108 | - public void cancelAll() { | |
| 129 | + public synchronized void cancelAll() { | |
| 109 | 130 | //解除所有订阅 |
| 110 | 131 | if (null != hashDisposable && hashDisposable.size() > 0) { |
| 111 | 132 | if (null != hashTag && hashTag.size() > 0) { |
| ... | ... | @@ -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 | 3 | import android.app.Dialog; |
| 4 | 4 | import android.content.Context; |
| ... | ... | @@ -15,7 +15,7 @@ import android.widget.TextView; |
| 15 | 15 | import androidx.annotation.NonNull; |
| 16 | 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 | 38 | public SelectDialog(@NonNull Context context, String tipText, String btnCancelText, DialogInterface cancelInterface, String btnOkText, DialogInterface okInterface) { |
| 39 | 39 | super(context, R.style.MyDialog); |
| 40 | 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 | 42 | initView(view); |
| 43 | 43 | layoutParams = new LinearLayout.LayoutParams((int) (getScreenWidth(context) * 0.8), ViewGroup.LayoutParams.WRAP_CONTENT); |
| 44 | 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 | 3 | import android.app.Dialog; |
| 4 | 4 | import android.content.Context; |
| ... | ... | @@ -14,7 +14,7 @@ import android.widget.TextView; |
| 14 | 14 | |
| 15 | 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 | 68 | inputDialog.build(inputDialog, R.layout.dialog_select_ios); |
| 69 | 69 | break; |
| 70 | 70 | case STYLE_KONGZUE: |
| 71 | - inputDialog.build(inputDialog, R.layout.dialog_select); | |
| 71 | + inputDialog.build(inputDialog, R.layout.my_dialog_select); | |
| 72 | 72 | break; |
| 73 | 73 | case STYLE_MATERIAL: |
| 74 | 74 | inputDialog.build(inputDialog); |
| ... | ... | @@ -686,7 +686,7 @@ public class InputDialog extends MessageDialog { |
| 686 | 686 | build(this, R.layout.dialog_select_ios); |
| 687 | 687 | break; |
| 688 | 688 | case STYLE_KONGZUE: |
| 689 | - build(this, R.layout.dialog_select); | |
| 689 | + build(this, R.layout.my_dialog_select); | |
| 690 | 690 | break; |
| 691 | 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 | 97 | messageDialog.build(messageDialog, R.layout.dialog_select_ios); |
| 98 | 98 | break; |
| 99 | 99 | case STYLE_KONGZUE: |
| 100 | - messageDialog.build(messageDialog, R.layout.dialog_select); | |
| 100 | + messageDialog.build(messageDialog, R.layout.my_dialog_select); | |
| 101 | 101 | break; |
| 102 | 102 | case STYLE_MATERIAL: |
| 103 | 103 | messageDialog.build(messageDialog); |
| ... | ... | @@ -880,7 +880,7 @@ public class MessageDialog extends BaseDialog { |
| 880 | 880 | build(this, R.layout.dialog_select_ios); |
| 881 | 881 | break; |
| 882 | 882 | case STYLE_KONGZUE: |
| 883 | - build(this, R.layout.dialog_select); | |
| 883 | + build(this, R.layout.my_dialog_select); | |
| 884 | 884 | break; |
| 885 | 885 | case STYLE_MATERIAL: |
| 886 | 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
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 | 9 | android:id="@+id/ll_child" |
| 10 | 10 | android:layout_width="match_parent" |
| 11 | 11 | android:layout_height="wrap_content" |
| 12 | - android:background="@drawable/free_xiaojia_dialog_bg" | |
| 12 | + android:background="@drawable/my_dialog_bg" | |
| 13 | 13 | android:orientation="vertical" |
| 14 | 14 | android:paddingTop="10dp"> |
| 15 | 15 | |
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | android:layout_width="match_parent" |
| 33 | 33 | android:layout_height="1dp" |
| 34 | 34 | android:layout_marginTop="3dp" |
| 35 | - android:background="@color/line" /> | |
| 35 | + android:background="@color/my_dialog_line" /> | |
| 36 | 36 | |
| 37 | 37 | <LinearLayout |
| 38 | 38 | android:layout_width="match_parent" |
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | android:layout_gravity="center" |
| 55 | 55 | android:background="@drawable/selector_xiaojia_tip_dialog_btn_bottom" |
| 56 | 56 | android:text="好的" |
| 57 | - android:textColor="@color/btn_green" | |
| 57 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 58 | 58 | android:textSize="15sp" /> |
| 59 | 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 | 9 | android:id="@+id/ll_child" |
| 10 | 10 | android:layout_width="match_parent" |
| 11 | 11 | android:layout_height="wrap_content" |
| 12 | - android:background="@drawable/free_xiaojia_dialog_bg" | |
| 12 | + android:background="@drawable/my_dialog_bg" | |
| 13 | 13 | android:orientation="vertical" |
| 14 | 14 | android:paddingTop="10dp"> |
| 15 | 15 | |
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | android:layout_width="match_parent" |
| 33 | 33 | android:layout_height="1dp" |
| 34 | 34 | android:layout_marginTop="3dp" |
| 35 | - android:background="@color/line" /> | |
| 35 | + android:background="@color/my_dialog_line" /> | |
| 36 | 36 | |
| 37 | 37 | <LinearLayout |
| 38 | 38 | android:layout_width="match_parent" |
| ... | ... | @@ -52,9 +52,9 @@ |
| 52 | 52 | android:layout_width="match_parent" |
| 53 | 53 | android:layout_height="match_parent" |
| 54 | 54 | android:layout_gravity="center" |
| 55 | - android:background="@drawable/selector_xiaojia_dialog_btn_left" | |
| 55 | + android:background="@drawable/selector_my_dialog_btn_left" | |
| 56 | 56 | android:text="否" |
| 57 | - android:textColor="@color/btn_green" | |
| 57 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 58 | 58 | android:textSize="15sp" |
| 59 | 59 | android:textStyle="bold" /> |
| 60 | 60 | </LinearLayout> |
| ... | ... | @@ -62,7 +62,7 @@ |
| 62 | 62 | <View |
| 63 | 63 | android:layout_width="1dp" |
| 64 | 64 | android:layout_height="match_parent" |
| 65 | - android:background="@color/line" /> | |
| 65 | + android:background="@color/my_dialog_line" /> | |
| 66 | 66 | |
| 67 | 67 | <LinearLayout |
| 68 | 68 | android:layout_width="0dp" |
| ... | ... | @@ -76,9 +76,9 @@ |
| 76 | 76 | android:layout_width="match_parent" |
| 77 | 77 | android:layout_height="match_parent" |
| 78 | 78 | android:layout_gravity="center" |
| 79 | - android:background="@drawable/selector_xiaojia_dialog_btn_right" | |
| 79 | + android:background="@drawable/selector_my_dialog_btn_right" | |
| 80 | 80 | android:text="否" |
| 81 | - android:textColor="@color/btn_green" | |
| 81 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 82 | 82 | android:textSize="15sp" |
| 83 | 83 | android:textStyle="bold" /> |
| 84 | 84 | </LinearLayout> | ... | ... |
core/base/src/main/res/values/colors.xml
| ... | ... | @@ -60,4 +60,7 @@ |
| 60 | 60 | <color name="tipTextColor">#8f8f8f</color> |
| 61 | 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 | 66 | </resources> |
| 64 | 67 | \ No newline at end of file | ... | ... |
core/base/src/main/res/values/style.xml
| ... | ... | @@ -155,5 +155,16 @@ |
| 155 | 155 | <item name="android:windowEnterAnimation">@anim/top_menu_enter</item> |
| 156 | 156 | <item name="android:windowExitAnimation">@anim/top_menu_exit</item> |
| 157 | 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 | 170 | </resources> |
| 160 | 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 | 40 | private String initBaseUrl(Class clazz) { |
| 41 | 41 | if (AppConfig.isDebug()) { |
| 42 | 42 | baseUrl = BASE_DEBUG_URL;//还原初始地址 |
| 43 | - if (clazz == ApiBaseServiceOpen.class) { | |
| 44 | - return OPEN_URL; | |
| 45 | - } | |
| 46 | 43 | } else { |
| 47 | 44 | baseUrl = BASE_URL; |
| 48 | 45 | } |
| 46 | + if (clazz == ApiBaseServiceOpen.class) { | |
| 47 | + return OPEN_URL; | |
| 48 | + } | |
| 49 | 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 | 17 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; |
| 18 | 18 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.WifiRecycleAdapter; |
| 19 | 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 | 21 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.WifiPwdDialog; |
| 22 | 22 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 23 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | |
| 24 | 23 | |
| 25 | 24 | import java.util.ArrayList; |
| 26 | 25 | import java.util.List; |
| ... | ... | @@ -87,7 +86,7 @@ public class ChangeWifiFragmentView extends BaseView { |
| 87 | 86 | } |
| 88 | 87 | |
| 89 | 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 | 90 | @Override |
| 92 | 91 | public void onClick(TipDialog dialog) { |
| 93 | 92 | dialog.dismiss(); |
| ... | ... | @@ -142,7 +141,7 @@ public class ChangeWifiFragmentView extends BaseView { |
| 142 | 141 | } |
| 143 | 142 | }); |
| 144 | 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 | 145 | wifiPwdDialog.setCancelable(false); |
| 147 | 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 | 25 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.DeviceInfoActivity; |
| 26 | 26 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.FirmwareUpdateActivity; |
| 27 | 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 | 29 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; |
| 30 | 30 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; |
| 31 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | |
| 32 | 31 | |
| 33 | 32 | public class DeviceManagerFragmentView extends BaseView { |
| 34 | 33 | private DeviceManagerFragment fragment; |
| ... | ... | @@ -143,7 +142,7 @@ public class DeviceManagerFragmentView extends BaseView { |
| 143 | 142 | selectDialog.setCancelable(false); |
| 144 | 143 | selectDialog.setCanceledOnTouchOutside(false); |
| 145 | 144 | selectDialog.setTipTextStyle(Typeface.DEFAULT); |
| 146 | - selectDialog.setRightBtnColor(R.color.btn_green); | |
| 145 | + selectDialog.setRightBtnColor(R.color.my_dialog_btn_text_color); | |
| 147 | 146 | if (!selectDialog.isShowing()) { |
| 148 | 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 | 19 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.SelectWifiActivity; |
| 20 | 20 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.BluetoothDeviceAdapter; |
| 21 | 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 | 23 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 24 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | |
| 25 | 24 | |
| 26 | 25 | import java.util.ArrayList; |
| 27 | 26 | import java.util.List; |
| ... | ... | @@ -112,7 +111,7 @@ public class SearchDevicefragmentView extends BaseView { |
| 112 | 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 | 115 | wifiDialog.setCancelable(false); |
| 117 | 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 | 30 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.ConnFailActivity; |
| 31 | 31 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.WifiRecycleAdapter; |
| 32 | 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 | 34 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.WifiPwdDialog; |
| 35 | 35 | import com.cnlive.strike.xiaojiaspeaker.util.BlueToothUtil; |
| 36 | 36 | import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil; |
| 37 | 37 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 38 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | |
| 39 | 38 | |
| 40 | 39 | import org.greenrobot.eventbus.EventBus; |
| 41 | 40 | |
| ... | ... | @@ -120,7 +119,7 @@ public class SelectWifiFragmentView extends BaseView { |
| 120 | 119 | } |
| 121 | 120 | |
| 122 | 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 | 123 | @Override |
| 125 | 124 | public void onClick(TipDialog dialog) { |
| 126 | 125 | dialog.dismiss(); |
| ... | ... | @@ -161,7 +160,7 @@ public class SelectWifiFragmentView extends BaseView { |
| 161 | 160 | } |
| 162 | 161 | }); |
| 163 | 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 | 164 | wifiPwdDialog.setCancelable(false); |
| 166 | 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 | 23 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.UserManagerAdapter; |
| 24 | 24 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.UserManagerFragment; |
| 25 | 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 | 27 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenu; |
| 28 | 28 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenuInfo; |
| 29 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | |
| 30 | 29 | |
| 31 | 30 | import java.util.ArrayList; |
| 32 | 31 | import java.util.List; |
| ... | ... | @@ -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 | 166 | deleteDialog.setTipTextStyle(Typeface.DEFAULT); |
| 168 | 167 | if (!deleteDialog.isShowing()) { |
| 169 | 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 | 7 | import android.content.Context; |
| 8 | 8 | import android.content.Intent; |
| 9 | 9 | import android.content.IntentFilter; |
| 10 | -import android.content.pm.PackageManager; | |
| 11 | 10 | import android.net.Uri; |
| 12 | -import android.os.Bundle; | |
| 13 | 11 | import android.provider.Settings; |
| 14 | 12 | import android.util.Log; |
| 15 | 13 | import android.view.View; |
| 16 | - | |
| 17 | -import androidx.databinding.DataBindingUtil; | |
| 18 | - | |
| 19 | 14 | import com.clj.fastble.BleManager; |
| 20 | 15 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 21 | 16 | import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; |
| ... | ... | @@ -24,10 +19,8 @@ import com.cnlive.core.libs.base.util.StatusBarConfig; |
| 24 | 19 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 25 | 20 | import com.cnlive.strike.xiaojiaspeaker.databinding.ActivityBlueToothStep2Binding; |
| 26 | 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 | 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 | 25 | import org.greenrobot.eventbus.Subscribe; |
| 33 | 26 | import org.greenrobot.eventbus.ThreadMode; |
| ... | ... | @@ -35,7 +28,6 @@ import org.greenrobot.eventbus.ThreadMode; |
| 35 | 28 | public class BlueToothStep2Activity extends BaseActivity { |
| 36 | 29 | private ActivityBlueToothStep2Binding binding; |
| 37 | 30 | private int permissionRequestCount = 0;//权限请求次数 |
| 38 | - private boolean isClickNextBtn = false; | |
| 39 | 31 | private SelectDialog selectDialog; |
| 40 | 32 | |
| 41 | 33 | @Override |
| ... | ... | @@ -119,7 +111,7 @@ public class BlueToothStep2Activity extends BaseActivity { |
| 119 | 111 | * 一次申请一组权限(使用拒绝弹框)点击事件 |
| 120 | 112 | */ |
| 121 | 113 | public void getPermissionsWithTip() { |
| 122 | - String[] permissions = new String[]{ Manifest.permission.INTERNET | |
| 114 | + String[] permissions = new String[]{Manifest.permission.INTERNET | |
| 123 | 115 | , Manifest.permission.ACCESS_FINE_LOCATION |
| 124 | 116 | , Manifest.permission.ACCESS_COARSE_LOCATION}; |
| 125 | 117 | requestPermission(permissions, "您尚未授予程序运行所需权限\n是否设置?", new OnPermissionResponseListener() { |
| ... | ... | @@ -178,10 +170,8 @@ public class BlueToothStep2Activity extends BaseActivity { |
| 178 | 170 | switch (blueState) { |
| 179 | 171 | case BluetoothAdapter.STATE_TURNING_ON: |
| 180 | 172 | Log.e(TAG, "监听到蓝牙已开启"); |
| 181 | - if (isClickNextBtn) { | |
| 182 | - SearchDeviceActivity.startActivity(BlueToothStep2Activity.this); | |
| 183 | - finish(); | |
| 184 | - } | |
| 173 | + SearchDeviceActivity.startActivity(BlueToothStep2Activity.this); | |
| 174 | + finish(); | |
| 185 | 175 | break; |
| 186 | 176 | case BluetoothAdapter.STATE_ON: |
| 187 | 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 | 3 | import android.Manifest; |
| 4 | 4 | import android.app.Activity; |
| 5 | 5 | import android.content.Intent; |
| 6 | -import android.content.pm.PackageManager; | |
| 7 | 6 | import android.net.Uri; |
| 8 | 7 | import android.os.Bundle; |
| 9 | 8 | import android.os.Handler; |
| ... | ... | @@ -11,16 +10,13 @@ import android.provider.Settings; |
| 11 | 10 | import android.text.TextUtils; |
| 12 | 11 | import android.util.Log; |
| 13 | 12 | |
| 14 | -import androidx.annotation.NonNull; | |
| 15 | - | |
| 16 | 13 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 17 | 14 | import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; |
| 18 | 15 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 19 | 16 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; |
| 20 | 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 | 19 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 23 | -import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; | |
| 24 | 20 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsUtils; |
| 25 | 21 | |
| 26 | 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 | 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 | 46 | @Override |
| 42 | 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 | 3 | import android.Manifest; |
| 4 | 4 | import android.app.Activity; |
| 5 | 5 | import android.content.Intent; |
| 6 | -import android.content.pm.PackageManager; | |
| 7 | 6 | import android.net.Uri; |
| 8 | -import android.os.Bundle; | |
| 9 | 7 | import android.os.Handler; |
| 10 | 8 | import android.provider.Settings; |
| 11 | 9 | import android.util.Log; |
| ... | ... | @@ -14,7 +12,7 @@ import com.clj.fastble.data.BleDevice; |
| 14 | 12 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 15 | 13 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 16 | 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 | 16 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 19 | 17 | import com.cnlive.strike.xiaojiaspeaker.util.lib_permisshelper.PermissionsListener; |
| 20 | 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 | 87 | binding.topbar.addLeftImageButton(R.drawable.icon_xiaojia_back, R.id.left_back).setOnClickListener(new View.OnClickListener() { |
| 88 | 88 | @Override |
| 89 | 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 | 50 | @Override |
| 51 | 51 | protected void initFragmentStyle() { |
| 52 | 52 | super.initFragmentStyle(); |
| 53 | - setStatusBarTextColor(StatusBarConfig.WHITE); | |
| 53 | + setStatusBarTextColor(StatusBarConfig.BLACK); | |
| 54 | 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 | 88 | //显示视图 |
| 89 | 89 | this.setContentView(view); |
| 90 | 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 | 92 | this.et_pwd.addTextChangedListener(new TextWatcher() { |
| 93 | 93 | @Override |
| 94 | 94 | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
| ... | ... | @@ -99,12 +99,12 @@ public class WifiPwdDialog extends Dialog { |
| 99 | 99 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
| 100 | 100 | if (charSequence.length() < 8) { |
| 101 | 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 | 104 | } else { |
| 105 | 105 | btn_ok.setClickable(true); |
| 106 | 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 | 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 | 3 | <item android:drawable="@color/transparent"/> |
| 4 | 4 | </ripple> |
| 5 | 5 | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable-v21/selectable_xiaojia_item_white.xml
| 1 | 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 | 3 | <item android:drawable="@color/white"/> |
| 4 | 4 | </ripple> |
| 5 | 5 | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/miui_xiaojia_back_drawable.xml
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | </item> |
| 10 | 10 | <item android:state_checked="true"> |
| 11 | 11 | <shape> |
| 12 | - <solid android:color="@color/btn_green" /> | |
| 12 | + <solid android:color="@color/my_dialog_btn_text_color" /> | |
| 13 | 13 | <corners android:radius="99dp" /> |
| 14 | 14 | <stroke android:width="1px" android:color="#DEDEDE" /> |
| 15 | 15 | </shape> | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/ripple_xiaojia_bg.xml
| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> |
| 4 | 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 | 7 | <item android:drawable="@color/white"/> |
| 8 | 8 | </selector> |
| 9 | 9 | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/selectable_xiaojia_background.xml
| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> |
| 4 | 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 | 7 | <item android:drawable="@color/white"/> |
| 8 | 8 | </selector> |
| 9 | 9 | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/selectable_xiaojia_item_white.xml
| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/> |
| 4 | 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 | 7 | <item android:drawable="@color/white"/> |
| 8 | 8 | </selector> |
| 9 | 9 | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_btn_green.xml
| ... | ... | @@ -2,10 +2,10 @@ |
| 2 | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 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 | 8 | <gradient |
| 9 | - android:endColor="@color/btn_green" | |
| 9 | + android:endColor="@color/my_dialog_btn_text_color" | |
| 10 | 10 | android:startColor="#49EE1D" /> |
| 11 | 11 | </shape> |
| 12 | 12 | \ No newline at end of file | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_dialog_btn_left_press.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <corners android:bottomLeftRadius="20dp" /> |
| 4 | - <solid android:color="@color/line" /> | |
| 4 | + <solid android:color="@color/my_dialog_line" /> | |
| 5 | 5 | </shape> |
| 6 | 6 | \ No newline at end of file | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_dialog_btn_right_press.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <corners android:bottomRightRadius="20dp" /> |
| 4 | - <solid android:color="@color/line" /> | |
| 4 | + <solid android:color="@color/my_dialog_line" /> | |
| 5 | 5 | </shape> |
| 6 | 6 | \ No newline at end of file | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_et_wifi_bg.xml
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <stroke |
| 4 | 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 | 7 | <corners android:radius="10dp" /> |
| 8 | 8 | </shape> |
| 9 | 9 | \ No newline at end of file | ... | ... |
module/xiaojiasoundbox/src/main/res/drawable/shape_xiaojia_green_stroke.xml
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <stroke |
| 4 | 4 | android:width="1dp" |
| 5 | - android:color="@color/btn_green" /> | |
| 5 | + android:color="@color/my_dialog_btn_text_color" /> | |
| 6 | 6 | <solid android:color="@color/white" /> |
| 7 | 7 | <corners android:radius="20dp" /> |
| 8 | 8 | </shape> |
| 9 | 9 | \ No newline at end of file | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/activity_conn_bluetooth_success.xml
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | android:layout_height="wrap_content" |
| 38 | 38 | android:layout_marginTop="20dp" |
| 39 | 39 | android:text="@string/conn_success" |
| 40 | - android:textColor="@color/btn_green" | |
| 40 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 41 | 41 | android:textSize="20sp" |
| 42 | 42 | android:textStyle="bold" /> |
| 43 | 43 | </LinearLayout> |
| ... | ... | @@ -70,7 +70,7 @@ |
| 70 | 70 | android:layout_marginTop="30dp" |
| 71 | 71 | android:background="@drawable/shape_xiaojia_green_stroke" |
| 72 | 72 | android:text="完成" |
| 73 | - android:textColor="@color/btn_green" | |
| 73 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 74 | 74 | android:textSize="18sp" /> |
| 75 | 75 | |
| 76 | 76 | <TextView |
| ... | ... | @@ -81,7 +81,7 @@ |
| 81 | 81 | android:layout_marginTop="30sp" |
| 82 | 82 | android:gravity="center" |
| 83 | 83 | android:text="给音箱取个名字吧 >>" |
| 84 | - android:textColor="@color/btn_green" | |
| 84 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 85 | 85 | android:textSize="13sp" /> |
| 86 | 86 | |
| 87 | 87 | </LinearLayout> |
| ... | ... | @@ -98,7 +98,7 @@ |
| 98 | 98 | android:layout_height="1dp" |
| 99 | 99 | android:layout_marginLeft="10dp" |
| 100 | 100 | android:layout_marginRight="10dp" |
| 101 | - android:background="@color/line" /> | |
| 101 | + android:background="@color/my_dialog_line" /> | |
| 102 | 102 | |
| 103 | 103 | <TextView |
| 104 | 104 | android:layout_width="wrap_content" |
| ... | ... | @@ -116,7 +116,7 @@ |
| 116 | 116 | android:layout_gravity="center_horizontal" |
| 117 | 117 | android:layout_marginTop="15dp" |
| 118 | 118 | android:text="@string/go_to_liaten_china" |
| 119 | - android:textColor="@color/btn_green" | |
| 119 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 120 | 120 | android:textSize="13sp" /> |
| 121 | 121 | </LinearLayout> |
| 122 | 122 | </LinearLayout> | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/dialog_edit_role.xml
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | android:id="@+id/ll_child" |
| 10 | 10 | android:layout_width="match_parent" |
| 11 | 11 | android:layout_height="wrap_content" |
| 12 | - android:background="@drawable/free_xiaojia_dialog_bg" | |
| 12 | + android:background="@drawable/my_dialog_bg" | |
| 13 | 13 | android:orientation="vertical" |
| 14 | 14 | android:paddingTop="10dp"> |
| 15 | 15 | |
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | android:layout_marginLeft="10dp" |
| 32 | 32 | android:layout_marginTop="15dp" |
| 33 | 33 | android:layout_marginRight="10dp" |
| 34 | - android:background="@color/line" /> | |
| 34 | + android:background="@color/my_dialog_line" /> | |
| 35 | 35 | |
| 36 | 36 | <LinearLayout |
| 37 | 37 | android:layout_width="match_parent" |
| ... | ... | @@ -66,7 +66,7 @@ |
| 66 | 66 | android:layout_height="1dp" |
| 67 | 67 | android:layout_marginLeft="10dp" |
| 68 | 68 | android:layout_marginRight="10dp" |
| 69 | - android:background="@color/line" /> | |
| 69 | + android:background="@color/my_dialog_line" /> | |
| 70 | 70 | |
| 71 | 71 | <LinearLayout |
| 72 | 72 | android:layout_width="match_parent" |
| ... | ... | @@ -86,7 +86,7 @@ |
| 86 | 86 | android:layout_width="match_parent" |
| 87 | 87 | android:layout_height="match_parent" |
| 88 | 88 | android:layout_gravity="center" |
| 89 | - android:background="@drawable/selector_xiaojia_dialog_btn_left" | |
| 89 | + android:background="@drawable/selector_my_dialog_btn_left" | |
| 90 | 90 | android:text="取消" |
| 91 | 91 | android:textColor="@color/color_282828" |
| 92 | 92 | android:textSize="17sp" /> |
| ... | ... | @@ -95,7 +95,7 @@ |
| 95 | 95 | <View |
| 96 | 96 | android:layout_width="1dp" |
| 97 | 97 | android:layout_height="match_parent" |
| 98 | - android:background="@color/line" /> | |
| 98 | + android:background="@color/my_dialog_line" /> | |
| 99 | 99 | |
| 100 | 100 | <LinearLayout |
| 101 | 101 | android:layout_width="0dp" |
| ... | ... | @@ -109,9 +109,9 @@ |
| 109 | 109 | android:layout_width="match_parent" |
| 110 | 110 | android:layout_height="match_parent" |
| 111 | 111 | android:layout_gravity="center" |
| 112 | - android:background="@drawable/selector_xiaojia_dialog_btn_right" | |
| 112 | + android:background="@drawable/selector_my_dialog_btn_right" | |
| 113 | 113 | android:text="保存" |
| 114 | - android:textColor="@color/btn_green" | |
| 114 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 115 | 115 | android:textSize="17sp" /> |
| 116 | 116 | </LinearLayout> |
| 117 | 117 | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/dialog_wifi_pwd.xml
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | android:id="@+id/ll_child" |
| 10 | 10 | android:layout_width="match_parent" |
| 11 | 11 | android:layout_height="wrap_content" |
| 12 | - android:background="@drawable/free_xiaojia_dialog_bg" | |
| 12 | + android:background="@drawable/my_dialog_bg" | |
| 13 | 13 | android:orientation="vertical" |
| 14 | 14 | android:paddingTop="10dp"> |
| 15 | 15 | |
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | android:layout_width="match_parent" |
| 72 | 72 | android:layout_height="1dp" |
| 73 | 73 | android:layout_marginTop="3dp" |
| 74 | - android:background="@color/line" /> | |
| 74 | + android:background="@color/my_dialog_line" /> | |
| 75 | 75 | |
| 76 | 76 | <LinearLayout |
| 77 | 77 | android:layout_width="match_parent" |
| ... | ... | @@ -91,7 +91,7 @@ |
| 91 | 91 | android:layout_width="match_parent" |
| 92 | 92 | android:layout_height="match_parent" |
| 93 | 93 | android:layout_gravity="center" |
| 94 | - android:background="@drawable/selector_xiaojia_dialog_btn_left" | |
| 94 | + android:background="@drawable/selector_my_dialog_btn_left" | |
| 95 | 95 | android:text="否" |
| 96 | 96 | android:textColor="@color/black" |
| 97 | 97 | android:textSize="15sp" |
| ... | ... | @@ -101,7 +101,7 @@ |
| 101 | 101 | <View |
| 102 | 102 | android:layout_width="1dp" |
| 103 | 103 | android:layout_height="match_parent" |
| 104 | - android:background="@color/line" /> | |
| 104 | + android:background="@color/my_dialog_line" /> | |
| 105 | 105 | |
| 106 | 106 | <LinearLayout |
| 107 | 107 | android:layout_width="0dp" |
| ... | ... | @@ -115,10 +115,10 @@ |
| 115 | 115 | android:layout_width="match_parent" |
| 116 | 116 | android:layout_height="match_parent" |
| 117 | 117 | android:layout_gravity="center" |
| 118 | - android:background="@drawable/selector_xiaojia_dialog_btn_right" | |
| 118 | + android:background="@drawable/selector_my_dialog_btn_right" | |
| 119 | 119 | android:clickable="false" |
| 120 | 120 | android:text="否" |
| 121 | - android:textColor="@color/line" | |
| 121 | + android:textColor="@color/my_dialog_line" | |
| 122 | 122 | android:textSize="15sp" |
| 123 | 123 | android:textStyle="bold" /> |
| 124 | 124 | </LinearLayout> | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/fragment_change_device_name.xml
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | android:layout_height="1dp" |
| 59 | 59 | android:layout_marginLeft="10dp" |
| 60 | 60 | android:layout_marginRight="10dp" |
| 61 | - android:background="@color/line" /> | |
| 61 | + android:background="@color/my_dialog_line" /> | |
| 62 | 62 | |
| 63 | 63 | <TextView |
| 64 | 64 | android:layout_width="wrap_content" | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/fragment_device_detail.xml
| ... | ... | @@ -121,7 +121,7 @@ |
| 121 | 121 | android:layout_height="1dp" |
| 122 | 122 | android:layout_marginLeft="10dp" |
| 123 | 123 | android:layout_marginRight="10dp" |
| 124 | - android:background="@color/line" /> | |
| 124 | + android:background="@color/my_dialog_line" /> | |
| 125 | 125 | </LinearLayout> |
| 126 | 126 | |
| 127 | 127 | |
| ... | ... | @@ -173,7 +173,7 @@ |
| 173 | 173 | android:layout_height="1dp" |
| 174 | 174 | android:layout_marginLeft="10dp" |
| 175 | 175 | android:layout_marginRight="10dp" |
| 176 | - android:background="@color/line" /> | |
| 176 | + android:background="@color/my_dialog_line" /> | |
| 177 | 177 | <!--设备说明--> |
| 178 | 178 | <RelativeLayout |
| 179 | 179 | android:id="@+id/rl_device_declare" | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/fragment_device_manager.xml
module/xiaojiasoundbox/src/main/res/layout/fragment_search_device.xml
| ... | ... | @@ -42,7 +42,7 @@ |
| 42 | 42 | android:layout_height="50dp" |
| 43 | 43 | android:clickable="false" |
| 44 | 44 | android:focusableInTouchMode="false" |
| 45 | - app:indicatorColor="@color/btn_green" | |
| 45 | + app:indicatorColor="@color/my_dialog_btn_text_color" | |
| 46 | 46 | app:indicatorName="BallSpinFadeLoaderIndicator" /> |
| 47 | 47 | </LinearLayout> |
| 48 | 48 | <!-- 未扫描到的视图--> | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/fragment_select_wifi.xml
| ... | ... | @@ -53,7 +53,7 @@ |
| 53 | 53 | android:layout_height="50dp" |
| 54 | 54 | android:clickable="false" |
| 55 | 55 | android:focusableInTouchMode="false" |
| 56 | - app:indicatorColor="@color/btn_green" | |
| 56 | + app:indicatorColor="@color/my_dialog_btn_text_color" | |
| 57 | 57 | app:indicatorName="BallSpinFadeLoaderIndicator" /> |
| 58 | 58 | </LinearLayout> |
| 59 | 59 | </FrameLayout> | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/item_list_user_host.xml
module/xiaojiasoundbox/src/main/res/layout/item_list_user_member.xml
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | android:paddingLeft="5dp" |
| 55 | 55 | android:paddingRight="5dp" |
| 56 | 56 | android:text="管理员" |
| 57 | - android:textColor="@color/btn_green" | |
| 57 | + android:textColor="@color/my_dialog_btn_text_color" | |
| 58 | 58 | android:textSize="11sp" /> |
| 59 | 59 | </LinearLayout> |
| 60 | 60 | |
| ... | ... | @@ -143,6 +143,6 @@ |
| 143 | 143 | android:id="@+id/view_line" |
| 144 | 144 | android:layout_width="match_parent" |
| 145 | 145 | android:layout_height="1dp" |
| 146 | - android:background="@color/line" /> | |
| 146 | + android:background="@color/my_dialog_line" /> | |
| 147 | 147 | </LinearLayout> |
| 148 | 148 | </layout> |
| 149 | 149 | \ No newline at end of file | ... | ... |
module/xiaojiasoundbox/src/main/res/layout/list_item_wifi1.xml
module/xiaojiasoundbox/src/main/res/layout/pop_item_menu.xml
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | android:id="@+id/view_line" |
| 41 | 41 | android:layout_width="match_parent" |
| 42 | 42 | android:layout_height="0.1dp" |
| 43 | - android:background="@color/line" /> | |
| 43 | + android:background="@color/my_dialog_line" /> | |
| 44 | 44 | |
| 45 | 45 | </LinearLayout> |
| 46 | 46 | </layout> |
| 47 | 47 | \ No newline at end of file | ... | ... |
module/xiaojiasoundbox/src/main/res/values/styles.xml
| 1 | 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 | 4 | <!-- 自定义checkbox--> |
| 13 | 5 | <style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox"> |
| 14 | 6 | <item name="android:button">@null</item> | ... | ... |