Commit 5197a0d6 authored by jianglx's avatar jianglx

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

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