package com.example.travelapplication.activity.details;
import android.app.ActionBar;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import com.example.travelapplication.BuildConfig;
import com.example.travelapplication.R;
import com.example.travelapplication.activity.base.BaseActivity;
import com.example.travelapplication.activity.comment.CommentStrategyActivity;
import com.example.travelapplication.activity.view.BaseView;
import com.example.travelapplication.activity.view.LoadingView;
import com.example.travelapplication.adapter.GlideApp;
import com.example.travelapplication.adapter.LoopDetailsBackgroundAdapter;
import com.example.travelapplication.adapter.WeatherRecyclerViewAdapter;
import com.example.travelapplication.infrastructure.utils.DecideErrorUtils;
import com.example.travelapplication.infrastructure.utils.Global_Variable;
import com.example.travelapplication.infrastructure.utils.SnackBarUtils;
import com.example.travelapplication.model.TravelStrategy;
import com.example.travelapplication.service.business.ReportBusinessService;
import com.example.travelapplication.service.business.TravelStrategyBusinessService;
import com.example.travelapplication.service.business.listener.BaseHandler;
import com.example.travelapplication.service.business.listener.OnResultListener;
import com.example.travelapplication.service.business.listener.pagerOnClickListener;
import java.util.ArrayList;
import java.util.List;
import interfaces.heweather.com.interfacesmodule.bean.Code;
import interfaces.heweather.com.interfacesmodule.bean.Lang;
import interfaces.heweather.com.interfacesmodule.bean.Unit;
import interfaces.heweather.com.interfacesmodule.bean.weather.forecast.Forecast;
import interfaces.heweather.com.interfacesmodule.bean.weather.forecast.ForecastBase;
import interfaces.heweather.com.interfacesmodule.view.HeConfig;
import interfaces.heweather.com.interfacesmodule.view.HeWeather;
import retrofit2.Response;
import static com.example.travelapplication.component.popup.LoadingDialog.closeLoadingDialog;
import static com.example.travelapplication.component.popup.LoadingDialog.createLoadingDialog;
import static com.example.travelapplication.infrastructure.utils.TimeFormatUtils.getFormatDatetime;
public class TravelStrategyDetailsActivity extends BaseActivity implements LoadingView, BaseView {
private final static String TAG = "result:";
private ImageView img1;
private ImageView img2;
private ImageView img3;
private TextView themeText;
private TextView areaText;
private TextView costText;
private TextView travelDaysText;
private TextView userName;
private TextView scenicNumberText;
private TextView issueTime;
private TextView strategyContent;
private ImageButton commentBtn;
private ImageButton favoriteBtn;
private ImageButton reportBtn;
private RadioGroup radioGroup;
private Button issueReportBtn;
private ViewPager viewPager; //轮播图模块
private int[] mImg_id;
private ArrayList<ImageView> mImgList;
private int previousSelectedPosition;//之前选择的位置
private Dialog loadingDialog;
private Integer strategyId;
private String cityName;
private String reportReson;
boolean isRunning = false;
//以下是天气控件
private ImageView openWeather;
private ImageView closeWeather;
private ConstraintLayout weatherDetail;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_travel_strategy_details);
HeConfig.init("HE2003121843011687", "5ccffd3aaa834e86a52f4faaba4507cd");
HeConfig.switchToFreeServerNode();
initView();
strategyId = getIntent().getIntExtra("strategy_id", 0);
initData();
setListener();
initLoopView();
}
private void initView(){
img1 = findViewById(R.id.strategy_p1);
img2 = findViewById(R.id.strategy_p2);
img3 = findViewById(R.id.strategy_p3);
themeText = findViewById(R.id.theme_text);
areaText = findViewById(R.id.area_text);
costText = findViewById(R.id.cost_text);
travelDaysText = findViewById(R.id.travel_days_text);
userName = findViewById(R.id.issueUser_text);
scenicNumberText = findViewById(R.id.scenic_text);
issueTime = findViewById(R.id.issueTime_text);
strategyContent = findViewById(R.id.travel_content_text);
commentBtn = findViewById(R.id.commentBtn);
favoriteBtn = findViewById(R.id.star);
reportBtn = findViewById(R.id.reportStr);
openWeather = findViewById(R.id.open_weather);
closeWeather = findViewById(R.id.close_weather);
weatherDetail = findViewById(R.id.weather_detail);
}
private void initData(){
loadingDialog = createLoadingDialog(getAnchorView().getContext());
TravelStrategyBusinessService travelStrategyBusinessService = new TravelStrategyBusinessService();
travelStrategyBusinessService.getStrategyDatail(new OnResultListener() {
@Override
public void onSuccess(Object object) {
TravelStrategy travelStrategy = (TravelStrategy) object;
initStrategy(travelStrategy);
finishLoading();
}
@Override
public void onError(Object object) {
DecideErrorUtils.showErrorMessage(getAnchorView(), object);
}
},strategyId);
}
private void initWeatherDate(){
HeWeather.getWeatherForecast(TravelStrategyDetailsActivity.this, cityName, Lang.CHINESE_SIMPLIFIED, Unit.METRIC,
new HeWeather.OnResultWeatherForecastBeanListener() {
@Override
public void onError(Throwable throwable) {
DecideErrorUtils.showErrorMessage(getAnchorView(), throwable);
}
@Override
public void onSuccess(Forecast forecast) {
if ( Code.OK.getCode().equalsIgnoreCase(forecast.getStatus()) ){
//此时返回数据
List<ForecastBase> forecastBases = forecast.getDaily_forecast();
initWeather(forecastBases);
} else {
//在此查看返回数据失败的原因
String status = forecast.getStatus();
Code code = Code.toEnum(status);
Log.i(TAG, "failed code: " + code);
}
}
});
}
private void setListener(){
openWeather.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
initWeatherDate();
weatherDetail.setVisibility(View.VISIBLE);
openWeather.setVisibility(View.GONE);
closeWeather.setVisibility(View.VISIBLE);
}
});
closeWeather.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
weatherDetail.setVisibility(View.GONE);
closeWeather.setVisibil
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
对于基于Android的旅游攻略App的毕业设计项目,以下是一些建议和步骤,以帮助你顺利进行项目开发: 1. **需求分析**: - 确定目标用户群体,例如热爱旅游的学生、上班族、退休人士等。 - 明确App需要提供的核心功能,如旅游目的地推荐、攻略分享、行程规划、地图导航、预订酒店和交通工具等。 2. **系统设计**: - 设计数据库模型,存储旅游目的地信息、攻略内容、用户信息等。 - 设计系统的架构,明确各层的职责,如控制器层(Controller)、服务层(Service)、持久层(DAO)。 3. **技术选型**: - 选择适合的编程语言,如Java或Kotlin。 - 选择适合的框架,如Spring Boot,用于快速开发和部署。 - 选择适合的前端框架,如React Native或Flutter,用于实现跨平台的用户界面。 - 选择适合的数据库,如MySQL或MongoDB。 4. **功能实现**: - 实现旅游目的地推荐功能,使用户能够查看热门的旅游目的地。 - 实现攻略分享功能,允许用户发布和浏览其他用户
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计-基于Android的旅游攻略app (1313个子文件)
gradlew.bat 2KB
CHANGELOG 40KB
CHANGELOG 40KB
ShopService.class 11KB
TravelStrategyController.class 10KB
TravelStrategyService.class 10KB
ObjectSelector.class 9KB
ShopController.class 9KB
BusinessExceptionController.class 9KB
UserController.class 8KB
FoodController.class 8KB
FoodService.class 8KB
UserService.class 7KB
CommityService.class 6KB
HttpResponseDataUtil.class 6KB
TravelStrategy.class 6KB
ReplyService.class 6KB
JwtHelper.class 6KB
Shop.class 5KB
ReportController.class 5KB
QUser.class 5KB
User.class 5KB
FavoriteService.class 5KB
ReportService.class 5KB
QTravelStrategy.class 5KB
ObjectPropertiesTrimmer.class 5KB
QShop.class 5KB
CommityController.class 5KB
QCommity.class 5KB
PageController.class 4KB
Commity.class 4KB
QFood.class 4KB
ReplyController.class 4KB
FavoriteControlle.class 4KB
QReply.class 4KB
CityController.class 4KB
QueryExpressionParser.class 4KB
Food.class 4KB
QFavorite.class 3KB
QArea.class 3KB
QAdmin.class 3KB
AliasResolver.class 3KB
ShopRepository.class 3KB
QType.class 3KB
FileUtil.class 3KB
Type.class 3KB
ErrorMessage.class 3KB
TokenIdentityContext.class 3KB
Reply.class 3KB
TestController.class 2KB
QCity.class 2KB
Encryption.class 2KB
AreaControlle.class 2KB
ErrorCode.class 2KB
EnsureDataUtil.class 2KB
Favorite.class 2KB
AreaService.class 2KB
CityService.class 2KB
Area.class 2KB
ResourceNotFoundException.class 2KB
ConflictException.class 2KB
ObjectQueryExpression.class 2KB
ErrorMessageBuilder.class 2KB
ArgumentErrorException.class 1KB
CorsConfig.class 1KB
UnProcessableException.class 1KB
UnAuthorizedException.class 1KB
City.class 1KB
Admin.class 1KB
Token.class 1KB
BusinessException.class 1KB
InvalidObjectSelectionException.class 1KB
GetNowTimeUtil.class 859B
FindCateServerApplication.class 779B
FindCateClientApplication.class 779B
PropertyQueryExpression.class 756B
HttpResponseDataUtil$1.class 698B
FindCateClientApplicationTests.class 668B
FavoriteRepository.class 651B
CommityRepository.class 647B
AdminRepository.class 639B
ReplyRepository.class 639B
UserRepository.class 635B
TypeRepository.class 635B
FoodRepository.class 635B
Response.class 634B
TestController.class 617B
TravelStrategyRepository.class 589B
Constraint.class 549B
AreaRepository.class 549B
CityRepository.class 549B
QueryExpression.class 374B
FieldProcessor.class 302B
IdentityContext.class 284B
bootstrap.css 143KB
bootstrap.css 143KB
bootstrap.min.css 122KB
bootstrap.min.css 122KB
bootstrap.min.css 118KB
bootstrap.min.css 118KB
共 1313 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
资源评论
人工智能教学实践
- 粉丝: 533
- 资源: 299
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Vue开发的一个应用程序.zip
- 彩虹外链网盘V5.3新增用户系统与分块上传
- 编译原理 - Engineering a Compiler - Second Edition - Keith D. Cooper
- 一个物流网硬件开发的例子,paho-mqtt,附说明
- 计算机网络期末复习最全资料!必过!
- T/GDIIA 005-2021 信息技术应用创新项目运行维护服务标准
- 模拟真实的无线通信环境,比较BPSK、QPSK、16QAM、64QAM的调制性能
- maven源代码.zip
- STN4900-VB一款2个N-Channel沟道SOP8的MOSFET晶体管参数介绍与应用说明
- STN4546S8RG-VB一款N-Channel沟道SOP8的MOSFET晶体管参数介绍与应用说明
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功