初始化代码
1
modulemain/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
53
modulemain/build.gradle
Normal file
@@ -0,0 +1,53 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.qxcm.modulemain'
|
||||
compileSdk 35
|
||||
|
||||
defaultConfig {
|
||||
minSdk 24
|
||||
targetSdk 35
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
dataBinding {
|
||||
enabled = true
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation libs.appcompat
|
||||
implementation libs.material
|
||||
implementation libs.activity
|
||||
implementation libs.constraintlayout
|
||||
implementation project(':modulevoice')
|
||||
implementation project(':modulecircle')
|
||||
implementation project(':modulevocal')
|
||||
|
||||
testImplementation libs.junit
|
||||
androidTestImplementation libs.ext.junit
|
||||
androidTestImplementation libs.espresso.core
|
||||
|
||||
implementation project(':moduleUtil')
|
||||
}
|
||||
21
modulemain/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.qxcm.modulemain;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.qxcm.modulemain", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
17
modulemain/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.QxLive">
|
||||
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:exported="true" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,331 @@
|
||||
package com.qxcm.modulemain.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.FragmentUtils;
|
||||
import com.example.modulecircle.fragment.CircleFragment;
|
||||
import com.example.modulevocal.fragment.VocalRangeFragment;
|
||||
import com.example.modulevoice.fragment.VoiceFragment;
|
||||
import com.qxcm.modulemain.R;
|
||||
import com.qxcm.modulemain.contacts.HomeContacts;
|
||||
import com.qxcm.modulemain.databinding.ActivityMainBinding;
|
||||
import com.qxcm.modulemain.presenter.HomePresenter;
|
||||
import com.qxcm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.qxcm.moduleutil.utils.logger.Logger;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBinding> implements HomeContacts.View, View.OnClickListener {
|
||||
private static int index = -1;
|
||||
// private AppUpdateDialog appUpdateDialog;
|
||||
|
||||
public static boolean isShortsShowing() {
|
||||
return index == 1;
|
||||
}
|
||||
|
||||
public String giftBagUrl;
|
||||
|
||||
private Fragment[] fragments;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
index = -1;
|
||||
// ServiceUtils.startService(EMqttService.class);
|
||||
checkTab(getIntent().getIntExtra("tab", -1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
fragments = new Fragment[]{
|
||||
VoiceFragment.newInstance(), // 声播
|
||||
CircleFragment.newInstance(), // 语圈
|
||||
VoiceFragment.newInstance(),
|
||||
VocalRangeFragment.newInstance()
|
||||
// TrendFindFragment.newInstance(), // 动态
|
||||
// IndexFragment.newInstance(), // 派对
|
||||
// NewsFragment.newInstance(), // 消息
|
||||
// MeFragment.newInstance(), // 我的
|
||||
};
|
||||
FragmentUtils.add(getSupportFragmentManager(), fragments, R.id.frame_layout, 0);
|
||||
MvpPre.initData();
|
||||
MvpPre.userFiles();
|
||||
|
||||
// boolean isFirst = SPUtil.getBooleanDefultFalse(Constant.Channel.ISFIRST);
|
||||
// if (!isFirst) {
|
||||
// MvpPre.randomHotRoom();
|
||||
// SPUtil.saveboolean(Constant.Channel.ISFIRST, true);
|
||||
// }
|
||||
// if (!TextUtils.isEmpty(giftBagUrl)) {
|
||||
// new NewUserGiftDialog(this, giftBagUrl).show();
|
||||
// }
|
||||
// MvpPre.delayPreloadImage();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
checkTab(intent.getIntExtra("tab", -1));
|
||||
}
|
||||
|
||||
private void checkTab(int tab) {
|
||||
if (tab >= 0) {
|
||||
selectShow(tab);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
// EventBus.getDefault().register(this);
|
||||
mBinding.rlMedia.setOnClickListener(this);
|
||||
mBinding.rlTrend.setOnClickListener(this);
|
||||
// mBinding.rlParty.setOnClickListener(this);
|
||||
mBinding.rlNews.setOnClickListener(this);
|
||||
mBinding.rlMe.setOnClickListener(this);
|
||||
// mBinding.ivGuanbi.setOnClickListener(this);
|
||||
// mBinding.riv.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initCompleted() {
|
||||
// 初始化显示派对Tab
|
||||
reset();
|
||||
mBinding.rlMedia.setSelected(true);
|
||||
FragmentUtils.showHide(0, fragments);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected HomePresenter bindPresenter() {
|
||||
return new HomePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoadings() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disLoadings() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.rl_media) {
|
||||
selectShow(0);
|
||||
} else if (id == R.id.rl_trend) {
|
||||
selectShow(1);
|
||||
} else if (id == R.id.rl_news) {
|
||||
selectShow(2);
|
||||
} else if (id == R.id.rl_me) {
|
||||
selectShow(3);
|
||||
//C0101我的界面
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.C0101);
|
||||
}
|
||||
// else if (id == R.id.iv_guanbi) {
|
||||
// mBinding.ll.setVisibility(View.INVISIBLE);
|
||||
// MyApplication.getInstance().isShow = false;
|
||||
// MyApplication.getInstance().isPlaying = false;
|
||||
// if (RoomActivity.sDestroied) {
|
||||
// MvpPre.quitRoom(MyApplication.getInstance().playId);
|
||||
// } else {
|
||||
// EventBus.getDefault().post(new RoomOutEvent());
|
||||
// }
|
||||
// } else if (id == R.id.riv) {
|
||||
// String roomId = MyApplication.getInstance().playId;
|
||||
// if (!TextUtils.isEmpty(roomId)) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form", "首页").withString("roomId", roomId).navigation();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void quitSuccess(String roomId) {
|
||||
// RtcManager.getInstance().leaveChannel(roomId);
|
||||
// RtcManager.getInstance().setAudioUrl(null);
|
||||
// EMqttService.cleanSubscribeRoom(roomId);
|
||||
// BaseApplication.getInstance().isPlaying = false;
|
||||
// BaseApplication.getInstance().isShow = false;
|
||||
// RtcManager.getInstance().removeRtcEventListener();
|
||||
}
|
||||
|
||||
|
||||
private void reset() {
|
||||
mBinding.rlMedia.setSelected(false);
|
||||
mBinding.rlTrend.setSelected(false);
|
||||
// mBinding.rlParty.setSelected(false);
|
||||
mBinding.rlNews.setSelected(false);
|
||||
mBinding.rlMe.setSelected(false);
|
||||
}
|
||||
|
||||
private void selectShow(int postion) {
|
||||
if (postion == index) {
|
||||
if (postion == 1) {
|
||||
// EventBus.getDefault().post(new RefreshShortsEvent());
|
||||
} else if (postion == 2) {
|
||||
// EventBus.getDefault().post(new NewsTabReEvent());
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
reset();
|
||||
index = postion;
|
||||
switch (postion) {
|
||||
case 0:
|
||||
mBinding.rlMedia.setSelected(true);
|
||||
// mBinding.llBottomBar.setBackgroundResource(R.drawable.icon_bbar_bg);
|
||||
|
||||
break;
|
||||
case 1:
|
||||
mBinding.rlTrend.setSelected(true);
|
||||
// mBinding.llBottomBar.setBackgroundResource(R.drawable.icon_bbar_bg);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
mBinding.rlNews.setSelected(true);
|
||||
// mBinding.llBottomBar.setBackgroundResource(R.drawable.icon_bbar_bg);
|
||||
|
||||
break;
|
||||
case 3:
|
||||
mBinding.rlMe.setSelected(true);
|
||||
// mBinding.llBottomBar.setBackgroundResource(R.drawable.icon_bbar_bg);
|
||||
|
||||
break;
|
||||
}
|
||||
FragmentUtils.showHide(postion, fragments);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
ActivityUtils.startHomeActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.loginIm();
|
||||
Logger.i("MainActivity", "onResume");
|
||||
// Beta.checkAppUpgrade(false, false);
|
||||
MvpPre.appUpdate();
|
||||
MvpPre.signSwitch();
|
||||
refreshUnread();
|
||||
// boolean b = MyApplication.getInstance().isPlaying;
|
||||
// if (b) {
|
||||
// ImageLoader.loadHead(MainActivity.this, mBinding.riv, MyApplication.getInstance().playCover);
|
||||
// mBinding.riv.postDelayed(mRivAnimationTask, 1000);
|
||||
// mBinding.ll.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
// mBinding.ll.setVisibility(View.INVISIBLE);
|
||||
// }
|
||||
// if (MyApplication.getInstance().isPlaying && MyApplication.getInstance().isShow) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form", "首页").withString("roomId", MyApplication.getInstance().playId).navigation();
|
||||
// }
|
||||
// Logger.i("isPlay", "onResume: " + b + "view:" + mBinding.ll.getVisibility());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
// mBinding.riv.removeCallbacks(mRivAnimationTask);
|
||||
// mBinding.riv.clearAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
// LogUtils.d(BaseApplication.getInstance().getToken());
|
||||
}
|
||||
|
||||
private final Runnable mRivAnimationTask = () -> {
|
||||
// Animation rivRotateAnimation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.rotate_anim);
|
||||
// mBinding.riv.startAnimation(rivRotateAnimation);
|
||||
};
|
||||
|
||||
private void refreshUnread() {
|
||||
MvpPre.userNews();
|
||||
}
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void newMessage(NewsMessageEvent newsMessageEvent) {
|
||||
// refreshUnread();
|
||||
// }
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void logOut(LogOutEvent logOutEvent) {
|
||||
// MyApplication.getInstance().reLogin();
|
||||
// }
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void backHomeEvent(BackHomeEvent event) {
|
||||
// mBinding.rlMedia.post(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// mBinding.rlMedia.performClick();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public void appUpdate(AppUpdateModel appUpdateModel) {
|
||||
// if (appUpdateModel.getVersionCode() > BuildConfig.VERSION_CODE) {
|
||||
// if (appUpdateDialog == null) {
|
||||
// appUpdateDialog = new AppUpdateDialog(this);
|
||||
// appUpdateDialog.setAppUpdateModel(appUpdateModel);
|
||||
// if (appUpdateModel.getForceUpdate() == 1) {
|
||||
// appUpdateDialog.setCanceledOnTouchOutside(false);
|
||||
// }
|
||||
// }
|
||||
// appUpdateDialog.show();
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void setRandomHotRoom(String roomId) {
|
||||
if (!TextUtils.isEmpty(roomId)) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form", "首页").withString("roomId", roomId).navigation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUnReadCount(int unreadMessageCount) {
|
||||
if (unreadMessageCount == 0) {
|
||||
mBinding.tvMessage0.setVisibility(View.GONE);
|
||||
mBinding.tvMessage0.setText("0");
|
||||
} else {
|
||||
mBinding.tvMessage0.setVisibility(View.VISIBLE);
|
||||
mBinding.tvMessage0.setText(String.valueOf(unreadMessageCount));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动获取一次用户信息
|
||||
*
|
||||
*
|
||||
*/
|
||||
// @Override
|
||||
// public void UserFilesSuccess(UserBean userBean) {
|
||||
// MyApplication.getInstance().setUser(userBean);
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.qxcm.modulemain.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.qxcm.moduleutil.activity.IPresenter;
|
||||
import com.qxcm.moduleutil.activity.IView;
|
||||
|
||||
|
||||
public final class HomeContacts {
|
||||
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
|
||||
|
||||
// void appUpdate(AppUpdateModel appUpdateModel);
|
||||
|
||||
void setRandomHotRoom(String roomId);
|
||||
|
||||
void setUnReadCount(int unreadMessageCount);
|
||||
|
||||
// void UserFilesSuccess(UserBean userBean);
|
||||
|
||||
void quitSuccess(String roomId);
|
||||
}
|
||||
|
||||
public interface IHomePre extends IPresenter {
|
||||
void initData();
|
||||
|
||||
void loginIm();
|
||||
|
||||
void quitRoom(String roomId);
|
||||
|
||||
void appUpdate();
|
||||
|
||||
void randomHotRoom();
|
||||
|
||||
void userNews();
|
||||
|
||||
void signSwitch();
|
||||
|
||||
void userFiles();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
package com.qxcm.modulemain.presenter;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.blankj.utilcode.util.ThreadUtils;
|
||||
import com.qxcm.modulemain.contacts.HomeContacts;
|
||||
import com.qxcm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class HomePresenter extends BasePresenter<HomeContacts.View> implements HomeContacts.IHomePre {
|
||||
|
||||
public HomePresenter(HomeContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void appUpdate() {
|
||||
// getApi().appUpdate(new BaseObserver<AppUpdateModel>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(AppUpdateModel appUpdataModel) {
|
||||
// MvpRef.get().appUpdate(appUpdataModel);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomHotRoom() {
|
||||
// NewApi.getInstance().getRandomRecommendRoom(new com.qpyy.libcommon.api.BaseObserver<RandomRecommendRoomResp>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(RandomRecommendRoomResp randomRecommendRoomResp) {
|
||||
// if (randomRecommendRoomResp != null && !TextUtils.isEmpty(randomRecommendRoomResp.getRoom_id()) && !"0".equals(randomRecommendRoomResp.getRoom_id())) {
|
||||
// MvpRef.get().setRandomHotRoom(randomRecommendRoomResp.getRoom_id());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userNews() {
|
||||
// NewApi.getInstance().getMessageCount(new com.qpyy.libcommon.api.BaseObserver<UserMsgCountResp>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(UserMsgCountResp userMsgCountResp) {
|
||||
// int unreadMessageCount = EMClient.getInstance().chatManager().getUnreadMessageCount() + userMsgCountResp.getUnReadCount();
|
||||
// MvpRef.get().setUnReadCount(unreadMessageCount);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void signSwitch() {
|
||||
// getApi().signSwitch(new BaseObserver<SignSwitchModel>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(SignSwitchModel signSwitchModel) {
|
||||
// MyApplication.getInstance().labor = signSwitchModel.getLabor() == 1;
|
||||
// MyApplication.getInstance().chat_min_level = signSwitchModel.getChat_min_level();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userFiles() {
|
||||
// getApi().userFiles(new BaseObserver<UserBean>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(UserBean userBean) {
|
||||
// MvpRef.get().UserFilesSuccess(userBean);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
// GrabMarblesManager.INSTANCE.setToken(SpUtils.getToken());
|
||||
// GrabMarblesManager.INSTANCE.setUserId(SpUtils.getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loginIm() {
|
||||
// boolean connected = EMClient.getInstance().isConnected();
|
||||
// if (NetworkUtils.isConnected() && !connected) {
|
||||
// UserBean user = MyApplication.getInstance().getUser();
|
||||
// if (TextUtils.isEmpty(user.getEmchat_username()) || TextUtils.isEmpty(user.getEmchat_password())) {
|
||||
// ToastUtils.showShort("无环信账号或密码,请重新登录");
|
||||
// MyApplication.getInstance().reLogin();
|
||||
// return;
|
||||
// }
|
||||
// EMClient.getInstance().login(user.getEmchat_username(), user.getEmchat_password(), new EMCallBack() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// EChartHelper.getInstance().setCurrentUserName(user.getEmchat_username());
|
||||
// EChartHelper.getInstance().getUserProfileManager().updateCurrentUserNickName(user.getNickname());
|
||||
// EChartHelper.getInstance().getUserProfileManager().setCurrentUserAvatar(user.getHead_picture());
|
||||
// EMClient.getInstance().groupManager().loadAllGroups();
|
||||
// EMClient.getInstance().chatManager().loadAllConversations();
|
||||
// EMClient.getInstance().pushManager().asyncUpdatePushNickname(user.getEmchat_username(), new EMCallBack() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int i, String s) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onProgress(int i, String s) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int i, String s) {
|
||||
//// ToastUtils.showShort("登录失败:" + i + " " + s);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onProgress(int i, String s) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void quitRoom(String roomId) {
|
||||
// MvpRef.get().showLoadings();
|
||||
// NewApi.getInstance().quit(roomId, new com.qpyy.libcommon.api.BaseObserver<String>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(String s) {
|
||||
// MvpRef.get().quitSuccess(roomId);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
//// MvpRef.get().disLoadings();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
private boolean isIgnoringBatteryOptimizations() {
|
||||
boolean isIgnoring = false;
|
||||
PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||
if (powerManager != null) {
|
||||
isIgnoring = powerManager.isIgnoringBatteryOptimizations(mContext.getPackageName());
|
||||
}
|
||||
return isIgnoring;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
public void requestIgnoreBatteryOptimizations() {
|
||||
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + mContext.getPackageName()));
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳转到指定应用的首页
|
||||
*/
|
||||
private void showActivity(@NonNull String packageName) {
|
||||
Intent intent = mContext.getPackageManager().getLaunchIntentForPackage(packageName);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到指定应用的指定页面
|
||||
*/
|
||||
private void showActivity(@NonNull String packageName, @NonNull String activityDir) {
|
||||
Intent intent = new Intent();
|
||||
intent.setComponent(new ComponentName(packageName, activityDir));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
private void goXiaomiSetting() {
|
||||
showActivity("com.miui.securitycenter",
|
||||
"com.miui.permcenter.autostart.AutoStartManagementActivity");
|
||||
}
|
||||
|
||||
private void goHuaweiSetting() {
|
||||
try {
|
||||
showActivity("com.huawei.systemmanager",
|
||||
"com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity");
|
||||
} catch (Exception e) {
|
||||
showActivity("com.huawei.systemmanager",
|
||||
"com.huawei.systemmanager.optimize.bootstart.BootStartActivity");
|
||||
}
|
||||
}
|
||||
|
||||
private void goOPPOSetting() {
|
||||
try {
|
||||
showActivity("com.coloros.phonemanager");
|
||||
} catch (Exception e1) {
|
||||
try {
|
||||
showActivity("com.oppo.safe");
|
||||
} catch (Exception e2) {
|
||||
try {
|
||||
showActivity("com.coloros.oppoguardelf");
|
||||
} catch (Exception e3) {
|
||||
showActivity("com.coloros.safecenter");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void goVIVOSetting() {
|
||||
showActivity("com.iqoo.secure");
|
||||
}
|
||||
|
||||
private void goMeizuSetting() {
|
||||
showActivity("com.meizu.safe");
|
||||
}
|
||||
|
||||
private void goSamsungSetting() {
|
||||
try {
|
||||
showActivity("com.samsung.android.sm_cn");
|
||||
} catch (Exception e) {
|
||||
showActivity("com.samsung.android.sm");
|
||||
}
|
||||
}
|
||||
|
||||
private void goLetvSetting() {
|
||||
showActivity("com.letv.android.letvsafe",
|
||||
"com.letv.android.letvsafe.AutobootManageActivity");
|
||||
}
|
||||
|
||||
private void goSmartisanSetting() {
|
||||
showActivity("com.smartisanos.security");
|
||||
}
|
||||
|
||||
public void delayPreloadImage() {
|
||||
// ThreadUtils.runOnUiThreadDelayed(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// ImageUtils.preloadImgConstants();
|
||||
// }
|
||||
// }, 6 * 1000);
|
||||
}
|
||||
}
|
||||
170
modulemain/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
30
modulemain/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
179
modulemain/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,179 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activity.MainActivity">
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/transparent"
|
||||
android:clipChildren="false"
|
||||
android:paddingBottom="@dimen/dp_21">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_bottom_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_49"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@drawable/home_bbar_yuan"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_media"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_media" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab1"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_trend"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_tend" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab2"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_news"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-3dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_news"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_news" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_message0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_toRightOf="@+id/iv_news"
|
||||
|
||||
android:background="@drawable/ease_bg_msg_count"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_5"
|
||||
android:paddingTop="1.5dp"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
tools:text="99+"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/iv_news"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab3"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_me"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/main_bottom_bar_icon_me" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="@string/main_tab4"
|
||||
android:textColor="@drawable/text_color_two"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
modulemain/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
modulemain/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
modulemain/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
modulemain/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
modulemain/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
modulemain/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
modulemain/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
modulemain/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
modulemain/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
modulemain/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
8
modulemain/src/main/res/values-en-rUs/strings.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
|
||||
|
||||
<string name="main_tab1">Voice broadcasting</string>
|
||||
<string name="main_tab2">Language circle</string>
|
||||
<string name="main_tab3">news</string>
|
||||
<string name="main_tab4">vocal range</string>
|
||||
|
||||
</resources>
|
||||
3
modulemain/src/main/res/values-land/dimens.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">48dp</dimen>
|
||||
</resources>
|
||||
16
modulemain/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
3
modulemain/src/main/res/values-w1240dp/dimens.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">200dp</dimen>
|
||||
</resources>
|
||||
3
modulemain/src/main/res/values-w600dp/dimens.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">48dp</dimen>
|
||||
</resources>
|
||||
6
modulemain/src/main/res/values-w820dp/dimens.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<resources>
|
||||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
|
||||
(such as screen margins) for screens with more than 820dp of available width. This
|
||||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
|
||||
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||
</resources>
|
||||
7
modulemain/src/main/res/values-zh-rCN/strings.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<resources>
|
||||
<string name="app_name">moduleMain</string>
|
||||
<string name="main_tab1">声播</string>
|
||||
<string name="main_tab2">语圈</string>
|
||||
<string name="main_tab3">音信</string>
|
||||
<string name="main_tab4">音域</string>
|
||||
</resources>
|
||||
10
modulemain/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
</resources>
|
||||
8
modulemain/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="appbar_padding">16dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="appbar_padding_top">8dp</dimen>
|
||||
</resources>
|
||||
12
modulemain/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<resources>
|
||||
<string name="app_name">moduleMain</string>
|
||||
<string name="main_tab1">声播</string>
|
||||
<string name="main_tab2">语圈</string>
|
||||
<string name="main_tab3">音信</string>
|
||||
<string name="main_tab4">音域</string>
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
<string name="title_activity_ranking_list">RankingListActivity</string>
|
||||
<string name="tab_text_1">Tab 1</string>
|
||||
<string name="tab_text_2">Tab 2</string>
|
||||
</resources>
|
||||
25
modulemain/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.QxLive.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.QxLive.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<style name="Theme.QxLive.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.qxcm.modulemain;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||