diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..a95301d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1,7 @@
+.gradle
+/local.properties
+/build
+/captures
+*.iml
+.idea
+*.apk #optional
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..a3ff3e3
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,53 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ compileSdk 31
+
+ defaultConfig {
+ applicationId "com.example.travelor"
+ minSdk 24
+ targetSdk 31
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ sourceSets {
+ main{
+ jniLibs.srcDirs = ['libs']
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.3.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ implementation files('libs\\AMap2DMap_6.0.0_AMapSearch_9.7.0_AMapLocation_6.4.2_20231215.jar')
+ testImplementation 'junit:junit:4.+'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+
+ implementation 'androidx.cardview:cardview:1.0.0'
+ implementation 'androidx.appcompat:appcompat:1.4.0'
+
+ // todo added
+ implementation files('libs/SparkChain.aar')
+}
diff --git a/app/libs/AMap2DMap_6.0.0_AMapSearch_9.7.0_AMapLocation_6.4.2_20231215.jar b/app/libs/AMap2DMap_6.0.0_AMapSearch_9.7.0_AMapLocation_6.4.2_20231215.jar
new file mode 100644
index 0000000..c27979b
Binary files /dev/null and b/app/libs/AMap2DMap_6.0.0_AMapSearch_9.7.0_AMapLocation_6.4.2_20231215.jar differ
diff --git a/app/libs/SparkChain.aar b/app/libs/SparkChain.aar
new file mode 100644
index 0000000..6c894fc
Binary files /dev/null and b/app/libs/SparkChain.aar differ
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f98030f
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,23 @@
+# 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
+-keep class com.amap.** { *; }
+-dontwarn com.amap.**
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/example/travelor/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/travelor/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..30452ad
--- /dev/null
+++ b/app/src/androidTest/java/com/example/travelor/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.travelor;
+
+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 Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.travelor", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..2e4cd45
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/AddActivity.java b/app/src/main/java/com/example/travelor/AddActivity.java
new file mode 100644
index 0000000..45078b6
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/AddActivity.java
@@ -0,0 +1,82 @@
+package com.example.travelor;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.EditText;
+
+import com.example.travelor.bean.Plans;
+import com.example.travelor.datebase.PlansDbOpenHelper;
+import com.example.travelor.util.ToastUtil;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class AddActivity extends AppCompatActivity {
+
+ private EditText etMainPlan, etDetails;
+
+ private PlansDbOpenHelper mPlansDbOpenHelper;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_add);
+
+ etMainPlan = findViewById(R.id.et_name);
+ etDetails = findViewById(R.id.et_describe);
+ mPlansDbOpenHelper = new PlansDbOpenHelper(this);
+
+ etMainPlan.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+ @Override
+ public void onFocusChange(View v, boolean hasFocus) {
+ if (hasFocus) {
+ etMainPlan.setSelected(true);
+ } else {
+ etMainPlan.setSelected(false);
+ }
+ }
+ });
+
+ etDetails.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+ @Override
+ public void onFocusChange(View v, boolean hasFocus) {
+ if (hasFocus) {
+ etDetails.setSelected(true);
+ } else {
+ etDetails.setSelected(false);
+ }
+ }
+ });
+ }
+
+ public void add(View view) {
+ String mainPlan = etMainPlan.getText().toString();
+ String details = etDetails.getText().toString();
+ if (TextUtils.isEmpty(mainPlan)) {
+ ToastUtil.toastShort(this, "活动名称不能为空!");
+ return;
+ }
+
+ Plans plan = new Plans();
+
+ plan.setMainPlan(mainPlan);
+ plan.setDetails(details);
+ plan.setCreateTime(getCurrentTimeFormat());
+ long row = mPlansDbOpenHelper.insertData(plan);
+ if (row != -1) {
+ ToastUtil.toastShort(this, "添加成功!");
+ this.finish();
+ } else {
+ ToastUtil.toastShort(this, "添加失败!");
+ }
+ }
+
+ private String getCurrentTimeFormat() {
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY年MM月dd HH:mm:ss");
+ Date date = new Date();
+ return simpleDateFormat.format(date);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/AttractionCollectActivity.java b/app/src/main/java/com/example/travelor/AttractionCollectActivity.java
new file mode 100644
index 0000000..186ff16
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/AttractionCollectActivity.java
@@ -0,0 +1,122 @@
+package com.example.travelor;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.os.Bundle;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.TextView;
+
+import com.example.travelor.adapter.AttractionCltAdapter;
+import com.example.travelor.adapter.HotelAdapter;
+import com.example.travelor.bean.Attractions;
+import com.example.travelor.datebase.AttrCltDbOpenHelper;
+import com.example.travelor.util.ToastUtil;
+
+import java.util.List;
+
+public class AttractionCollectActivity extends AppCompatActivity {
+ private TextView vtManage;
+ private TextView vtBack;
+ private ViewGroup llDelete;
+ private TextView chooseAll;
+ private Button btDelete;
+ private Boolean isChooseAll = false;
+ private Boolean managed = false;
+
+ private List mAttraction;
+ private AttrCltDbOpenHelper mAttrCltDbOpenHelper;
+ private AttractionCltAdapter mAttractionCltAdapter;
+ private RecyclerView collectRecycler;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.attraction_collect_layout);
+
+ vtManage = findViewById(R.id.vt_manage);
+ vtBack = findViewById(R.id.back);
+ llDelete = findViewById(R.id.ll_delete);
+ btDelete = findViewById(R.id.bt_delete);
+ chooseAll = findViewById(R.id.choose_all);
+
+ collectRecycler = findViewById(R.id.collect_rlv);
+ mAttrCltDbOpenHelper = new AttrCltDbOpenHelper(this);
+
+ initData();
+ initEvent();
+ }
+
+ private void initEvent() {
+ vtManage.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if(managed == false) {
+ vtManage.setText("完成");
+ managed = true;
+ llDelete.setVisibility(View.VISIBLE);
+ }
+ else{
+ vtManage.setText("管理");
+ managed = false;
+ llDelete.setVisibility(View.INVISIBLE);
+ }
+
+ mAttractionCltAdapter.setCheckBoxStatus(managed);
+
+ deleteManage();
+ }
+ });
+
+ vtBack.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ finish();
+ }
+ });
+ }
+
+ private void deleteManage() {
+ chooseAll.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if(isChooseAll == false) {
+ isChooseAll = true;
+ mAttractionCltAdapter.chooseAll();
+ chooseAll.setText("取消");
+ }
+ else {
+ isChooseAll = false;
+ mAttractionCltAdapter.cancelAll();
+ chooseAll.setText("全选");
+ }
+
+ }
+ });
+
+ btDelete.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ mAttractionCltAdapter.deleteChosen();
+ ToastUtil.toastShort(AttractionCollectActivity.this, "删除成功!");
+ }
+ });
+ }
+
+ private void initData() {
+ llDelete.setVisibility(View.INVISIBLE); // 初始是看不见的
+
+ mAttraction = mAttrCltDbOpenHelper.queryAllFromDb();
+ mAttractionCltAdapter = new AttractionCltAdapter(this, mAttraction);
+ collectRecycler.setAdapter(mAttractionCltAdapter);
+
+ RecyclerView.LayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
+ collectRecycler.setLayoutManager(linearLayoutManager); // 创建布局管理器
+ mAttractionCltAdapter.notifyDataSetChanged();
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/DetailsPageActivity.java b/app/src/main/java/com/example/travelor/DetailsPageActivity.java
new file mode 100644
index 0000000..f3cfc8f
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/DetailsPageActivity.java
@@ -0,0 +1,281 @@
+package com.example.travelor;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.viewpager.widget.ViewPager;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.VideoView;
+
+import com.example.travelor.adapter.HotelAdapter;
+import com.example.travelor.adapter.ImagePagerAdapter;
+import com.example.travelor.bean.Attractions;
+import com.example.travelor.bean.Hotels;
+import com.example.travelor.bean.Plans;
+import com.example.travelor.datebase.AttrCltDbOpenHelper;
+import com.example.travelor.datebase.HotelDbOpenHelper;
+import com.example.travelor.fragment.FrontPageFragment;
+import com.example.travelor.util.SpfUtil;
+import com.example.travelor.util.ToastUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DetailsPageActivity extends AppCompatActivity {
+ private ViewPager viewPager;
+ private List imageList;
+ private ArrayList dots = new ArrayList<>();
+ private Attractions mAttraction;
+
+ private TextView tvName;
+ private TextView tvRank;
+ private TextView tvLocation;
+ private List imageViews = new ArrayList<>();
+ private TextView tvPrice;
+ private TextView tvIntroduce;
+ private TextView back;
+
+ private VideoView videoView;
+ private Button btnToggle;
+ private int currentPosition = 1;
+ private boolean isPlaying = false;
+
+ private Context mContext;
+ private View likeItIcon;
+ private View locationIcon;
+ public static final String KEY_COLLECTED = "collected";
+
+ private RecyclerView hotelRecycler;
+ private List mHotels;
+ private HotelAdapter mHotelAdapter;
+ private HotelDbOpenHelper mHotelDbOpenHelper;
+
+ private Button btCollect;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.details_page_layout);
+ mContext = this;
+
+ tvName = findViewById(R.id.name);
+ tvRank = findViewById(R.id.rank);
+ tvPrice = findViewById(R.id.price);
+ tvIntroduce = findViewById(R.id.introduce);
+ tvLocation = findViewById(R.id.location);
+ btCollect = findViewById(R.id.buy_now);
+ imageViews.add((ImageView)findViewById(R.id.photo1));
+ imageViews.add((ImageView)findViewById(R.id.photo2));
+ imageViews.add((ImageView)findViewById(R.id.photo3));
+
+ hotelRecycler = findViewById(R.id.hotel_rl);
+ mHotels = new ArrayList<>();
+ mHotelDbOpenHelper = new HotelDbOpenHelper(this);
+
+ initData();
+ initEvent();
+ }
+
+ private void initEvent() {
+ imageSwitch();
+ videoPlayer();
+ setLikeIt();
+ viewRoute();
+ backEvent();
+ collect();
+ }
+
+ private void collect() {
+ btCollect.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ AttrCltDbOpenHelper attractionCollectDbOpenHelper = new AttrCltDbOpenHelper(mContext);
+ long row = attractionCollectDbOpenHelper.insertData(mAttraction);
+ if (row != -1) {
+ ToastUtil.toastShort(mContext, "收藏成功!");
+ } else {
+ ToastUtil.toastShort(mContext, "已收藏!");
+ }
+ }
+ });
+ }
+
+ private void backEvent() {
+ back = findViewById(R.id.turn_back);
+ back.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ finish();
+ }
+ });
+ }
+
+ // 查看路线
+ private void viewRoute() {
+ locationIcon = findViewById(R.id.location_icon);
+ locationIcon.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(DetailsPageActivity.this, GaodeMapActivity.class);
+ intent.putExtra("attraction", mAttraction);
+ startActivity(intent);
+ finish();
+ }
+ });
+ }
+
+ // 设置收藏点亮
+ private void setLikeIt() {
+ likeItIcon = findViewById(R.id.likeIt_icon);
+
+ likeItIcon.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Boolean isCollected = SpfUtil.getBoolean(DetailsPageActivity.this, KEY_COLLECTED);
+ if(isCollected) {
+ likeItIcon.setSelected(false);
+ SpfUtil.saveBoolean(DetailsPageActivity.this, KEY_COLLECTED, false);
+ }
+ else {
+ likeItIcon.setSelected(true);
+ SpfUtil.saveBoolean(DetailsPageActivity.this, KEY_COLLECTED, true);
+ }
+ }
+ });
+ }
+
+ // 风景图设置
+ private void setImages(String imagesString) {
+ String[] imageNames = imagesString.split("#");
+
+ for (int i = 0; i < imageNames.length; i++) {
+ int id = getResources().getIdentifier(imageNames[i], "drawable", getPackageName());
+ imageViews.get(i).setImageResource(id);
+ }
+ }
+
+ // 接收数据并初始化
+ private void initData() {
+ Intent intent = getIntent();
+ mAttraction = (Attractions) intent.getSerializableExtra("attraction");
+ if (mAttraction != null) {
+ tvName.setText(mAttraction.getName());
+ tvRank.setText(mAttraction.getRank());
+ tvIntroduce.setText(" " + mAttraction.getIntroduce());
+ tvLocation.setText("地理位置: "+mAttraction.getLocation());
+ tvPrice.setText("¥ " + mAttraction.getPrice());
+ setImages(mAttraction.getImages());
+ }
+
+ initHotel(mAttraction.getName());
+ }
+
+ // 处理酒店视图
+ private void initHotel(String mAttraction) {
+ mHotels = mHotelDbOpenHelper.queryFromDbByAttraction("杭州西湖"); // todo 动态景点名称
+ mHotelAdapter = new HotelAdapter(this, mHotels);
+ hotelRecycler.setAdapter(mHotelAdapter);
+
+ RecyclerView.LayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
+ hotelRecycler.setLayoutManager(linearLayoutManager); // 创建布局管理器
+ mHotelAdapter.notifyDataSetChanged();
+ }
+
+ //视频播放
+ private void videoPlayer() {
+ videoView = findViewById(R.id.videoView);
+ btnToggle = findViewById(R.id.btnToggle);
+
+ String videoPath = "android.resource://" + getPackageName() + "/" + R.raw.west_lack;
+ Uri uri = Uri.parse(videoPath);
+ videoView.setVideoURI(uri);
+ videoView.requestFocus();
+ videoView.seekTo(currentPosition);
+
+ btnToggle.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if(!isPlaying) {
+ videoView.seekTo(currentPosition); // 设置播放位置
+ videoView.start();
+ isPlaying = true;
+ btnToggle.setSelected(true);
+ btnToggle.setVisibility(View.INVISIBLE);
+ setBtnVisible();
+ }
+ else { // 如果正在播放,则停止播放
+ videoView.pause();
+ currentPosition = videoView.getCurrentPosition(); // 记录当前播放位置;
+ isPlaying = false;
+ btnToggle.setSelected(false);
+ }
+ }
+ });
+ }
+
+ // 开始停止播放逻辑
+ private void setBtnVisible() {
+ videoView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if(btnToggle.getVisibility() == View.INVISIBLE)
+ btnToggle.setVisibility(View.VISIBLE);
+ else btnToggle.setVisibility(View.INVISIBLE);
+ }
+ });
+ };
+
+ // 图片轮回切换
+ private void imageSwitch() {
+ viewPager = findViewById(R.id.viewPager);
+ imageList = new ArrayList<>(); // 存储图片资源的列表
+ final int[] position = {0}; // 当前显示的图片索引
+
+ // 添加图片资源到列表
+ imageList.add(R.drawable.west_lake1);
+ imageList.add(R.drawable.west_lake2);
+ imageList.add(R.drawable.west_lake3);
+
+ dots.add(findViewById(R.id.p1));
+ dots.add(findViewById(R.id.p2));
+ dots.add(findViewById(R.id.p3));
+
+ // 创建适配器并设置给ViewPager
+ ImagePagerAdapter adapter = new ImagePagerAdapter(imageList);
+ viewPager.setAdapter(adapter);
+
+ // 设置自动切换
+ Handler handler = new Handler();
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ int oldPosition = position[0];
+ position[0] = (position[0] + 1) % imageList.size();
+
+ viewPager.setCurrentItem(position[0], true);
+ dots.get(oldPosition).setBackgroundResource(R.drawable.dot_normal);
+ dots.get(position[0]).setBackgroundResource(R.drawable.dot_focus);
+
+ handler.postDelayed(this, 1000); // 设置延时时间(单位:毫秒)
+ }
+ };
+
+ // 启动自动切换
+ handler.postDelayed(runnable, 1000); // 设置初始延时时间(单位:毫秒)
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/EditPlanActivity.java b/app/src/main/java/com/example/travelor/EditPlanActivity.java
new file mode 100644
index 0000000..e60cff3
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/EditPlanActivity.java
@@ -0,0 +1,72 @@
+package com.example.travelor;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.TextView;
+
+import com.example.travelor.bean.Plans;
+import com.example.travelor.datebase.PlansDbOpenHelper;
+import com.example.travelor.util.ToastUtil;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class EditPlanActivity extends AppCompatActivity {
+ private TextView et_mainPlan;
+ private TextView et_details;
+ private TextView createTime;
+ private Plans mPlan;
+ private PlansDbOpenHelper mPlansDbOpenHelper;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_edit_plan);
+
+ et_mainPlan = findViewById(R.id.et_name);
+ et_details = findViewById(R.id.et_describe);
+
+ initData();
+ }
+
+ private void initData() {
+ Intent intent = getIntent();
+ mPlan = (Plans) intent.getSerializableExtra("plan");
+ if (mPlan != null) {
+ et_mainPlan.setText(mPlan.getMainPlan());
+ et_details.setText(mPlan.getDetails());
+ }
+ mPlansDbOpenHelper = new PlansDbOpenHelper(this);
+ }
+
+ public void save(View view) {
+ String mainPlan = et_mainPlan.getText().toString();
+ String details = et_details.getText().toString();
+ if (TextUtils.isEmpty(mainPlan)) {
+ ToastUtil.toastShort(this, "标题不能为空!");
+ return;
+ }
+
+ mPlan.setMainPlan(mainPlan);
+ mPlan.setDetails(details);
+ mPlan.setCreateTime(getCurrentTimeFormat());
+ long rowId = mPlansDbOpenHelper.updateData(mPlan);
+ if (rowId != -1) {
+ ToastUtil.toastShort(this, "修改成功!");
+ this.finish();
+ }else{
+ ToastUtil.toastShort(this, "修改失败!");
+ }
+
+ }
+
+ private String getCurrentTimeFormat() {
+ SimpleDateFormat sdf = new SimpleDateFormat("YYYY年MM月dd日 HH:mm:ss");
+ Date date = new Date();
+ return sdf.format(date);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/GaodeMapActivity.java b/app/src/main/java/com/example/travelor/GaodeMapActivity.java
new file mode 100644
index 0000000..8fcdc8b
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/GaodeMapActivity.java
@@ -0,0 +1,123 @@
+package com.example.travelor;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.amap.api.location.AMapLocation;
+import com.amap.api.location.AMapLocationClient;
+import com.amap.api.location.AMapLocationClientOption;
+import com.amap.api.location.AMapLocationListener;
+import com.amap.api.maps2d.AMap;
+import com.amap.api.maps2d.CameraUpdateFactory;
+import com.amap.api.maps2d.MapView;
+import com.amap.api.maps2d.MapsInitializer;
+import com.amap.api.maps2d.model.LatLng;
+import com.amap.api.maps2d.model.MarkerOptions;
+import com.amap.api.services.core.ServiceSettings;
+import com.example.travelor.bean.Attractions;
+
+
+public class GaodeMapActivity extends AppCompatActivity {
+
+ private MapView mMapView;
+ private AMapLocationClient mLocationClient;
+ private Button back;
+ private Attractions attractions;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.gaode_map_layout);//设置对应的XML布局文件
+
+ initData();
+
+ //定位隐私政策同意
+ AMapLocationClient.updatePrivacyShow(this,true,true);
+ AMapLocationClient.updatePrivacyAgree(this,true);
+
+ mMapView = (MapView) findViewById(R.id.mapView);
+ mMapView.onCreate(savedInstanceState);// 此方法必须重写
+ AMap aMap = mMapView.getMap();
+ aMap.setTrafficEnabled(true);// 显示实时交通状况
+ //地图模式可选类型:MAP_TYPE_NORMAL,MAP_TYPE_SATELLITE,MAP_TYPE_NIGHT
+ aMap.setMapType(AMap.MAP_TYPE_SATELLITE);// 卫星地图模式
+
+ // 返回
+ back = findViewById(R.id.back);
+ back.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(GaodeMapActivity.this, DetailsPageActivity.class);
+ intent.putExtra("attraction", attractions);
+ startActivity(intent);
+ finish();
+ }
+ });
+
+ // 初始化定位客户端
+// try {
+// mLocationClient = new AMapLocationClient(getApplicationContext());
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// AMapLocationClientOption option = new AMapLocationClientOption();
+// option.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
+// mLocationClient.setLocationOption(option);
+// mLocationClient.setLocationListener(new AMapLocationListener() {
+// @Override
+// public void onLocationChanged(AMapLocation aMapLocation) {
+// // 处理定位结果
+// if (aMapLocation != null) {
+// double latitude = aMapLocation.getLatitude();
+// double longitude = aMapLocation.getLongitude();
+// // 在地图上显示当前位置
+// LatLng latLng = new LatLng(latitude, longitude);
+// MarkerOptions markerOptions = new MarkerOptions().position(latLng);
+// AMap map = mMapView.getMap();
+// map.addMarker(markerOptions);
+// map.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16));
+// }
+// }
+// });
+//
+// mLocationClient.startLocation();
+ }
+
+ private void initData() {
+ Intent intent = getIntent();
+ attractions = (Attractions) intent.getSerializableExtra("attraction");
+ }
+
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ //在activity执行onDestroy时执行mMapView.onDestroy(),销毁地图
+ mMapView.onDestroy();
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ //在activity执行onResume时执行mMapView.onResume (),重新绘制加载地图
+ mMapView.onResume();
+ }
+ @Override
+ protected void onPause() {
+ super.onPause();
+ //在activity执行onPause时执行mMapView.onPause (),暂停地图的绘制
+ mMapView.onPause();
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ //在activity执行onSaveInstanceState时执行mMapView.onSaveInstanceState (outState),保存地图当前的状态
+ mMapView.onSaveInstanceState(outState);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/LoginActivity.java b/app/src/main/java/com/example/travelor/LoginActivity.java
new file mode 100644
index 0000000..8c1d13a
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/LoginActivity.java
@@ -0,0 +1,101 @@
+package com.example.travelor;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.travelor.util.SpfUtil;
+
+import com.example.travelor.datebase.UsersDbOpenHelper;
+
+public class LoginActivity extends AppCompatActivity {
+
+ private EditText etAccount, etPassword;
+ private Button btnLogin;
+ private TextView etSignIn;
+ private CheckBox cbRememberMe;
+
+ private UsersDbOpenHelper mUsersDbOpenHelper;
+
+ public static final String KEY_ACCOUNT = "account";
+ public static final String KEY_PASSWORD = "password";
+ public static final String KEY_REMEMBER_CHECK = "remember_check";
+
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.login_layout);
+
+ etAccount = findViewById(R.id.account);
+ etPassword = findViewById(R.id.password);
+ btnLogin = findViewById(R.id.buttonLogin);
+ etSignIn = findViewById(R.id.sign_new_account);
+ cbRememberMe = findViewById(R.id.checkbox);
+
+ // 自动填充记录
+ String rmAccount = SpfUtil.getString(this, KEY_ACCOUNT);
+ String rmPassword = SpfUtil.getString(this, KEY_PASSWORD);
+ Boolean rmCheck = SpfUtil.getBoolean(this, KEY_REMEMBER_CHECK);
+ etAccount.setText(rmAccount);
+ etPassword.setText(rmPassword);
+ cbRememberMe.setChecked(rmCheck);
+
+ btnLogin.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ String account = etAccount.getText().toString();
+ String password = etPassword.getText().toString();
+
+ // 进行登录验证逻辑
+ if (isValidCredentials(account, password)) {
+ rememberMe(account, password);
+
+ // 登录成功,跳转到主界面或其他目标界面
+ Intent intent = new Intent(LoginActivity.this, PageJumpActivity.class);
+ startActivity(intent);
+ finish();
+ } else {
+ // 登录失败,显示错误消息
+ Toast.makeText(LoginActivity.this, "账号或密码错误!", Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+
+ etSignIn.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(LoginActivity.this, SignInActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ });
+ }
+
+ private void rememberMe(String account, String password) {
+ boolean isChecked = cbRememberMe.isChecked();
+ if(isChecked) {
+ SpfUtil.saveString(this, KEY_ACCOUNT, account);
+ SpfUtil.saveString(this, KEY_PASSWORD, password);
+ SpfUtil.saveBoolean(this, KEY_REMEMBER_CHECK, true);
+ }
+ else {
+ SpfUtil.saveString(this, KEY_ACCOUNT, "");
+ SpfUtil.saveString(this, KEY_PASSWORD, "");
+ SpfUtil.saveBoolean(this, KEY_REMEMBER_CHECK, false);
+ }
+ }
+
+ private boolean isValidCredentials(String account, String password) {
+ mUsersDbOpenHelper = new UsersDbOpenHelper(this);
+ String realPassword = mUsersDbOpenHelper.queryFromDbByAccount(account);
+ if(realPassword.equals("") || !realPassword.equals(password))
+ return false;
+ return true;
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/MainActivity.java b/app/src/main/java/com/example/travelor/MainActivity.java
new file mode 100644
index 0000000..b5a0d20
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/MainActivity.java
@@ -0,0 +1,48 @@
+package com.example.travelor;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+//import android.util.Log;
+//
+//import com.iflytek.sparkchain.core.SparkChain;
+//import com.iflytek.sparkchain.core.SparkChainConfig;
+
+public class MainActivity extends AppCompatActivity {
+
+ private static final String TAG = "test";
+ private Handler handler = new Handler();
+ private Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ tomainActivity();
+ }
+ };
+
+ private void tomainActivity(){
+ startActivity(new Intent(this, LoginActivity.class));
+ finish();
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+// initSpark();
+
+ handler.postDelayed(runnable, 1000);
+ }
+
+// private void initSpark() {
+// SparkChainConfig config = SparkChainConfig.builder()
+// .appID("cb12df0e")
+// .apiKey("5ccdd362e25ff16b77acd893af903ac0")
+// .apiSecret("ZGZmYTgyNWFmYWVjYzdlZTgwYzkyOGM0");//从平台获取的授权appid,apikey,apisecrety
+// int ret = SparkChain.getInst().init(getApplicationContext(), config);
+// Log.d(TAG,"sdk init:"+ret);
+// }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/PageJumpActivity.java b/app/src/main/java/com/example/travelor/PageJumpActivity.java
new file mode 100644
index 0000000..f1526e5
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/PageJumpActivity.java
@@ -0,0 +1,56 @@
+package com.example.travelor;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+import com.example.travelor.fragment.FrontPageFragment;
+
+import com.example.travelor.fragment.MineFragment;
+import com.example.travelor.fragment.PlanFragment;
+import com.example.travelor.fragment.SparkAiFragment;
+
+public class PageJumpActivity extends AppCompatActivity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main_page_layout);
+
+ FragmentManager fm = getSupportFragmentManager();
+ FragmentTransaction ft = fm.beginTransaction();
+ FrontPageFragment fgm_front_page = new FrontPageFragment();
+ ft.replace(R.id.main_fragment, fgm_front_page);
+ ft.commit();
+ }
+
+ public void page_jump(View view) {
+ FragmentManager fm = getSupportFragmentManager();
+ FragmentTransaction ft = fm.beginTransaction();
+
+ FrontPageFragment fgm_front_page = new FrontPageFragment();
+ PlanFragment fgm_plan_page = new PlanFragment();
+ MineFragment fgm_mine_page = new MineFragment();
+ SparkAiFragment fgm_spark_page = new SparkAiFragment();
+
+ switch (view.getId()){
+ case R.id.front_page:
+ ft.replace(R.id.main_fragment, fgm_front_page);
+ break;
+ case R.id.plan:
+ ft.replace(R.id.main_fragment, fgm_plan_page);
+ break;
+ case R.id.mine:
+ ft.replace(R.id.main_fragment, fgm_mine_page);
+ break;
+ case R.id.spark:
+ ft.replace(R.id.main_fragment, fgm_spark_page);
+ break;
+ }
+ ft.commit();
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/SignInActivity.java b/app/src/main/java/com/example/travelor/SignInActivity.java
new file mode 100644
index 0000000..15738f6
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/SignInActivity.java
@@ -0,0 +1,166 @@
+package com.example.travelor;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.example.travelor.bean.Users;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+import com.example.travelor.datebase.UsersDbOpenHelper;
+
+public class SignInActivity extends AppCompatActivity {
+ private EditText etAccount;
+ private EditText etPassword;
+ private EditText etConfirmPwd;
+ private EditText etUserName;
+ private EditText etVerifyCode;
+ private Button btnSignIn;
+ private Button btnVerify;
+ private TextView tvAgree;
+ private TextView tvLogin;
+ private CheckBox ckAgree;
+ private UsersDbOpenHelper mUsersDbOpenHelper;
+
+ private String verification_code = "";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.sign_in_layout);
+
+ etAccount = findViewById(R.id.sign_account);
+ etPassword = findViewById(R.id.new_password);
+ etConfirmPwd = findViewById(R.id.confirm_password);
+ etVerifyCode = findViewById(R.id.verification_code);
+ etUserName = findViewById(R.id.username);
+ btnSignIn = findViewById(R.id.buttonSignIn);
+ btnVerify = findViewById(R.id.sent_VerifyCode);
+ tvAgree = findViewById(R.id.agree_pact);
+ tvLogin = findViewById(R.id.tvlogin);
+ ckAgree = findViewById(R.id.agree_check);
+ mUsersDbOpenHelper = new UsersDbOpenHelper(this);
+
+ //发送验证码
+ btnVerify.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Random random = new Random();
+ int randomNumber = 1000 + random.nextInt(9000);
+ verification_code = String.valueOf(randomNumber);
+
+ Toast.makeText(SignInActivity.this, verification_code, Toast.LENGTH_SHORT).show();
+ }
+ });
+
+ // 注册按钮
+ btnSignIn.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ String mAccount = etAccount.getText().toString();
+ String mPassword = etPassword.getText().toString();
+ String mConfirmPwd = etConfirmPwd.getText().toString();
+ String mVerifyCode = etVerifyCode.getText().toString();
+ String UserName = etUserName.getText().toString();
+
+ Boolean is_OK = isValidAccount(mAccount, mPassword, mConfirmPwd, mVerifyCode, UserName);
+ if(is_OK) {
+ saveDate(mAccount, mPassword, UserName);
+ Toast.makeText(SignInActivity.this, "注册成功!", Toast.LENGTH_SHORT).show();
+
+ Intent intent = new Intent(SignInActivity.this, LoginActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ }
+ });
+
+ tvAgree.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(SignInActivity.this);
+ builder.setTitle("安全协议");
+ builder.setMessage("xxxxxxxxx\nxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxx");
+ builder.setCancelable(false);
+ builder.setPositiveButton("同意", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ ckAgree.setChecked(true);
+ }
+ });
+ builder.show();
+ }
+ });
+
+ tvLogin.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(SignInActivity.this, LoginActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ });
+
+ }
+
+ // 获取当前时间
+ private String getCurrentTimeFormat() {
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY年MM月dd HH:mm:ss");
+ Date date = new Date();
+ return simpleDateFormat.format(date);
+ }
+
+ // 将新用户保存到数据库
+ private void saveDate(String mAccount, String mPassword, String userName) {
+ Users newUser = new Users();
+
+ newUser.setAccount(mAccount);
+ newUser.setUserName(userName);
+ newUser.setPassword(mPassword);
+ newUser.setCreatedTime(getCurrentTimeFormat());
+
+ mUsersDbOpenHelper.insertData(newUser);
+ }
+
+ // 判断新用户设置是否合法
+ private Boolean isValidAccount(String mAccount, String mPassword, String mConfirmPwd, String mVerifyCode, String userName) {
+ String regex = "^1[3456789]\\d{9}$";
+ if(!mAccount.matches(regex)) {
+ Toast.makeText(SignInActivity.this, "账号不合法!", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ if(!mUsersDbOpenHelper.queryFromDbByAccount(mAccount).equals("")) {
+ Toast.makeText(SignInActivity.this, "此账号已经存在,请登录!", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ if(mPassword.length() < 6) {
+ Toast.makeText(SignInActivity.this, "密码太短!", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ if(!mConfirmPwd.equals(mPassword)) {
+ Toast.makeText(SignInActivity.this, "密码确认有误!", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ if(verification_code.equals("") || !mVerifyCode.equals(verification_code)) {
+ Toast.makeText(SignInActivity.this, "验证码错误!", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ if(!ckAgree.isChecked()) {
+ Toast.makeText(SignInActivity.this, "请同意协议!", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/SparkAiActivity.java b/app/src/main/java/com/example/travelor/SparkAiActivity.java
new file mode 100644
index 0000000..088e143
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/SparkAiActivity.java
@@ -0,0 +1,144 @@
+package com.example.travelor;
+
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.travelor.R;
+import com.example.travelor.adapter.ChatAdapter;
+import com.example.travelor.bean.Chats;
+import com.example.travelor.datebase.ChatDbOpenHelper;
+import com.example.travelor.util.ToastUtil;
+import com.iflytek.sparkchain.core.LLM;
+import com.iflytek.sparkchain.core.LLMConfig;
+import com.iflytek.sparkchain.core.LLMOutput;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class SparkAiActivity extends AppCompatActivity {
+
+ private static final String TAG = "test";
+ private String results;
+// private LLM llm;
+ private Button btSend;
+ private EditText etQuestion;
+ private TextView tvBack;
+ private List mChats;
+ private ChatAdapter mChatAdapter;
+ private RecyclerView mRecyclerView;
+ private ChatDbOpenHelper mChatDbOpenHelper;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_spark_ai);
+// initSpark();
+ initData();
+ initEvent();
+ }
+
+ private void initData() {
+ btSend = findViewById(R.id.send);
+ etQuestion = findViewById(R.id.question);
+ mRecyclerView = findViewById(R.id.chat_list);
+ tvBack = findViewById(R.id.back);
+
+ mChats = new ArrayList<>();
+ mChatDbOpenHelper = new ChatDbOpenHelper(this);
+ }
+
+ public void onResume() {
+ super.onResume();
+ refreshDataFromDb();
+ setLayout();
+ }
+
+ private void setLayout() {
+ mChatAdapter.notifyDataSetChanged();
+ RecyclerView.LayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
+ mRecyclerView.setLayoutManager(linearLayoutManager); // 创建布局管理器
+ }
+
+ private void refreshDataFromDb() {
+ mChats = getDataFromDB();
+ mChatAdapter.refreshData(mChats);
+ }
+ private List getDataFromDB() {
+ return mChatDbOpenHelper.queryAllFromDb();
+ }
+
+ private void initEvent() {
+ mChatAdapter = new ChatAdapter(this,mChats);
+ mRecyclerView.setAdapter(mChatAdapter);
+
+ btSend.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ String content = etQuestion.getText().toString();
+ etQuestion.setText(""); // 发送后设置为空
+
+ Chats newUserChat = new Chats();
+ newUserChat.setContent(content);
+ newUserChat.setIdentity("user");
+ addItem(newUserChat);
+
+ String result = "亚布力雪乡位于中国黑龙江省,属于寒温带大陆性气候区。冬季气温极低,属于严寒地区。一般来说,12月至次年2月是雪乡最寒冷的季节,气温可达到零下20摄氏度甚至更低。在雪乡旅游时,一定要做好保暖工作,穿着厚重的冬装,戴上帽子、手套和围巾等防寒物品,以确保自己的身体能保持温暖。同时,还要注意防寒措施,如避免长时间暴露在室外、及时进食热食、多喝水等,以确保身体的健康和安全。";
+// String result = interact(content);
+ Chats newAiChat = new Chats();
+ newAiChat.setContent(result);
+ newAiChat.setIdentity("ai");
+ addItem(newAiChat);
+ }
+ });
+
+ tvBack.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ finish();
+ }
+ });
+ }
+
+ private void addItem(Chats newChat) {
+ long row = mChatDbOpenHelper.insertData(newChat);
+ if (row != -1) {
+ ToastUtil.toastShort(this, "添加成功!");
+ } else {
+ ToastUtil.toastShort(this, "添加失败!");
+ }
+ refreshDataFromDb();
+ }
+
+
+// private String interact(String question) {
+// LLMOutput syncOutput = llm.run(question);
+// String result = "对不起,我的能力不足,不能回答!";
+// if(syncOutput.getErrCode() == 0) {
+// Log.i(TAG, "同步调用:" + syncOutput.getRole() + ":" + syncOutput.getContent());
+// results = syncOutput.getContent();
+// System.out.println(results);
+// }else {
+// Log.e(TAG, "同步调用:" + "errCode" + syncOutput.getErrCode() + " errMsg:" + syncOutput.getErrMsg());
+// }
+// return result;
+// }
+//
+// private void initSpark() {
+// LLMConfig llmConfig = LLMConfig.builder();
+// llmConfig.domain("generalv2");
+// llmConfig.url("ws(s)://spark-api.xf-yun.com/v2.1/chat");//如果使用generalv2,domain和url都可缺省,SDK默认;如果使用general,url可缺省,SDK会自动补充;如果是其他,则需要设置domain和url。
+// llm = new LLM(llmConfig);
+// }
+
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/adapter/AttractionCardAdapter.java b/app/src/main/java/com/example/travelor/adapter/AttractionCardAdapter.java
new file mode 100644
index 0000000..43d6054
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/adapter/AttractionCardAdapter.java
@@ -0,0 +1,109 @@
+package com.example.travelor.adapter;
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.travelor.DetailsPageActivity;
+import com.example.travelor.R;
+import com.example.travelor.bean.Attractions;
+
+import java.util.List;
+
+import com.example.travelor.datebase.AttractionDbOpenHelper;
+
+public class AttractionCardAdapter extends RecyclerView.Adapter {
+
+ private List mAttractionList;
+ private LayoutInflater mLayoutInflater;
+ private Context mContext;
+
+ private AttractionDbOpenHelper mAttractionDbOpenHelper;
+
+ public AttractionCardAdapter(Context context, List mAttractionList){
+ this.mAttractionList = mAttractionList;
+ this.mContext = context;
+ mLayoutInflater = LayoutInflater.from(mContext);
+ mAttractionDbOpenHelper = new AttractionDbOpenHelper(mContext);
+ }
+
+ @NonNull
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = mLayoutInflater.inflate(R.layout.attraction_card, parent, false);
+ MyViewHolder myViewHolder = new MyViewHolder(view);
+
+ return myViewHolder;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+ bindViewHolder((MyViewHolder) holder, position);
+ }
+
+ private void bindViewHolder(MyViewHolder holder, int position) {
+ Attractions attraction = mAttractionList.get(position);
+ holder.mAttrName.setText(attraction.getName());
+ holder.mAttrRank.setText(attraction.getRank());
+ holder.mAttrLocation.setText(attraction.getLocation());
+
+// holder.mAttrImage.setImageResource(R.drawable.circular_image);
+ // 动态设置图片
+ holder.mAttrImage.setImageResource(getResourceId(attraction.getImages()));
+
+ holder.mCardContain.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ Intent intent = new Intent(mContext, DetailsPageActivity.class);
+ intent.putExtra("attraction", attraction);
+ mContext.startActivity(intent);
+ }
+ });
+ }
+
+ public int getResourceId(String fileNames) {
+ String[] imageNames = fileNames.split("#");
+ String resourceName = imageNames[0];
+ String resourceType = "drawable";
+ String packageName = mContext.getPackageName();
+ return mContext.getResources().getIdentifier(resourceName, resourceType, packageName);
+ }
+
+ @Override
+ public int getItemCount() {
+ return mAttractionList.size();
+ }
+
+ public void refreshData(List mAttractions) {
+ this.mAttractionList = mAttractions;
+ notifyDataSetChanged();
+ }
+
+ // 用于保存 list_item.xml 中的视图组件
+ class MyViewHolder extends RecyclerView.ViewHolder{
+ ImageView mAttrImage;
+ TextView mAttrName;
+ TextView mAttrRank;
+ TextView mAttrLocation;
+ ViewGroup mCardContain;
+
+ public MyViewHolder(@NonNull View itemView) {
+ super(itemView);
+ this.mAttrImage = itemView.findViewById(R.id.attraction_image);
+ this.mAttrName = itemView.findViewById(R.id.attraction_name);
+ this.mAttrRank = itemView.findViewById(R.id.rank);
+ this.mAttrLocation = itemView.findViewById(R.id.location);
+ this.mCardContain = itemView.findViewById(R.id.card_contain);
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/adapter/AttractionCltAdapter.java b/app/src/main/java/com/example/travelor/adapter/AttractionCltAdapter.java
new file mode 100644
index 0000000..57f6994
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/adapter/AttractionCltAdapter.java
@@ -0,0 +1,164 @@
+package com.example.travelor.adapter;
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.travelor.DetailsPageActivity;
+import com.example.travelor.LoginActivity;
+import com.example.travelor.R;
+import com.example.travelor.SignInActivity;
+import com.example.travelor.bean.Attractions;
+import com.example.travelor.datebase.AttrCltDbOpenHelper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AttractionCltAdapter extends RecyclerView.Adapter {
+ private List mAttractionList;
+ private LayoutInflater mLayoutInflater;
+ private Context mContext;
+ private Boolean checkboxVisible = false;
+ private Boolean mChooseAll = false;
+ private AttrCltDbOpenHelper mAttrCltDbOpenHelper;
+ private boolean mCancelAll = false;
+ private boolean[] checkedPositions; // 跟踪复选框的选中状态
+
+ public AttractionCltAdapter(Context context, List mAttraction) {
+ this.mAttractionList = mAttraction;
+ this.mContext = context;
+ mLayoutInflater = LayoutInflater.from(mContext);
+ mAttrCltDbOpenHelper = new AttrCltDbOpenHelper(mContext);
+ checkedPositions = new boolean[mAttraction.size()];
+ }
+
+ @NonNull
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = mLayoutInflater.inflate(R.layout.attraction_collect_card, parent, false);
+ AttractionCltAdapter.MyViewHolder myViewHolder = new AttractionCltAdapter.MyViewHolder(view);
+
+ return myViewHolder;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+ bindViewHolder((AttractionCltAdapter.MyViewHolder) holder, position);
+ }
+
+ private void bindViewHolder(AttractionCltAdapter.MyViewHolder holder, int position) {
+ Attractions attraction = mAttractionList.get(position);
+ holder.mAttrName.setText(attraction.getName());
+ holder.mAttrLocation.setText(attraction.getLocation());
+// holder.mAttrImage.setImageResource(R.drawable.west_lake1); // todo
+
+ // 动态设置图片
+ holder.mAttrImage.setImageResource(getResourceId(attraction.getImages()));
+ String introduce = attraction.getIntroduce();
+ // 卡片简介不能太长
+ holder.mAttrIntroduce.setText("简介:" + introduce.substring(0, Math.min(introduce.length(), 15)));
+
+ if (checkboxVisible) {
+ holder.mChoice.setVisibility(View.VISIBLE);
+ } else {
+ holder.mChoice.setVisibility(View.INVISIBLE);
+ checkedPositions[position] = false;
+ }
+
+ holder.mChoice.setChecked(checkedPositions[position]);
+ holder.mChoice.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ checkedPositions[position] = isChecked; // 更新选中状态
+ }
+ });
+
+ holder.mDetails.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(mContext, DetailsPageActivity.class);
+ intent.putExtra("attraction", attraction);
+ mContext.startActivity(intent);
+ }
+ });
+ }
+
+ public int getResourceId(String fileNames) {
+ String[] imageNames = fileNames.split("#");
+ String resourceName = imageNames[0];
+ String resourceType = "drawable";
+ String packageName = mContext.getPackageName();
+ return mContext.getResources().getIdentifier(resourceName, resourceType, packageName);
+ }
+
+ @Override
+ public int getItemCount() {
+ return mAttractionList.size();
+ }
+
+ public void refreshData(List mAttractions) {
+ this.mAttractionList = mAttractions;
+ for (int i = 0; i < mAttractionList.size(); i++)
+ checkedPositions[i] = false;
+ notifyDataSetChanged();
+ }
+
+ public void setCheckBoxStatus(Boolean managed) {
+ this.checkboxVisible = managed;
+ notifyDataSetChanged();
+ }
+
+ public void chooseAll() {
+ for (int i = 0; i < mAttractionList.size(); i++)
+ checkedPositions[i] = true;
+ notifyDataSetChanged();
+ }
+
+ public void deleteChosen() {
+ List newAttractionList = new ArrayList<>();
+ for (int i = 0; i < mAttractionList.size(); i++) {
+ if (checkedPositions[i])
+ mAttrCltDbOpenHelper.deleteFromDbByName(mAttractionList.get(i).getName());
+ else newAttractionList.add(mAttractionList.get(i));
+ }
+ refreshData(newAttractionList);
+ }
+
+ public void cancelAll() {
+ for (int i = 0; i < mAttractionList.size(); i++)
+ checkedPositions[i] = false;
+ notifyDataSetChanged();
+ }
+
+ class MyViewHolder extends RecyclerView.ViewHolder{
+ ImageView mAttrImage;
+ TextView mAttrName;
+ TextView mAttrLocation;
+ TextView mAttrIntroduce;
+ TextView mDetails;
+ CheckBox mChoice;
+ ViewGroup mCardContain;
+
+ public MyViewHolder(@NonNull View itemView) {
+ super(itemView);
+ this.mAttrImage = itemView.findViewById(R.id.image);
+ this.mAttrName = itemView.findViewById(R.id.name);
+ this.mAttrLocation = itemView.findViewById(R.id.location);
+ this.mAttrIntroduce = itemView.findViewById(R.id.introduce);
+ this.mCardContain = itemView.findViewById(R.id.card_contain);
+ this.mDetails = itemView.findViewById(R.id.details);
+ this.mChoice = itemView.findViewById(R.id.cb_choice);
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/adapter/ChatAdapter.java b/app/src/main/java/com/example/travelor/adapter/ChatAdapter.java
new file mode 100644
index 0000000..a41f225
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/adapter/ChatAdapter.java
@@ -0,0 +1,114 @@
+package com.example.travelor.adapter;
+
+import android.content.Context;
+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.travelor.R;
+import com.example.travelor.bean.Chats;
+import com.example.travelor.datebase.ChatDbOpenHelper;
+import com.example.travelor.datebase.PlansDbOpenHelper;
+
+import java.util.List;
+
+public class ChatAdapter extends RecyclerView.Adapter{
+
+ private List mChatsList;
+ private LayoutInflater mLayoutInflater;
+ private Context mContext;
+ private ChatDbOpenHelper mChatDbOpenHelper;
+
+ private int viewType;
+
+ public static int TYPE_AI_LAYOUT = 0;
+ public static int TYPE_USER_LAYOUT = 1;
+
+ public ChatAdapter(Context context, List mChatsList){
+ this.mChatsList = mChatsList;
+ this.mContext = context;
+ mLayoutInflater = LayoutInflater.from(mContext);
+ mChatDbOpenHelper = new ChatDbOpenHelper(mContext); // 创建数据库管理对象
+ }
+
+ public int getItemViewType(int position) {
+ String identity = mChatsList.get(position).getIdentity();
+ if (identity.equals("ai")) viewType = TYPE_AI_LAYOUT;
+ else viewType = TYPE_USER_LAYOUT;
+ return viewType;
+ }
+
+ @NonNull
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ if(viewType == TYPE_AI_LAYOUT){
+ View view = mLayoutInflater.inflate(R.layout.ai_response_item, parent, false);
+ AiViewHolder aiViewHolder = new AiViewHolder(view);
+ return aiViewHolder;
+ }else if(viewType == TYPE_USER_LAYOUT){
+ View view = mLayoutInflater.inflate(R.layout.user_ask_item, parent, false);
+ UserViewHolder myGridViewHolder = new UserViewHolder(view);
+ return myGridViewHolder;
+ }
+
+ return null;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+ if (holder == null) {
+ return;
+ }
+ if(holder instanceof AiViewHolder){ // 判断holder的类型
+ bindAiViewHolder((AiViewHolder) holder, position);
+ } else if (holder instanceof UserViewHolder) {
+ bindUserViewHolder((UserViewHolder) holder, position);
+ }
+ }
+
+ private void bindUserViewHolder(UserViewHolder holder, int position) {
+ Chats chat = mChatsList.get(position);
+
+ holder.userContent.setText(chat.getContent());
+ // todo 头像
+ }
+
+ private void bindAiViewHolder(AiViewHolder holder, int position) {
+ Chats chat = mChatsList.get(position);
+ holder.aiContent.setText(chat.getContent());
+ }
+
+
+ @Override
+ public int getItemCount() {
+ return mChatsList.size();
+ }
+
+ // 刷新数据
+ public void refreshData(List chats) {
+ this.mChatsList = chats;
+ notifyDataSetChanged();
+ }
+
+ class AiViewHolder extends RecyclerView.ViewHolder{
+ TextView aiContent;
+ public AiViewHolder(@NonNull View itemView) {
+ super(itemView);
+ this.aiContent = itemView.findViewById(R.id.ai_content);
+ }
+ }
+ class UserViewHolder extends RecyclerView.ViewHolder{
+ TextView userContent;
+ ViewGroup chatContain;
+
+ public UserViewHolder(@NonNull View itemView) {
+ super(itemView);
+ this.userContent = itemView.findViewById(R.id.user_content);
+ this.chatContain = itemView.findViewById(R.id.user_contain);
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/adapter/HotelAdapter.java b/app/src/main/java/com/example/travelor/adapter/HotelAdapter.java
new file mode 100644
index 0000000..99bbc0e
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/adapter/HotelAdapter.java
@@ -0,0 +1,92 @@
+package com.example.travelor.adapter;
+
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.travelor.R;
+import com.example.travelor.bean.Hotels;
+import com.example.travelor.datebase.HotelDbOpenHelper;
+
+import java.util.List;
+
+public class HotelAdapter extends RecyclerView.Adapter {
+ private List mHotelList;
+ private LayoutInflater mLayoutInflater;
+ private Context mContext;
+
+ public HotelAdapter(Context context, List mHotelList){
+ this.mHotelList = mHotelList;
+ this.mContext = context;
+ mLayoutInflater = LayoutInflater.from(mContext);
+ }
+
+ @NonNull
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = mLayoutInflater.inflate(R.layout.hotel_item_layout, parent, false);
+ HtViewHolder htViewHolder = new HtViewHolder(view);
+
+ return htViewHolder;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+ bindViewHolder((HtViewHolder) holder, position);
+ }
+
+ private void bindViewHolder(HtViewHolder holder, int position) {
+ Hotels hotel = mHotelList.get(position);
+
+ holder.mHotelName.setText(hotel.getHotelName());
+ holder.mHotelPrice.setText(hotel.getHotelPrice());
+ holder.mHotelScore.setText(hotel.getHotelScore());
+ holder.mHotelRank.setText(hotel.getHotelRank());
+ holder.mHotelLocation.setText(hotel.getHotelLocation());
+
+ holder.mCardContain.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ // todo 收藏
+ }
+ });
+ }
+
+ @Override
+ public int getItemCount() {
+ return mHotelList.size();
+ }
+
+ public void refreshData(List mHotels) {
+ this.mHotelList = mHotels;
+ notifyDataSetChanged();
+ }
+
+ class HtViewHolder extends RecyclerView.ViewHolder{
+ ImageView mHotelImage;
+ TextView mHotelName;
+ TextView mHotelRank;
+ TextView mHotelLocation;
+ TextView mHotelScore;
+ TextView mHotelPrice;
+ ViewGroup mCardContain;
+
+ public HtViewHolder(@NonNull View itemView) {
+ super(itemView);
+ this.mHotelName = itemView.findViewById(R.id.hotel_name);
+ this.mHotelImage = itemView.findViewById(R.id.hotel_image);
+ this.mHotelLocation = itemView.findViewById(R.id.hotel_location);
+ this.mHotelRank = itemView.findViewById(R.id.hotel_rank);
+ this.mHotelScore = itemView.findViewById(R.id.hotel_score);
+ this.mHotelPrice = itemView.findViewById(R.id.hotel_price);
+ this.mCardContain = itemView.findViewById(R.id.hotel_card);
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/adapter/ImagePagerAdapter.java b/app/src/main/java/com/example/travelor/adapter/ImagePagerAdapter.java
new file mode 100644
index 0000000..bd63b6a
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/adapter/ImagePagerAdapter.java
@@ -0,0 +1,43 @@
+package com.example.travelor.adapter;
+
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import androidx.annotation.NonNull;
+import androidx.viewpager.widget.PagerAdapter;
+
+import java.util.List;
+
+public class ImagePagerAdapter extends PagerAdapter {
+ private List imageList;
+
+ public ImagePagerAdapter(List imageList) {
+ this.imageList = imageList;
+ }
+
+ @Override
+ public int getCount() {
+ return imageList.size();
+ }
+
+ @Override
+ public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
+ return view == object;
+ }
+
+ @NonNull
+ @Override
+ public Object instantiateItem(@NonNull ViewGroup container, int position) {
+ ImageView imageView = new ImageView(container.getContext());
+ imageView.setScaleType(ImageView.ScaleType.FIT_XY);
+ imageView.setImageResource(imageList.get(position));
+ container.addView(imageView);
+ return imageView;
+ }
+
+ @Override
+ public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
+ container.removeView((View) object);
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/adapter/PlanAdapter.java b/app/src/main/java/com/example/travelor/adapter/PlanAdapter.java
new file mode 100644
index 0000000..3f27d27
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/adapter/PlanAdapter.java
@@ -0,0 +1,142 @@
+package com.example.travelor.adapter;
+
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.travelor.EditPlanActivity;
+import com.example.travelor.R;
+import com.example.travelor.bean.Plans;
+import com.example.travelor.datebase.PlansDbOpenHelper;
+
+import java.util.List;
+
+public class PlanAdapter extends RecyclerView.Adapter{
+ private List mPlansList;
+ private LayoutInflater mLayoutInflater;
+ private Context mContext;
+ private boolean isSwipeActive = false;
+ private final int SWIPE_THRESHOLD = 4;
+ private float startX;
+ private PlansDbOpenHelper mPlansDbOpenHelper;
+
+ public PlanAdapter(Context context, List mPlansList){
+ this.mPlansList = mPlansList;
+ this.mContext = context;
+ mLayoutInflater = LayoutInflater.from(mContext);
+ mPlansDbOpenHelper = new PlansDbOpenHelper(mContext); // 创建数据库管理对象
+ }
+
+ @NonNull
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = mLayoutInflater.inflate(R.layout.one_plan, parent, false);
+ PlanAdapter.MyViewHolder myViewHolder = new PlanAdapter.MyViewHolder(view);
+ return myViewHolder;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+ bindViewHolder((PlanAdapter.MyViewHolder) holder, position);
+ }
+
+ private void bindViewHolder(PlanAdapter.MyViewHolder holder, int position) {
+ Plans plan = mPlansList.get(position);
+
+ holder.planIndex.setText(Integer.toString(position + 1));
+ holder.mainPlan.setText(plan.getMainPlan());
+ holder.planDetails.setText(plan.getDetails());
+ holder.createTime.setText(plan.getCreateTime());
+
+ holder.planContain.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View view, MotionEvent event) {
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ startX = event.getX();
+ isSwipeActive = false;
+ break;
+ case MotionEvent.ACTION_MOVE:
+ float distanceX = event.getX() - startX;
+ if (distanceX < SWIPE_THRESHOLD) {
+ isSwipeActive = true;
+ holder.handleContain.setVisibility(View.VISIBLE);
+ }
+ else if(distanceX > SWIPE_THRESHOLD) {
+ isSwipeActive = false;
+ holder.handleContain.setVisibility(View.INVISIBLE);
+ }
+ break;
+ }
+ return true;
+ }
+ });
+
+ holder.deleteButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ int row = mPlansDbOpenHelper.deleteFromDbById(plan.getId());
+ if (row > 0) {
+ removeData(position);
+ }
+ }
+ });
+
+ holder.editButton.setOnClickListener((new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(mContext, EditPlanActivity.class);
+ intent.putExtra("plan", plan);
+ mContext.startActivity(intent);
+ }
+ }));
+
+ }
+
+ private void removeData(int position) {
+ mPlansList.remove(position);
+ notifyItemRemoved(position);
+ }
+
+ @Override
+ public int getItemCount() {
+ return mPlansList.size();
+ }
+
+ public void refreshData(List mPlansList) {
+ this.mPlansList = mPlansList;
+ notifyDataSetChanged();
+ }
+
+ class MyViewHolder extends RecyclerView.ViewHolder{
+ TextView planIndex;
+ TextView mainPlan;
+ TextView planDetails;
+ TextView createTime;
+ ViewGroup planContain;
+ ViewGroup handleContain;
+ ImageButton editButton;
+ ImageButton deleteButton;
+
+ public MyViewHolder(@NonNull View itemView) {
+ super(itemView);
+ this.planIndex = itemView.findViewById(R.id.plan_index);
+ this.mainPlan = itemView.findViewById(R.id.main_plan);
+ this.planDetails = itemView.findViewById(R.id.details);
+ this.createTime = itemView.findViewById(R.id.create_time);
+ this.planContain = itemView.findViewById(R.id.plan_contain);
+ this.handleContain = itemView.findViewById(R.id.handle_buttons);
+ this.editButton = itemView.findViewById(R.id.edit_button);
+ this.deleteButton = itemView.findViewById(R.id.delete_button);
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/bean/Attractions.java b/app/src/main/java/com/example/travelor/bean/Attractions.java
new file mode 100644
index 0000000..54f8137
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/bean/Attractions.java
@@ -0,0 +1,108 @@
+package com.example.travelor.bean;
+
+import android.text.TextUtils;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class Attractions implements Serializable {
+
+ private String id;
+ private String name;
+ private String location;
+ private String introduce;
+ private String hotels;
+ private String images;
+ private String video;
+ private String price;
+ private String rank;
+ private String category;
+
+ public String getId() { return id; }
+
+ public void setId(String id) { this.id = id; }
+
+ public void setCategory(String category) { this.category = category; }
+
+ public String getCategory() { return category; }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public void setIntroduce(String introduce) {
+ this.introduce = introduce;
+ }
+
+ public void setHotels(String hotels) {
+ this.hotels = hotels;
+ }
+
+ public void setImages(String images) {
+ this.images = images;
+ }
+
+ public void setVideo(String video) {
+ this.video = video;
+ }
+
+ public void setPrice(String price) {
+ this.price = price;
+ }
+
+ public void setRank(String rank) {
+ this.rank = rank;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getIntroduce() {
+ return introduce;
+ }
+
+ public String getHotels() {
+ return hotels;
+ }
+
+ public String getImages() {
+ return images;
+ }
+
+ public String getVideo() {
+ return video;
+ }
+
+ public String getPrice() {
+ return price;
+ }
+
+ public String getRank() {
+ return rank;
+ }
+
+ @Override
+ public String toString() {
+ return "Attractions{" +
+ "id='" + id + '\'' +
+ ", name='" + name + '\'' +
+ ", location='" + location + '\'' +
+ ", introduce='" + introduce + '\'' +
+ ", hotels='" + hotels + '\'' +
+ ", images='" + images + '\'' +
+ ", video='" + video + '\'' +
+ ", price='" + price + '\'' +
+ ", rank='" + rank + '\'' +
+ ", category='" + category + '\'' +
+ '}';
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/bean/Chats.java b/app/src/main/java/com/example/travelor/bean/Chats.java
new file mode 100644
index 0000000..ddb2e3c
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/bean/Chats.java
@@ -0,0 +1,42 @@
+package com.example.travelor.bean;
+
+import java.io.Serializable;
+
+public class Chats implements Serializable {
+ private String id;
+ private String identity;
+ private String content;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getIdentity() {
+ return identity;
+ }
+
+ public void setIdentity(String identity) {
+ this.identity = identity;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ @Override
+ public String toString() {
+ return "chats{" +
+ "id='" + id + '\'' +
+ ", identity='" + identity + '\'' +
+ ", content='" + content + '\'' +
+ '}';
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/bean/Hotels.java b/app/src/main/java/com/example/travelor/bean/Hotels.java
new file mode 100644
index 0000000..50d7312
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/bean/Hotels.java
@@ -0,0 +1,72 @@
+package com.example.travelor.bean;
+
+import java.io.Serializable;
+
+public class Hotels implements Serializable {
+ private String hotelName;
+ private String hotelLocation;
+ private String hotelImage;
+ private String hotelRank;
+ private String hotelScore;
+ private String hotelPrice;
+
+ public String getHotelName() {
+ return hotelName;
+ }
+
+ public void setHotelName(String hotelName) {
+ this.hotelName = hotelName;
+ }
+
+ public String getHotelLocation() {
+ return hotelLocation;
+ }
+
+ public void setHotelLocation(String hotelLocation) {
+ this.hotelLocation = hotelLocation;
+ }
+
+ public String getHotelImage() {
+ return hotelImage;
+ }
+
+ public void setHotelImage(String hotelImage) {
+ this.hotelImage = hotelImage;
+ }
+
+ public String getHotelRank() {
+ return hotelRank;
+ }
+
+ public void setHotelRank(String hotelRank) {
+ this.hotelRank = hotelRank;
+ }
+
+ public String getHotelScore() {
+ return hotelScore;
+ }
+
+ public void setHotelScore(String hotelScore) {
+ this.hotelScore = hotelScore;
+ }
+
+ public String getHotelPrice() {
+ return hotelPrice;
+ }
+
+ public void setHotelPrice(String hotelPrice) {
+ this.hotelPrice = hotelPrice;
+ }
+
+ @Override
+ public String toString() {
+ return "Hotels{" +
+ "hotelName='" + hotelName + '\'' +
+ ", hotelLocation='" + hotelLocation + '\'' +
+ ", hotelImage='" + hotelImage + '\'' +
+ ", hotelRank='" + hotelRank + '\'' +
+ ", hotelScore='" + hotelScore + '\'' +
+ ", hotelPrice='" + hotelPrice + '\'' +
+ '}';
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/bean/Plans.java b/app/src/main/java/com/example/travelor/bean/Plans.java
new file mode 100644
index 0000000..9414832
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/bean/Plans.java
@@ -0,0 +1,51 @@
+package com.example.travelor.bean;
+
+import java.io.Serializable;
+
+public class Plans implements Serializable {
+ private String mainPlan;
+ private String details;
+ private String createTime;
+ private String id;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getMainPlan() {
+ return mainPlan;
+ }
+
+ public void setMainPlan(String main_plan) {
+ this.mainPlan = main_plan;
+ }
+
+ public String getDetails() {
+ return details;
+ }
+
+ public void setDetails(String details) {
+ this.details = details;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String create_time) {
+ this.createTime = create_time;
+ }
+
+ @Override
+ public String toString() {
+ return "plans{" +
+ "main_plan='" + mainPlan + '\'' +
+ ", details='" + details + '\'' +
+ ", create_time='" + createTime + '\'' +
+ '}';
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/bean/Users.java b/app/src/main/java/com/example/travelor/bean/Users.java
new file mode 100644
index 0000000..2226819
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/bean/Users.java
@@ -0,0 +1,63 @@
+package com.example.travelor.bean;
+
+import java.io.Serializable;
+
+public class Users implements Serializable {
+
+ private String account;
+ private String password;
+ private String username;
+ private String createdTime;
+ private String id;
+
+ public void setUserName(String userName) {
+ this.username = userName;
+ }
+
+ public String getUserName() {
+ return username;
+ }
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setCreatedTime(String createdTime) {
+ this.createdTime = createdTime;
+ }
+
+ public String getCreatedTime() {
+ return createdTime;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public String toString() {
+ return "Users{" +
+ "account='" + account + '\'' +
+ ", password='" + password + '\'' +
+ ", createdTime='" + createdTime + '\'' +
+ ", userName='" + username + '\'' +
+ ", id='" + id + '\'' +
+ '}';
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/datebase/AttrCltDbOpenHelper.java b/app/src/main/java/com/example/travelor/datebase/AttrCltDbOpenHelper.java
new file mode 100644
index 0000000..6d25898
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/datebase/AttrCltDbOpenHelper.java
@@ -0,0 +1,101 @@
+package com.example.travelor.datebase;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.text.TextUtils;
+
+import com.example.travelor.bean.Attractions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AttrCltDbOpenHelper extends SQLiteOpenHelper {
+ private static final String DB_NAME = "attractionCollectSQLite.db";
+ private static final String TABLE_NAME_NOTE = "attractions_collect";
+
+ private static final String CREATE_TABLE_SQL = "create table " + TABLE_NAME_NOTE + " (id integer primary key autoincrement, " +
+ "name text UNIQUE, introduce text, location text, hotels text, images text, video text, rank text, price text, category text)";
+
+
+ public AttrCltDbOpenHelper(Context context) {
+ super(context, DB_NAME, null, 2);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_TABLE_SQL);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ if(oldVersion <= 2){//当数据库版本小于版本2时,就要升级下面的所有字段
+ db.execSQL("drop table if exists " + TABLE_NAME_NOTE);
+ onCreate(db);
+ }
+ }
+
+ public long insertData(Attractions attraction) {
+
+ SQLiteDatabase db = getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put("name", attraction.getName());
+ values.put("introduce", attraction.getIntroduce());
+ values.put("location", attraction.getLocation());
+ values.put("hotels", attraction.getHotels());
+ values.put("images", attraction.getImages());
+ values.put("video", attraction.getVideo());
+ values.put("rank", attraction.getRank());
+ values.put("price", attraction.getPrice());
+ values.put("category", attraction.getCategory());
+
+ return db.insert(TABLE_NAME_NOTE, null, values);
+ }
+
+ public int deleteFromDbByName(String name) {
+ SQLiteDatabase db = getWritableDatabase();
+ return db.delete(TABLE_NAME_NOTE, "name = ?", new String[]{name}); // 创建包含单个元素的字符串数组
+ }
+
+ @SuppressLint("Range")
+ public List queryAllFromDb() {
+ SQLiteDatabase db = getWritableDatabase();
+ List attractionList = new ArrayList<>();
+
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, null, null, null, null, null);
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String attrName = cursor.getString(cursor.getColumnIndex("name"));
+ String attrRank = cursor.getString(cursor.getColumnIndex("rank"));
+ String attrImage = cursor.getString(cursor.getColumnIndex("images"));
+ String attrLocation = cursor.getString(cursor.getColumnIndex("location"));
+ String attrVideo = cursor.getString(cursor.getColumnIndex("video"));
+ String attrHotels = cursor.getString(cursor.getColumnIndex("hotels"));
+ String attrPrice = cursor.getString(cursor.getColumnIndex("price"));
+ String attrIntroduce = cursor.getString(cursor.getColumnIndex("introduce"));
+ String attrCategory = cursor.getString(cursor.getColumnIndex("category"));
+
+ Attractions attraction = new Attractions();
+ attraction.setImages(attrImage);
+ attraction.setName(attrName);
+ attraction.setRank(attrRank);
+ attraction.setLocation(attrLocation);
+ attraction.setPrice(attrPrice);
+ attraction.setVideo(attrVideo);
+ attraction.setHotels(attrHotels);
+ attraction.setIntroduce(attrIntroduce);
+ attraction.setCategory(attrCategory);
+
+ attractionList.add(attraction);
+ }
+ cursor.close();
+ }
+
+ return attractionList;
+ }
+
+}
diff --git a/app/src/main/java/com/example/travelor/datebase/AttractionDbOpenHelper.java b/app/src/main/java/com/example/travelor/datebase/AttractionDbOpenHelper.java
new file mode 100644
index 0000000..5fce188
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/datebase/AttractionDbOpenHelper.java
@@ -0,0 +1,233 @@
+package com.example.travelor.datebase;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.text.TextUtils;
+
+import com.example.travelor.bean.Attractions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AttractionDbOpenHelper extends SQLiteOpenHelper {
+
+ private static final String DB_NAME = "attractionSQLite.db";
+ private static final String TABLE_NAME_NOTE = "attractions";
+
+ private static final String CREATE_TABLE_SQL = "create table " + TABLE_NAME_NOTE + " (id integer primary key autoincrement, " +
+ "name text, introduce text, location text, hotels text, images text, video text, rank text, price text, category text)";
+
+
+ public AttractionDbOpenHelper(Context context) {
+ super(context, DB_NAME, null, 7);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_TABLE_SQL);
+// initDb();
+ }
+
+ private boolean isTableExit(SQLiteDatabase db) {
+ String query = "SELECT name FROM sqlite_master WHERE type='table' AND name=?";
+ Cursor cursor = db.rawQuery(query, new String[]{TABLE_NAME_NOTE});
+ boolean exists = false;
+ if (cursor != null && cursor.moveToFirst()) {
+ exists = true;
+ cursor.close();
+ }
+ return exists;
+ }
+
+ private void initDb() {
+ String[] names = {"西湖", "故宫博物院", "呼伦贝尔草原", "八达岭长城", "里维耶拉", "乌镇西栅"};
+ String[] introduces = {"西湖的面积约为6.4平方公里,湖水清澈,四周环绕着青山绿树,水的色随季节和气变化而呈现出不同的色彩。湖中有三座岛屿,其中最大的是“花港观鱼”岛,另外还有“苏堤晓”岛和“照红楼”岛,每座岛屿都有着自的特色景观历史建筑西湖周边有多著名的景,如岳庙、雷峰塔、苏堤、白堤等。岳庙是供奉武林至尊岳飞的古建筑,是中国最重要的岳庙之一;雷峰是一座古老佛塔,以其独特的形状和悠久的历史而知名;苏堤和白堤是两条连接岸的人工堤岸,沿途植被繁茂,是游览西湖的佳路径。",
+ "故宫博物院建于明代,始建于1406年,修建历时14年,总占地面积约72万平方米。整个建筑群呈北南走向,呈长方形,主要分为外朝和内廷两部分。外朝是宫廷的政治和宗教活动区域,包括三大殿(午门、太和殿、乾清宫),以及充满仪式感的文华殿、武英殿等;内廷是皇帝和后妃的居住区域,包括乾隆花园、紫禁城等。",
+ "内蒙古的草原是其最具代表性的景观之一。草原广袤辽阔,牧场遍布,悠闲的牛羊们在碧绿的草地上吃草,成群结队的骏马在飞奔。特别是在夏季时,草原如同一副绿色的画卷,迷人而壮观,吸引着众多游客前往观赏和体验。",
+ "万里长城是中国古代的一项伟大建筑工程,也是世界文化遗产之一,被誉为世界奇迹。它是中国古代防御体系的重要组成部分,始建于公元前7世纪,历经多个朝代的修建,形成了如今的规模。万里长城的主体建设始于公元前3世纪的秦朝,当时的秦始皇统一了中国大部分地区,为了抵御北方游牧民族的入侵,下令修筑长城。但目前所见的大部分长城是明朝时期的建筑,明朝时期的长城修建者主要是为了抵御满洲族的入侵。",
+ "里维耶拉(Ribeira)是葡萄牙波尔图市(Porto)的一个历史街区,也是欧洲最古老的市中心之一,位于杜罗河(Douro River)畔。里维耶拉被列为联合国教科文组织世界遗产,并被誉为波尔图最具特色和迷人的地方之一",
+ "乌镇西栅位于乌镇的西侧,是一个保存完好的古镇建筑群落,被誉为“东方小威尼斯”。西栅地区有着优美的水系,河道纵横交错,古老的石桥横跨其间,整个镇子几乎处处可见水景。一进入西栅,就能感受到它独特的水乡风情和古朴的民俗文化。"};
+ String[] locations = {"浙江省杭州市", "北京市东城区", "内蒙古呼伦贝尔市", "北京市延庆区", "葡萄牙波尔图市", "浙江省嘉兴市"};
+ String[] hotels = {"酒店1,酒店2", "酒店3", "酒店4,酒店5", "酒店4#酒店5", "酒店4#酒店5", "酒店4#酒店5"};
+ String[] images = {"west_lake1#west_lake2#west_lake3",
+ "gugong#west_lake2#west_lake3",
+ "hulunbeier#west_lake2#west_lake3",
+ "greate_wall#west_lake2#west_lake3",
+ "ribeira#west_lake2#west_lake3",
+ "wuzhen#west_lake2#west_lake3"};
+ String[] videos = {"video1", "video2", "video3", "video4", "video5", "video6"};
+ String[] ranks = {"AAAAA", "AAAA", "AAAAA", "AAAA", "AAAAA", "AAA"};
+ String[] prices = {"123", "99", "144", "233", "112", "323"};
+ String[] category = {"风景", "人文", "自然", "风景", "人文", "自然"};
+
+ for(int i = 0; i < names.length; i++) {
+ Attractions oneAttraction = new Attractions();
+ oneAttraction.setName(names[i]);
+ oneAttraction.setIntroduce(introduces[i]);
+ oneAttraction.setLocation(locations[i]);
+ oneAttraction.setHotels(hotels[i]);
+ oneAttraction.setImages(images[i]);
+ oneAttraction.setVideo(videos[i]);
+ oneAttraction.setRank(ranks[i]);
+ oneAttraction.setPrice(prices[i]);
+ oneAttraction.setCategory(category[i]);
+
+ insertData(oneAttraction);
+ }
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ if(oldVersion <= 7){//当数据库版本小于版本2时,就要升级下面的所有字段
+ db.execSQL("drop table if exists " + TABLE_NAME_NOTE);
+ onCreate(db);
+ }
+ }
+
+ public long insertData(Attractions attraction) {
+
+ SQLiteDatabase db = getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put("name", attraction.getName());
+ values.put("introduce", attraction.getIntroduce());
+ values.put("location", attraction.getLocation());
+ values.put("hotels", attraction.getHotels());
+ values.put("images", attraction.getImages());
+ values.put("video", attraction.getVideo());
+ values.put("rank", attraction.getRank());
+ values.put("price", attraction.getPrice());
+ values.put("category", attraction.getCategory());
+
+ return db.insert(TABLE_NAME_NOTE, null, values);
+ }
+
+ public int deleteFromDbById(String id) {
+ SQLiteDatabase db = getWritableDatabase();
+// return db.delete(TABLE_NAME_NOTE, "id = ?", new String[]{id});
+// return db.delete(TABLE_NAME_NOTE, "id is ?", new String[]{id});
+ return db.delete(TABLE_NAME_NOTE, "id like ?", new String[]{id}); // 创建包含单个元素的字符串数组
+ }
+
+ @SuppressLint("Range")
+ public List queryAllFromDb() {
+// initDb(); // todo
+ SQLiteDatabase db = getWritableDatabase();
+ List attractionList = new ArrayList<>();
+
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, null, null, null, null, null);
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String attrName = cursor.getString(cursor.getColumnIndex("name"));
+ String attrRank = cursor.getString(cursor.getColumnIndex("rank"));
+ String attrImage = cursor.getString(cursor.getColumnIndex("images"));
+ String attrLocation = cursor.getString(cursor.getColumnIndex("location"));
+ String attrVideo = cursor.getString(cursor.getColumnIndex("video"));
+ String attrHotels = cursor.getString(cursor.getColumnIndex("hotels"));
+ String attrPrice = cursor.getString(cursor.getColumnIndex("price"));
+ String attrIntroduce = cursor.getString(cursor.getColumnIndex("introduce"));
+ String attrCategory = cursor.getString(cursor.getColumnIndex("category"));
+
+ Attractions attraction = new Attractions();
+ attraction.setImages(attrImage);
+ attraction.setName(attrName);
+ attraction.setRank(attrRank);
+ attraction.setLocation(attrLocation);
+ attraction.setPrice(attrPrice);
+ attraction.setVideo(attrVideo);
+ attraction.setHotels(attrHotels);
+ attraction.setIntroduce(attrIntroduce);
+ attraction.setCategory(attrCategory);
+
+ attractionList.add(attraction);
+ }
+ cursor.close();
+ }
+
+ return attractionList;
+ }
+
+ @SuppressLint("Range")
+ public List queryFromDbByName(String name) {
+ if (TextUtils.isEmpty(name)) {
+ return queryAllFromDb();
+ }
+
+ SQLiteDatabase db = getWritableDatabase();
+ List attractionList = new ArrayList<>();
+ // 模糊查询
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, "name like ?", new String[]{"%"+name+"%"}, null, null, null);
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String attrName = cursor.getString(cursor.getColumnIndex("name"));
+ String attrRank = cursor.getString(cursor.getColumnIndex("rank"));
+ String attrImage = cursor.getString(cursor.getColumnIndex("images"));
+ String attrLocation = cursor.getString(cursor.getColumnIndex("location"));
+ String attrVideo = cursor.getString(cursor.getColumnIndex("video"));
+ String attrHotels = cursor.getString(cursor.getColumnIndex("hotels"));
+ String attrPrice = cursor.getString(cursor.getColumnIndex("price"));
+ String attrIntroduce = cursor.getString(cursor.getColumnIndex("introduce"));
+ String attrCategory = cursor.getString(cursor.getColumnIndex("category"));
+
+ Attractions attraction = new Attractions();
+ attraction.setImages(attrImage);
+ attraction.setName(attrName);
+ attraction.setRank(attrRank);
+ attraction.setLocation(attrLocation);
+ attraction.setPrice(attrPrice);
+ attraction.setVideo(attrVideo);
+ attraction.setHotels(attrHotels);
+ attraction.setIntroduce(attrIntroduce);
+ attraction.setCategory(attrCategory);
+
+ attractionList.add(attraction);
+ }
+ cursor.close();
+ }
+
+ return attractionList;
+ }
+
+ @SuppressLint("Range")
+ public List queryFromDbByCategory(String category) {
+ if (TextUtils.isEmpty(category)) {
+ return queryAllFromDb();
+ }
+ SQLiteDatabase db = getWritableDatabase();
+ List attractionList = new ArrayList<>();
+ // 模糊查询
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, "category = ?", new String[]{category}, null, null, null);
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String attrName = cursor.getString(cursor.getColumnIndex("name"));
+ String attrRank = cursor.getString(cursor.getColumnIndex("rank"));
+ String attrImage = cursor.getString(cursor.getColumnIndex("images"));
+ String attrLocation = cursor.getString(cursor.getColumnIndex("location"));
+ String attrVideo = cursor.getString(cursor.getColumnIndex("video"));
+ String attrHotels = cursor.getString(cursor.getColumnIndex("hotels"));
+ String attrPrice = cursor.getString(cursor.getColumnIndex("price"));
+ String attrIntroduce = cursor.getString(cursor.getColumnIndex("introduce"));
+ String attrCategory = cursor.getString(cursor.getColumnIndex("category"));
+
+ Attractions attraction = new Attractions();
+ attraction.setImages(attrImage);
+ attraction.setName(attrName);
+ attraction.setRank(attrRank);
+ attraction.setLocation(attrLocation);
+ attraction.setPrice(attrPrice);
+ attraction.setVideo(attrVideo);
+ attraction.setHotels(attrHotels);
+ attraction.setIntroduce(attrIntroduce);
+ attraction.setCategory(attrCategory);
+
+ attractionList.add(attraction);
+ }
+ cursor.close();
+ }
+ return attractionList;
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/datebase/ChatDbOpenHelper.java b/app/src/main/java/com/example/travelor/datebase/ChatDbOpenHelper.java
new file mode 100644
index 0000000..c73914c
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/datebase/ChatDbOpenHelper.java
@@ -0,0 +1,74 @@
+package com.example.travelor.datebase;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+import com.example.travelor.bean.Chats;
+import com.example.travelor.bean.Hotels;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ChatDbOpenHelper extends SQLiteOpenHelper {
+ private static final String DB_NAME = "chatSQLite.db";
+ private static final String TABLE_NAME_NOTE = "aiChat";
+
+ private static final String CREATE_TABLE_SQL = "create table " + TABLE_NAME_NOTE + " (id integer primary key autoincrement, " +
+ "identity text, content text)";
+
+
+ public ChatDbOpenHelper(Context context) {
+ super(context, DB_NAME, null, 5);
+ }
+
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_TABLE_SQL);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ if(oldVersion <= 5){//当数据库版本小于版本2时,就要升级下面的所有字段
+ db.execSQL("drop table if exists " + TABLE_NAME_NOTE);
+ onCreate(db);
+ }
+ }
+
+ public long insertData(Chats chat) {
+ SQLiteDatabase db = getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put("identity", chat.getIdentity());
+ values.put("content", chat.getContent());
+
+ return db.insert(TABLE_NAME_NOTE, null, values);
+ }
+
+ @SuppressLint("Range")
+ public List queryAllFromDb() {
+ SQLiteDatabase db = getWritableDatabase();
+ List chats = new ArrayList<>();
+
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, null, null, null, null, null);
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String identity = cursor.getString(cursor.getColumnIndex("identity"));
+ String content = cursor.getString(cursor.getColumnIndex("content"));;
+
+ Chats chat = new Chats();
+ chat.setIdentity(identity);
+ chat.setContent(content);
+
+ chats.add(chat);
+ }
+ cursor.close();
+ }
+
+ return chats;
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/datebase/HotelCollectDbOpenHelper.java b/app/src/main/java/com/example/travelor/datebase/HotelCollectDbOpenHelper.java
new file mode 100644
index 0000000..b2dd86f
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/datebase/HotelCollectDbOpenHelper.java
@@ -0,0 +1,90 @@
+package com.example.travelor.datebase;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.text.TextUtils;
+
+import com.example.travelor.bean.Attractions;
+import com.example.travelor.bean.Hotels;
+import com.example.travelor.bean.Plans;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HotelCollectDbOpenHelper extends SQLiteOpenHelper {
+ private static final String DB_NAME = "hotelCollectSQLite.db";
+ private static final String TABLE_NAME_NOTE = "hotel_collect";
+
+
+ private static final String CREATE_TABLE_SQL = "create table " + TABLE_NAME_NOTE + " (id integer primary key autoincrement," +
+ "name text UNIQUE, location text, image text, rank text, score text, price text, attraction text)";
+
+ public HotelCollectDbOpenHelper(Context context) {
+ super(context, DB_NAME, null, 1);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_TABLE_SQL);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+
+ public int deleteFromDbById(String id) {
+ SQLiteDatabase db = getWritableDatabase();
+ return db.delete(TABLE_NAME_NOTE, "id = ?", new String[]{id}); // 创建包含单个元素的字符串数组
+ }
+
+ public long insertData(Hotels hotel) {
+
+ SQLiteDatabase db = getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put("name", hotel.getHotelName());
+ values.put("location", hotel.getHotelLocation());
+ values.put("image", hotel.getHotelImage());
+ values.put("rank", hotel.getHotelRank());
+ values.put("score", hotel.getHotelScore());
+ values.put("price", hotel.getHotelPrice());
+
+ return db.insert(TABLE_NAME_NOTE, null, values);
+ }
+
+ @SuppressLint("Range")
+ public List queryAllFromDb() {
+ SQLiteDatabase db = getWritableDatabase();
+ List hotelList = new ArrayList<>();
+
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, null, null, null, null, null);
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String hotelName = cursor.getString(cursor.getColumnIndex("name"));
+ String hotelRank = cursor.getString(cursor.getColumnIndex("rank"));
+ String hotelImage = cursor.getString(cursor.getColumnIndex("image"));
+ String hotelLocation = cursor.getString(cursor.getColumnIndex("location"));
+ String hotelPrice = cursor.getString(cursor.getColumnIndex("price"));
+ String hotelScore = cursor.getString(cursor.getColumnIndex("score"));
+
+ Hotels hotel = new Hotels();
+ hotel.setHotelName(hotelName);
+ hotel.setHotelImage(hotelImage);
+ hotel.setHotelLocation(hotelLocation);
+ hotel.setHotelPrice(hotelPrice);
+ hotel.setHotelScore(hotelScore);
+ hotel.setHotelRank(hotelRank);
+
+ hotelList.add(hotel);
+ }
+ cursor.close();
+ }
+
+ return hotelList;
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/datebase/HotelDbOpenHelper.java b/app/src/main/java/com/example/travelor/datebase/HotelDbOpenHelper.java
new file mode 100644
index 0000000..5c47ad5
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/datebase/HotelDbOpenHelper.java
@@ -0,0 +1,97 @@
+package com.example.travelor.datebase;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.text.TextUtils;
+
+import com.example.travelor.bean.Attractions;
+import com.example.travelor.bean.Hotels;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HotelDbOpenHelper extends SQLiteOpenHelper {
+ private static final String DB_NAME = "travelerSQLite.db";
+ private static final String TABLE_NAME_NOTE = "hotel";
+
+ private static final String[][] INITIAL_DATA = {
+ {"杭州武林万怡酒店", "浙江省 杭州市 湖墅南路28号", "src/main/res/drawable/hotel1.jpg", "★★★★ 四星级酒店", "8.3", "¥709", "杭州西湖"},
+ {"浙江西子宾馆", "浙江省 杭州市 南山路37号", "src/main/res/drawable/hotel1.jpg", "★★★★★ 五星级酒店", "9.0", "¥1399", "杭州西湖"},
+ {"杭州君悦酒店", "浙江省 杭州市 湖滨路28号", "src/main/res/drawable/hotel1.jpg", "★★★★★ 五星级酒店", " 8.1", "¥1699", "杭州西湖"},
+ };
+
+ private static final String CREATE_TABLE_SQL = "create table " + TABLE_NAME_NOTE + " (id integer primary key autoincrement," +
+ "name text UNIQUE, location text, image text, rank text, score text, price text, attraction text)";
+
+ public HotelDbOpenHelper(Context context) {
+ super(context, DB_NAME, null, 1);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_TABLE_SQL);
+
+ insertInitialData(db);
+ }
+
+ private void insertInitialData(SQLiteDatabase db) {
+ ContentValues values = new ContentValues();
+
+ for (String[] data : INITIAL_DATA) {
+ values.put("name", data[0]);
+ values.put("location",data[1]);
+ values.put("image", data[2]);
+ values.put("rank", data[3]);
+ values.put("score", data[4]);
+ values.put("price", data[5]);
+ values.put("attraction", data[6]);
+
+ db.insert(TABLE_NAME_NOTE, null, values);
+ // 清空ContentValues,以便下一次插入数据重新设置值
+ values.clear();
+ }
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ if(oldVersion <= 2){//当数据库版本小于版本2时,就要升级下面的所有字段
+ db.execSQL("drop table if exists " + TABLE_NAME_NOTE);
+ onCreate(db);
+ }
+ }
+
+ @SuppressLint("Range")
+ public List queryFromDbByAttraction(String attraction) {
+ SQLiteDatabase db = getWritableDatabase();
+ List hotelList = new ArrayList<>();
+ // 模糊查询
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, "attraction = ?", new String[]{attraction}, null, null, null);
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String hotelName = cursor.getString(cursor.getColumnIndex("name"));
+ String hotelRank = cursor.getString(cursor.getColumnIndex("rank"));
+ String hotelImage = cursor.getString(cursor.getColumnIndex("image"));
+ String hotelLocation = cursor.getString(cursor.getColumnIndex("location"));
+ String hotelPrice = cursor.getString(cursor.getColumnIndex("price"));
+ String hotelScore = cursor.getString(cursor.getColumnIndex("score"));
+
+ Hotels hotel = new Hotels();
+ hotel.setHotelName(hotelName);
+ hotel.setHotelImage(hotelImage);
+ hotel.setHotelLocation(hotelLocation);
+ hotel.setHotelPrice(hotelPrice);
+ hotel.setHotelScore(hotelScore);
+ hotel.setHotelRank(hotelRank);
+
+ hotelList.add(hotel);
+ }
+ cursor.close();
+ }
+
+ return hotelList;
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/datebase/PlansDbOpenHelper.java b/app/src/main/java/com/example/travelor/datebase/PlansDbOpenHelper.java
new file mode 100644
index 0000000..10dc182
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/datebase/PlansDbOpenHelper.java
@@ -0,0 +1,100 @@
+package com.example.travelor.datebase;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+import com.example.travelor.bean.Plans;
+import com.example.travelor.bean.Users;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PlansDbOpenHelper extends SQLiteOpenHelper {
+
+ private static final String DB_NAME = "plansSQLite.db";
+ private static final String TABLE_NAME_NOTE = "plans";
+
+ private static final String CREATE_TABLE_SQL = "create table " + TABLE_NAME_NOTE + " (id integer primary key autoincrement, main_plan text, details text, create_time text)";
+
+
+ public PlansDbOpenHelper(Context context) {
+ super(context, DB_NAME, null, 2);
+ }
+
+
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_TABLE_SQL);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ if(oldVersion <= 2){//当数据库版本小于版本2时,就要升级下面的所有字段
+ db.execSQL("drop table if exists " + TABLE_NAME_NOTE);
+ onCreate(db);
+ }
+ }
+
+ public long insertData(Plans plan) {
+
+ SQLiteDatabase db = getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put("main_plan", plan.getMainPlan());
+ values.put("details", plan.getDetails());
+ values.put("create_time", plan.getCreateTime());
+
+ return db.insert(TABLE_NAME_NOTE, null, values);
+ }
+
+ public int deleteFromDbById(String id) {
+ SQLiteDatabase db = getWritableDatabase();
+ return db.delete(TABLE_NAME_NOTE, "id = ?", new String[]{id}); // 创建包含单个元素的字符串数组
+ }
+
+ @SuppressLint("Range")
+ public List queryAllFromDb() {
+
+ SQLiteDatabase db = getWritableDatabase();
+ List planList = new ArrayList<>();
+
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, null, null, null, null, null);
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String id = cursor.getString(cursor.getColumnIndex("id"));
+ String main_plan = cursor.getString(cursor.getColumnIndex("main_plan"));
+ String details = cursor.getString(cursor.getColumnIndex("details"));
+ String createTime = cursor.getString(cursor.getColumnIndex("create_time"));
+
+ Plans plan = new Plans();
+ plan.setId(id);
+ plan.setMainPlan(main_plan);
+ plan.setDetails(details);
+ plan.setCreateTime(createTime);
+
+ planList.add(plan);
+ }
+ cursor.close();
+ }
+
+ return planList;
+
+ }
+
+ public int updateData(Plans plan) {
+
+ SQLiteDatabase db = getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put("main_plan", plan.getMainPlan());
+ values.put("details", plan.getDetails());
+ values.put("create_time", plan.getCreateTime());
+
+ return db.update(TABLE_NAME_NOTE, values, "id = ?", new String[]{plan.getId()});
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/datebase/UsersDbOpenHelper.java b/app/src/main/java/com/example/travelor/datebase/UsersDbOpenHelper.java
new file mode 100644
index 0000000..fb3f8bb
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/datebase/UsersDbOpenHelper.java
@@ -0,0 +1,114 @@
+package com.example.travelor.datebase;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+import com.example.travelor.bean.Users;
+
+public class UsersDbOpenHelper extends SQLiteOpenHelper {
+
+ private static final String DB_NAME = "usersSQLite.db";
+ private static final String TABLE_NAME_NOTE = "users";
+
+ private static final String CREATE_TABLE_SQL = "create table " + TABLE_NAME_NOTE + " (id integer primary key autoincrement, account text, password text, username text, create_time text)";
+
+
+ public UsersDbOpenHelper(Context context) {
+ super(context, DB_NAME, null, 1);
+ }
+
+
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_TABLE_SQL);
+
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+
+ public long insertData(Users users) {
+
+ SQLiteDatabase db = getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put("account", users.getAccount());
+ values.put("password", users.getPassword());
+ values.put("username", users.getUserName());
+ values.put("create_time", users.getCreatedTime());
+
+ return db.insert(TABLE_NAME_NOTE, null, values);
+ }
+
+ public int deleteFromDbById(String id) {
+ SQLiteDatabase db = getWritableDatabase();
+// return db.delete(TABLE_NAME_NOTE, "id = ?", new String[]{id});
+// return db.delete(TABLE_NAME_NOTE, "id is ?", new String[]{id});
+ return db.delete(TABLE_NAME_NOTE, "id like ?", new String[]{id}); // 创建包含单个元素的字符串数组
+ }
+
+
+
+// public int updateData(Note note) {
+//
+// SQLiteDatabase db = getWritableDatabase();
+//
+// ContentValues values = new ContentValues();
+// values.put("title", note.getTitle());
+// values.put("content", note.getContent());
+// values.put("create_time", note.getCreatedTime());
+// // 返回整数值 表示受影响的行数
+// return db.update(TABLE_NAME_NOTE, values, "id like ?", new String[]{note.getId()});
+// }
+
+// public List queryAllFromDb() {
+//
+// SQLiteDatabase db = getWritableDatabase();
+// List noteList = new ArrayList<>();
+//
+// Cursor cursor = db.query(TABLE_NAME_NOTE, null, null, null, null, null, null);
+// if (cursor != null) {
+// while (cursor.moveToNext()) {
+// String id = cursor.getString(cursor.getColumnIndex("id"));
+// String title = cursor.getString(cursor.getColumnIndex("title"));
+// String content = cursor.getString(cursor.getColumnIndex("content"));
+// String createTime = cursor.getString(cursor.getColumnIndex("create_time"));
+//
+// Note note = new Note();
+// note.setId(id);
+// note.setTitle(title);
+// note.setContent(content);
+// note.setCreatedTime(createTime);
+//
+// noteList.add(note);
+// }
+// cursor.close();
+// }
+//
+// return noteList;
+//
+// }
+//
+ @SuppressLint("Range")
+ public String queryFromDbByAccount(String account) {
+ SQLiteDatabase db = getWritableDatabase();
+ String password = "";
+
+ Cursor cursor = db.query(TABLE_NAME_NOTE, null, "account=?", new String[]{account}, null, null, null);
+
+ if (cursor != null && cursor.moveToFirst()) {
+ password = cursor.getString(cursor.getColumnIndex("password"));
+ cursor.close();
+ }
+ return password;
+ }
+
+
+}
diff --git a/app/src/main/java/com/example/travelor/fragment/FrontPageFragment.java b/app/src/main/java/com/example/travelor/fragment/FrontPageFragment.java
new file mode 100644
index 0000000..734bed8
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/fragment/FrontPageFragment.java
@@ -0,0 +1,153 @@
+package com.example.travelor.fragment;
+
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.SearchView;
+import android.widget.TextView;
+
+import com.example.travelor.R;
+import com.example.travelor.adapter.AttractionCardAdapter;
+import com.example.travelor.bean.Attractions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.example.travelor.datebase.AttractionDbOpenHelper;
+
+public class FrontPageFragment extends Fragment{
+
+ private RecyclerView mRecyclerView;
+ private List mAttractions;
+ private AttractionCardAdapter mAttrAdapter;
+ private SearchView searchView;
+ private TextView showAttraction;
+ private TextView showAll;
+ private TextView showHumanity;
+ private TextView showNature;
+
+ private AttractionDbOpenHelper mAttractionDbOpenHelper;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.front_page_layout, container, false);
+ initView(rootView);
+ initData();
+ initEvent();
+
+ // 搜索框
+ searchView = rootView.findViewById(R.id.searchView);
+ showAttraction = rootView.findViewById(R.id.show_attraction);
+ showAll = rootView.findViewById(R.id.show_all);
+ showNature = rootView.findViewById(R.id.show_nature);
+ showHumanity = rootView.findViewById(R.id.show_humanity);
+
+ search();
+ categoryAct();
+
+ return rootView;
+ }
+
+ // 按类别查询
+ private void categoryAct() {
+ showAll.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ mAttractions = mAttractionDbOpenHelper.queryAllFromDb();
+ mAttrAdapter.refreshData(mAttractions);
+ setLayout();
+ }
+ });
+
+ showAttraction.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ mAttractions = mAttractionDbOpenHelper.queryFromDbByCategory("风景");
+ mAttrAdapter.refreshData(mAttractions);
+ setLayout();
+ }
+ });
+
+ showNature.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ mAttractions = mAttractionDbOpenHelper.queryFromDbByCategory("自然");
+ mAttrAdapter.refreshData(mAttractions);
+ setLayout();
+ }
+ });
+
+ showHumanity.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ mAttractions = mAttractionDbOpenHelper.queryFromDbByCategory("人文");
+ mAttrAdapter.refreshData(mAttractions);
+ setLayout();
+ }
+ });
+ }
+
+ // 景点名搜索
+ private void search() {
+ searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
+ @Override
+ public boolean onQueryTextSubmit(String query) { return false; }
+
+ @Override
+ public boolean onQueryTextChange(String newText) {
+ performSearch(newText);
+ return true;
+ }
+ });
+ }
+
+ private void performSearch(String query) {
+ mAttractions = mAttractionDbOpenHelper.queryFromDbByName(query);
+ mAttrAdapter.refreshData(mAttractions);
+ setLayout();
+ }
+
+ // 回溯
+ public void onResume() {
+ super.onResume();
+ refreshDataFromDb();
+ setLayout();
+ }
+
+ // 更新视图
+ private void setLayout() {
+ RecyclerView.LayoutManager linearLayoutManager = new LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false);
+ mRecyclerView.setLayoutManager(linearLayoutManager); // 创建布局管理器
+ mAttrAdapter.notifyDataSetChanged();
+ }
+
+ private void refreshDataFromDb() {
+ mAttractions = getDataFromDB();
+ mAttrAdapter.refreshData(mAttractions);
+ }
+
+ private List getDataFromDB() {
+ return mAttractionDbOpenHelper.queryAllFromDb();
+ }
+
+ private void initEvent() {
+ mAttrAdapter = new AttractionCardAdapter(requireContext(), mAttractions);
+ mRecyclerView.setAdapter(mAttrAdapter);
+ }
+
+ private void initData() {
+ mAttractions = new ArrayList<>();
+ mAttractionDbOpenHelper = new AttractionDbOpenHelper(requireContext());
+ }
+
+ private void initView(View rootView) {
+ mRecyclerView = rootView.findViewById(R.id.rlv);
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/fragment/MineFragment.java b/app/src/main/java/com/example/travelor/fragment/MineFragment.java
new file mode 100644
index 0000000..089ab6e
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/fragment/MineFragment.java
@@ -0,0 +1,51 @@
+package com.example.travelor.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+import com.example.travelor.AttractionCollectActivity;
+import com.example.travelor.LoginActivity;
+import com.example.travelor.R;
+import com.example.travelor.SignInActivity;
+
+public class MineFragment extends Fragment {
+ private Button btLogout;
+ public ViewGroup vgCollect;
+
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.fragment_mine, container, false);
+
+ btLogout = rootView.findViewById(R.id.logout);
+ vgCollect = rootView.findViewById(R.id.mine_collect);
+
+ initEvent();
+
+ return rootView;
+ }
+
+ private void initEvent() {
+ btLogout.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(getActivity(), LoginActivity.class);
+ startActivity(intent);
+ }
+ });
+
+ vgCollect.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(getActivity(), AttractionCollectActivity.class);
+ startActivity(intent);
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/fragment/PlanFragment.java b/app/src/main/java/com/example/travelor/fragment/PlanFragment.java
new file mode 100644
index 0000000..5e7ad58
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/fragment/PlanFragment.java
@@ -0,0 +1,105 @@
+package com.example.travelor.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.example.travelor.AddActivity;
+import com.example.travelor.DetailsPageActivity;
+import com.example.travelor.R;
+import com.example.travelor.adapter.PlanAdapter;
+import com.example.travelor.bean.Plans;
+import com.example.travelor.datebase.PlansDbOpenHelper;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class PlanFragment extends Fragment {
+ private RecyclerView mRecyclerView;
+ private List mPlans;
+ private PlanAdapter mPlanAdapter;
+ private FloatingActionButton addButton;
+ private PlansDbOpenHelper mPlansDbOpenHelper;
+ private TextView mDate;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.plan_layout, container, false);
+
+ addButton = rootView.findViewById(R.id.btn_add);
+ mDate = rootView.findViewById(R.id.date);
+
+ initView(rootView);
+ initData();
+ initEvent();
+ add();
+ return rootView;
+ }
+
+ public void onResume() {
+ super.onResume();
+ refreshDataFromDb();
+ setLayout();
+ }
+
+ // 更新视图
+ private void setLayout() {
+ mPlanAdapter.notifyDataSetChanged();
+ RecyclerView.LayoutManager linearLayoutManager = new LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false);
+ mRecyclerView.setLayoutManager(linearLayoutManager); // 创建布局管理器
+ }
+
+ private void refreshDataFromDb() {
+ mPlans = getDataFromDB();
+ mPlanAdapter.refreshData(mPlans);
+ }
+
+ private List getDataFromDB() {
+ return mPlansDbOpenHelper.queryAllFromDb();
+ }
+
+ private void initEvent() {
+ mPlanAdapter = new PlanAdapter(requireContext(), mPlans);
+ mRecyclerView.setAdapter(mPlanAdapter);
+ mDate.setText(getCurrentTimeFormat());
+ }
+
+ private String getCurrentTimeFormat() {
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd");
+ Date date = new Date();
+ return simpleDateFormat.format(date);
+ }
+
+ private void initData() {
+ mPlans = new ArrayList<>();
+ mPlansDbOpenHelper = new PlansDbOpenHelper(requireContext());
+ }
+
+ private void initView(View rootView) {
+ mRecyclerView = rootView.findViewById(R.id.plan_rlv);
+ }
+
+ public void add() {
+ addButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(getActivity(), AddActivity.class);
+ startActivity(intent);
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/fragment/SparkAiFragment.java b/app/src/main/java/com/example/travelor/fragment/SparkAiFragment.java
new file mode 100644
index 0000000..ffa0e77
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/fragment/SparkAiFragment.java
@@ -0,0 +1,39 @@
+package com.example.travelor.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.example.travelor.LoginActivity;
+import com.example.travelor.PageJumpActivity;
+import com.example.travelor.R;
+import com.example.travelor.SparkAiActivity;
+
+public class SparkAiFragment extends Fragment {
+
+ private TextView tvStart;
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.fragment_spark_ai, container, false);
+ tvStart = rootView.findViewById(R.id.start);
+ initEvent();
+ return rootView;
+ }
+
+ private void initEvent() {
+ tvStart.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(getActivity(), SparkAiActivity.class);
+ startActivity(intent);
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/travelor/util/SpfUtil.java b/app/src/main/java/com/example/travelor/util/SpfUtil.java
new file mode 100644
index 0000000..2ad3048
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/util/SpfUtil.java
@@ -0,0 +1,50 @@
+package com.example.travelor.util;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+public class SpfUtil {
+
+ private static String SPF_NAME = "noteSpf";
+
+ public static void saveString(Context context, String key, String value) {
+ SharedPreferences spf = context.getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
+ SharedPreferences.Editor edit = spf.edit();
+ edit.putString(key, value);
+ edit.apply();
+ }
+
+ public static String getString(Context context, String key) {
+ SharedPreferences spf = context.getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
+ return spf.getString(key, "");
+ }
+
+ public static void saveBoolean(Context context, String key, boolean value) {
+ SharedPreferences spf = context.getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
+ SharedPreferences.Editor edit = spf.edit();
+ edit.putBoolean(key, value);
+ edit.apply();
+ }
+
+ public static Boolean getBoolean(Context context, String key) {
+ SharedPreferences spf = context.getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
+ return spf.getBoolean(key, false);
+ }
+
+ public static void saveInt(Context context, String key, int value) {
+ SharedPreferences spf = context.getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
+ SharedPreferences.Editor edit = spf.edit();
+ edit.putInt(key, value);
+ edit.apply();
+ }
+
+ public static int getInt(Context context, String key) {
+ SharedPreferences spf = context.getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
+ return spf.getInt(key, -1);
+ }
+
+ public static int getIntWithDefault(Context context, String key, int defValue) {
+ SharedPreferences spf = context.getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
+ return spf.getInt(key, defValue);
+ }
+}
diff --git a/app/src/main/java/com/example/travelor/util/ToastUtil.java b/app/src/main/java/com/example/travelor/util/ToastUtil.java
new file mode 100644
index 0000000..5ebe816
--- /dev/null
+++ b/app/src/main/java/com/example/travelor/util/ToastUtil.java
@@ -0,0 +1,15 @@
+package com.example.travelor.util;
+
+import android.content.Context;
+import android.widget.Toast;
+
+public class ToastUtil {
+
+ public static void toastShort(Context context, String msg) {
+ Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
+ }
+
+ public static void toastLong(Context context, String msg) {
+ Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
+ }
+}
diff --git a/app/src/main/jniLibs/arm64-v8a/libAMapSDK_MAP_v9_8_3.so b/app/src/main/jniLibs/arm64-v8a/libAMapSDK_MAP_v9_8_3.so
new file mode 100644
index 0000000..6121025
Binary files /dev/null and b/app/src/main/jniLibs/arm64-v8a/libAMapSDK_MAP_v9_8_3.so differ
diff --git a/app/src/main/jniLibs/armeabi-v7a/libAMapSDK_MAP_v9_8_3.so b/app/src/main/jniLibs/armeabi-v7a/libAMapSDK_MAP_v9_8_3.so
new file mode 100644
index 0000000..40f53fa
Binary files /dev/null and b/app/src/main/jniLibs/armeabi-v7a/libAMapSDK_MAP_v9_8_3.so differ
diff --git a/app/src/main/jniLibs/armeabi/libAMapSDK_MAP_v9_8_3.so b/app/src/main/jniLibs/armeabi/libAMapSDK_MAP_v9_8_3.so
new file mode 100644
index 0000000..40f53fa
Binary files /dev/null and b/app/src/main/jniLibs/armeabi/libAMapSDK_MAP_v9_8_3.so differ
diff --git a/app/src/main/jniLibs/x86_64/libAMapSDK_MAP_v9_8_3.so b/app/src/main/jniLibs/x86_64/libAMapSDK_MAP_v9_8_3.so
new file mode 100644
index 0000000..0833a9c
Binary files /dev/null and b/app/src/main/jniLibs/x86_64/libAMapSDK_MAP_v9_8_3.so differ
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/attraction_card.xml b/app/src/main/res/drawable/attraction_card.xml
new file mode 100644
index 0000000..fa1c3ca
--- /dev/null
+++ b/app/src/main/res/drawable/attraction_card.xml
@@ -0,0 +1,20 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/back.png b/app/src/main/res/drawable/back.png
new file mode 100644
index 0000000..74418cf
Binary files /dev/null and b/app/src/main/res/drawable/back.png differ
diff --git a/app/src/main/res/drawable/blur_flash_page.jpg b/app/src/main/res/drawable/blur_flash_page.jpg
new file mode 100644
index 0000000..2dbead4
Binary files /dev/null and b/app/src/main/res/drawable/blur_flash_page.jpg differ
diff --git a/app/src/main/res/drawable/btn_send.xml b/app/src/main/res/drawable/btn_send.xml
new file mode 100644
index 0000000..308c0fe
--- /dev/null
+++ b/app/src/main/res/drawable/btn_send.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/btn_start.png b/app/src/main/res/drawable/btn_start.png
new file mode 100644
index 0000000..de696bf
Binary files /dev/null and b/app/src/main/res/drawable/btn_start.png differ
diff --git a/app/src/main/res/drawable/btn_stop.png b/app/src/main/res/drawable/btn_stop.png
new file mode 100644
index 0000000..7ec5a90
Binary files /dev/null and b/app/src/main/res/drawable/btn_stop.png differ
diff --git a/app/src/main/res/drawable/btn_toggle_style.xml b/app/src/main/res/drawable/btn_toggle_style.xml
new file mode 100644
index 0000000..c3f2153
--- /dev/null
+++ b/app/src/main/res/drawable/btn_toggle_style.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/buy_button.xml b/app/src/main/res/drawable/buy_button.xml
new file mode 100644
index 0000000..7c312a4
--- /dev/null
+++ b/app/src/main/res/drawable/buy_button.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/circle_background.xml b/app/src/main/res/drawable/circle_background.xml
new file mode 100644
index 0000000..cd5547e
--- /dev/null
+++ b/app/src/main/res/drawable/circle_background.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/circle_border_shape.xml b/app/src/main/res/drawable/circle_border_shape.xml
new file mode 100644
index 0000000..0c97df9
--- /dev/null
+++ b/app/src/main/res/drawable/circle_border_shape.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/circular_image.jpg b/app/src/main/res/drawable/circular_image.jpg
new file mode 100644
index 0000000..5bf9e30
Binary files /dev/null and b/app/src/main/res/drawable/circular_image.jpg differ
diff --git a/app/src/main/res/drawable/circular_image2.jpg b/app/src/main/res/drawable/circular_image2.jpg
new file mode 100644
index 0000000..032f870
Binary files /dev/null and b/app/src/main/res/drawable/circular_image2.jpg differ
diff --git a/app/src/main/res/drawable/collect.png b/app/src/main/res/drawable/collect.png
new file mode 100644
index 0000000..f612231
Binary files /dev/null and b/app/src/main/res/drawable/collect.png differ
diff --git a/app/src/main/res/drawable/collect_card.xml b/app/src/main/res/drawable/collect_card.xml
new file mode 100644
index 0000000..0c1b4fe
--- /dev/null
+++ b/app/src/main/res/drawable/collect_card.xml
@@ -0,0 +1,83 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/collected.png b/app/src/main/res/drawable/collected.png
new file mode 100644
index 0000000..8a5d420
Binary files /dev/null and b/app/src/main/res/drawable/collected.png differ
diff --git a/app/src/main/res/drawable/dashed_line.xml b/app/src/main/res/drawable/dashed_line.xml
new file mode 100644
index 0000000..8060722
--- /dev/null
+++ b/app/src/main/res/drawable/dashed_line.xml
@@ -0,0 +1,8 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/dot_focus.xml b/app/src/main/res/drawable/dot_focus.xml
new file mode 100644
index 0000000..3cf5a20
--- /dev/null
+++ b/app/src/main/res/drawable/dot_focus.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/dot_normal.xml b/app/src/main/res/drawable/dot_normal.xml
new file mode 100644
index 0000000..a62f0f8
--- /dev/null
+++ b/app/src/main/res/drawable/dot_normal.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/edit_text_bg.xml b/app/src/main/res/drawable/edit_text_bg.xml
new file mode 100644
index 0000000..7fc1920
--- /dev/null
+++ b/app/src/main/res/drawable/edit_text_bg.xml
@@ -0,0 +1,4 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/edit_text_bg_focus.xml b/app/src/main/res/drawable/edit_text_bg_focus.xml
new file mode 100644
index 0000000..55bd89c
--- /dev/null
+++ b/app/src/main/res/drawable/edit_text_bg_focus.xml
@@ -0,0 +1,4 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/edittext_border.xml b/app/src/main/res/drawable/edittext_border.xml
new file mode 100644
index 0000000..a546201
--- /dev/null
+++ b/app/src/main/res/drawable/edittext_border.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/edittext_border_toggle.xml b/app/src/main/res/drawable/edittext_border_toggle.xml
new file mode 100644
index 0000000..5216ab2
--- /dev/null
+++ b/app/src/main/res/drawable/edittext_border_toggle.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/forum.png b/app/src/main/res/drawable/forum.png
new file mode 100644
index 0000000..675c048
Binary files /dev/null and b/app/src/main/res/drawable/forum.png differ
diff --git a/app/src/main/res/drawable/front_page.png b/app/src/main/res/drawable/front_page.png
new file mode 100644
index 0000000..3f2e179
Binary files /dev/null and b/app/src/main/res/drawable/front_page.png differ
diff --git a/app/src/main/res/drawable/gradient_background.xml b/app/src/main/res/drawable/gradient_background.xml
new file mode 100644
index 0000000..7b19258
--- /dev/null
+++ b/app/src/main/res/drawable/gradient_background.xml
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/greate_wall.jpg b/app/src/main/res/drawable/greate_wall.jpg
new file mode 100644
index 0000000..b28a726
Binary files /dev/null and b/app/src/main/res/drawable/greate_wall.jpg differ
diff --git a/app/src/main/res/drawable/gugong.jpg b/app/src/main/res/drawable/gugong.jpg
new file mode 100644
index 0000000..f22105e
Binary files /dev/null and b/app/src/main/res/drawable/gugong.jpg differ
diff --git a/app/src/main/res/drawable/head_image.jpg b/app/src/main/res/drawable/head_image.jpg
new file mode 100644
index 0000000..d487011
Binary files /dev/null and b/app/src/main/res/drawable/head_image.jpg differ
diff --git a/app/src/main/res/drawable/hotel1.jpg b/app/src/main/res/drawable/hotel1.jpg
new file mode 100644
index 0000000..a4c8fdd
Binary files /dev/null and b/app/src/main/res/drawable/hotel1.jpg differ
diff --git a/app/src/main/res/drawable/hotel2.jpg b/app/src/main/res/drawable/hotel2.jpg
new file mode 100644
index 0000000..6f3018a
Binary files /dev/null and b/app/src/main/res/drawable/hotel2.jpg differ
diff --git a/app/src/main/res/drawable/hotel3.jpg b/app/src/main/res/drawable/hotel3.jpg
new file mode 100644
index 0000000..9c9198c
Binary files /dev/null and b/app/src/main/res/drawable/hotel3.jpg differ
diff --git a/app/src/main/res/drawable/hulunbeier.jpg b/app/src/main/res/drawable/hulunbeier.jpg
new file mode 100644
index 0000000..1480992
Binary files /dev/null and b/app/src/main/res/drawable/hulunbeier.jpg differ
diff --git a/app/src/main/res/drawable/ic_collect.png b/app/src/main/res/drawable/ic_collect.png
new file mode 100644
index 0000000..9cd89cd
Binary files /dev/null and b/app/src/main/res/drawable/ic_collect.png differ
diff --git a/app/src/main/res/drawable/ic_coupon.png b/app/src/main/res/drawable/ic_coupon.png
new file mode 100644
index 0000000..fdcc788
Binary files /dev/null and b/app/src/main/res/drawable/ic_coupon.png differ
diff --git a/app/src/main/res/drawable/ic_delete.png b/app/src/main/res/drawable/ic_delete.png
new file mode 100644
index 0000000..36c0213
Binary files /dev/null and b/app/src/main/res/drawable/ic_delete.png differ
diff --git a/app/src/main/res/drawable/ic_edit.png b/app/src/main/res/drawable/ic_edit.png
new file mode 100644
index 0000000..f625659
Binary files /dev/null and b/app/src/main/res/drawable/ic_edit.png differ
diff --git a/app/src/main/res/drawable/ic_go.png b/app/src/main/res/drawable/ic_go.png
new file mode 100644
index 0000000..204c7a3
Binary files /dev/null and b/app/src/main/res/drawable/ic_go.png differ
diff --git a/app/src/main/res/drawable/ic_history.png b/app/src/main/res/drawable/ic_history.png
new file mode 100644
index 0000000..0a19341
Binary files /dev/null and b/app/src/main/res/drawable/ic_history.png differ
diff --git a/app/src/main/res/drawable/ic_hotel.png b/app/src/main/res/drawable/ic_hotel.png
new file mode 100644
index 0000000..de5c1f1
Binary files /dev/null and b/app/src/main/res/drawable/ic_hotel.png differ
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_list.png b/app/src/main/res/drawable/ic_list.png
new file mode 100644
index 0000000..1931bbc
Binary files /dev/null and b/app/src/main/res/drawable/ic_list.png differ
diff --git a/app/src/main/res/drawable/ic_message.png b/app/src/main/res/drawable/ic_message.png
new file mode 100644
index 0000000..6af866a
Binary files /dev/null and b/app/src/main/res/drawable/ic_message.png differ
diff --git a/app/src/main/res/drawable/ic_setting.png b/app/src/main/res/drawable/ic_setting.png
new file mode 100644
index 0000000..6d2479d
Binary files /dev/null and b/app/src/main/res/drawable/ic_setting.png differ
diff --git a/app/src/main/res/drawable/ic_share.png b/app/src/main/res/drawable/ic_share.png
new file mode 100644
index 0000000..ce8076a
Binary files /dev/null and b/app/src/main/res/drawable/ic_share.png differ
diff --git a/app/src/main/res/drawable/ic_simple_back.png b/app/src/main/res/drawable/ic_simple_back.png
new file mode 100644
index 0000000..180a88d
Binary files /dev/null and b/app/src/main/res/drawable/ic_simple_back.png differ
diff --git a/app/src/main/res/drawable/ic_spark.jpg b/app/src/main/res/drawable/ic_spark.jpg
new file mode 100644
index 0000000..b934ffd
Binary files /dev/null and b/app/src/main/res/drawable/ic_spark.jpg differ
diff --git a/app/src/main/res/drawable/ic_start_search.png b/app/src/main/res/drawable/ic_start_search.png
new file mode 100644
index 0000000..09c5779
Binary files /dev/null and b/app/src/main/res/drawable/ic_start_search.png differ
diff --git a/app/src/main/res/drawable/ic_transmit.png b/app/src/main/res/drawable/ic_transmit.png
new file mode 100644
index 0000000..d2a3258
Binary files /dev/null and b/app/src/main/res/drawable/ic_transmit.png differ
diff --git a/app/src/main/res/drawable/ic_transpond.png b/app/src/main/res/drawable/ic_transpond.png
new file mode 100644
index 0000000..ac0adcf
Binary files /dev/null and b/app/src/main/res/drawable/ic_transpond.png differ
diff --git a/app/src/main/res/drawable/ic_vip.png b/app/src/main/res/drawable/ic_vip.png
new file mode 100644
index 0000000..22fb023
Binary files /dev/null and b/app/src/main/res/drawable/ic_vip.png differ
diff --git a/app/src/main/res/drawable/ic_women.png b/app/src/main/res/drawable/ic_women.png
new file mode 100644
index 0000000..63c567d
Binary files /dev/null and b/app/src/main/res/drawable/ic_women.png differ
diff --git a/app/src/main/res/drawable/index_block.xml b/app/src/main/res/drawable/index_block.xml
new file mode 100644
index 0000000..8c619ce
--- /dev/null
+++ b/app/src/main/res/drawable/index_block.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/like.png b/app/src/main/res/drawable/like.png
new file mode 100644
index 0000000..f4f1864
Binary files /dev/null and b/app/src/main/res/drawable/like.png differ
diff --git a/app/src/main/res/drawable/like_toggle_style.xml b/app/src/main/res/drawable/like_toggle_style.xml
new file mode 100644
index 0000000..1cf4b5a
--- /dev/null
+++ b/app/src/main/res/drawable/like_toggle_style.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/liked.png b/app/src/main/res/drawable/liked.png
new file mode 100644
index 0000000..02ceaa6
Binary files /dev/null and b/app/src/main/res/drawable/liked.png differ
diff --git a/app/src/main/res/drawable/locate.png b/app/src/main/res/drawable/locate.png
new file mode 100644
index 0000000..63385b5
Binary files /dev/null and b/app/src/main/res/drawable/locate.png differ
diff --git a/app/src/main/res/drawable/login_image.jpg b/app/src/main/res/drawable/login_image.jpg
new file mode 100644
index 0000000..cbc0c41
Binary files /dev/null and b/app/src/main/res/drawable/login_image.jpg differ
diff --git a/app/src/main/res/drawable/low_right_shadow.xml b/app/src/main/res/drawable/low_right_shadow.xml
new file mode 100644
index 0000000..2bbb24b
--- /dev/null
+++ b/app/src/main/res/drawable/low_right_shadow.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/low_shadow.xml b/app/src/main/res/drawable/low_shadow.xml
new file mode 100644
index 0000000..979feaf
--- /dev/null
+++ b/app/src/main/res/drawable/low_shadow.xml
@@ -0,0 +1,15 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/mine.png b/app/src/main/res/drawable/mine.png
new file mode 100644
index 0000000..027be8b
Binary files /dev/null and b/app/src/main/res/drawable/mine.png differ
diff --git a/app/src/main/res/drawable/plan.png b/app/src/main/res/drawable/plan.png
new file mode 100644
index 0000000..e3aa754
Binary files /dev/null and b/app/src/main/res/drawable/plan.png differ
diff --git a/app/src/main/res/drawable/plan_background.jpg b/app/src/main/res/drawable/plan_background.jpg
new file mode 100644
index 0000000..9c9738e
Binary files /dev/null and b/app/src/main/res/drawable/plan_background.jpg differ
diff --git a/app/src/main/res/drawable/ribeira.jpg b/app/src/main/res/drawable/ribeira.jpg
new file mode 100644
index 0000000..744c53d
Binary files /dev/null and b/app/src/main/res/drawable/ribeira.jpg differ
diff --git a/app/src/main/res/drawable/right_arrow.png b/app/src/main/res/drawable/right_arrow.png
new file mode 100644
index 0000000..f67829a
Binary files /dev/null and b/app/src/main/res/drawable/right_arrow.png differ
diff --git a/app/src/main/res/drawable/rounded_border.xml b/app/src/main/res/drawable/rounded_border.xml
new file mode 100644
index 0000000..3c3e831
--- /dev/null
+++ b/app/src/main/res/drawable/rounded_border.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/search_frame.xml b/app/src/main/res/drawable/search_frame.xml
new file mode 100644
index 0000000..c2bbccb
--- /dev/null
+++ b/app/src/main/res/drawable/search_frame.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/sign_edittext_border.xml b/app/src/main/res/drawable/sign_edittext_border.xml
new file mode 100644
index 0000000..f9c38ef
--- /dev/null
+++ b/app/src/main/res/drawable/sign_edittext_border.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/sign_in_frame.xml b/app/src/main/res/drawable/sign_in_frame.xml
new file mode 100644
index 0000000..abc24fd
--- /dev/null
+++ b/app/src/main/res/drawable/sign_in_frame.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/spark_image.jpg b/app/src/main/res/drawable/spark_image.jpg
new file mode 100644
index 0000000..fbc102a
Binary files /dev/null and b/app/src/main/res/drawable/spark_image.jpg differ
diff --git a/app/src/main/res/drawable/west_lake1.jpg b/app/src/main/res/drawable/west_lake1.jpg
new file mode 100644
index 0000000..8cd3518
Binary files /dev/null and b/app/src/main/res/drawable/west_lake1.jpg differ
diff --git a/app/src/main/res/drawable/west_lake2.jpeg b/app/src/main/res/drawable/west_lake2.jpeg
new file mode 100644
index 0000000..c9ea78c
Binary files /dev/null and b/app/src/main/res/drawable/west_lake2.jpeg differ
diff --git a/app/src/main/res/drawable/west_lake3.jpg b/app/src/main/res/drawable/west_lake3.jpg
new file mode 100644
index 0000000..1a68b0a
Binary files /dev/null and b/app/src/main/res/drawable/west_lake3.jpg differ
diff --git a/app/src/main/res/drawable/wuzhen.jpg b/app/src/main/res/drawable/wuzhen.jpg
new file mode 100644
index 0000000..c16e4b5
Binary files /dev/null and b/app/src/main/res/drawable/wuzhen.jpg differ
diff --git a/app/src/main/res/layout/activity_add.xml b/app/src/main/res/layout/activity_add.xml
new file mode 100644
index 0000000..4184a73
--- /dev/null
+++ b/app/src/main/res/layout/activity_add.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_edit_plan.xml b/app/src/main/res/layout/activity_edit_plan.xml
new file mode 100644
index 0000000..750f73f
--- /dev/null
+++ b/app/src/main/res/layout/activity_edit_plan.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..44d2364
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_spark_ai.xml b/app/src/main/res/layout/activity_spark_ai.xml
new file mode 100644
index 0000000..7a2e587
--- /dev/null
+++ b/app/src/main/res/layout/activity_spark_ai.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/ai_response_item.xml b/app/src/main/res/layout/ai_response_item.xml
new file mode 100644
index 0000000..67d4685
--- /dev/null
+++ b/app/src/main/res/layout/ai_response_item.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/attraction_card.xml b/app/src/main/res/layout/attraction_card.xml
new file mode 100644
index 0000000..5ea9fe2
--- /dev/null
+++ b/app/src/main/res/layout/attraction_card.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/attraction_collect_card.xml b/app/src/main/res/layout/attraction_collect_card.xml
new file mode 100644
index 0000000..8a2684a
--- /dev/null
+++ b/app/src/main/res/layout/attraction_collect_card.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/attraction_collect_layout.xml b/app/src/main/res/layout/attraction_collect_layout.xml
new file mode 100644
index 0000000..bf17f08
--- /dev/null
+++ b/app/src/main/res/layout/attraction_collect_layout.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/details_page_layout.xml b/app/src/main/res/layout/details_page_layout.xml
new file mode 100644
index 0000000..7c52491
--- /dev/null
+++ b/app/src/main/res/layout/details_page_layout.xml
@@ -0,0 +1,261 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_mine.xml b/app/src/main/res/layout/fragment_mine.xml
new file mode 100644
index 0000000..e6e87df
--- /dev/null
+++ b/app/src/main/res/layout/fragment_mine.xml
@@ -0,0 +1,368 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_spark_ai.xml b/app/src/main/res/layout/fragment_spark_ai.xml
new file mode 100644
index 0000000..a741ce4
--- /dev/null
+++ b/app/src/main/res/layout/fragment_spark_ai.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/front_page_layout.xml b/app/src/main/res/layout/front_page_layout.xml
new file mode 100644
index 0000000..e532419
--- /dev/null
+++ b/app/src/main/res/layout/front_page_layout.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/gaode_map_layout.xml b/app/src/main/res/layout/gaode_map_layout.xml
new file mode 100644
index 0000000..871f406
--- /dev/null
+++ b/app/src/main/res/layout/gaode_map_layout.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/hotel_item_layout.xml b/app/src/main/res/layout/hotel_item_layout.xml
new file mode 100644
index 0000000..6b2a39d
--- /dev/null
+++ b/app/src/main/res/layout/hotel_item_layout.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/login_layout.xml b/app/src/main/res/layout/login_layout.xml
new file mode 100644
index 0000000..7cab00b
--- /dev/null
+++ b/app/src/main/res/layout/login_layout.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/main_page_layout.xml b/app/src/main/res/layout/main_page_layout.xml
new file mode 100644
index 0000000..589d1a9
--- /dev/null
+++ b/app/src/main/res/layout/main_page_layout.xml
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/one_plan.xml b/app/src/main/res/layout/one_plan.xml
new file mode 100644
index 0000000..7fd6371
--- /dev/null
+++ b/app/src/main/res/layout/one_plan.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/plan_layout.xml b/app/src/main/res/layout/plan_layout.xml
new file mode 100644
index 0000000..04c2836
--- /dev/null
+++ b/app/src/main/res/layout/plan_layout.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/sign_in_layout.xml b/app/src/main/res/layout/sign_in_layout.xml
new file mode 100644
index 0000000..a80215d
--- /dev/null
+++ b/app/src/main/res/layout/sign_in_layout.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/user_ask_item.xml b/app/src/main/res/layout/user_ask_item.xml
new file mode 100644
index 0000000..bcc8495
--- /dev/null
+++ b/app/src/main/res/layout/user_ask_item.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round_new.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round_new.png
new file mode 100644
index 0000000..e996365
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round_new.png differ
diff --git a/app/src/main/res/raw/west_lack.mp4 b/app/src/main/res/raw/west_lack.mp4
new file mode 100644
index 0000000..bc22847
Binary files /dev/null and b/app/src/main/res/raw/west_lack.mp4 differ
diff --git a/app/src/main/res/raw/west_lake2.mp4 b/app/src/main/res/raw/west_lake2.mp4
new file mode 100644
index 0000000..170ed32
Binary files /dev/null and b/app/src/main/res/raw/west_lake2.mp4 differ
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..695f48d
--- /dev/null
+++ b/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..8aa0a37
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,26 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+
+ #48A57A
+ #56B23B
+ #76B945
+ #01624F
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+ #F4B98E
+ #5B5B5B
+ #DADADA
+
+ #463434
+
+ @color/green_500
+ #689F38
+ #F4511E
+ #025864
+ #E5E5E5
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..c5f781f
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,5 @@
+
+ Travelor
+
+ Hello blank fragment
+
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..b68e7f5
--- /dev/null
+++ b/app/src/main/res/values/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/example/travelor/ExampleUnitTest.java b/app/src/test/java/com/example/travelor/ExampleUnitTest.java
new file mode 100644
index 0000000..14c5dfd
--- /dev/null
+++ b/app/src/test/java/com/example/travelor/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.travelor;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e708b1c
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..6bd9293
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Dec 11 16:31:57 CST 2023
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/images/test.txt b/images/test.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/images/test.txt
@@ -0,0 +1 @@
+
diff --git a/images/图片1.png b/images/图片1.png
new file mode 100644
index 0000000..f5b12a5
Binary files /dev/null and b/images/图片1.png differ
diff --git a/images/图片10.png b/images/图片10.png
new file mode 100644
index 0000000..4ab6066
Binary files /dev/null and b/images/图片10.png differ
diff --git a/images/图片11.png b/images/图片11.png
new file mode 100644
index 0000000..2191889
Binary files /dev/null and b/images/图片11.png differ
diff --git a/images/图片12.png b/images/图片12.png
new file mode 100644
index 0000000..4d56c05
Binary files /dev/null and b/images/图片12.png differ
diff --git a/images/图片13.png b/images/图片13.png
new file mode 100644
index 0000000..e53f3ca
Binary files /dev/null and b/images/图片13.png differ
diff --git a/images/图片2.png b/images/图片2.png
new file mode 100644
index 0000000..03ef146
Binary files /dev/null and b/images/图片2.png differ
diff --git a/images/图片3.png b/images/图片3.png
new file mode 100644
index 0000000..14f2ef6
Binary files /dev/null and b/images/图片3.png differ
diff --git a/images/图片4.png b/images/图片4.png
new file mode 100644
index 0000000..21a3ee3
Binary files /dev/null and b/images/图片4.png differ
diff --git a/images/图片5.png b/images/图片5.png
new file mode 100644
index 0000000..356f84d
Binary files /dev/null and b/images/图片5.png differ
diff --git a/images/图片6.png b/images/图片6.png
new file mode 100644
index 0000000..cd61508
Binary files /dev/null and b/images/图片6.png differ
diff --git a/images/图片7.png b/images/图片7.png
new file mode 100644
index 0000000..2947cc3
Binary files /dev/null and b/images/图片7.png differ
diff --git a/images/图片8.png b/images/图片8.png
new file mode 100644
index 0000000..dd29ce9
Binary files /dev/null and b/images/图片8.png differ
diff --git a/images/图片9.png b/images/图片9.png
new file mode 100644
index 0000000..361288d
Binary files /dev/null and b/images/图片9.png differ