前言
带你实现女朋友骑虎难下的 App
需要
- 须要日记本,花言巧语要记录
- 须要只能和 ta 聊天模块
- 须要能够记录要害日期,防止遗记送命
0202年了,Android开发大都应该是老油条了把。这太简略,咱们开始入手。
我晓得没图是骗不到人的。先放图,大家看一下最终实现的成果。
即时通讯局部
应用了融云 sdk 集成了单聊局部
配置布局文件
这是您的会话列表 Activity 对应的布局文件:conversationlist.xml。留神 android:name 固定为融云的 ConversationListFragment。
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:id="@+id/conversationlist" android:name="io.rong.imkit.fragment.ConversationListFragment" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout>
新建 Activity
public class ConversationListActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.conversationlist); FragmentManager fragmentManage = getSupportFragmentManager(); ConversationListFragment fragement = (ConversationListFragment) fragmentManage.findFragmentById(R.id.conversationlist); Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon() .appendPath("conversationlist") .appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") .appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "false") .appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false") .appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false") .appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true") .build(); fragement.setUri(uri); } }
<!--会话列表--> <activity android:name="io.rong.fast.activity.ConversationListActivity" android:screenOrientation="portrait" android:windowSoftInputMode="stateHidden|adjustResize"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:host="io.rong.fast" android:pathPrefix="/conversationlist" android:scheme="rong" /> </intent-filter> </activity>
其余局部参考
融云官网:https://www.rongcloud.cn/
文档频道:https://docs.rongcloud.cn/v4
纪念日局部
日历控件:https://juejin.im/post/684490…
其余局部如若有人须要,会尽快传到 github 。
github:https://github.com/yanxiame/r…