feat:修改Logo
修改主题色 删除首页Tab相关无用代码
@@ -86,7 +86,7 @@
|
|||||||
<application
|
<application
|
||||||
android:name=".application.App"
|
android:name=".application.App"
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/app_logo"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
|
@@ -465,8 +465,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
|||||||
|
|
||||||
Log.i("checkLostUser", "onLogin");
|
Log.i("checkLostUser", "onLogin");
|
||||||
|
|
||||||
//登录成功查询未读信息数量
|
|
||||||
mMainTabLayout.setUnReadDynamicCount(0);
|
|
||||||
int unreadCount = IMMessageManager.get().queryUnreadMsg();
|
int unreadCount = IMMessageManager.get().queryUnreadMsg();
|
||||||
mMainTabLayout.setMsgNum(unreadCount);
|
mMainTabLayout.setMsgNum(unreadCount);
|
||||||
openCommunityNotice();
|
openCommunityNotice();
|
||||||
@@ -614,9 +612,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
|||||||
case MainTabType.TAB_TYPE_HOME:
|
case MainTabType.TAB_TYPE_HOME:
|
||||||
reportTabClick(IReportConstants.ELEVEN);
|
reportTabClick(IReportConstants.ELEVEN);
|
||||||
break;
|
break;
|
||||||
case MainTabType.TAB_TYPE_SQUARE:
|
|
||||||
reportTabClick(IReportConstants.TWELVE);
|
|
||||||
break;
|
|
||||||
case MainTabType.TAB_TYPE_MSG:
|
case MainTabType.TAB_TYPE_MSG:
|
||||||
reportTabClick(IReportConstants.THIRTEEN);
|
reportTabClick(IReportConstants.THIRTEEN);
|
||||||
break;
|
break;
|
||||||
@@ -803,11 +798,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
||||||
public void onUnReadCount(UnReadCountEvent event) {
|
|
||||||
mMainTabLayout.setUnReadDynamicCount(event.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void SquarePublish(SquareTaskEvent event) {
|
public void SquarePublish(SquareTaskEvent event) {
|
||||||
}
|
}
|
||||||
|
@@ -139,8 +139,6 @@ public class MainRedPointTab extends RelativeLayout {
|
|||||||
private int getDefaultRes(int tabType, boolean select) {
|
private int getDefaultRes(int tabType, boolean select) {
|
||||||
int resId = select ? R.drawable.ic_main_tab_home_pressed : R.drawable.ic_main_tab_home;
|
int resId = select ? R.drawable.ic_main_tab_home_pressed : R.drawable.ic_main_tab_home;
|
||||||
switch (tabType) {
|
switch (tabType) {
|
||||||
case MainTabType.TAB_TYPE_SQUARE:
|
|
||||||
break;
|
|
||||||
case MainTabType.TAB_TYPE_STAR:
|
case MainTabType.TAB_TYPE_STAR:
|
||||||
resId = select ? R.drawable.ic_main_tab_star_pressed : R.drawable.ic_main_tab_star;
|
resId = select ? R.drawable.ic_main_tab_star_pressed : R.drawable.ic_main_tab_star;
|
||||||
break;
|
break;
|
||||||
|
@@ -23,9 +23,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class MainTabLayout extends LinearLayout implements View.OnClickListener {
|
public class MainTabLayout extends LinearLayout implements View.OnClickListener {
|
||||||
|
|
||||||
private final List<MainRedPointTab> tabViewList = new ArrayList<>(5);
|
private final List<MainRedPointTab> tabViewList = new ArrayList<>(4);
|
||||||
private MainRedPointTab homeTab;
|
private MainRedPointTab homeTab;
|
||||||
private MainRedPointTab squareTab;
|
|
||||||
private MainRedPointTab starTab;
|
private MainRedPointTab starTab;
|
||||||
private MainRedPointTab msgTab;
|
private MainRedPointTab msgTab;
|
||||||
private MainRedPointTab meTab;
|
private MainRedPointTab meTab;
|
||||||
@@ -56,7 +55,6 @@ public class MainTabLayout extends LinearLayout implements View.OnClickListener
|
|||||||
setOrientation(HORIZONTAL);
|
setOrientation(HORIZONTAL);
|
||||||
inflate(context, R.layout.main_tab_layout, this);
|
inflate(context, R.layout.main_tab_layout, this);
|
||||||
|
|
||||||
squareTab = findViewById(R.id.main_square_tab);
|
|
||||||
msgTab = findViewById(R.id.main_msg_tab);
|
msgTab = findViewById(R.id.main_msg_tab);
|
||||||
starTab = findViewById(R.id.main_star_tab);
|
starTab = findViewById(R.id.main_star_tab);
|
||||||
homeTab = findViewById(R.id.main_home_tab);
|
homeTab = findViewById(R.id.main_home_tab);
|
||||||
@@ -65,17 +63,15 @@ public class MainTabLayout extends LinearLayout implements View.OnClickListener
|
|||||||
homeTab.setOnClickListener(this);
|
homeTab.setOnClickListener(this);
|
||||||
meTab.setOnClickListener(this);
|
meTab.setOnClickListener(this);
|
||||||
starTab.setOnClickListener(this);
|
starTab.setOnClickListener(this);
|
||||||
squareTab.setOnClickListener(this);
|
|
||||||
msgTab.setOnClickListener(this);
|
msgTab.setOnClickListener(this);
|
||||||
|
|
||||||
tabViewList.add(homeTab);
|
|
||||||
tabViewList.add(squareTab);
|
|
||||||
tabViewList.add(starTab);
|
tabViewList.add(starTab);
|
||||||
|
tabViewList.add(homeTab);
|
||||||
tabViewList.add(msgTab);
|
tabViewList.add(msgTab);
|
||||||
tabViewList.add(meTab);
|
tabViewList.add(meTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMainTabInfoList(@NonNull @Size(5) List<MainTabInfo> mainTabInfoList) {
|
public void setMainTabInfoList(@NonNull @Size(4) List<MainTabInfo> mainTabInfoList) {
|
||||||
this.mainTabInfoList = mainTabInfoList;
|
this.mainTabInfoList = mainTabInfoList;
|
||||||
for (int i = 0; i < mainTabInfoList.size(); i++) {
|
for (int i = 0; i < mainTabInfoList.size(); i++) {
|
||||||
MainTabInfo mainTabInfo = mainTabInfoList.get(i);
|
MainTabInfo mainTabInfo = mainTabInfoList.get(i);
|
||||||
@@ -85,9 +81,6 @@ public class MainTabLayout extends LinearLayout implements View.OnClickListener
|
|||||||
case MainTabType.TAB_TYPE_MSG:
|
case MainTabType.TAB_TYPE_MSG:
|
||||||
redPointTab.setNumber(msgNumber);
|
redPointTab.setNumber(msgNumber);
|
||||||
break;
|
break;
|
||||||
case MainTabType.TAB_TYPE_SQUARE:
|
|
||||||
redPointTab.setNumber(squareNumber);
|
|
||||||
break;
|
|
||||||
case MainTabType.TAB_TYPE_ME:
|
case MainTabType.TAB_TYPE_ME:
|
||||||
redPointTab.setNumber(meNumber);
|
redPointTab.setNumber(meNumber);
|
||||||
break;
|
break;
|
||||||
@@ -109,9 +102,6 @@ public class MainTabLayout extends LinearLayout implements View.OnClickListener
|
|||||||
case R.id.main_home_tab:
|
case R.id.main_home_tab:
|
||||||
select(MainTabType.TAB_TYPE_HOME);
|
select(MainTabType.TAB_TYPE_HOME);
|
||||||
break;
|
break;
|
||||||
case R.id.main_square_tab:
|
|
||||||
select(MainTabType.TAB_TYPE_SQUARE);
|
|
||||||
break;
|
|
||||||
case R.id.main_star_tab:
|
case R.id.main_star_tab:
|
||||||
select(MainTabType.TAB_TYPE_STAR);
|
select(MainTabType.TAB_TYPE_STAR);
|
||||||
break;
|
break;
|
||||||
@@ -127,7 +117,6 @@ public class MainTabLayout extends LinearLayout implements View.OnClickListener
|
|||||||
private void select(int tabType) {
|
private void select(int tabType) {
|
||||||
if (tabType == 0) tabType = MainTabType.TAB_TYPE_HOME;
|
if (tabType == 0) tabType = MainTabType.TAB_TYPE_HOME;
|
||||||
if (mLastPosition == tabType) return;
|
if (mLastPosition == tabType) return;
|
||||||
squareTab.select(tabType == MainTabType.TAB_TYPE_SQUARE);
|
|
||||||
msgTab.select(tabType == MainTabType.TAB_TYPE_MSG);
|
msgTab.select(tabType == MainTabType.TAB_TYPE_MSG);
|
||||||
starTab.select(tabType == MainTabType.TAB_TYPE_STAR);
|
starTab.select(tabType == MainTabType.TAB_TYPE_STAR);
|
||||||
homeTab.select(tabType == MainTabType.TAB_TYPE_HOME);
|
homeTab.select(tabType == MainTabType.TAB_TYPE_HOME);
|
||||||
@@ -154,14 +143,6 @@ public class MainTabLayout extends LinearLayout implements View.OnClickListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUnReadDynamicCount(int mUnReadDynamicCount) {
|
|
||||||
squareNumber = mUnReadDynamicCount;
|
|
||||||
MainRedPointTab pointTab = findTabInfoByType(MainTabType.TAB_TYPE_SQUARE);
|
|
||||||
if (pointTab != null) {
|
|
||||||
pointTab.setNumber(mUnReadDynamicCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private MainRedPointTab findTabInfoByType(int tabType) {
|
private MainRedPointTab findTabInfoByType(int tabType) {
|
||||||
if (mainTabInfoList == null) return null;
|
if (mainTabInfoList == null) return null;
|
||||||
|
BIN
app/src/main/res/drawable-xxhdpi/default_avatar.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/default_banner.png
Normal file
After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 5.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/default_cover.png
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/splash_bg.webp
Normal file
After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 37 KiB |
@@ -1,14 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
|
<gradient android:startColor="#70E9FF" android:centerColor="#AE87FF" android:endColor="#FF5CE1"/>
|
||||||
<gradient
|
|
||||||
android:angle="180"
|
|
||||||
android:endColor="#FF5AECFA"
|
|
||||||
android:centerColor="#FF9DB4FF"
|
|
||||||
android:startColor="#FFCF70FF"
|
|
||||||
android:type="linear"
|
|
||||||
android:useLevel="true" />
|
|
||||||
<corners android:radius="21dp" />
|
<corners android:radius="21dp" />
|
||||||
|
|
||||||
</shape>
|
</shape>
|
@@ -2,12 +2,13 @@
|
|||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<shape android:shape="rectangle">
|
<bitmap
|
||||||
<solid android:color="@color/base_color_theme" />
|
android:dither="true"
|
||||||
</shape>
|
android:filter="true"
|
||||||
|
android:src="@drawable/splash_bg" />
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item android:top="@dimen/dp_188">
|
<item android:top="@dimen/dp_148">
|
||||||
<bitmap
|
<bitmap
|
||||||
android:dither="true"
|
android:dither="true"
|
||||||
android:filter="true"
|
android:filter="true"
|
||||||
@@ -15,12 +16,4 @@
|
|||||||
android:src="@drawable/splash_bg_logo" />
|
android:src="@drawable/splash_bg_logo" />
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
|
||||||
<bitmap
|
|
||||||
android:dither="true"
|
|
||||||
android:filter="true"
|
|
||||||
android:gravity="bottom|fill_horizontal"
|
|
||||||
android:src="@drawable/splash_bg_bottom" />
|
|
||||||
</item>
|
|
||||||
|
|
||||||
</layer-list>
|
</layer-list>
|
||||||
|
@@ -2,8 +2,10 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<corners android:radius="12dp" />
|
<corners android:radius="12dp" />
|
||||||
|
|
||||||
|
<gradient android:startColor="#70E9FF" android:centerColor="#AE87FF" android:endColor="#FF5CE1"/>
|
||||||
|
|
||||||
<stroke
|
<stroke
|
||||||
android:width="1dp"
|
android:width="1dp"
|
||||||
android:color="#FF1E1E1F" />
|
android:color="#FF1E1E1F" />
|
||||||
<solid android:color="@color/base_color_theme" />
|
|
||||||
</shape>
|
</shape>
|
@@ -32,14 +32,4 @@
|
|||||||
android:textColor="@color/text_normal_c6c6e9"
|
android:textColor="@color/text_normal_c6c6e9"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/versions"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_marginTop="85dp"
|
|
||||||
android:text="@string/slogan"
|
|
||||||
android:textColor="@color/text_title_color"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@@ -20,14 +20,6 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<com.chwl.app.ui.widget.MainRedPointTab
|
|
||||||
android:id="@+id/main_square_tab"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<com.chwl.app.ui.widget.MainRedPointTab
|
<com.chwl.app.ui.widget.MainRedPointTab
|
||||||
android:id="@+id/main_msg_tab"
|
android:id="@+id/main_msg_tab"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/base_shape_cbff00_23dp"
|
android:background="@drawable/base_shape_theme_24dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/send_msg"
|
android:text="@string/send_msg"
|
||||||
android:textColor="@color/color_1E1E1F"
|
android:textColor="@color/color_1E1E1F"
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@color/ic_launcher_background"/>
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
|
||||||
</adaptive-icon>
|
|
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@color/ic_launcher_background"/>
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
|
||||||
</adaptive-icon>
|
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 9.7 KiB |
@@ -851,7 +851,6 @@
|
|||||||
|
|
||||||
<string name="hint_input_nick">請輸入昵稱</string>
|
<string name="hint_input_nick">請輸入昵稱</string>
|
||||||
<string name="text_bind_phone">綁定手機號</string>
|
<string name="text_bind_phone">綁定手機號</string>
|
||||||
<string name="slogan">來&app_name;,邂逅你的專屬聲音</string>
|
|
||||||
|
|
||||||
<string name="text_agree">同意</string>
|
<string name="text_agree">同意</string>
|
||||||
<string name="text_disagree">不同意</string>
|
<string name="text_disagree">不同意</string>
|
||||||
|
@@ -2,9 +2,8 @@ package com.chwl.core.home.bean;
|
|||||||
|
|
||||||
public interface MainTabType {
|
public interface MainTabType {
|
||||||
//tabType(1-派对,2-广场,3-赛事,4-消息,5-我的)
|
//tabType(1-派对,2-广场,3-赛事,4-消息,5-我的)
|
||||||
int TAB_TYPE_HOME = 1;
|
int TAB_TYPE_STAR = 1;
|
||||||
int TAB_TYPE_SQUARE = 2;
|
int TAB_TYPE_HOME = 2;
|
||||||
int TAB_TYPE_MSG = 4;
|
int TAB_TYPE_MSG = 3;
|
||||||
int TAB_TYPE_ME = 5;
|
int TAB_TYPE_ME = 4;
|
||||||
int TAB_TYPE_STAR = 6;
|
|
||||||
}
|
}
|
||||||
|
@@ -1,15 +1,12 @@
|
|||||||
package com.chwl.core.initial;
|
package com.chwl.core.initial;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
|
|
||||||
import com.chwl.core.base.IModel;
|
import com.chwl.core.base.IModel;
|
||||||
import com.chwl.core.bean.response.ServiceResult;
|
|
||||||
import com.chwl.core.home.bean.MainTabInfo;
|
import com.chwl.core.home.bean.MainTabInfo;
|
||||||
import com.chwl.core.initial.bean.BoxInfo;
|
|
||||||
import com.chwl.core.initial.bean.FairyOpenInfo;
|
import com.chwl.core.initial.bean.FairyOpenInfo;
|
||||||
import com.chwl.core.initial.bean.InitInfo;
|
import com.chwl.core.initial.bean.InitInfo;
|
||||||
import com.chwl.core.initial.bean.SplashComponent;
|
import com.chwl.core.initial.bean.SplashComponent;
|
||||||
@@ -29,15 +26,11 @@ public interface IInitialModel extends IModel {
|
|||||||
|
|
||||||
Single<InitInfo> init(boolean force);
|
Single<InitInfo> init(boolean force);
|
||||||
|
|
||||||
boolean isReportSwitch();
|
|
||||||
|
|
||||||
SplashComponent getLocalSplashVo();
|
SplashComponent getLocalSplashVo();
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
InitInfo getCacheInitInfo();
|
InitInfo getCacheInitInfo();
|
||||||
|
|
||||||
InitInfo getCacheInitInfoOnly();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 只是load 一下初始化接口
|
* 只是load 一下初始化接口
|
||||||
*
|
*
|
||||||
@@ -47,33 +40,8 @@ public interface IInitialModel extends IModel {
|
|||||||
|
|
||||||
String getPublicChatHallUid();
|
String getPublicChatHallUid();
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
|
||||||
void loadMainTabInfoList();
|
|
||||||
|
|
||||||
Single<BoxInfo> getBoxInfo();
|
|
||||||
|
|
||||||
boolean isCaptchaSwitch();
|
|
||||||
|
|
||||||
long getTimeDiff();
|
|
||||||
|
|
||||||
int getFindNewbieCharmLevel();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 回调结果至百度信息流api
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
|
|
||||||
Single<ServiceResult> reportAdv(String oaid, String imeiMD5);
|
|
||||||
|
|
||||||
int getTeenagerMode();
|
int getTeenagerMode();
|
||||||
|
|
||||||
int getRoomRefresh();
|
|
||||||
|
|
||||||
int getDynamicRefresh();
|
|
||||||
|
|
||||||
int getDefaultHomeTab();
|
|
||||||
|
|
||||||
Single<FairyOpenInfo> requestFairyOpenInfo();
|
Single<FairyOpenInfo> requestFairyOpenInfo();
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
package com.chwl.core.initial;
|
package com.chwl.core.initial;
|
||||||
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -143,12 +142,7 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
|
|
||||||
private InitialModel() {
|
private InitialModel() {
|
||||||
api = RxNet.create(Api.class);
|
api = RxNet.create(Api.class);
|
||||||
loadMainTabInfoList();
|
List<MainTabInfo> tabInfoList = getDefaultMainTab();
|
||||||
List<MainTabInfo> tabInfoList = DemoCache.readMainTabInfoList();
|
|
||||||
if (ListUtils.isListEmpty(tabInfoList)) {
|
|
||||||
tabInfoList = getDefaultMainTab();
|
|
||||||
DemoCache.saveMainTabInfoList(tabInfoList);
|
|
||||||
}
|
|
||||||
mainTabInfosLiveData.setValue(tabInfoList);
|
mainTabInfosLiveData.setValue(tabInfoList);
|
||||||
IntentFilter filter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
|
IntentFilter filter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
|
||||||
receiver = new BroadcastReceiver() {
|
receiver = new BroadcastReceiver() {
|
||||||
@@ -315,11 +309,6 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
return publicChatHallUid;
|
return publicChatHallUid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isReportSwitch() {
|
|
||||||
return reportSwitch;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 如果返回的是null,则可能是过期了,也有可能是因为图片还没有下载
|
* 如果返回的是null,则可能是过期了,也有可能是因为图片还没有下载
|
||||||
*
|
*
|
||||||
@@ -359,25 +348,6 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
return cacheInitInfo == null ? DemoCache.readInitInfo() : cacheInitInfo;
|
return cacheInitInfo == null ? DemoCache.readInitInfo() : cacheInitInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 过期了才为空
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public InitInfo getCacheInitInfoOnly() {
|
|
||||||
if (System.currentTimeMillis() - DemoCache.readInitInfoSavingTime() > TIME_EXPIRED) {
|
|
||||||
// 过期了
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
InitInfo initInfo = DemoCache.readInitInfo();
|
|
||||||
// 没有缓存
|
|
||||||
if (initInfo == null) {
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
return initInfo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void downloadSplashPicture(final String path) {
|
private void downloadSplashPicture(final String path) {
|
||||||
if (TextUtils.isEmpty(path)) return;
|
if (TextUtils.isEmpty(path)) return;
|
||||||
if (path.equals(DemoCache.readSplashPicture()) && new File(path).exists()) return;
|
if (path.equals(DemoCache.readSplashPicture()) && new File(path).exists()) return;
|
||||||
@@ -419,27 +389,12 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
|
||||||
@Override
|
|
||||||
public void loadMainTabInfoList() {
|
|
||||||
api.getMainTabList()
|
|
||||||
.compose(RxHelper.handleSchedulers())
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.subscribe(mainTabInfos -> {
|
|
||||||
if (mainTabInfos.size() == 5) {
|
|
||||||
DemoCache.saveMainTabInfoList(mainTabInfos);
|
|
||||||
mainTabInfosLiveData.setValue(mainTabInfos);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private List<MainTabInfo> getDefaultMainTab() {
|
private List<MainTabInfo> getDefaultMainTab() {
|
||||||
return new ArrayList<>(Arrays.asList(
|
return new ArrayList<>(Arrays.asList(
|
||||||
new MainTabInfo(
|
new MainTabInfo(
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"Star",
|
||||||
MainTabType.TAB_TYPE_STAR,
|
MainTabType.TAB_TYPE_STAR,
|
||||||
null
|
null
|
||||||
),
|
),
|
||||||
@@ -450,13 +405,6 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
MainTabType.TAB_TYPE_HOME,
|
MainTabType.TAB_TYPE_HOME,
|
||||||
null
|
null
|
||||||
),
|
),
|
||||||
new MainTabInfo(
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
ResUtil.getString(R.string.xchat_android_core_initial_initialmodel_04),
|
|
||||||
MainTabType.TAB_TYPE_SQUARE,
|
|
||||||
null
|
|
||||||
),
|
|
||||||
new MainTabInfo(
|
new MainTabInfo(
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@@ -474,50 +422,12 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取宝箱信息,如果没有,则重新加载
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Single<BoxInfo> getBoxInfo() {
|
|
||||||
if (boxInfo != null) {
|
|
||||||
return Single.just(boxInfo);
|
|
||||||
}
|
|
||||||
return loadInitInfo().flatMap(info -> {
|
|
||||||
boxInfo = initBoxInfo(info);
|
|
||||||
return Single.just(boxInfo);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private BoxInfo initBoxInfo(InitInfo info) {
|
private BoxInfo initBoxInfo(InitInfo info) {
|
||||||
BoxInfo boxInfo = new BoxInfo();
|
BoxInfo boxInfo = new BoxInfo();
|
||||||
boxInfo.setOpenBoxSwitchLevelNo(info.getOpenBoxSwitchLevelNo());
|
boxInfo.setOpenBoxSwitchLevelNo(info.getOpenBoxSwitchLevelNo());
|
||||||
return boxInfo;
|
return boxInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCaptchaSwitch() {
|
|
||||||
return captchaSwitch;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getTimeDiff() {
|
|
||||||
return this.timeDiff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 回调结果至百度信息流api
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Single<ServiceResult> reportAdv(String oaid, String imeiMd5) {
|
|
||||||
return api.reportAdv(imeiMd5, oaid)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地区检测
|
* 地区检测
|
||||||
*/
|
*/
|
||||||
@@ -556,26 +466,6 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
return teenagerMode;
|
return teenagerMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRoomRefresh() {
|
|
||||||
return roomRefresh;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDynamicRefresh() {
|
|
||||||
return dynamicRefresh;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDefaultHomeTab() {
|
|
||||||
return defaultHomeTab;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFindNewbieCharmLevel() {
|
|
||||||
return findNewbieCharmLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Single<FairyOpenInfo> requestFairyOpenInfo() {
|
public Single<FairyOpenInfo> requestFairyOpenInfo() {
|
||||||
return api.getFairyOpenInfo()
|
return api.getFairyOpenInfo()
|
||||||
@@ -601,24 +491,6 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
@GET("/client/init")
|
@GET("/client/init")
|
||||||
Single<ServiceResult<InitInfo>> init();
|
Single<ServiceResult<InitInfo>> init();
|
||||||
|
|
||||||
/**
|
|
||||||
* 回调结果至百度信息流api
|
|
||||||
*
|
|
||||||
* @param imeiMD5
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST("/observe/callback")
|
|
||||||
@FormUrlEncoded
|
|
||||||
Single<ServiceResult> reportAdv(@Field("imei") String imeiMD5, @Field("oaid") String oaidMD5);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取首页Tab配置
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/app/bottomBar/getCurrentAppBottomBar")
|
|
||||||
Single<ServiceResult<List<MainTabInfo>>> getMainTabList();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 夺宝精灵开放状态
|
* 夺宝精灵开放状态
|
||||||
*
|
*
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@color/base_color_theme" />
|
<gradient android:startColor="#70E9FF" android:centerColor="#AE87FF" android:endColor="#FF5CE1"/>
|
||||||
<corners android:radius="15dp" />
|
<corners android:radius="15dp" />
|
||||||
</shape>
|
</shape>
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@color/base_color_theme" />
|
<gradient android:startColor="#70E9FF" android:centerColor="#AE87FF" android:endColor="#FF5CE1"/>
|
||||||
<corners android:radius="30dp" />
|
<corners android:radius="30dp" />
|
||||||
</shape>
|
</shape>
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@color/base_color_theme" />
|
<gradient android:startColor="#70E9FF" android:centerColor="#AE87FF" android:endColor="#FF5CE1"/>
|
||||||
<corners android:radius="5dp" />
|
<corners android:radius="5dp" />
|
||||||
</shape>
|
</shape>
|
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<gradient android:startColor="#70E9FF" android:centerColor="#AE87FF" android:endColor="#FF5CE1"/>
|
||||||
|
<corners android:radius="23dp" />
|
||||||
|
</shape>
|
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!--主题色-->
|
<!--主题色-->
|
||||||
<color name="base_color_theme">#CBFF00</color>
|
<color name="base_color_theme">#718CFF</color>
|
||||||
|
|
||||||
<!--主题色对应的文本色-->
|
<!--主题色对应的文本色-->
|
||||||
<color name="base_color_theme_text">#1E1E1F</color>
|
<color name="base_color_theme_text">#1E1E1F</color>
|
||||||
|
|
||||||
<!--正面按钮-文本色-->
|
<!--正面按钮-文本色-->
|
||||||
<color name="base_color_positive_text">#1E1E1F</color>
|
<color name="base_color_positive_text">#FFFFFF</color>
|
||||||
|
|
||||||
<!--负面按钮-文本色-->
|
<!--负面按钮-文本色-->
|
||||||
<color name="base_color_negative_text">#FFFFFF</color>
|
<color name="base_color_negative_text">#FFFFFF</color>
|
||||||
|