Commit 5197a0d6 authored by jianglx's avatar jianglx

给订单详情页面补添加沉浸式样式。网页唤醒App title 解码;申请更大的内存使用空间;修改主页面的Viewpager的预加载页面为5,解决每次切换模块重新请求数据的问题

parent a67acf5d
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/logo" android:icon="@mipmap/logo"
android:label="@string/app_name" android:label="@string/app_name"
android:largeHeap="true"
android:resizeableActivity="false" android:resizeableActivity="false"
android:roundIcon="@mipmap/logo" android:roundIcon="@mipmap/logo"
android:supportsRtl="true" android:supportsRtl="true"
......
...@@ -110,7 +110,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -110,7 +110,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
showTitle(false); showTitle(false);
mAdapter = new TabAdapter(getSupportFragmentManager(), getListFragment()); mAdapter = new TabAdapter(getSupportFragmentManager(), getListFragment());
viewPager.setAdapter(mAdapter); viewPager.setAdapter(mAdapter);
// viewPager.setOffscreenPageLimit(3); viewPager.setOffscreenPageLimit(5);
setCurrent(TYPE_HOME_PAGE); setCurrent(TYPE_HOME_PAGE);
SwitchFragment.setFragmentSelected(new SwitchFragment.ChangeFragment() { SwitchFragment.setFragmentSelected(new SwitchFragment.ChangeFragment() {
......
...@@ -57,7 +57,7 @@ public class RvClientApplication extends FrameApp { ...@@ -57,7 +57,7 @@ public class RvClientApplication extends FrameApp {
ShareInstall.getInstance().reportRegister(); ShareInstall.getInstance().reportRegister();
} }
LogUtil.setLogEnable(true, getApplicationContext()); LogUtil.setLogEnable(true, getApplicationContext());
CrashHandler.getInstance().init(this); CrashHandler.getInstance().init(getApplicationContext());
// 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext // 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext
SDKInitializer.initialize(this); SDKInitializer.initialize(this);
//自4.3.0起,百度地图SDK所有接口均支持百度坐标和国测局坐标,用此方法设置您使用的坐标类型. //自4.3.0起,百度地图SDK所有接口均支持百度坐标和国测局坐标,用此方法设置您使用的坐标类型.
......
...@@ -13,6 +13,8 @@ import com.sh.sdk.shareinstall.listener.AppGetInfoListener; ...@@ -13,6 +13,8 @@ import com.sh.sdk.shareinstall.listener.AppGetInfoListener;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.net.URLDecoder;
/******** /********
* shareInstall 唤醒界面 * shareInstall 唤醒界面
*/ */
...@@ -45,7 +47,7 @@ public class WakeUpActivity extends AppCompatActivity { ...@@ -45,7 +47,7 @@ public class WakeUpActivity extends AppCompatActivity {
} }
String url = object.optString("url"); String url = object.optString("url");
LogUtil.d("唤醒传过来的url=" + url); LogUtil.d("唤醒传过来的url=" + url);
String title = object.optString("title"); String title = URLDecoder.decode(object.optString("title"), "UTF-8");
LogUtil.d("唤醒传过来的tile=" + title); LogUtil.d("唤醒传过来的tile=" + title);
if (!TextUtils.isEmpty(url) && !TextUtils.isEmpty(title)) { if (!TextUtils.isEmpty(url) && !TextUtils.isEmpty(title)) {
Intent intent = new Intent(getApplicationContext(), MainActivity.class); Intent intent = new Intent(getApplicationContext(), MainActivity.class);
...@@ -55,7 +57,7 @@ public class WakeUpActivity extends AppCompatActivity { ...@@ -55,7 +57,7 @@ public class WakeUpActivity extends AppCompatActivity {
startActivity(intent); startActivity(intent);
finish(); finish();
} }
} catch (JSONException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/colorWrite" android:background="@color/colorWrite"
tools:context="com.test.rv.WelcomeActivity"> tools:context=".WakeUpActivity">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -7,7 +7,9 @@ import android.os.SystemClock; ...@@ -7,7 +7,9 @@ import android.os.SystemClock;
import android.util.Log; import android.util.Log;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.StringWriter; import java.io.StringWriter;
import java.io.Writer; import java.io.Writer;
...@@ -28,7 +30,7 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler { ...@@ -28,7 +30,7 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
// 系统默认的UncaughtException处理类 // 系统默认的UncaughtException处理类
private Thread.UncaughtExceptionHandler mDefaultHandler; private Thread.UncaughtExceptionHandler mDefaultHandler;
private static CrashHandler instance = new CrashHandler(); private static CrashHandler instance;
private Context mContext; private Context mContext;
// 用来存储设备信息和异常信息 // 用来存储设备信息和异常信息
...@@ -47,6 +49,9 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler { ...@@ -47,6 +49,9 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
* 获取CrashHandler实例 ,单例模式 * 获取CrashHandler实例 ,单例模式
*/ */
public static CrashHandler getInstance() { public static CrashHandler getInstance() {
if (instance == null) {
instance = new CrashHandler();
}
return instance; return instance;
} }
...@@ -131,7 +136,7 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler { ...@@ -131,7 +136,7 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
* @return 返回文件名称, 便于将文件传送到服务器 * @return 返回文件名称, 便于将文件传送到服务器
* @throws Exception * @throws Exception
*/ */
private String saveCrashInfoFile(Throwable ex) throws Exception { private String saveCrashInfoFile(Throwable ex) {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
try { try {
SimpleDateFormat sDateFormat = new SimpleDateFormat( SimpleDateFormat sDateFormat = new SimpleDateFormat(
...@@ -167,23 +172,33 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler { ...@@ -167,23 +172,33 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
return null; return null;
} }
private String writeFile(String sb) throws Exception { private String writeFile(String sb) {
String time = formatter.format(new Date()); String time = formatter.format(new Date());
String fileName = "crash-" + time + ".log"; String fileName = "crash-" + time + ".log";
String path = getGlobalpath(); String path = getGlobalpath();
File dir = new File(path); File dir = new File(path);
if (!dir.exists()) if (!dir.exists())
dir.mkdirs(); dir.mkdirs();
FileOutputStream fos = new FileOutputStream(path + fileName, true); FileOutputStream fos = null;
try {
fos = new FileOutputStream(path + fileName, true);
fos.write(sb.getBytes()); fos.write(sb.getBytes());
fos.flush(); fos.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (fos != null) {
try {
fos.close(); fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return fileName; return fileName;
} }
public String getGlobalpath() { public String getGlobalpath() {
// return mContext.getCacheDir().getPath() + File.separator + "crash" + File.separator;
// return Environment.getExternalStorageDirectory().getPath() + File.separator + "crash" + File.separator;
return mContext.getExternalCacheDir().getPath() + File.separator + "crash" + File.separator; return mContext.getExternalCacheDir().getPath() + File.separator + "crash" + File.separator;
} }
......
...@@ -109,7 +109,7 @@ public class EvaluationActivity extends BaseStatusActivity<PickerPresenter> { ...@@ -109,7 +109,7 @@ public class EvaluationActivity extends BaseStatusActivity<PickerPresenter> {
@Override @Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) { protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle(mActivity.getString(R.string.rv_to_appointment_evaluation)); titleView.setTitle(getString(R.string.rv_to_appointment_evaluation));
dataBean = (OrderListBean.DataBeanX.DataBean) intent.getSerializableExtra("dataBean"); dataBean = (OrderListBean.DataBeanX.DataBean) intent.getSerializableExtra("dataBean");
if (dataBean != null) { if (dataBean != null) {
......
...@@ -7,6 +7,7 @@ import android.content.Intent; ...@@ -7,6 +7,7 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.View; import android.view.View;
import android.webkit.JavascriptInterface; import android.webkit.JavascriptInterface;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
...@@ -27,6 +28,7 @@ import com.frame.base.url.Constance; ...@@ -27,6 +28,7 @@ import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity; import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
import com.ruiwenliu.wrapper.util.ViewHolder; import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.dialog.PaymentTypeSelection; import com.rv.component.dialog.PaymentTypeSelection;
...@@ -81,7 +83,6 @@ public class MemberOrderDetailsActivity extends BaseStatusActivity<PickerPresent ...@@ -81,7 +83,6 @@ public class MemberOrderDetailsActivity extends BaseStatusActivity<PickerPresent
return new Intent(context, MemberOrderDetailsActivity.class) return new Intent(context, MemberOrderDetailsActivity.class)
.putExtra("dataBean", dataBean); .putExtra("dataBean", dataBean);
} }
@Override @Override
protected int setLayout() { protected int setLayout() {
return R.layout.activity_travel_order_details; return R.layout.activity_travel_order_details;
...@@ -423,6 +424,7 @@ public class MemberOrderDetailsActivity extends BaseStatusActivity<PickerPresent ...@@ -423,6 +424,7 @@ public class MemberOrderDetailsActivity extends BaseStatusActivity<PickerPresent
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
StatusBarUtil.setRootViewFitsSystemWindows(mActivity, false);
ButterKnife.bind(this); ButterKnife.bind(this);
} }
......
...@@ -33,6 +33,7 @@ import com.frame.base.bus.RxBus; ...@@ -33,6 +33,7 @@ import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.frame.rv.widget.PayResult; import com.frame.rv.widget.PayResult;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
import com.ruiwenliu.wrapper.util.ViewHolder; import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.control.ProgressWebView; import com.rv.component.control.ProgressWebView;
...@@ -353,6 +354,7 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> { ...@@ -353,6 +354,7 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation // TODO: add setContentView(...) invocation
StatusBarUtil.setRootViewFitsSystemWindows(mActivity, false);
ButterKnife.bind(this); ButterKnife.bind(this);
} }
......
...@@ -32,6 +32,7 @@ import com.frame.rv.config.RvFrameConfig; ...@@ -32,6 +32,7 @@ import com.frame.rv.config.RvFrameConfig;
import com.frame.rv.widget.PayResult; import com.frame.rv.widget.PayResult;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity; import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
import com.ruiwenliu.wrapper.util.ViewHolder; import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.control.ProgressWebView; import com.rv.component.control.ProgressWebView;
...@@ -493,6 +494,7 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent ...@@ -493,6 +494,7 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
StatusBarUtil.setRootViewFitsSystemWindows(mActivity, false);
ButterKnife.bind(this); ButterKnife.bind(this);
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:background="@color/colorAuxiliaryYellow"
android:orientation="vertical"
app:use_type="use_padding_top">
<RelativeLayout <RelativeLayout
android:id="@+id/lay_title" android:id="@+id/lay_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="@color/colorAuxiliaryYellow" android:layout_height="@dimen/size_55"
android:layout_height="@dimen/size_55"> android:background="@color/colorAuxiliaryYellow">
<ImageView <ImageView
android:id="@+id/iv_back" android:id="@+id/iv_back"
...@@ -26,9 +34,9 @@ ...@@ -26,9 +34,9 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center" android:gravity="center"
android:maxWidth="320dp"
android:maxLines="1" android:maxLines="1"
android:text="订单详情" android:text="订单详情"
android:maxWidth="320dp"
android:textColor="@color/textMain" android:textColor="@color/textMain"
android:textSize="@dimen/text_18" /> android:textSize="@dimen/text_18" />
...@@ -38,11 +46,12 @@ ...@@ -38,11 +46,12 @@
android:layout_height="@dimen/size_32" android:layout_height="@dimen/size_32"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@drawable/rv_rentingcar_icon_service_white"
android:layout_marginRight="@dimen/size_5" android:layout_marginRight="@dimen/size_5"
android:padding="@dimen/size_8" /> android:padding="@dimen/size_8"
android:src="@drawable/rv_rentingcar_icon_service_white" />
</RelativeLayout> </RelativeLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
<ProgressBar <ProgressBar
...@@ -52,53 +61,49 @@ ...@@ -52,53 +61,49 @@
android:layout_height="@dimen/size_3" android:layout_height="@dimen/size_3"
android:indeterminateOnly="false" android:indeterminateOnly="false"
android:max="100" android:max="100"
android:visibility="gone" android:progressDrawable="@drawable/shape_rv_bg_yellow_progress"
android:progressDrawable="@drawable/shape_rv_bg_yellow_progress" > android:visibility="gone"></ProgressBar>
</ProgressBar>
<WebView <WebView
android:id="@+id/webView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1" />
android:id="@+id/webView"
/>
<include layout="@layout/common_line"/> <include layout="@layout/common_line" />
<LinearLayout <LinearLayout
android:id="@+id/ll_item_bottom" android:id="@+id/ll_item_bottom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_70" android:layout_height="@dimen/size_70"
android:paddingLeft="@dimen/size_12"
android:paddingRight="@dimen/size_12"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal"
android:paddingLeft="@dimen/size_12"
android:paddingRight="@dimen/size_12">
<TextView <TextView
android:id="@+id/tv_cancel_order" android:id="@+id/tv_cancel_order"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:textSize="@dimen/text_14"
android:gravity="center"
android:layout_marginRight="@dimen/size_5" android:layout_marginRight="@dimen/size_5"
android:layout_weight="1"
android:background="@drawable/shape_rv_border_gray" android:background="@drawable/shape_rv_border_gray"
android:textColor="@color/textGray" android:gravity="center"
android:text="@string/rv_cancel_order" android:text="@string/rv_cancel_order"
/> android:textColor="@color/textGray"
android:textSize="@dimen/text_14" />
<TextView <TextView
android:id="@+id/tv_pick_up_the_car" android:id="@+id/tv_pick_up_the_car"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:textSize="@dimen/text_14"
android:gravity="center"
android:layout_marginLeft="@dimen/size_5" android:layout_marginLeft="@dimen/size_5"
android:layout_weight="1"
android:background="@drawable/shape_rv_bg_yellow" android:background="@drawable/shape_rv_bg_yellow"
android:textColor="@color/colorWrite" android:gravity="center"
android:text="@string/rv_pick_up_the_car" android:text="@string/rv_pick_up_the_car"
/> android:textColor="@color/colorWrite"
android:textSize="@dimen/text_14" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="vertical">
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:background="@color/colorAuxiliaryYellow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:use_type="use_padding_top">
<RelativeLayout <RelativeLayout
android:id="@+id/lay_title" android:id="@+id/lay_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="@color/colorAuxiliaryYellow" android:layout_height="@dimen/size_55"
android:layout_height="@dimen/size_55"> android:background="@color/colorAuxiliaryYellow">
<ImageView <ImageView
android:id="@+id/iv_back" android:id="@+id/iv_back"
...@@ -26,8 +34,8 @@ ...@@ -26,8 +34,8 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center" android:gravity="center"
android:maxLines="1"
android:maxWidth="320dp" android:maxWidth="320dp"
android:maxLines="1"
android:text="订单详情" android:text="订单详情"
android:textColor="@color/textMain" android:textColor="@color/textMain"
android:textSize="@dimen/text_18" /> android:textSize="@dimen/text_18" />
...@@ -38,13 +46,14 @@ ...@@ -38,13 +46,14 @@
android:layout_height="@dimen/size_32" android:layout_height="@dimen/size_32"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@drawable/rv_rentingcar_icon_service_white"
android:layout_marginRight="@dimen/size_5" android:layout_marginRight="@dimen/size_5"
android:padding="@dimen/size_8" /> android:padding="@dimen/size_8"
android:src="@drawable/rv_rentingcar_icon_service_white" />
</RelativeLayout> </RelativeLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
<include layout="@layout/common_line"/> <include layout="@layout/common_line" />
<ProgressBar <ProgressBar
android:id="@+id/pb_progress" android:id="@+id/pb_progress"
...@@ -53,53 +62,49 @@ ...@@ -53,53 +62,49 @@
android:layout_height="@dimen/size_3" android:layout_height="@dimen/size_3"
android:indeterminateOnly="false" android:indeterminateOnly="false"
android:max="100" android:max="100"
android:visibility="gone" android:progressDrawable="@drawable/shape_rv_bg_yellow_progress"
android:progressDrawable="@drawable/shape_rv_bg_yellow_progress" > android:visibility="gone"></ProgressBar>
</ProgressBar>
<WebView <WebView
android:id="@+id/webView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1" />
android:id="@+id/webView"
/>
<include layout="@layout/common_line"/> <include layout="@layout/common_line" />
<LinearLayout <LinearLayout
android:id="@+id/ll_item_bottom" android:id="@+id/ll_item_bottom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_70" android:layout_height="@dimen/size_70"
android:paddingLeft="@dimen/size_12"
android:paddingRight="@dimen/size_12"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal"
android:paddingLeft="@dimen/size_12"
android:paddingRight="@dimen/size_12">
<TextView <TextView
android:id="@+id/tv_cancel_order" android:id="@+id/tv_cancel_order"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:textSize="@dimen/text_14"
android:gravity="center"
android:layout_marginRight="@dimen/size_5" android:layout_marginRight="@dimen/size_5"
android:layout_weight="1"
android:background="@drawable/shape_rv_border_gray" android:background="@drawable/shape_rv_border_gray"
android:textColor="@color/textGray" android:gravity="center"
android:text="@string/rv_cancel_order" android:text="@string/rv_cancel_order"
/> android:textColor="@color/textGray"
android:textSize="@dimen/text_14" />
<TextView <TextView
android:id="@+id/tv_pick_up_the_car" android:id="@+id/tv_pick_up_the_car"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:textSize="@dimen/text_14"
android:gravity="center"
android:layout_marginLeft="@dimen/size_5" android:layout_marginLeft="@dimen/size_5"
android:layout_weight="1"
android:background="@drawable/shape_rv_bg_yellow" android:background="@drawable/shape_rv_bg_yellow"
android:textColor="@color/colorWrite" android:gravity="center"
android:text="立即支付" android:text="立即支付"
/> android:textColor="@color/colorWrite"
android:textSize="@dimen/text_14" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -12,6 +12,7 @@ import android.support.annotation.Nullable; ...@@ -12,6 +12,7 @@ import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
...@@ -67,7 +68,7 @@ import io.reactivex.functions.Consumer; ...@@ -67,7 +68,7 @@ import io.reactivex.functions.Consumer;
*/ */
public class TourismFragment extends BaseFragment<TourismPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener { public class TourismFragment extends BaseFragment<TourismPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
//BaseQuickAdapter.RequestLoadMoreListener, //BaseQuickAdapter.RequestLoadMoreListener,
@BindView(R2.id.travel_city_text) @BindView(R2.id.travel_city_text)
TextView travelCityText; TextView travelCityText;
@BindView(R2.id.search_input) @BindView(R2.id.search_input)
...@@ -135,7 +136,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -135,7 +136,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
//全部热门旅游 //全部热门旅游
mAllPopularAdapter = new AllPopularAdapter(); mAllPopularAdapter = new AllPopularAdapter();
rvPopularMore.setLayoutManager(new GridLayoutManager(_mActivity, 3)); rvPopularMore.setLayoutManager(new GridLayoutManager(_mActivity, 3));
rvPopularMore.addItemDecoration(new AbSpacesItemDecoration2(20,10));// 分割线。 rvPopularMore.addItemDecoration(new AbSpacesItemDecoration2(20, 10));// 分割线。
// rvPopularMore.setNestedScrollingEnabled(false); // rvPopularMore.setNestedScrollingEnabled(false);
rvPopularMore.setAdapter(mAllPopularAdapter); rvPopularMore.setAdapter(mAllPopularAdapter);
...@@ -186,7 +187,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -186,7 +187,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
getLoadTourAroundData(mPage); getLoadTourAroundData(mPage);
} }
} }
},rvTourAround); }, rvTourAround);
} }
@Override @Override
...@@ -361,7 +362,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -361,7 +362,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
@Override @Override
public void OnBannerClick(int position) { public void OnBannerClick(int position) {
BeanTourismBanner.DataBean dataBean = banners.get(position); BeanTourismBanner.DataBean dataBean = banners.get(position);
mPresenter.toTarget(getActivity(),dataBean.getUrl(),dataBean.getTitle()); mPresenter.toTarget(getActivity(), dataBean.getUrl(), dataBean.getTitle());
// ComponentName componentName = new ComponentName(getActivity(), "com.rv.share.WebViewActivity"); // ComponentName componentName = new ComponentName(getActivity(), "com.rv.share.WebViewActivity");
// Intent intent = new Intent(); // Intent intent = new Intent();
// intent.setComponent(componentName); // intent.setComponent(componentName);
...@@ -389,7 +390,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -389,7 +390,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
if (geoCoder !=null){ if (geoCoder != null) {
geoCoder.destroy(); geoCoder.destroy();
} }
} }
...@@ -448,7 +449,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -448,7 +449,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
private int left; private int left;
private int right; private int right;
public AbSpacesItemDecoration(int left,int right) { public AbSpacesItemDecoration(int left, int right) {
this.left = left; this.left = left;
this.right = right; this.right = right;
} }
...@@ -456,12 +457,12 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -456,12 +457,12 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
@Override @Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int childCount = parent.getChildCount(); int childCount = parent.getChildCount();
if ((childCount -1) % 2==0){ if ((childCount - 1) % 2 == 0) {
outRect.left = left; outRect.left = left;
outRect.right = right; outRect.right = right;
outRect.bottom = right; outRect.bottom = right;
outRect.top = right; outRect.top = right;
}else { } else {
outRect.left = right; outRect.left = right;
outRect.right = left; outRect.right = left;
outRect.bottom = right; outRect.bottom = right;
...@@ -476,7 +477,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -476,7 +477,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
private int left; private int left;
private int right; private int right;
public AbSpacesItemDecoration2(int left,int right) { public AbSpacesItemDecoration2(int left, int right) {
this.left = left; this.left = left;
this.right = right; this.right = right;
} }
...@@ -484,17 +485,17 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -484,17 +485,17 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
@Override @Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int childCount = parent.getChildCount(); int childCount = parent.getChildCount();
if (childCount % 3==1){ if (childCount % 3 == 1) {
outRect.left = left; outRect.left = left;
outRect.right = right; outRect.right = right;
outRect.bottom = right; outRect.bottom = right;
outRect.top = right; outRect.top = right;
}else if (childCount % 3 == 2){ } else if (childCount % 3 == 2) {
outRect.left = right; outRect.left = right;
outRect.right = right; outRect.right = right;
outRect.bottom = right; outRect.bottom = right;
outRect.top = right; outRect.top = right;
}else if (childCount % 3 ==0){ } else if (childCount % 3 == 0) {
outRect.left = right; outRect.left = right;
outRect.right = left; outRect.right = left;
outRect.bottom = right; outRect.bottom = right;
...@@ -590,6 +591,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements ...@@ -590,6 +591,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
latLatitude = location.getLatitude(); latLatitude = location.getLatitude();
lonLongitude = location.getLongitude(); lonLongitude = location.getLongitude();
mLatLng = new LatLng(location.getLatitude(), location.getLongitude()); mLatLng = new LatLng(location.getLatitude(), location.getLongitude());
if (!TextUtils.isEmpty(location.getCity()))
travelCityText.setText(location.getCity()); travelCityText.setText(location.getCity());
locationManager.stopLocation(); locationManager.stopLocation();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment