update
@ -20,6 +20,11 @@ android {
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
}
|
||||
aaptOptions {
|
||||
cruncherEnabled = false
|
||||
@ -71,8 +76,9 @@ repositories {
|
||||
}
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies["appcompat-androidx"]
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
//common
|
||||
api project(path: ':common')
|
||||
@ -88,7 +94,9 @@ dependencies {
|
||||
implementation 'com.google.android.exoplayer:exoplayer:2.18.5'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.5@aar'
|
||||
|
||||
implementation 'cn.rongcloud.sdk:call_kit:5.5.0' // 音视频通话能力 UI 组件
|
||||
|
||||
implementation 'cn.rongcloud.sdk:call_kit:5.2.0' // 音视频通话能力 UI 组件
|
||||
implementation 'com.github.luqiming666:SwipeRecyclerView:1.4.8'//支持侧滑删除
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'com.blankj:utilcode:1.30.0'//獲取uuid
|
||||
|
||||
}
|
||||
|
@ -85,17 +85,18 @@
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
<application
|
||||
android:name=".AppContext"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:preserveLegacyExternalStorage="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:replace="theme,label,icon,allowBackup">
|
||||
<activity
|
||||
android:name=".activitys.LauncherActivity"
|
||||
android:name=".activity.LauncherActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@ -103,10 +104,28 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activitys.MainActivity"
|
||||
android:exported="false"
|
||||
android:name=".activity.MainActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.message.MsgMoreConfigActivity"
|
||||
android:exported="false" />
|
||||
|
||||
/>
|
||||
<activity
|
||||
android:name=".activity.message.ChatActivity"
|
||||
android:screenOrientation="fullSensor"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"/>
|
||||
<meta-data
|
||||
android:name="SERVER_HOST"
|
||||
android:value="${serverHost}" />
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ApplicationId"
|
||||
android:value="@string/facebook_app_id" />
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ClientToken"
|
||||
android:value="@string/facebook_client_token" />
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
|
||||
android:value="false" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
@ -1,10 +1,76 @@
|
||||
package com.shayu.onetoone;
|
||||
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
public class AppContext extends MultiDexApplication {
|
||||
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.shayu.onetoone.activity.fragments.message.ChatMessageFragment;
|
||||
import com.shayu.onetoone.activity.message.ChatActivity;
|
||||
import com.shayu.onetoone.utils.NeverCrashUtils;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
|
||||
import io.rong.imkit.RongIM;
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imlib.IMLibRTCClient;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Message;
|
||||
|
||||
public class AppContext extends CommonAppContext {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
NeverCrashUtils.getInstance()
|
||||
.setDebugMode(BuildConfig.DEBUG)
|
||||
.setMainCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
AppManager.runDebugCode(() -> {
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
Process.killProcess(Process.myPid());
|
||||
System.exit(0);
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
throw new RuntimeException(e);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
})
|
||||
.setUncaughtCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
})
|
||||
.register(this);
|
||||
FacebookSdk.setApplicationId("126035687816994");
|
||||
ARouter.openLog();
|
||||
ARouter.openDebug();
|
||||
ARouter.printStackTrace();
|
||||
ARouter.init(this);
|
||||
|
||||
String appKey = "pvxdm17jpd3hr";
|
||||
boolean enablePush = true;
|
||||
RongIM.init(this, appKey, enablePush);
|
||||
|
||||
RongcloudIMManager.initRongIM(this);
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
public boolean onReceived(Message message, int left, boolean hasPackage, boolean offline) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
RouteUtils.registerActivity(RouteUtils.RongActivityType.ConversationActivity, ChatActivity.class);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public abstract class AbsOTOActivity extends AppCompatActivity {
|
||||
public Context mContext;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(getLayoutId());
|
||||
mContext = this;
|
||||
main(savedInstanceState);
|
||||
View view=findViewById(R.id.btn_back);
|
||||
if(view!=null){
|
||||
view.setOnClickListener(v -> finish());
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
protected abstract void main(Bundle savedInstanceState);
|
||||
|
||||
public void setTitle(String title) {
|
||||
TextView view = findViewById(R.id.title);
|
||||
if (view != null) {
|
||||
view.setText(title);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.DeviceUtils;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.event.UpdateTablePointMe;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.JsonBean;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class LauncherActivity extends AbsOTOActivity {
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_launcher;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
//临时用的登录代码,将就下
|
||||
HttpClient.getInstance().get("Login.userLogin", "setLoginInfo")
|
||||
.params("user_login", "95001")
|
||||
.params("user_pass", "123")
|
||||
.params("pushid", "")
|
||||
.params("lastlogindevice", "Android")
|
||||
.params("uuid_Device", DeviceUtils.getUniqueDeviceId())
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
String uid = obj.getString("id");
|
||||
String token = obj.getString("token");
|
||||
// mFirstLogin = obj.getIntValue("first_login") == 1;
|
||||
// mShowInvite = obj.getIntValue("isagent") == 1;
|
||||
CommonAppConfig.getInstance().setLoginInfo(uid, token, true);
|
||||
//设置登录信息
|
||||
IMLoginModel model = GsonUtils.fromJson(info[0], IMLoginModel.class);
|
||||
IMLoginManager.get(mContext).setupLoginUser(model);
|
||||
connectRongCloud();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void connectRongCloud() {
|
||||
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).upDataUserInfo(info[0]);
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
UserBean bean = JSON.toJavaObject(obj, UserBean.class);
|
||||
bean.setMedalName(obj.getString("medal_name"));
|
||||
bean.setMedalLevel(obj.getIntValue("medal_level"));
|
||||
CommonAppConfig.getInstance().setUserBean(bean);
|
||||
CommonAppConfig.getInstance().setUserItemList(obj.getString("list"));
|
||||
bean.seUserInfoComplete(obj.getIntValue("user_info_complete"));
|
||||
SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, info[0]);
|
||||
|
||||
|
||||
//融云连接服务器
|
||||
RongcloudIMManager.connectIM(mContext);
|
||||
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
System.out.println("code = " + code + ", msg = " + msg + ", info = " + Arrays.toString(info));
|
||||
RouteManager.forwardMainActivity();
|
||||
finish();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<JsonBean> response) {
|
||||
super.onError(response);
|
||||
String message = response.message();
|
||||
System.out.println(">>>>>" + message);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,23 +1,24 @@
|
||||
package com.shayu.onetoone.activitys;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.angcyo.tablayout.DslTabLayout;
|
||||
import com.angcyo.tablayout.DslTabLayoutConfig;
|
||||
import com.angcyo.tablayout.delegate2.ViewPager2Delegate;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activitys.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.activitys.fragments.DynamicFragment;
|
||||
import com.shayu.onetoone.activitys.fragments.FriendsFragment;
|
||||
import com.shayu.onetoone.activitys.fragments.MessageFragment;
|
||||
import com.shayu.onetoone.activitys.fragments.MyFragment;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.activity.fragments.DynamicFragment;
|
||||
import com.shayu.onetoone.activity.fragments.FriendsFragment;
|
||||
import com.shayu.onetoone.activity.fragments.MessageFragment;
|
||||
import com.shayu.onetoone.activity.fragments.MyFragment;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -26,16 +27,14 @@ import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function4;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
@Route(path = RouteManager.ACTIVITY_MAIN)
|
||||
public class MainActivity extends AbsOTOActivity {
|
||||
List<BaseFragment> fragments = new ArrayList<>();
|
||||
private ViewPager2 viewPager;
|
||||
private DslTabLayout dslTabLayout;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
fragments.add(new FriendsFragment());
|
||||
fragments.add(new DynamicFragment());
|
||||
fragments.add(new MessageFragment());
|
||||
@ -56,8 +55,29 @@ public class MainActivity extends AppCompatActivity {
|
||||
return fragments.size();
|
||||
}
|
||||
});
|
||||
|
||||
viewPager.setUserInputEnabled(false);
|
||||
ViewPager2Delegate.Companion.install(viewPager, dslTabLayout, false);
|
||||
|
||||
dslTabLayout.configTabLayoutConfig(new Function1<DslTabLayoutConfig, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(DslTabLayoutConfig dslTabLayoutConfig) {
|
||||
dslTabLayoutConfig.setOnSelectItemView(new Function4<View, Integer, Boolean, Boolean, Boolean>() {
|
||||
@Override
|
||||
public Boolean invoke(View itemView, Integer index, Boolean select, Boolean fromUse) {
|
||||
if (select) {
|
||||
viewPager.setCurrentItem(index);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_main;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.shayu.onetoone.activity.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
public abstract class BaseFragment extends Fragment {
|
||||
public Context mContext;
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View itemView = createView(inflater, container, savedInstanceState);
|
||||
this.mContext = getContext();
|
||||
initView(itemView);
|
||||
return itemView;
|
||||
}
|
||||
|
||||
public abstract void initView(View itemView);
|
||||
|
||||
public abstract View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState);
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.shayu.onetoone.activity.fragments;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public class DynamicFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public void initView(View itemView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_dynamic, container, false);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.shayu.onetoone.activitys.fragments;
|
||||
package com.shayu.onetoone.activity.fragments;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
@ -6,15 +6,16 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public class FriendsFragment extends BaseFragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
public void initView(View itemView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_friends, container, false);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.shayu.onetoone.activitys.fragments;
|
||||
package com.shayu.onetoone.activity.fragments;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
@ -7,7 +7,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
@ -15,9 +14,11 @@ import androidx.viewpager2.widget.ViewPager2;
|
||||
import com.angcyo.tablayout.DslTabLayout;
|
||||
import com.angcyo.tablayout.DslTabLayoutConfig;
|
||||
import com.angcyo.tablayout.delegate2.ViewPager2Delegate;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activitys.message.MsgFriendFragment;
|
||||
import com.shayu.onetoone.activitys.message.MsgMessageFragment;
|
||||
import com.shayu.onetoone.activity.fragments.message.MsgFriendFragment;
|
||||
import com.shayu.onetoone.activity.fragments.message.MsgMessageFragment;
|
||||
import com.shayu.onetoone.dialog.MsgMoreDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -26,20 +27,24 @@ import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function4;
|
||||
|
||||
public class MessageFragment extends BaseFragment {
|
||||
public class MessageFragment extends BaseFragment implements View.OnClickListener {
|
||||
List<BaseFragment> fragments = new ArrayList<>();
|
||||
View more;
|
||||
XPopup.Builder moreXPopup;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_msg, container, false);
|
||||
initView(view);
|
||||
return view;
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_msg, container, false);
|
||||
}
|
||||
|
||||
private void initView(View itemView) {
|
||||
@Override
|
||||
public void initView(View itemView) {
|
||||
ViewPager2 viewPager2 = itemView.findViewById(R.id.viewPager);
|
||||
DslTabLayout tabLayout = itemView.findViewById(R.id.dslTabLayout);
|
||||
more = itemView.findViewById(R.id.more);
|
||||
more.setOnClickListener(this);
|
||||
moreXPopup = new XPopup.Builder(getContext()).watchView(more);
|
||||
viewPager2.setUserInputEnabled(false);
|
||||
//绑定ViewPager2到tabLayout
|
||||
ViewPager2Delegate.Companion.install(viewPager2, tabLayout, false);
|
||||
|
||||
@ -74,4 +79,17 @@ public class MessageFragment extends BaseFragment {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showMoreDialog() {
|
||||
moreXPopup.asCustom(new MsgMoreDialog(mContext)).show();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
if (id == R.id.more) {
|
||||
showMoreDialog();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.shayu.onetoone.activity.fragments;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public class MyFragment extends BaseFragment {
|
||||
@Override
|
||||
public void initView(View itemView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.activity_msg_config, container, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import static io.rong.imkit.conversation.extension.component.inputpanel.InputPanel.InputStyle.STYLE_CONTAINER_EXTENSION;
|
||||
import static io.rong.imkit.conversation.extension.component.inputpanel.InputPanel.InputStyle.STYLE_SWITCH_CONTAINER_EXTENSION;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
public class ChatMessageFragment extends ConversationFragment {
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||
String targetId = "user1";
|
||||
Message.SentStatus sentStatus = Message.SentStatus.SENT;
|
||||
TextMessage content = TextMessage.obtain("这里是消息内容");
|
||||
long sentTime = System.currentTimeMillis();
|
||||
IMCenter.getInstance().insertOutgoingMessage(conversationType, targetId, sentStatus, content, sentTime, new RongIMClient.ResultCallback<Message>() {
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
ToastUtil.show("消息发送成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
ToastUtil.show("消息发送失败:"+e.msg);
|
||||
Log.i("聊天", "onError: "+e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
|
||||
public class MsgFriendFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public void initView(View itemView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_msg_friend, container, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.adapter.MsgMessageRecyclerViewAdapter;
|
||||
import com.shayu.onetoone.bean.MsgMessageBean;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yanzhenjie.recyclerview.OnItemClickListener;
|
||||
import com.yanzhenjie.recyclerview.OnItemMenuClickListener;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuBridge;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuCreator;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuItem;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.ConversationIdentifier;
|
||||
|
||||
public class MsgMessageFragment extends BaseFragment {
|
||||
SwipeRecyclerView recyclerView;
|
||||
SwipeRefreshLayout swipeRefreshLayout;
|
||||
ConstraintLayout netError;
|
||||
MsgMessageRecyclerViewAdapter adapter;
|
||||
List<MsgMessageBean> list;
|
||||
|
||||
@Override
|
||||
public void initView(View itemView) {
|
||||
recyclerView = itemView.findViewById(R.id.recyclerView);
|
||||
swipeRefreshLayout = itemView.findViewById(R.id.swipeRefreshLayout);
|
||||
netError = itemView.findViewById(R.id.net_error);
|
||||
adapter = new MsgMessageRecyclerViewAdapter(getContext());
|
||||
list = new ArrayList<>();
|
||||
initData();
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
recyclerView.setSwipeMenuCreator(initSwipeMenuCreator());
|
||||
initMoreListener();
|
||||
initRefreshListener();
|
||||
recyclerView.setOnItemMenuClickListener(new OnItemMenuClickListener() {
|
||||
@Override
|
||||
public void onItemClick(SwipeMenuBridge menuBridge, int adapterPosition) {
|
||||
menuBridge.closeMenu();
|
||||
if (menuBridge.getPosition() == 0) {
|
||||
ToastUtil.showDebug("置顶:" + adapter.getList().get(adapterPosition).getNickname());
|
||||
} else {
|
||||
ToastUtil.showDebug("删除:" + adapter.getList().get(adapterPosition).getNickname());
|
||||
adapter.getList().remove(adapterPosition);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
recyclerView.setOnItemClickListener(new OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int i) {
|
||||
RouteManager.forwardMsgChatActivity();
|
||||
}
|
||||
});
|
||||
recyclerView.setAdapter(adapter);
|
||||
adapter.setList(list);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_msg_message, container, false);
|
||||
}
|
||||
|
||||
private SwipeMenuCreator initSwipeMenuCreator() {
|
||||
SwipeMenuCreator creator = (leftMenu, rightMenu, position) -> {
|
||||
SwipeMenuItem top = new SwipeMenuItem(getContext());
|
||||
SwipeMenuItem del = new SwipeMenuItem(getContext());
|
||||
top.setBackgroundColor(Color.parseColor("#D9D9D9"));
|
||||
del.setBackgroundColor(Color.parseColor("#FE5268"));
|
||||
top.setText("置顶");
|
||||
del.setText("删除");
|
||||
top.setHeight(ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
top.setWidth(DpUtil.dp2px(71));
|
||||
del.setHeight(ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
del.setWidth(DpUtil.dp2px(71));
|
||||
|
||||
rightMenu.addMenuItem(top);
|
||||
rightMenu.addMenuItem(del);
|
||||
|
||||
};
|
||||
return creator;
|
||||
}
|
||||
|
||||
private void initMoreListener() {
|
||||
SwipeRecyclerView.LoadMoreListener moreListener = new SwipeRecyclerView.LoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
List<MsgMessageBean> tmp =
|
||||
new ArrayList<>(list);
|
||||
initData();
|
||||
tmp.addAll(list);
|
||||
adapter.setList(tmp);
|
||||
list = new ArrayList<>(tmp);
|
||||
recyclerView.loadMoreFinish(false, true);
|
||||
}
|
||||
};
|
||||
recyclerView.setLoadMoreListener(moreListener);
|
||||
}
|
||||
|
||||
private void initRefreshListener() {
|
||||
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
initData();
|
||||
adapter.setList(list);
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
list = new ArrayList<>();
|
||||
for (int i = 0; i < 20; i++) {
|
||||
MsgMessageBean bean = new MsgMessageBean();
|
||||
bean.setId(i);
|
||||
bean.setNickname("名字" + i);
|
||||
bean.setContent("内容" + i);
|
||||
bean.setTime("时间:" + i);
|
||||
if (i % 5 == 0) {
|
||||
bean.setNotRead(true);
|
||||
bean.setNotReadNum(i);
|
||||
}
|
||||
if (i % 2 == 0) {
|
||||
bean.setAvatar("https://downs.yaoulive.com/%E4%BA%A4%E5%8F%89%2015%403x.png");
|
||||
} else {
|
||||
bean.setAvatar("https://downs.yaoulive.com/%E4%BA%A4%E5%8F%89%2014%403x.png");
|
||||
}
|
||||
list.add(bean);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.shayu.onetoone.activity.message;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||
import com.shayu.onetoone.activity.fragments.message.ChatMessageFragment;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
|
||||
@Route(path = RouteManager.ACTIVITY_MSG_CHAT)
|
||||
public class ChatActivity extends AbsOTOActivity {
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_msg_chat;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
ConversationFragment conversationFragment = new ChatMessageFragment();
|
||||
FragmentManager manager = getSupportFragmentManager();
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
transaction.replace(R.id.container, conversationFragment);
|
||||
transaction.commit();
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.shayu.onetoone.activity.message;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||
import com.shayu.onetoone.adapter.MsgGreetConfigAdapter;
|
||||
import com.shayu.onetoone.bean.MsgGreetConfigBean;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
|
||||
@Route(path = RouteManager.ACTIVITY_MSG_MORE_CONFIG_ACTIVITY)
|
||||
public class MsgMoreConfigActivity extends AbsOTOActivity {
|
||||
RecyclerView recyclerView;
|
||||
MsgGreetConfigAdapter adapter;
|
||||
SwitchCompat msgSwitch;
|
||||
View add;
|
||||
View editLayout;
|
||||
Button cancel, apply;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_msg_config;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
setTitle("打招呼設置");
|
||||
recyclerView = findViewById(R.id.msg_recyclerView);
|
||||
msgSwitch = findViewById(R.id.msg_switch);
|
||||
add = findViewById(R.id.add_msg);
|
||||
cancel = findViewById(R.id.btn_cancel);
|
||||
apply = findViewById(R.id.btn_apply);
|
||||
editLayout = findViewById(R.id.edit_layout);
|
||||
|
||||
adapter = new MsgGreetConfigAdapter(this);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
recyclerView.setAdapter(adapter);
|
||||
adapter.setDeleteListener((size, position) -> {
|
||||
if (size >= 10) {
|
||||
add.setVisibility(View.GONE);
|
||||
} else {
|
||||
add.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
add.setOnClickListener(v -> {
|
||||
adapter.addItem(new MsgGreetConfigBean());
|
||||
if (adapter.getItemCount() >= 10) {
|
||||
add.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
msgSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> editLayout.setVisibility(isChecked ? View.VISIBLE : View.GONE));
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package com.shayu.onetoone.activitys;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public class LauncherActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_launcher);
|
||||
startActivity(new Intent(this, MainActivity.class));
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package com.shayu.onetoone.activitys.fragments;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
public class BaseFragment extends Fragment {
|
||||
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package com.shayu.onetoone.activitys.fragments;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public class DynamicFragment extends BaseFragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_dynamic, container, false);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package com.shayu.onetoone.activitys.fragments;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public class MyFragment extends BaseFragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_my, container, false);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package com.shayu.onetoone.activitys.message;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activitys.fragments.BaseFragment;
|
||||
|
||||
public class MsgFriendFragment extends BaseFragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_msg_friend,container,false);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package com.shayu.onetoone.activitys.message;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activitys.fragments.BaseFragment;
|
||||
|
||||
public class MsgMessageFragment extends BaseFragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_msg_message, container, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MsgGreetConfigBean;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAdapter.ViewHolder> {
|
||||
List<MsgGreetConfigBean> mList;
|
||||
Context mContext;
|
||||
OnItemClickListener<Integer> deleteListener;
|
||||
|
||||
public MsgGreetConfigAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
this.mList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setList(List<MsgGreetConfigBean> mList) {
|
||||
this.mList = mList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setDeleteListener(OnItemClickListener<Integer> deleteListener) {
|
||||
this.deleteListener = deleteListener;
|
||||
}
|
||||
|
||||
public List<MsgGreetConfigBean> getNotEmptyList() {
|
||||
List<MsgGreetConfigBean> tmp = new ArrayList<>();
|
||||
for (MsgGreetConfigBean bean : mList) {
|
||||
if (bean.getContent() != null) {
|
||||
tmp.add(bean);
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_msg_greet_config, viewGroup, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
|
||||
viewHolder.setData(mList.get(i), i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public void addItem(MsgGreetConfigBean msgGreetConfigBean) {
|
||||
mList.add(msgGreetConfigBean);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private EditText editText;
|
||||
private View edit;
|
||||
private View del;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
editText = itemView.findViewById(R.id.editTextText);
|
||||
edit = itemView.findViewById(R.id.edit);
|
||||
del = itemView.findViewById(R.id.del);
|
||||
editText.setEnabled(false);
|
||||
}
|
||||
|
||||
public void setData(MsgGreetConfigBean bean, int position) {
|
||||
del.setOnClickListener(v -> {
|
||||
mList.remove(position);
|
||||
if (deleteListener != null) {
|
||||
deleteListener.onItemClick(mList.size(), position);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
});
|
||||
edit.setOnClickListener(v -> {
|
||||
editText.setEnabled(true);
|
||||
editText.requestFocus();
|
||||
});
|
||||
if (bean.getContent() == null) {
|
||||
editText.setEnabled(true);
|
||||
editText.setText("");
|
||||
} else {
|
||||
editText.setText(bean.getContent());
|
||||
editText.setEnabled(false);
|
||||
}
|
||||
|
||||
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
Log.i("编辑", "onFocusChange: " + hasFocus);
|
||||
if (!hasFocus && editText.getText().toString().length() > 0) {
|
||||
mList.get(position).setContent(editText.getText().toString());
|
||||
editText.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MsgMessageBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MsgMessageRecyclerViewAdapter extends RecyclerView.Adapter<MsgMessageRecyclerViewAdapter.ViewHolder> {
|
||||
List<MsgMessageBean> list;
|
||||
Context mContext;
|
||||
|
||||
public MsgMessageRecyclerViewAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<MsgMessageBean> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<MsgMessageBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_msg_message, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.setData(list.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView avatar;
|
||||
TextView name;
|
||||
TextView content;
|
||||
TextView time;
|
||||
TextView read;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
avatar = itemView.findViewById(R.id.msg_message_avatar);
|
||||
name = itemView.findViewById(R.id.msg_message_title);
|
||||
content = itemView.findViewById(R.id.msg_message_content);
|
||||
time = itemView.findViewById(R.id.msg_message_content_time);
|
||||
read = itemView.findViewById(R.id.msg_message_content_not_read);
|
||||
}
|
||||
|
||||
public void setData(MsgMessageBean bean, int position) {
|
||||
if (bean.isNotRead()) {
|
||||
read.setVisibility(View.VISIBLE);
|
||||
read.setText(bean.getNotReadNum() + "");
|
||||
} else {
|
||||
read.setVisibility(View.GONE);
|
||||
}
|
||||
ImgLoader.display(mContext, bean.getAvatar(), avatar);
|
||||
name.setText(bean.getNickname());
|
||||
content.setText(bean.getContent());
|
||||
time.setText(String.format("·%s", bean.getTime()));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class MsgGreetConfigBean extends BaseModel {
|
||||
private int id;
|
||||
private String content;
|
||||
|
||||
public MsgGreetConfigBean(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public MsgGreetConfigBean() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MsgGreetConfigBean{" +
|
||||
"id=" + id +
|
||||
", content='" + content + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class MsgMessageBean extends BaseModel {
|
||||
private int id;
|
||||
private String avatar;
|
||||
private String nickname;
|
||||
private String content;
|
||||
private String time;
|
||||
private boolean isNotRead;//是否有未读
|
||||
private int notReadNum;//未读数量
|
||||
|
||||
public MsgMessageBean() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public boolean isNotRead() {
|
||||
return isNotRead;
|
||||
}
|
||||
|
||||
public void setNotRead(boolean notRead) {
|
||||
isNotRead = notRead;
|
||||
}
|
||||
|
||||
public int getNotReadNum() {
|
||||
return notReadNum;
|
||||
}
|
||||
|
||||
public void setNotReadNum(int notReadNum) {
|
||||
this.notReadNum = notReadNum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MsgMessageBean{" +
|
||||
"id=" + id +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", nickname='" + nickname + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", time='" + time + '\'' +
|
||||
", isNotRead=" + isNotRead +
|
||||
", notReadNum=" + notReadNum +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.shayu.onetoone.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
|
||||
public class MsgMoreDialog extends AttachPopupView implements View.OnClickListener {
|
||||
View config, read;
|
||||
|
||||
public MsgMoreDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_msg_more;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
config = findViewById(R.id.ll_config);
|
||||
read = findViewById(R.id.ll_read);
|
||||
config.setOnClickListener(this);
|
||||
read.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
if (id == R.id.ll_config) {
|
||||
RouteManager.forwardMsgMoreConfigActivity();
|
||||
} else if (id == R.id.ll_read) {
|
||||
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.shayu.onetoone.manager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
|
||||
/**
|
||||
* 路由跳转Activity
|
||||
*/
|
||||
public class RouteManager {
|
||||
public static final String ACTIVITY_MAIN = "/activity/MainActivity";
|
||||
public static final String ACTIVITY_MSG_MORE_CONFIG_ACTIVITY = "/activity/MsgMoreConfigActivity";
|
||||
public static final String ACTIVITY_MSG_CHAT = "/activity/ChatActivity";
|
||||
|
||||
|
||||
public static void forwardMainActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_MAIN)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardMsgMoreConfigActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_MSG_MORE_CONFIG_ACTIVITY)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardMsgChatActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_MSG_CHAT)
|
||||
.navigation();
|
||||
}
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
package com.shayu.onetoone.utils;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.FileUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @ClassName NeverCrashUtils
|
||||
* @Description 全局捕获异常
|
||||
*/
|
||||
public class NeverCrashUtils {
|
||||
|
||||
private final static String TAG = NeverCrashUtils.class.getSimpleName();
|
||||
private final static NeverCrashUtils INSTANCE = new NeverCrashUtils();
|
||||
|
||||
private boolean debugMode;
|
||||
private MainCrashHandler mainCrashHandler;
|
||||
private UncaughtCrashHandler uncaughtCrashHandler;
|
||||
|
||||
private NeverCrashUtils() {
|
||||
}
|
||||
|
||||
public static NeverCrashUtils getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private synchronized MainCrashHandler getMainCrashHandler() {
|
||||
if (null == mainCrashHandler) {
|
||||
mainCrashHandler = (t, e) -> {
|
||||
};
|
||||
}
|
||||
return mainCrashHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主线程发生异常时的回调,可用于打印日志文件
|
||||
* <p>
|
||||
* 注意跨线程操作的可能
|
||||
*/
|
||||
public NeverCrashUtils setMainCrashHandler(MainCrashHandler mainCrashHandler) {
|
||||
this.mainCrashHandler = mainCrashHandler;
|
||||
return this;
|
||||
}
|
||||
|
||||
private synchronized UncaughtCrashHandler getUncaughtCrashHandler() {
|
||||
if (null == uncaughtCrashHandler) {
|
||||
uncaughtCrashHandler = (t, e) -> {
|
||||
};
|
||||
}
|
||||
return uncaughtCrashHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* 子线程发生异常时的回调,可用于打印日志文件
|
||||
* <p>
|
||||
* 注意跨线程操作的可能
|
||||
*/
|
||||
public NeverCrashUtils setUncaughtCrashHandler(UncaughtCrashHandler uncaughtCrashHandler) {
|
||||
this.uncaughtCrashHandler = uncaughtCrashHandler;
|
||||
return this;
|
||||
}
|
||||
|
||||
private boolean isDebugMode() {
|
||||
return debugMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* debug模式,会打印log日志,且toast提醒发生异常,反之则都没有
|
||||
*/
|
||||
public NeverCrashUtils setDebugMode(boolean debugMode) {
|
||||
this.debugMode = debugMode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成监听异常的注册
|
||||
*
|
||||
* @param application application
|
||||
*/
|
||||
private boolean errorWhile = true;
|
||||
|
||||
public void register(Application application) {
|
||||
//主线程异常拦截
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
while (errorWhile) {
|
||||
try {
|
||||
Looper.loop();
|
||||
} catch (Throwable e) {
|
||||
if (isDebugMode()) {
|
||||
Log.e(TAG, "未捕获的主线程异常行为", e);
|
||||
}
|
||||
e.printStackTrace();
|
||||
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||
AppManager.runDebugCode(() -> errorWhile = false);
|
||||
// return;
|
||||
}
|
||||
}
|
||||
});
|
||||
/*
|
||||
//子线程异常拦截
|
||||
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
|
||||
if (isDebugMode()) {
|
||||
Log.e(TAG, "未捕获的子线程异常行为", e);
|
||||
}
|
||||
e.printStackTrace();
|
||||
Toast.makeText(application, "发生闪退", Toast.LENGTH_SHORT).show();
|
||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()),throwableToString(e),"error.log");
|
||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||
getUncaughtCrashHandler().uncaughtException(t, e);
|
||||
|
||||
});*/
|
||||
}
|
||||
|
||||
public interface MainCrashHandler {
|
||||
void mainException(Thread t, Throwable e);
|
||||
}
|
||||
|
||||
public interface UncaughtCrashHandler {
|
||||
void uncaughtException(Thread t, Throwable e);
|
||||
}
|
||||
|
||||
private static String throwableToString(Throwable e) {
|
||||
StringWriter writer = new StringWriter();
|
||||
writer.write("time=" + System.currentTimeMillis() + "\n");
|
||||
writer.write("AndroidVersion=" + Build.VERSION.SDK_INT + "\n");
|
||||
writer.write("AndroidName=" + Build.VERSION.RELEASE + "\n");
|
||||
writer.write("PhoneName=" + Build.BRAND + "\n");
|
||||
writer.write("Phone=" + Build.MODEL + "\n");
|
||||
writer.write("CPU=" + Arrays.toString(Build.SUPPORTED_ABIS) + "\n");
|
||||
writer.write("runTime=" + (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime()) + "\n");
|
||||
writer.write("enterRoom=" + CrashSaveBean.getInstance().getEnterRoom() + "\n");
|
||||
writer.write("slidingRoom=" + CrashSaveBean.getInstance().getSlidingRoom() + "\n");
|
||||
writer.write("playSvga=" + CrashSaveBean.getInstance().getPlaySvga() + "\n");
|
||||
writer.write("ActivitySize=" + CrashSaveBean.getInstance().getActivitySize() + "\n");
|
||||
writer.write("UserData=" + SpUtil.getInstance().getStringValue(SpUtil.USER_INFO) + "\n");
|
||||
writer.write("[ERROR]");
|
||||
PrintWriter printWriter = new PrintWriter(writer);
|
||||
e.printStackTrace(printWriter);
|
||||
return writer.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="118dp" android:height="42dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ff8e7ddf" />
|
||||
<corners android:topLeftRadius="23dp" android:topRightRadius="23dp" android:bottomLeftRadius="23dp" android:bottomRightRadius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="118dp" android:height="42dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffd1d1d1" />
|
||||
<corners android:topLeftRadius="23dp" android:topRightRadius="23dp" android:bottomLeftRadius="23dp" android:bottomRightRadius="23dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
12
OneToOne/src/main/res/drawable/bg_msg_more_config.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="343dp" android:height="40dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffffffff" />
|
||||
<corners android:topLeftRadius="20dp" android:topRightRadius="20dp" android:bottomLeftRadius="20dp" android:bottomRightRadius="20dp" />
|
||||
<item android:name="android:shadowColor">#d000000</item>
|
||||
<item android:name="android:shadowDx">0</item>
|
||||
<item android:name="android:shadowDy">4</item>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
12
OneToOne/src/main/res/drawable/bg_msg_more_config_img.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="343dp" android:height="110dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffffffff" />
|
||||
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp" android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" />
|
||||
<item android:name="android:shadowColor">#d000000</item>
|
||||
<item android:name="android:shadowDx">0</item>
|
||||
<item android:name="android:shadowDy">4</item>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
12
OneToOne/src/main/res/drawable/bg_msg_more_config_top.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="343dp" android:height="71dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffffffff" />
|
||||
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp" android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" />
|
||||
<item android:name="android:shadowColor">#d000000</item>
|
||||
<item android:name="android:shadowDx">0</item>
|
||||
<item android:name="android:shadowDy">4</item>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_red_point.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="18dp" android:height="18dp">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#ffff4986" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
71
OneToOne/src/main/res/layout-v26/item_msg_message.xml
Normal file
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/msg_message_avatar"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_message_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/msg_message_content"
|
||||
app:layout_constraintStart_toEndOf="@+id/msg_message_avatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/msg_message_avatar"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_message_content"
|
||||
android:layout_width="185dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/msg_message_avatar"
|
||||
app:layout_constraintStart_toEndOf="@+id/msg_message_avatar"
|
||||
tools:text="@tools:sample/lorem[4:10]" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_message_content_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/msg_message_content"
|
||||
tools:text="@tools:sample/date/hhmm" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_message_content_not_read"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:autoSizeMaxTextSize="14sp"
|
||||
android:autoSizeMinTextSize="5sp"
|
||||
android:autoSizeStepGranularity="1sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:background="@drawable/bg_red_point"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
|
||||
|
||||
android:textColor="#fff"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -5,6 +5,6 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activitys.LauncherActivity">
|
||||
tools:context=".activity.LauncherActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activitys.MainActivity">
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewPager"
|
||||
|
16
OneToOne/src/main/res/layout/activity_msg_chat.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/color_b14066"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
141
OneToOne/src/main/res/layout/activity_msg_config.xml
Normal file
@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
layout="@layout/view_activity_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ll_config"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/bg_msg_more_config_top"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@+id/include">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="21dp"
|
||||
android:text="打招呼文案"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/msg_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:checked="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/edit_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_config">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/msg_recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:listitem="@layout/item_msg_greet_config" />
|
||||
|
||||
<include
|
||||
android:id="@+id/add_msg"
|
||||
layout="@layout/view_msg_greet_config_add"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/upload_img"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="110dp"
|
||||
android:layout_marginTop="17dp"
|
||||
android:background="@drawable/bg_msg_more_config_img">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="9dp"
|
||||
android:text="上传图片(非必選)"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView5"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView5"
|
||||
android:layout_width="33dp"
|
||||
android:layout_height="33dp"
|
||||
android:layout_marginStart="110dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_msg_more_config_add_image" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="49dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="118dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:background="@drawable/bg_msg_greet_config_btn_cancel"
|
||||
android:text="清除设置"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_apply"
|
||||
android:layout_width="118dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/bg_msg_greet_config_btn_apply"
|
||||
android:text="保存设置"
|
||||
android:textColor="#FFFFFF"
|
||||
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
61
OneToOne/src/main/res/layout/dialog_msg_more.xml
Normal file
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/bg_msg_more"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_config"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@mipmap/ic_msg_more_config" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:gravity="center"
|
||||
android:text="打招呼设置"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_read"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@mipmap/ic_msg_more_read" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:gravity="center"
|
||||
android:text="一键已读"
|
||||
android:textColor="#FF4A85"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -1,6 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/net_error"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="41dp"
|
||||
android:background="#FEE9EE"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:src="@mipmap/ic_message_tab_right"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/textView5"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:src="@mipmap/ic_message_tab_error"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView5"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="网络不给力,请检查网络设置"
|
||||
android:textColor="#E26891"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/net_error">
|
||||
|
||||
<com.yanzhenjie.recyclerview.SwipeRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/item_msg_message" />
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
47
OneToOne/src/main/res/layout/item_msg_greet_config.xml
Normal file
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="17dp"
|
||||
android:background="@drawable/bg_msg_more_config">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:background="#00FFFFFF"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:hint="请输入文案"
|
||||
android:textColor="#333333"
|
||||
android:textColorHint="#BEBDBD"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/edit"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:autofillHints="" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/del"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_msg_more_config_del" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="29dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/del"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_msg_more_config_edit" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
66
OneToOne/src/main/res/layout/item_msg_message.xml
Normal file
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/msg_message_avatar"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_message_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/msg_message_content"
|
||||
app:layout_constraintStart_toEndOf="@+id/msg_message_avatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/msg_message_avatar"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_message_content"
|
||||
android:layout_width="185dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/msg_message_avatar"
|
||||
app:layout_constraintStart_toEndOf="@+id/msg_message_avatar"
|
||||
tools:text="@tools:sample/lorem[4:10]" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_message_content_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/msg_message_content"
|
||||
tools:text="@tools:sample/date/hhmm" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_message_content_not_read"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:background="@drawable/bg_red_point"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
|
||||
android:textColor="#fff"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
104
OneToOne/src/main/res/layout/rc_conversation_fragment.xml
Normal file
@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/rc_background_main_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/rc_refresh"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/rc_extension"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rc_message_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never" />
|
||||
</io.rong.imkit.widget.refresh.SmartRefreshLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_new_message_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:background="@drawable/rc_conversation_newmsg"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="12dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="@id/rc_refresh"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_unread_message_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/rc_unread_height"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_30"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_unread_msg_bg_style"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:minWidth="120dp"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_mention_message_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/rc_unread_height"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_80"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_unread_msg_bg_style"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:minWidth="120dp"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:text="@string/rc_mention_messages"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<io.rong.imkit.conversation.extension.RongExtension
|
||||
android:id="@+id/rc_extension"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
app:RCStyle="SCE"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/rc_refresh" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rc_notification_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#660F0F0F"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
30
OneToOne/src/main/res/layout/view_activity_title.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="18dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_top_break" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="TextView" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
32
OneToOne/src/main/res/layout/view_msg_greet_config_add.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="17dp"
|
||||
android:background="@drawable/bg_msg_more_config"
|
||||
android:layout_height="40dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="添加更多"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView4"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView7"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_msg_more_config_add" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
BIN
OneToOne/src/main/res/mipmap-xxhdpi/bg_msg_more.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_more_config.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_more_config_add.png
Normal file
After Width: | Height: | Size: 618 B |
After Width: | Height: | Size: 1.8 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_more_config_del.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_more_config_edit.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_more_read.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_top_break.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
24
OneToOne/src/main/res/values/style.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="Base.Theme.NoActionBar">
|
||||
<item name="colorPrimary">#8E7DDF</item>
|
||||
<item name="colorPrimaryDark">#8E7DDF</item>
|
||||
<item name="colorAccent">#8E7DDF</item>
|
||||
<item name="android:colorBackground">#F3F4F6</item>
|
||||
<item name="android:windowAnimationStyle">@style/AnimationActivity</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">#8E7DDF</item>
|
||||
</style>
|
||||
|
||||
<style name="dialog" parent="AppTheme">
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@color/transparent</item>
|
||||
<item name="android:backgroundDimAmount">0.5</item>
|
||||
<!--显示区域以外是否使用黑色半透明背景-->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
</style>
|
||||
</resources>
|
@ -10,7 +10,7 @@ buildscript {
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url 'https://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@ -37,9 +37,9 @@ allprojects {
|
||||
maven { url "https://mvn.mob.com/android" }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'http://developer.huawei.com/repo'}//华为库
|
||||
maven { url 'https://developer.huawei.com/repo'}//华为库
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url 'https://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url "https://jitpack.io" }
|
||||
google() // Google's Maven repository
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
#Thu Feb 04 00:05:45 CST 2021
|
||||
android.injected.testOnly=false
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
org.gradle.parallel=true
|
||||
org.gradle.configureondemand=true
|
||||
android.useAndroidX=true
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,4 +1,4 @@
|
||||
#Mon Sep 17 11:16:30 CST 2018
|
||||
#Thu Sep 28 15:02:07 CST 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|