Compare commits
1 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
d4fec59c64 | 2 years ago |
@ -1,3 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/poem.iml" filepath="$PROJECT_DIR$/.idea/poem.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,15 +0,0 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
@ -1,3 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
@ -1 +0,0 @@
|
||||
poem
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="11" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1 +0,0 @@
|
||||
/build
|
||||
@ -1,21 +0,0 @@
|
||||
# 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
|
||||
@ -1,26 +0,0 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
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.example.myapplication", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- 步骤一:添加网络权限 -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||
|
||||
<application
|
||||
android:name=".XUIInit"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@drawable/app"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@drawable/app"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MyApplication"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".Activity.RegisterActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".Activity.MainActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".Activity.AdviceActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".Activity.DetailActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".Activity.PoetryListActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".Activity.TestActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".Activity.ChatActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".Activity.LoginActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -1,36 +0,0 @@
|
||||
package com.example.myapplication.Activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.xuexiang.xui.widget.edittext.MultiLineEditText;
|
||||
|
||||
public class AdviceActivity extends AppCompatActivity {
|
||||
|
||||
private TextView poetryTitle;
|
||||
private MultiLineEditText advice;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_advice);
|
||||
|
||||
Intent intent = getIntent();
|
||||
String poetryId = intent.getStringExtra("poemId");
|
||||
String Title = intent.getStringExtra("poemTitle");
|
||||
String username = intent.getStringExtra("username");
|
||||
|
||||
initView();
|
||||
|
||||
poetryTitle.setText(Title);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
poetryTitle = findViewById(R.id.poetryTitle);
|
||||
advice = findViewById(R.id.advice);
|
||||
}
|
||||
}
|
||||
@ -1,151 +0,0 @@
|
||||
package com.example.myapplication.Adapter;
|
||||
|
||||
import android.media.MediaPlayer;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.myapplication.Modal.ClientMessageBean;
|
||||
import com.example.myapplication.Modal.SystemMessageBean;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class MsgAdapter extends RecyclerView.Adapter<MsgAdapter.ViewHolder> {
|
||||
private List<ClientMessageBean> mMsgList;
|
||||
private MediaPlayer mPlayer;
|
||||
static class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
LinearLayout leftLayout;
|
||||
LinearLayout rightLayout;
|
||||
LinearLayout centerLayout;
|
||||
LinearLayout voiceRightLayout;
|
||||
LinearLayout voiceLeftLayout;
|
||||
TextView leftMsg;
|
||||
TextView rightMsg;
|
||||
TextView centerMsg;
|
||||
ImageButton broadcastRight;
|
||||
ImageButton broadcastLeft;
|
||||
public ViewHolder(View view){
|
||||
super(view);
|
||||
leftLayout = view.findViewById(R.id.left_layout);
|
||||
rightLayout = view.findViewById(R.id.right_layout);
|
||||
centerLayout = view.findViewById(R.id.center_layout);
|
||||
leftMsg = view.findViewById(R.id.left_msg);
|
||||
rightMsg = view.findViewById(R.id.right_msg);
|
||||
centerMsg = view.findViewById(R.id.center_msg);
|
||||
voiceLeftLayout = view.findViewById(R.id.voice_order);
|
||||
voiceRightLayout = view.findViewById(R.id.voice_self);
|
||||
broadcastLeft = view.findViewById(R.id.record_order);
|
||||
broadcastRight = view.findViewById(R.id.record_self);
|
||||
}
|
||||
}
|
||||
|
||||
public MsgAdapter(List<ClientMessageBean> msgList, MediaPlayer mPlayer){
|
||||
mMsgList = msgList;
|
||||
this.mPlayer = mPlayer;
|
||||
}
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType){
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.message_view,parent,false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder,int position){
|
||||
ClientMessageBean msg = mMsgList.get(position);
|
||||
if (msg.getType() == 2){
|
||||
//如果收到消息,则显示在左边,将右边,中间布局隐藏
|
||||
holder.leftLayout.setVisibility(View.VISIBLE);
|
||||
holder.centerLayout.setVisibility(View.GONE);
|
||||
holder.rightLayout.setVisibility(View.GONE);
|
||||
//语音隐藏
|
||||
holder.voiceRightLayout.setVisibility(View.GONE);
|
||||
holder.voiceLeftLayout.setVisibility(View.GONE);
|
||||
holder.leftMsg.setText(msg.getMessage());
|
||||
}else if(msg.getType() == 1){
|
||||
//将左,中布局隐藏
|
||||
holder.rightLayout.setVisibility(View.VISIBLE);
|
||||
holder.centerLayout.setVisibility(View.GONE);
|
||||
holder.leftLayout.setVisibility(View.GONE);
|
||||
holder.voiceRightLayout.setVisibility(View.GONE);
|
||||
holder.voiceLeftLayout.setVisibility(View.GONE);
|
||||
holder.rightMsg.setText(msg.getMessage());
|
||||
}else if(msg.getType() == 0){
|
||||
//隐藏左右布局
|
||||
holder.centerLayout.setVisibility(View.VISIBLE);
|
||||
holder.leftLayout.setVisibility(View.GONE);
|
||||
holder.rightLayout.setVisibility(View.GONE);
|
||||
holder.voiceRightLayout.setVisibility(View.GONE);
|
||||
holder.voiceLeftLayout.setVisibility(View.GONE);
|
||||
holder.centerMsg.setText(msg.getMessage());
|
||||
} else if (msg.getType() == 3) {
|
||||
holder.leftLayout.setVisibility(View.GONE);
|
||||
holder.rightLayout.setVisibility(View.GONE);
|
||||
holder.centerLayout.setVisibility(View.GONE);
|
||||
holder.voiceRightLayout.setVisibility(View.VISIBLE);
|
||||
holder.voiceLeftLayout.setVisibility(View.GONE);
|
||||
try {
|
||||
holder.broadcastRight.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
mPlayer.reset();
|
||||
mPlayer.setDataSource(msg.getMessage());
|
||||
mPlayer.prepare();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
mPlayer.start();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else if (msg.getType() == 4) {
|
||||
holder.leftLayout.setVisibility(View.GONE);
|
||||
holder.rightLayout.setVisibility(View.GONE);
|
||||
holder.centerLayout.setVisibility(View.GONE);
|
||||
holder.voiceRightLayout.setVisibility(View.GONE);
|
||||
holder.voiceLeftLayout.setVisibility(View.VISIBLE);
|
||||
try {
|
||||
holder.broadcastRight.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
mPlayer.reset();
|
||||
mPlayer.setDataSource(msg.getMessage());
|
||||
mPlayer.prepare();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
mPlayer.start();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getItemCount(){
|
||||
return mMsgList.size();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
package com.example.myapplication.Adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.Modal.Poetry;
|
||||
import com.example.myapplication.Util.Spilt;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PoemListAdapter extends BaseAdapter {
|
||||
private List<Poetry> poetryList = new ArrayList<Poetry>();
|
||||
private Context context;
|
||||
|
||||
public PoemListAdapter(List<Poetry> poetryList, Context context) {
|
||||
|
||||
this.poetryList = poetryList;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return poetryList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return poetryList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder viewHolder = null;
|
||||
Log.d("ListViewLoading", "--------------------------------------------");
|
||||
if (convertView == null) {
|
||||
viewHolder = new ViewHolder();
|
||||
convertView = View.inflate(context, R.layout.poem_item, null);
|
||||
viewHolder.author = convertView.findViewById(R.id.poem_author);
|
||||
viewHolder.title = convertView.findViewById(R.id.poem_title);
|
||||
viewHolder.contentView = convertView.findViewById(R.id.poem_content);
|
||||
viewHolder.spiltLine = convertView.findViewById(R.id.spilt_line);
|
||||
convertView.setTag(viewHolder);
|
||||
} else
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
|
||||
viewHolder.title.setText(poetryList.get(position).getName());
|
||||
String author = poetryList.get(position).getDynasty() + "." + poetryList.get(position).getAuthor();
|
||||
viewHolder.author.setText(author);
|
||||
|
||||
String content = poetryList.get(position).getContent();
|
||||
content = Spilt.spiltContentText(content);
|
||||
viewHolder.contentView.setText(content);
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
public class ViewHolder {
|
||||
public TextView title;
|
||||
public TextView author;
|
||||
public TextView contentView;
|
||||
public TextView spiltLine;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package com.example.myapplication.Adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.myapplication.Activity.ChatActivity;
|
||||
import com.example.myapplication.Modal.RoomBean;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomAdapter extends RecyclerView.Adapter<RoomAdapter.ViewHolder>{
|
||||
List<RoomBean> mRoomList ;
|
||||
Context mContext;
|
||||
static class ViewHolder extends RecyclerView.ViewHolder{
|
||||
TextView rname;
|
||||
TextView description;
|
||||
public ViewHolder(View view){
|
||||
super(view);
|
||||
rname = view.findViewById(R.id.rname);
|
||||
description = view.findViewById(R.id.description);
|
||||
}
|
||||
}
|
||||
public RoomAdapter(List<RoomBean> list,Context context){
|
||||
this.mRoomList = list;
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.room_view,parent,false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
RoomBean roomBean = mRoomList.get(position);
|
||||
holder.rname.setText(roomBean.getRname());
|
||||
holder.description.setText(roomBean.getDescription());
|
||||
View.OnClickListener listener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(mContext, ChatActivity.class);
|
||||
//用户名还需要调整
|
||||
intent.putExtra("username", String.valueOf(Math.random()));
|
||||
intent.putExtra("rid", roomBean.getRid());
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
};
|
||||
holder.description.setOnClickListener(listener);
|
||||
holder.rname.setOnClickListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mRoomList.size();
|
||||
}
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
package com.example.myapplication.Constant;
|
||||
|
||||
public class constant {
|
||||
public static final String poetry_IP = "http://101.33.242.218:8081/";
|
||||
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
package com.example.myapplication.Fragment.My;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.myapplication.databinding.FragmentMyBinding;
|
||||
import com.xuexiang.xui.widget.textview.supertextview.SuperTextView;
|
||||
|
||||
public class MyFragment extends Fragment {
|
||||
|
||||
private FragmentMyBinding binding;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
binding = FragmentMyBinding.inflate(inflater, container, false);
|
||||
View root = binding.getRoot();
|
||||
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
}
|
||||
@ -1,222 +0,0 @@
|
||||
package com.example.myapplication.Fragment.Search;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.myapplication.Activity.PoetryListActivity;
|
||||
import com.example.myapplication.Modal.PoetryUtil;
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.databinding.FragmentAssociationBinding;
|
||||
import com.example.myapplication.databinding.FragmentSearchBinding;
|
||||
import com.zhy.view.flowlayout.FlowLayout;
|
||||
import com.zhy.view.flowlayout.TagAdapter;
|
||||
import com.zhy.view.flowlayout.TagFlowLayout;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SearchFragment extends Fragment {
|
||||
|
||||
private FragmentSearchBinding binding;
|
||||
|
||||
private static final String TAG = "test";
|
||||
|
||||
private Button sureButton;
|
||||
|
||||
private final int COMPLETED = 1;
|
||||
private final int RESPONSE_SUCCESS = 2;
|
||||
private final int RESPONSE_FAIL = 0;
|
||||
private final int TO_WEBVIEW = 3;
|
||||
private JSONObject poetryObject;
|
||||
private JSONArray collectObject;
|
||||
|
||||
private TagFlowLayout typeTagLayout;
|
||||
private TagFlowLayout dynastyTagLayout;
|
||||
private TagFlowLayout styleTagLayout;
|
||||
|
||||
private String[] typeList = null;
|
||||
private String[] dynastyList = null;
|
||||
private String[] styleList = null;
|
||||
|
||||
private List<String> selectedType = new ArrayList<String>();
|
||||
private List<String> selectedStyle = new ArrayList<String>();
|
||||
private List<String> selectedDynasty = new ArrayList<String>();
|
||||
|
||||
public SearchFragment() {}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
binding = FragmentSearchBinding.inflate(inflater, container, false);
|
||||
View root = binding.getRoot();
|
||||
|
||||
|
||||
initView();//初始化视图
|
||||
|
||||
//将标签数据传递给下一页面
|
||||
sureButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent;
|
||||
intent = new Intent(getContext(), PoetryListActivity.class);
|
||||
String tag = "";
|
||||
String dynasty = "";
|
||||
String toolBarTitle = "";
|
||||
if (selectedDynasty.size() > 0)
|
||||
toolBarTitle += selectedDynasty.get(0) + ".";
|
||||
if (selectedType.size() > 0)
|
||||
toolBarTitle += selectedType.get(0) + ".";
|
||||
if (selectedStyle.size() > 0)
|
||||
toolBarTitle += selectedStyle.get(0);
|
||||
if (selectedType.size() == 0 && selectedStyle.size() == 0)
|
||||
toolBarTitle = selectedDynasty.get(0);
|
||||
|
||||
for (String temp : selectedType)
|
||||
tag += temp + ",";
|
||||
for (String temp1 : selectedStyle)
|
||||
tag += temp1 + ",";
|
||||
for (String temp2 : selectedDynasty)
|
||||
dynasty += temp2 + ",";
|
||||
|
||||
intent.putExtra("from", "filter");
|
||||
intent.putExtra("tag", tag);
|
||||
intent.putExtra("dynasty", dynasty);
|
||||
intent.putExtra("toolBarTitle", toolBarTitle);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
|
||||
private void initView() {
|
||||
sureButton = binding.sureButton;
|
||||
|
||||
initTagFlowLayout();
|
||||
}
|
||||
|
||||
// 分类检索的标签初始化
|
||||
private void initTagFlowLayout() {
|
||||
typeTagLayout = binding.typeFloat;
|
||||
dynastyTagLayout = binding.dynastyFloat;
|
||||
styleTagLayout = binding.styleFloat;
|
||||
|
||||
typeList = PoetryUtil.getType();//获取诗词类型标签
|
||||
dynastyList = PoetryUtil.getDynasty();//获取诗词朝代标签
|
||||
styleList = PoetryUtil.getStyle();//获取诗词风格标签
|
||||
|
||||
final LayoutInflater mInflater = getLayoutInflater();
|
||||
|
||||
// 适配器
|
||||
typeTagLayout.setAdapter(new TagAdapter<String>(typeList) {
|
||||
@Override
|
||||
public View getView(FlowLayout parent, int position, String s) {
|
||||
|
||||
TextView tv = (TextView) mInflater.inflate(R.layout.adapter_item_tag,
|
||||
typeTagLayout, false);
|
||||
tv.setText(s);
|
||||
return tv;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelected(int position, View view) {
|
||||
super.onSelected(position, view);
|
||||
selectedType.add(typeList[position]);
|
||||
showSelected(selectedType);
|
||||
TextView textView = (TextView) view;
|
||||
textView.setTextColor(Color.WHITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unSelected(int position, View view) {
|
||||
super.unSelected(position, view);
|
||||
TextView textView = (TextView) view;
|
||||
selectedType.remove(textView.getText());
|
||||
showSelected(selectedType);
|
||||
textView.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
});
|
||||
|
||||
dynastyTagLayout.setAdapter(new TagAdapter<String>(dynastyList) {
|
||||
@Override
|
||||
public View getView(FlowLayout parent, int position, String s) {
|
||||
|
||||
TextView tv = (TextView) mInflater.inflate(R.layout.adapter_item_tag,
|
||||
dynastyTagLayout, false);
|
||||
tv.setText(s);
|
||||
return tv;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelected(int position, View view) {
|
||||
super.onSelected(position, view);
|
||||
selectedDynasty.add(dynastyList[position]);
|
||||
TextView textView = (TextView) view;
|
||||
textView.setTextColor(Color.WHITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unSelected(int position, View view) {
|
||||
super.unSelected(position, view);
|
||||
TextView textView = (TextView) view;
|
||||
selectedDynasty.remove(textView.getText());
|
||||
textView.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
});
|
||||
|
||||
styleTagLayout.setAdapter(new TagAdapter<String>(styleList) {
|
||||
@Override
|
||||
public View getView(FlowLayout parent, int position, String s) {
|
||||
|
||||
TextView tv = (TextView) mInflater.inflate(R.layout.adapter_item_tag,
|
||||
styleTagLayout, false);
|
||||
tv.setText(s);
|
||||
return tv;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelected(int position, View view) {
|
||||
super.onSelected(position, view);
|
||||
selectedStyle.add(styleList[position]);
|
||||
TextView textView = (TextView) view;
|
||||
textView.setTextColor(Color.WHITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unSelected(int position, View view) {
|
||||
super.unSelected(position, view);
|
||||
TextView textView = (TextView) view;
|
||||
selectedStyle.remove(textView.getText());
|
||||
textView.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showSelected(List<String> temp) {
|
||||
if (temp.size() > 0) {
|
||||
for (String tempString : temp)
|
||||
System.out.println("selectedTag:" + tempString);
|
||||
} else
|
||||
System.out.println("没有选择");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
}
|
||||
@ -1,231 +0,0 @@
|
||||
package com.example.myapplication.Fragment.association;
|
||||
|
||||
import static com.xuexiang.xui.XUI.getContext;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.myapplication.Adapter.RoomAdapter;
|
||||
import com.example.myapplication.Modal.RoomBean;
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.databinding.FragmentAssociationBinding;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class AssociationFragment extends Fragment {
|
||||
|
||||
private FragmentAssociationBinding binding;
|
||||
|
||||
RecyclerView recyclerView;
|
||||
List<RoomBean> roomList = new ArrayList<>();
|
||||
RoomAdapter adapter;
|
||||
|
||||
AlertDialog.Builder createRoomBuilder ;
|
||||
View createView;
|
||||
ImageButton createRoomButton;
|
||||
ImageButton searchButton;
|
||||
AlertDialog dialog;
|
||||
Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(@NonNull Message message) {
|
||||
if(message.what == 1){
|
||||
System.out.println("room fresh");
|
||||
//更新聊天室列表
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
binding = FragmentAssociationBinding.inflate(inflater, container, false);
|
||||
View root = binding.getRoot();
|
||||
|
||||
initView();
|
||||
//设置适配器
|
||||
adapter = new RoomAdapter(roomList,getContext());
|
||||
LinearLayoutManager manager = new LinearLayoutManager(getContext());
|
||||
recyclerView.setLayoutManager(manager);
|
||||
recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
||||
recyclerView.setAdapter(adapter);
|
||||
getRoomList(0,100);
|
||||
|
||||
//添加监听
|
||||
createRoomButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
createRoomBuilder = new AlertDialog.Builder(getContext());
|
||||
createView = View.inflate(getContext(),R.layout.create_room,null);
|
||||
Button button = createView.findViewById(R.id.button);
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
EditText newRname = createView.findViewById(R.id.rname);
|
||||
EditText newDescription = createView.findViewById(R.id.description);
|
||||
String rname = String.valueOf(newRname.getText());
|
||||
String description = String.valueOf(newDescription.getText());
|
||||
createRoom(rname,description);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
createRoomBuilder.setView(createView);
|
||||
dialog = createRoomBuilder.create();
|
||||
dialog.show();
|
||||
}
|
||||
});
|
||||
|
||||
searchButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
EditText input = binding.key;
|
||||
String key = String.valueOf(input.getText());
|
||||
//发请求查找
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
HttpUrl url = new HttpUrl.Builder()
|
||||
.scheme("http")
|
||||
.host("101.33.242.218")
|
||||
.port(8081)
|
||||
.addPathSegment("chatController")
|
||||
.addPathSegment("getBySearch")
|
||||
.addQueryParameter("key",key)
|
||||
.addQueryParameter("page","0")
|
||||
.addQueryParameter("size","100")
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
Call call = client.newCall(request);
|
||||
call.enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
System.out.println("search failure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
System.out.println("onResponse");
|
||||
String res = response.body().string();
|
||||
Gson gson = new Gson();
|
||||
List<RoomBean> list = gson.fromJson(res, new TypeToken<ArrayList<RoomBean>>() {
|
||||
}.getType());
|
||||
roomList.clear();
|
||||
roomList.addAll(list);
|
||||
Message message = new Message();
|
||||
message.what = 1;
|
||||
handler.sendMessage(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
void initView(){
|
||||
recyclerView = binding.roomList;
|
||||
createRoomButton = binding.createRoomButton;
|
||||
searchButton = binding.searchButton;
|
||||
}
|
||||
|
||||
void getRoomList(Integer page, Integer size){
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
//这一部分还可调整页数刷新
|
||||
HttpUrl url = new HttpUrl.Builder()
|
||||
.scheme("http")
|
||||
.host("101.33.242.218")
|
||||
// .host("192.168.18.163")
|
||||
.port(8081)
|
||||
.addPathSegment("chatController")
|
||||
.addPathSegment("getAllRoom")
|
||||
.addQueryParameter("page", String.valueOf(page))
|
||||
.addQueryParameter("size", String.valueOf(size))
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
Call call = client.newCall(request);
|
||||
call.enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
Log.e("http","getAllRoom Failure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
System.out.println("onResponse");
|
||||
String res = response.body().string();
|
||||
Gson gson = new Gson();
|
||||
List<RoomBean> list = gson.fromJson(res, new TypeToken<ArrayList<RoomBean>>() {
|
||||
}.getType());
|
||||
roomList.clear();
|
||||
roomList.addAll(list);
|
||||
Message message = new Message();
|
||||
message.what = 1;
|
||||
handler.sendMessage(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void createRoom(String rname, String description){
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
HttpUrl url = new HttpUrl.Builder()
|
||||
.scheme("http")
|
||||
.host("101.33.242.218")
|
||||
.port(8081)
|
||||
.addPathSegment("chatController")
|
||||
.addPathSegment("createRoom")
|
||||
.addQueryParameter("rname",rname)
|
||||
.addQueryParameter("description",description)
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
Call call = client.newCall(request);
|
||||
call.enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
System.out.println("create failure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
//刷新聊天室列表
|
||||
//这里可以让服务器返回单个房间优化一下
|
||||
getRoomList(0,100);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
}
|
||||
@ -1,60 +0,0 @@
|
||||
package com.example.myapplication.Modal;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ClientMessageBean {
|
||||
/**
|
||||
* type对应
|
||||
* 0 系统消息
|
||||
* 1 自己发送的文本消息
|
||||
* 2 其他人发送的文本消息
|
||||
* 3 自己发送的语音消息
|
||||
* 4 其他人发送的语音消息
|
||||
*/
|
||||
private int type;
|
||||
private String from;
|
||||
private String message;
|
||||
private byte[] record;
|
||||
|
||||
public ClientMessageBean() {
|
||||
}
|
||||
|
||||
public ClientMessageBean(int type, String from, String message, byte[] record) {
|
||||
this.type = type;
|
||||
this.from = from;
|
||||
this.message = message;
|
||||
this.record = record;
|
||||
}
|
||||
|
||||
public byte[] getRecord() {
|
||||
return record;
|
||||
}
|
||||
|
||||
public void setRecord(byte[] record) {
|
||||
this.record = record;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
public void setFrom(String from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
package com.example.myapplication.Modal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EmotionResBean {
|
||||
private String emotion ;
|
||||
private List<Double> prob;
|
||||
|
||||
public EmotionResBean() {
|
||||
}
|
||||
|
||||
public EmotionResBean(String emotion, List<Double> prob) {
|
||||
this.emotion = emotion;
|
||||
this.prob = prob;
|
||||
}
|
||||
|
||||
public String getEmotion() {
|
||||
return emotion;
|
||||
}
|
||||
|
||||
public void setEmotion(String emotion) {
|
||||
this.emotion = emotion;
|
||||
}
|
||||
|
||||
public List<Double> getList() {
|
||||
return prob;
|
||||
}
|
||||
|
||||
public void setList(List<Double> list) {
|
||||
this.prob = list;
|
||||
}
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
package com.example.myapplication.Modal;
|
||||
|
||||
/**
|
||||
* @创建者 晏嘉琳
|
||||
* @创建时间 2023/5/31 17:58
|
||||
* @类描述 ${TODO}实体类
|
||||
*/
|
||||
|
||||
public class Poetry {
|
||||
private String title;
|
||||
private String desty;
|
||||
private String author;
|
||||
private String content;
|
||||
private String tag;
|
||||
|
||||
public Poetry() {
|
||||
}
|
||||
|
||||
public Poetry(String title, String desty, String author, String content, String tag) {
|
||||
this.title = title;
|
||||
this.desty = desty;
|
||||
this.author = author;
|
||||
this.content = content;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setName(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDynasty() {
|
||||
return desty;
|
||||
}
|
||||
|
||||
public void setDynasty(String desty) {
|
||||
this.desty = desty;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
}
|
||||
@ -1,121 +0,0 @@
|
||||
package com.example.myapplication.Modal;
|
||||
|
||||
/**
|
||||
* @创建者 晏嘉琳
|
||||
* @创建时间 2023/5/31 17:58
|
||||
* @类描述 ${TODO}实体类
|
||||
*/
|
||||
|
||||
public class PoetryDetail {
|
||||
private Integer id;
|
||||
private String title;
|
||||
private String desty;
|
||||
private String author;
|
||||
private String content;
|
||||
private String tag;
|
||||
private String trans_content;
|
||||
private String zhu;
|
||||
private String reference;
|
||||
private String appear;
|
||||
private String img;
|
||||
private String authorDetail;
|
||||
|
||||
public PoetryDetail() {
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDesty() {
|
||||
return desty;
|
||||
}
|
||||
|
||||
public void setDesty(String desty) {
|
||||
this.desty = desty;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public String getTransContent() {
|
||||
return trans_content;
|
||||
}
|
||||
|
||||
public void setTransContent(String trans_content) {
|
||||
this.trans_content = trans_content;
|
||||
}
|
||||
|
||||
public String getAnnotation() {
|
||||
return zhu;
|
||||
}
|
||||
|
||||
public void setAnnotation(String zhu) {
|
||||
this.zhu = zhu;
|
||||
}
|
||||
|
||||
public String getReference() {
|
||||
return reference;
|
||||
}
|
||||
|
||||
public void setReference(String reference) {
|
||||
this.reference = reference;
|
||||
}
|
||||
|
||||
public String getAppreciation() {
|
||||
return appear;
|
||||
}
|
||||
|
||||
public void setAppreciation(String appear) {
|
||||
this.appear = appear;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getAuthorDetail() {
|
||||
return authorDetail;
|
||||
}
|
||||
|
||||
public void setAuthorDetail(String authorDetail) {
|
||||
this.authorDetail = authorDetail;
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
package com.example.myapplication.Modal;
|
||||
|
||||
public class PrivateInfo {
|
||||
// 自行传入appId, secretId, secretKey等参数
|
||||
public static final String appId = "";
|
||||
public static final String soeAppId = "";
|
||||
public static final String hcmAppId = "";
|
||||
public static final String secretId = "AKIDkLhOw5atyqUuthOs8xazylNo36Ugfvyn";
|
||||
public static final String secretKey = "f5XpulV2MS4SdaImHclfKm26wb3A2f6K";
|
||||
public static final String token = "";
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package com.example.myapplication.Modal;
|
||||
|
||||
public class RoomBean {
|
||||
private int rid;
|
||||
private String rname;
|
||||
private String description;
|
||||
|
||||
public int getRid() {
|
||||
return rid;
|
||||
}
|
||||
|
||||
public void setRid(int rid) {
|
||||
this.rid = rid;
|
||||
}
|
||||
|
||||
public String getRname() {
|
||||
return rname;
|
||||
}
|
||||
|
||||
public void setRname(String rname) {
|
||||
this.rname = rname;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public RoomBean(int rid, String rname, String description) {
|
||||
this.rid = rid;
|
||||
this.rname = rname;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public RoomBean() {
|
||||
}
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package com.example.myapplication.Modal;
|
||||
|
||||
public class SystemMessageBean {
|
||||
private boolean isSystem;
|
||||
private String from;
|
||||
private String message;
|
||||
|
||||
public SystemMessageBean() {
|
||||
}
|
||||
|
||||
public SystemMessageBean(boolean isSystem, String from, String message) {
|
||||
this.isSystem = isSystem;
|
||||
this.from = from;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public boolean isSystem() {
|
||||
return isSystem;
|
||||
}
|
||||
|
||||
public void setSystem(boolean system) {
|
||||
isSystem = system;
|
||||
}
|
||||
|
||||
public String getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
public void setFrom(String from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package com.example.myapplication.Util;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class FileUtils {
|
||||
|
||||
/**
|
||||
* 将文件转换成Byte数组
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static byte[] getBytesByFile(File file) {
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
|
||||
byte[] b = new byte[1024];
|
||||
int n;
|
||||
while ((n = fis.read(b)) != -1) {
|
||||
bos.write(b, 0, n);
|
||||
}
|
||||
fis.close();
|
||||
byte[] data = bos.toByteArray();
|
||||
bos.close();
|
||||
return data;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Byte数组转换成文件
|
||||
*
|
||||
* @param bytes
|
||||
* @param filePath
|
||||
* @param fileName
|
||||
*/
|
||||
public static void getFileByBytes(byte[] bytes, String filePath, String fileName) {
|
||||
BufferedOutputStream bos = null;
|
||||
FileOutputStream fos = null;
|
||||
File file = null;
|
||||
try {
|
||||
file = new File(filePath + fileName);
|
||||
fos = new FileOutputStream(file);
|
||||
bos = new BufferedOutputStream(fos);
|
||||
bos.write(bytes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (bos != null) {
|
||||
try {
|
||||
bos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (fos != null) {
|
||||
try {
|
||||
fos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
package com.example.myapplication.Util;
|
||||
|
||||
public class Spilt {
|
||||
|
||||
public Spilt() {
|
||||
}
|
||||
|
||||
public static String spiltContentText(String contentText) {
|
||||
String result = "";
|
||||
String split[];
|
||||
|
||||
String regex = "\\(.*\\)";
|
||||
contentText = contentText.replaceAll(regex,"");
|
||||
|
||||
split = contentText.split("。");
|
||||
for(int i = 0; i < split.length; i++){
|
||||
result = result + split[i] + "。" + "\n";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//按换行分割字符串
|
||||
public static String[] spiltPoemTextByEnter(String poemText) {
|
||||
String result[];
|
||||
result = poemText.split("\n");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,110 +0,0 @@
|
||||
package com.example.myapplication.Util;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.example.myapplication.Modal.ClientMessageBean;
|
||||
import com.example.myapplication.Modal.SystemMessageBean;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.WebSocket;
|
||||
import okhttp3.WebSocketListener;
|
||||
import okio.ByteString;
|
||||
|
||||
public class WebSocketUtil {
|
||||
private static final int NORMAL_CLOSURE_STATUS = 1000;
|
||||
private final OkHttpClient client = new OkHttpClient.Builder()
|
||||
.pingInterval(10, TimeUnit.SECONDS)
|
||||
.build();
|
||||
private WebSocket socket;
|
||||
private WebSocketListener listener;
|
||||
private Map<String, WebSocket> webSockets = new ConcurrentHashMap<>();
|
||||
|
||||
private Handler handler;
|
||||
|
||||
public void connect(String url, Integer rid,String username, Handler handler) {
|
||||
this.handler = handler;
|
||||
url = url + rid+"/"+username;
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
listener = new WebSocketListener() {
|
||||
@Override
|
||||
public void onOpen(WebSocket webSocket, Response response) {
|
||||
System.out.println("open");
|
||||
socket = webSocket;
|
||||
}
|
||||
@Override
|
||||
public void onMessage(WebSocket webSocket, String text) {
|
||||
// 接收到服务端发来的消息
|
||||
Log.d("WebSocket", "onMessage: " + text);
|
||||
Message message = new Message();
|
||||
Gson gson = new Gson();
|
||||
SystemMessageBean messageBean = gson.fromJson(text,SystemMessageBean.class);
|
||||
message.obj = messageBean;
|
||||
handler.sendMessage(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(WebSocket webSocket, ByteString bytes) {
|
||||
// 接收到服务端发来的消息
|
||||
Log.d("WebSocket", "onMessage: " + bytes.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClosing(WebSocket webSocket, int code, String reason) {
|
||||
webSocket.close(NORMAL_CLOSURE_STATUS, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(WebSocket webSocket, Throwable t, Response response) {
|
||||
Log.e("WebSocket", "onFailure", t);
|
||||
}
|
||||
};
|
||||
socket = client.newWebSocket(request, listener);
|
||||
System.out.println("connect");
|
||||
}
|
||||
|
||||
public void send(String message) {
|
||||
// 在房间内发送消息
|
||||
socket.send(message);
|
||||
}
|
||||
|
||||
public void send(ByteString message) {
|
||||
// 在房间内发送消息
|
||||
socket.send(message);
|
||||
}
|
||||
|
||||
|
||||
public void disconnect() {
|
||||
if (socket != null) {
|
||||
socket.close(NORMAL_CLOSURE_STATUS, null);
|
||||
}
|
||||
client.dispatcher().executorService().shutdown();
|
||||
}
|
||||
|
||||
public void addWebSocket(String clientId, WebSocket webSocket) {
|
||||
webSockets.put(clientId, webSocket);
|
||||
}
|
||||
|
||||
public void removeWebSocket(String clientId) {
|
||||
webSockets.remove(clientId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import com.example.myapplication.Fragment.AiPoetry.AiPoetryFragment;
|
||||
import com.xuexiang.xui.XUI;
|
||||
|
||||
public class XUIInit extends Application {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
XUI.init(this);
|
||||
XUI.debug(true);
|
||||
}
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2019 xuexiangjys(xuexiangjys@163.com)
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
~
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:color="?attr/colorAccent" />
|
||||
<item android:state_selected="true" android:color="?attr/colorAccent" />
|
||||
<item android:state_enabled="false" android:color="@color/xui_btn_disable_color" />
|
||||
<item android:color="?attr/colorAccent" />
|
||||
</selector>
|
||||
@ -1,30 +0,0 @@
|
||||
<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>
|
||||
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/xui_config_color_light_blue"/>
|
||||
<corners android:radius="?attr/xui_btn_view_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:state_checked="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/xui_config_color_light_blue"/>
|
||||
<corners android:radius="?attr/xui_btn_view_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/xui_config_color_white"/>
|
||||
<corners android:radius="?attr/xui_btn_view_radius"/>
|
||||
<stroke android:width="1dp" android:color="@color/xui_config_color_light_blue"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 这里是设置背景色-->
|
||||
<solid android:color="#FFFFFF" />
|
||||
<!-- 这里是设置为四周 也可以单独设置某个位置为圆角-->
|
||||
<corners android:topLeftRadius="5dp"
|
||||
android:topRightRadius="5dp"
|
||||
android:bottomRightRadius="5dp"
|
||||
android:bottomLeftRadius="5dp"/>
|
||||
<!-- 这里设置边框 -->
|
||||
<stroke android:width="1dp" android:color="#DADADA" />
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/xui_btn_green_normal_color"/>
|
||||
<corners
|
||||
android:bottomLeftRadius="30dp"
|
||||
android:bottomRightRadius="30dp"
|
||||
android:topLeftRadius="30dp"
|
||||
android:topRightRadius="30dp"/>
|
||||
</shape>
|
||||
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:padding="10dp"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#fff"/>
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="5dp"
|
||||
android:bottomRightRadius="5dp"
|
||||
android:topLeftRadius="5dp"
|
||||
android:topRightRadius="5dp"/>
|
||||
|
||||
<stroke android:color="@color/xui_config_color_titlebar"
|
||||
android:width="2px"
|
||||
/>
|
||||
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 373 B |
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
|
||||
</vector>
|
||||
@ -1,26 +0,0 @@
|
||||
<!--
|
||||
~ Copyright (C) 2019 xuexiangjys(xuexiangjys@163.com)
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
~
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="#707070"
|
||||
android:pathData="M512,0c281.6,0 512,230.4 512,512s-230.4,512 -512,512 -512,-230.4 -512,-512 230.4,-512 512,-512zM627.2,505.6c44.8,-38.4 76.8,-89.6 76.8,-153.6 0,-108.8 -83.2,-192 -192,-192s-192,83.2 -192,192c0,64 32,115.2 76.8,153.6 -102.4,44.8 -172.8,147.2 -172.8,262.4 0,19.2 12.8,32 32,32s32,-12.8 32,-32c0,-121.6 102.4,-224 224,-224s224,102.4 224,224c0,19.2 12.8,32 32,32s32,-12.8 32,-32c0,-115.2 -70.4,-217.6 -172.8,-262.4zM512,480c-70.4,0 -128,-57.6 -128,-128s57.6,-128 128,-128 128,57.6 128,128 -57.6,128 -128,128z" />
|
||||
</vector>
|
||||
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
|
||||
</vector>
|
||||
@ -1,170 +0,0 @@
|
||||
<?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>
|
||||
|
Before Width: | Height: | Size: 648 B |
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
|
||||
</vector>
|
||||
@ -1,18 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M869.03,393.85a54.14,54.14 0,0 1,54.14 54.14v467.74a54.14,54.14 0,0 1,-54.14 54.14H154.97a54.14,54.14 0,0 1,-54.14 -54.14V447.98a54.14,54.14 0,0 1,54.14 -54.14h714.07m0,-54.14H154.97a108.27,108.27 0,0 0,-108.27 108.27v467.74a108.27,108.27 0,0 0,108.27 108.27h714.07a108.27,108.27 0,0 0,108.27 -108.27V447.98a108.27,108.27 0,0 0,-108.27 -108.27z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M817.87,362.72h-54.14v-56.84a251.74,251.74 0,1 0,-503.47 0v56.84h-54.14v-56.84a305.87,305.87 0,1 1,611.75 0z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M438.64,520.53m71.46,0l3.79,0q71.46,0 71.46,71.46l0,3.79q0,71.46 -71.46,71.46l-3.79,0q-71.46,0 -71.46,-71.46l0,-3.79q0,-71.46 71.46,-71.46Z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M483.04,567.63m28.15,0l1.35,0q28.15,0 28.15,28.15l0,204.37q0,28.15 -28.15,28.15l-1.35,0q-28.15,0 -28.15,-28.15l0,-204.37q0,-28.15 28.15,-28.15Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
||||
@ -1,4 +0,0 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024"
|
||||
android:viewportWidth="1024" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#000000" android:pathData="M640,542.72c76.8,-44.8 128,-128 128,-217.6 0,-140.8 -115.2,-256 -256,-256s-256,108.8 -256,249.6c0,96 51.2,172.8 128,217.6 -166.4,51.2 -281.6,204.8 -288,384 0,25.6 12.8,38.4 32,38.4s32,-12.8 32,-32c6.4,-192 160,-345.6 352,-345.6s345.6,153.6 352,345.6c0,19.2 12.8,32 32,32s32,-12.8 32,-32c-6.4,-179.2 -121.6,-332.8 -288,-384zM320,318.72c0,-108.8 83.2,-192 192,-192s192,83.2 192,192 -83.2,192 -192,192 -192,-83.2 -192,-192z"/>
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 797 B |
|
Before Width: | Height: | Size: 616 B |
@ -1,29 +0,0 @@
|
||||
<!--
|
||||
~ Copyright (C) 2019 xuexiangjys(xuexiangjys@163.com)
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
~
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="#8a8a8a"
|
||||
android:pathData="M595.71,526.11l-205.44,-197.28c-8.86,-10.43 -7.5,-25.97 3.02,-34.69 10.53,-8.74 26.24,-7.36 35.09,3.07l205.42,197.28c8.86,10.43 7.5,25.97 -3.01,34.69S604.56,536.56 595.71,526.11z" />
|
||||
<path
|
||||
android:fillColor="#8a8a8a"
|
||||
android:pathData="M390.26,695.68l205.44,-197.28c8.86,-10.43 24.56,-11.81 35.09,-3.09 10.53,8.74 11.87,24.27 3.02,34.69l-205.44,197.28c-8.85,10.43 -24.56,11.81 -35.09,3.07C382.75,721.66 381.39,706.13 390.26,695.68z" />
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 653 B |
|
Before Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 506 B |
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/xui_config_color_red"/>
|
||||
<corners
|
||||
android:bottomLeftRadius="30dp"
|
||||
android:bottomRightRadius="30dp"
|
||||
android:topLeftRadius="30dp"
|
||||
android:topRightRadius="30dp"/>
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 588 B |
|
Before Width: | Height: | Size: 573 B |
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:padding="10dp"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#fff"/>
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="30dp"
|
||||
android:bottomRightRadius="30dp"
|
||||
android:topLeftRadius="30dp"
|
||||
android:topRightRadius="30dp"/>
|
||||
|
||||
<stroke android:color="@color/xui_config_color_titlebar"
|
||||
android:width="2px"
|
||||
/>
|
||||
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 3.7 KiB |
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/xui_config_color_titlebar"/>
|
||||
<corners
|
||||
android:bottomLeftRadius="30dp"
|
||||
android:bottomRightRadius="30dp"
|
||||
android:topLeftRadius="30dp"
|
||||
android:topRightRadius="30dp"/>
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 5.0 KiB |
@ -1,33 +0,0 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Activity.AdviceActivity"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/poetryTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:gravity="center"/>
|
||||
|
||||
<com.xuexiang.xui.widget.edittext.MultiLineEditText
|
||||
android:id="@+id/advice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:mlet_maxCount="500"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<com.xuexiang.xui.widget.button.ButtonView
|
||||
android:id="@+id/advice_btn"
|
||||
style="@style/ButtonView.Blue"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/advice" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,384 +0,0 @@
|
||||
<?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"
|
||||
tools:context=".Activity.DetailActivity">
|
||||
|
||||
<!--标题栏-->
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/poem_titleBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/xui_config_color_titlebar"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/poem_titleText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="title"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/poem_menu_icon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/icon_collect1"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/poem_menu_advice"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/advice"/>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
<TextView
|
||||
android:id="@+id/menu_line"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/poem_titleBar"/>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/detail_scroll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="vertical"
|
||||
android:paddingBottom="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/menu_line">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/poem_linnear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--诗词正文-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/detail_poem"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<!-- 诗词内容-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/poem_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingTop="30dp"
|
||||
android:paddingRight="30dp"
|
||||
android:paddingBottom="10dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_poem_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="title"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_poem_author"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="dynasty . author"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/detail_poem_title"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_poem_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:lineSpacingMultiplier="1.3"
|
||||
android:text="content"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/detail_poem_author"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- 标签-->
|
||||
<!-- <com.zhy.view.flowlayout.TagFlowLayout-->
|
||||
<!-- android:id="@+id/tag_flow"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="60dp"-->
|
||||
<!-- android:foregroundGravity="center"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/poem_panel"-->
|
||||
<!-- zhy:max_select="1"></com.zhy.view.flowlayout.TagFlowLayout>-->
|
||||
<TextView
|
||||
android:id="@+id/tag_flow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="60dp"
|
||||
android:foregroundGravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/poem_panel"
|
||||
/>
|
||||
|
||||
<!-- 背诵-->
|
||||
<com.xuexiang.xui.widget.button.roundbutton.RoundButton
|
||||
android:id="@+id/poem_test_button"
|
||||
style="@style/RoundButton.Auto"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="测试一下"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tag_flow"
|
||||
app:layout_constraintWidth_percent="0.6"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!--作者详情-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/author_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="30dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tag_flow">
|
||||
|
||||
<com.xuexiang.xui.widget.imageview.RadiusImageView
|
||||
android:id="@+id/author_img"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_border_color="@color/xui_config_color_gray_6"
|
||||
app:riv_border_width="1px"
|
||||
app:riv_is_circle="true"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/author_border"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:background="@drawable/round_editstyle"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/author_img">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/author_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="1.3"
|
||||
android:padding="10dp"
|
||||
android:text="authorDetail"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!--赏析、注释等信息-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/author_panel">
|
||||
|
||||
<!--翻译-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/translation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/detail_label1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/type_label"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/type_label_style"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:text="诗词释义"
|
||||
app:layout_constraintLeft_toRightOf="@id/type_label"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/translation_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="1.3"
|
||||
android:padding="30dp"
|
||||
android:text="暂无翻译"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/detail_label1"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!--赏析-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/appreciation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/translation">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/detail_label2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/type_label2"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/label_style"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:text="诗词赏析"
|
||||
app:layout_constraintLeft_toRightOf="@id/type_label2"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appreciation_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="1.3"
|
||||
android:padding="30dp"
|
||||
android:text="暂无赏析"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/detail_label2"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!--注释-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/annotation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appreciation">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/detail_label3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/type_label3"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/dynasty_label_style"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:text="诗词注释"
|
||||
app:layout_constraintLeft_toRightOf="@id/type_label3"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<org.sufficientlysecure.htmltextview.HtmlTextView
|
||||
android:id="@+id/annotation_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="1.3"
|
||||
android:padding="30dp"
|
||||
android:text="暂无注释"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/detail_label3"/>
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/annotation_text"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,193 +0,0 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/app"
|
||||
android:layout_marginTop="40dp"/>
|
||||
|
||||
<TextView
|
||||
style="@style/TextStyle.Title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="登 录"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:tint="?attr/colorAccent"
|
||||
app:srcCompat="@drawable/ic_phone" />
|
||||
|
||||
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
|
||||
android:id="@+id/et_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:hint="@string/tip_please_input_username"
|
||||
app:met_clearButton="true"
|
||||
app:met_errorMessage="@string/tip_phone_number_error"
|
||||
app:met_floatingLabel="normal"
|
||||
app:met_floatingLabelText="@string/title_username" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_verify_code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:tint="?attr/colorAccent"
|
||||
app:srcCompat="@drawable/ic_password" />
|
||||
|
||||
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
|
||||
android:id="@+id/et_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:hint="@string/hint_please_input_verify_code"
|
||||
app:met_clearButton="false"
|
||||
app:met_errorMessage="@string/tip_error"
|
||||
app:met_floatingLabel="normal"
|
||||
app:met_floatingLabelText="@string/title_password"
|
||||
app:met_maxCharacters="11" />
|
||||
|
||||
<!-- <com.xuexiang.xui.widget.button.roundbutton.RoundButton-->
|
||||
<!-- android:id="@+id/btn_get_verify_code"-->
|
||||
<!-- style="@style/RoundButton"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="end"-->
|
||||
<!-- android:paddingStart="10dp"-->
|
||||
<!-- android:paddingTop="3dp"-->
|
||||
<!-- android:paddingEnd="10dp"-->
|
||||
<!-- android:paddingBottom="3dp"-->
|
||||
<!-- android:text="@string/action_get_verify_code"-->
|
||||
<!-- android:textColor="@color/selector_round_button_main_theme_color"-->
|
||||
<!-- android:textSize="13sp"-->
|
||||
<!-- app:rb_borderColor="@color/selector_round_button_main_theme_color"-->
|
||||
<!-- app:rb_borderWidth="1.5dp"-->
|
||||
<!-- app:rb_radius="15dp" />-->
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.xuexiang.xui.widget.alpha.XUIAlphaTextView
|
||||
android:id="@+id/tv_other_login"
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_gravity="start"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="其他登录方式"
|
||||
android:textColor="@color/xui_config_color_primary_text" />
|
||||
|
||||
<com.xuexiang.xui.widget.alpha.XUIAlphaTextView
|
||||
android:id="@+id/tv_forget_password"
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_gravity="end"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="忘记密码"
|
||||
android:textColor="@color/xui_config_color_primary_text" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.xuexiang.xui.widget.textview.supertextview.SuperButton
|
||||
android:id="@+id/bt_login"
|
||||
style="@style/SuperButton.Primary.Login"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/title_login" />
|
||||
|
||||
<com.xuexiang.xui.widget.textview.supertextview.SuperButton
|
||||
android:id="@+id/bt_register"
|
||||
style="@style/SuperButton.Primary.Login"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/title_register" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_protocol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleX="0.7"
|
||||
android:scaleY="0.7" />
|
||||
|
||||
<TextView
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/agree_protocol"
|
||||
android:textColor="@color/xui_config_color_primary_text" />
|
||||
|
||||
<com.xuexiang.xui.widget.alpha.XUIAlphaTextView
|
||||
android:id="@+id/tv_user_protocol"
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/title_user_protocol"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
|
||||
<TextView
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/lab_and"
|
||||
android:textColor="@color/xui_config_color_primary_text" />
|
||||
|
||||
<com.xuexiang.xui.widget.alpha.XUIAlphaTextView
|
||||
android:id="@+id/tv_privacy_protocol"
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/title_privacy_protocol"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
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:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!--主页面-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:background="?android:attr/windowBackground"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:menu="@menu/bottom_nav_menu" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/nav_view" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- 侧边栏-->
|
||||
<com.google.android.material.navigation.NavigationView
|
||||
android:id="@+id/search"
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
tools:ignore="MissingConstraints" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</com.google.android.material.navigation.NavigationView>
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
@ -1,51 +0,0 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".Activity.PoetryListActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/titleBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/xui_config_color_titlebar"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="title"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20dp"/>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/titleBar">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/poemList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#fff"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,142 +0,0 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/app"
|
||||
android:layout_marginTop="40dp"/>
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/TextStyle.Title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="注 册"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:tint="?attr/colorAccent"
|
||||
app:srcCompat="@drawable/ic_phone" />
|
||||
|
||||
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
|
||||
android:id="@+id/r_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:hint="@string/tip_please_input_username"
|
||||
app:met_clearButton="true"
|
||||
app:met_errorMessage="@string/tip_phone_number_error"
|
||||
app:met_floatingLabel="normal"
|
||||
app:met_floatingLabelText="@string/title_username" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_verify_code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:tint="?attr/colorAccent"
|
||||
app:srcCompat="@drawable/ic_password" />
|
||||
|
||||
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
|
||||
android:id="@+id/r_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:hint="@string/hint_please_input_verify_code"
|
||||
app:met_clearButton="false"
|
||||
app:met_errorMessage="@string/tip_error"
|
||||
app:met_floatingLabel="normal"
|
||||
app:met_floatingLabelText="@string/title_password"
|
||||
app:met_maxCharacters="11" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.xuexiang.xui.widget.textview.supertextview.SuperButton
|
||||
android:id="@+id/bt_register"
|
||||
style="@style/SuperButton.Primary.Login"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/title_register" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_protocol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleX="0.7"
|
||||
android:scaleY="0.7" />
|
||||
|
||||
<TextView
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/agree_protocol"
|
||||
android:textColor="@color/xui_config_color_primary_text" />
|
||||
|
||||
<com.xuexiang.xui.widget.alpha.XUIAlphaTextView
|
||||
android:id="@+id/tv_user_protocol"
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/title_user_protocol"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
|
||||
<TextView
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/lab_and"
|
||||
android:textColor="@color/xui_config_color_primary_text" />
|
||||
|
||||
<com.xuexiang.xui.widget.alpha.XUIAlphaTextView
|
||||
android:id="@+id/tv_privacy_protocol"
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/title_privacy_protocol"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,108 +0,0 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".Activity.TestActivity">
|
||||
|
||||
<!-- 具体诗词原文-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/poetpanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent">
|
||||
|
||||
<!-- 诗词名-->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="408dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="title"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 作者朝代-->
|
||||
<TextView
|
||||
android:id="@+id/author"
|
||||
android:layout_width="403dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="dynasty . author"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title" />
|
||||
|
||||
<!-- 原文-->
|
||||
<ScrollView
|
||||
android:layout_width="307dp"
|
||||
android:layout_height="153dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/author"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
tools:ignore="MissingConstraints" />
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/startRecord"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="onRecord"
|
||||
android:text="开始测试" />
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/viewAns"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="查看答案" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.github.mikephil.charting.charts.HorizontalBarChart
|
||||
android:id="@+id/ratings"
|
||||
android:layout_width="360dp"
|
||||
android:layout_height="207dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.49"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</com.github.mikephil.charting.charts.HorizontalBarChart>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result"
|
||||
android:layout_width="261dp"
|
||||
android:layout_height="64dp"
|
||||
android:text=""
|
||||
android:textSize="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ratings" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tag"
|
||||
style="@style/TextStyle.Explain"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginLeft="?attr/xui_config_content_spacing_horizontal"
|
||||
android:layout_marginTop="?attr/xui_config_content_spacing_horizontal"
|
||||
android:background="@drawable/bg_rect_round_blue"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/xui_config_color_titlebar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"/>
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/text_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/change_to_voice"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
app:srcCompat="@drawable/voice" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/input_txet"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_weight="15"
|
||||
android:hint="请输入内容"
|
||||
android:maxLines="2"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/send"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="#1EBD3D"
|
||||
android:text="发送"
|
||||
android:textColor="#fff" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/voice_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/back_to_text"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
app:srcCompat="@drawable/voice" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/record_voice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="15"
|
||||
android:text="按住说话"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@ -1,16 +0,0 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/msg_recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
<include layout="@layout/bottom"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,72 +0,0 @@
|
||||
<?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">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/head"
|
||||
android:layout_width="178dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="创建聊天室"
|
||||
android:textAlignment="center"
|
||||
android:textSize="30dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.497"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="298dp"
|
||||
android:layout_height="196dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/head"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="聊天室名"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/rname"
|
||||
android:layout_width="223dp"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="65dp"
|
||||
android:layout_weight="1"
|
||||
android:text="简介"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="110dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="确认"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,182 +0,0 @@
|
||||
<?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"
|
||||
xmlns:zhy="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Fragment.AiPoetry.AiPoetryFragment">
|
||||
|
||||
<!-- 顶部导航-->
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/titleBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/xui_config_color_titlebar"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="AI 诗 人"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/menu_icon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/ic_setting"/>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
<TextView
|
||||
android:id="@+id/menu_line"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/titleBar"/>
|
||||
|
||||
<!--诗词体裁选择-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ai_tag_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/menu_line"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="150dp">
|
||||
|
||||
<com.zhy.view.flowlayout.TagFlowLayout
|
||||
android:id="@+id/ai_poem_tag_flow"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:foregroundGravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintWidth_percent="0.6"
|
||||
app:layout_constraintTop_toTopOf="@id/ai_tag_layout"
|
||||
zhy:max_select="1">
|
||||
</com.zhy.view.flowlayout.TagFlowLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ai_spilt_line"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ai_poem_tag_flow"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="15dp">
|
||||
|
||||
<com.zhy.view.flowlayout.TagFlowLayout
|
||||
android:id="@+id/ai_style_tag_flow"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:foregroundGravity="center"
|
||||
app:layout_constraintWidth_percent="0.5"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ai_spilt_line"
|
||||
zhy:max_select="1">
|
||||
</com.zhy.view.flowlayout.TagFlowLayout>
|
||||
|
||||
<!--<com.xuexiang.xui.widget.spinner.materialspinner.MaterialSpinner
|
||||
style="@style/Material.SpinnerStyle"
|
||||
android:id="@+id/ai_ci_pai"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintLeft_toRightOf="@id/ai_style_tag_flow"
|
||||
app:layout_constraintTop_toTopOf="@id/ai_spilt_line"/>
|
||||
-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!--诗词创作-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ai_creating_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="25dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/ai_tag_layout"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent">
|
||||
<!--输入框-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/create_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ai_creating_layout">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ai_input_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/editstyle"
|
||||
app:layout_constraintHorizontal_bias="0.297"
|
||||
app:layout_constraintWidth_percent="0.5"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
|
||||
android:id="@+id/input_keyword"
|
||||
style="@style/EditText.Normal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="1dp"
|
||||
android:hint="输入关键词组"
|
||||
android:textAlignment="center"
|
||||
android:textColorHint="@color/xui_config_color_titlebar"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintHorizontal_bias="0.297"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:met_autoValidate="true"
|
||||
app:met_errorMessage="请输入中文字符"
|
||||
app:met_hideUnderline="true"
|
||||
app:met_regexp="[\u4e00-\u9fa5|\s]+"
|
||||
app:met_underlineColor="#fff"
|
||||
app:met_validateOnFocusLost="true"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.xuexiang.xui.widget.button.roundbutton.RoundButton
|
||||
android:id="@+id/creating_button"
|
||||
style="@style/RoundButton.Auto"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:text="开始"
|
||||
android:textColor="#fff"
|
||||
app:rb_backgroundColor="@color/xui_config_color_titlebar"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toRightOf="@id/ai_input_bar"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.2"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/created_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:lineSpacingMultiplier="1.3"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/create_bar"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,91 +0,0 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".Fragment.association.AssociationFragment"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true">
|
||||
|
||||
<!-- 顶部导航-->
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/titleBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/xui_config_color_titlebar"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="社 群"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/menu_icon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/ic_setting"/>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
<TextView
|
||||
android:id="@+id/menu_line"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/titleBar"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/key"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/searchButton"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@drawable/search"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@android:color/transparent"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/createRoomButton"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/transparent"
|
||||
android:scaleType="fitXY"
|
||||
app:srcCompat="@drawable/create_room" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/room_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,301 +0,0 @@
|
||||
<?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"
|
||||
tools:context=".Fragment.home.HomeFragment">
|
||||
|
||||
<!-- 顶部导航-->
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/titleBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/xui_config_color_titlebar"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="每 日 推 荐"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/menu_icon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/ic_setting"/>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
<TextView
|
||||
android:id="@+id/menu_line"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/titleBar"/>
|
||||
|
||||
<!-- 主页面-->
|
||||
<ScrollView
|
||||
android:id="@+id/detail_scroll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="vertical"
|
||||
android:paddingBottom="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/menu_line">
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/titleBar">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/titleBar">
|
||||
|
||||
<!--每日一句-->
|
||||
<TextView
|
||||
android:id="@+id/label1"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:background="@drawable/type_label_style"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:text="每日一句"
|
||||
app:layout_constraintLeft_toRightOf="@id/label1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/dailySentence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="100dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sentence"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="荷花开后西湖好,载酒来时。"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="@id/dailySentence"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/sentence">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tag1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="华东"
|
||||
android:textSize="15dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tag2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="西湖"
|
||||
android:textSize="15dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!--搜索框-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/search_bar"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/round_editstyle"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/dailySentence">
|
||||
|
||||
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
|
||||
android:id="@+id/search"
|
||||
style="@style/EditText.Normal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:hint="输入诗名或作者或诗句进行查询"
|
||||
android:textAlignment="center"
|
||||
android:textColorHint="@color/xui_config_color_titlebar"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.8"
|
||||
app:met_autoValidate="true"
|
||||
app:met_errorMessage="请输入中文字符"
|
||||
app:met_hideUnderline="true"
|
||||
app:met_iconPadding="8dp"
|
||||
app:met_regexp="[\u4e00-\u9fa5|\s]+"
|
||||
app:met_underlineColor="#fff"
|
||||
app:met_validateOnFocusLost="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="0dp"
|
||||
android:src="@drawable/ic_search"
|
||||
app:layout_constraintLeft_toRightOf="@id/search"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!--每日一诗-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/poet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/search_bar">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/labelbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/label_style"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:text="每日一诗"
|
||||
app:layout_constraintLeft_toRightOf="@id/label"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<com.xuexiang.xui.widget.textview.label.LabelButtonView
|
||||
android:id="@+id/detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="20dp"
|
||||
android:text="查看详情"
|
||||
android:textColor="@color/xui_config_color_titlebar"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- 具体诗词原文-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/poetpanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/labelbar">
|
||||
|
||||
<!-- 诗词名-->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="title"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!-- 作者朝代-->
|
||||
<TextView
|
||||
android:id="@+id/author"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="dynasty . author"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title"/>
|
||||
|
||||
<!-- 原文-->
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:lineSpacingMultiplier="1.3"
|
||||
android:text="content"
|
||||
android:textAlignment="center"
|
||||
android:singleLine="false"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/author"/>
|
||||
|
||||
<!-- 背诵朗诵功能-->
|
||||
<com.xuexiang.xui.widget.button.roundbutton.RoundButton
|
||||
android:id="@+id/test_button"
|
||||
style="@style/RoundButton.Auto"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="测试一下"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/content"
|
||||
app:layout_constraintWidth_percent="0.6"/>
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/test_button"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||