Commit b0a326fb authored by jianglx's avatar jianglx

Merge branch 'master' of http://113.105.137.151:22280/lify/rvapp into dev-member-john

parents e525a0e9 a4796f21
......@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 125
versionName "1.2.5"
versionCode 126
versionName "1.2.6"
multiDexEnabled true
//新版Gradle 是 implementation 为了兼容compile,写上这句话
......@@ -75,6 +75,7 @@ dependencies {
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
// api project(path: ':RvTravel')
api project(':component_resource')
api project(path: ':module_home')
api project(path: ':module_mine')
api project(path: ':module_camp')
......
......@@ -358,7 +358,12 @@
<activity
android:name="com.rv.camp.camp.CampDetailActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait" /> <!-- ============================旅游========================================== -->
android:screenOrientation="portrait" />
<activity
android:name="com.rv.camp.camp.CampShopShowActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
<activity android:name=".WakeUpActivity">
<intent-filter>
......
......@@ -4,17 +4,21 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.alibaba.android.arouter.launcher.ARouter;
import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig;
......@@ -23,6 +27,7 @@ import com.ruiwenliu.wrapper.base.BaseActivity;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseWrapperFragment;
import com.ruiwenliu.wrapper.bean.ActBean;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
import com.ruiwenliu.wrapper.util.listener.SwitchFragment;
import com.ruiwenliu.wrapper.weight.CustomScrollViewPager;
import com.ruiwenliu.wrapper.weight.TitleView;
......@@ -52,6 +57,7 @@ import butterknife.BindView;
import butterknife.OnClick;
public class MainActivity extends BaseActivity<CommonPresenter> {
// @BindView(R2.id.pager_view_fragment)
......@@ -96,6 +102,12 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
return R.layout.activity_main;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StatusBarUtil.setRootViewFitsSystemWindows(mActivity,false);
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
updateAppUtils = UpdateAppUtils.from(MainActivity.this);
......@@ -120,6 +132,8 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
getEffectiveTime();
getActivityPopup();
checkVersion();
}
@Override
......
......@@ -2,10 +2,13 @@ package com.xxfc.rv;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import com.ruiwenliu.wrapper.base.BaseActivity;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.LogUtil;
......@@ -57,7 +60,7 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
* 计时器
*/
private void interval() {
mDisposable = Flowable.interval(3, TimeUnit.SECONDS)
mDisposable = Flowable.interval(2, TimeUnit.SECONDS)
.doOnNext(new Consumer<Long>() {
@Override
public void accept(@NonNull Long aLong) throws Exception {
......@@ -94,4 +97,10 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
mDisposable.dispose();
}
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}
}
......@@ -15,6 +15,7 @@ import android.widget.Toast;
import com.alibaba.android.arouter.launcher.ARouter;
import com.ruiwenliu.wrapper.R;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.ruiwenliu.wrapper.weight.ToastView;
......@@ -55,6 +56,17 @@ public abstract class BaseWrapperActivity extends SupportActivity {
ButterKnife.bind(this);
initView(savedInstanceState, titleView, getIntent());
//当FitsSystemWindows设置 true 时,会在屏幕最上方预留出状态栏高度的 padding
StatusBarUtil.setRootViewFitsSystemWindows(this,true);
//设置状态栏透明
StatusBarUtil.setTranslucentStatus(this);
//一般的手机的状态栏文字和图标都是白色的, 可如果你的应用也是纯白色的, 或导致状态栏文字看不清
//所以如果你是这种情况,请使用以下代码, 设置状态使用深色文字图标风格, 否则你可以选择性注释掉这个if内容
if (!StatusBarUtil.setStatusBarDarkTheme(this, true)) {
//如果不支持设置深色风格 为了兼容总不能让状态栏白白的看不清, 于是设置一个状态栏颜色为半透明,
//这样半透明+白=灰, 状态栏的文字能看得清
StatusBarUtil.setStatusBarColor(this,0x55000000);
}
}
......
package com.ruiwenliu.wrapper.statusbar;
import android.os.Build;
import android.text.TextUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class OSUtils {
public static final String ROM_MIUI = "MIUI";
public static final String ROM_EMUI = "EMUI";
public static final String ROM_FLYME = "FLYME";
public static final String ROM_OPPO = "OPPO";
public static final String ROM_SMARTISAN = "SMARTISAN";
public static final String ROM_VIVO = "VIVO";
public static final String ROM_QIKU = "QIKU";
private static final String KEY_VERSION_MIUI = "ro.miui.ui.version.name";
private static final String KEY_VERSION_EMUI = "ro.build.version.emui";
private static final String KEY_VERSION_OPPO = "ro.build.version.opporom";
private static final String KEY_VERSION_SMARTISAN = "ro.smartisan.version";
private static final String KEY_VERSION_VIVO = "ro.vivo.os.version";
private static String sName;
private static String sVersion;
public static boolean isEmui() {
return check(ROM_EMUI);
}
public static boolean isMiui() {
return check(ROM_MIUI);
}
public static boolean isVivo() {
return check(ROM_VIVO);
}
public static boolean isOppo() {
return check(ROM_OPPO);
}
public static boolean isFlyme() {
return check(ROM_FLYME);
}
public static boolean is360() {
return check(ROM_QIKU) || check("360");
}
public static boolean isSmartisan() {
return check(ROM_SMARTISAN);
}
public static String getName() {
if (sName == null) {
check("");
}
return sName;
}
public static String getVersion() {
if (sVersion == null) {
check("");
}
return sVersion;
}
public static boolean check(String rom) {
if (sName != null) {
return sName.equals(rom);
}
if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
sName = ROM_MIUI;
} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
sName = ROM_EMUI;
} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
sName = ROM_OPPO;
} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
sName = ROM_VIVO;
} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
sName = ROM_SMARTISAN;
} else {
sVersion = Build.DISPLAY;
if (sVersion.toUpperCase().contains(ROM_FLYME)) {
sName = ROM_FLYME;
} else {
sVersion = Build.UNKNOWN;
sName = Build.MANUFACTURER.toUpperCase();
}
}
return sName.equals(rom);
}
public static String getProp(String name) {
String line = null;
BufferedReader input = null;
try {
Process p = Runtime.getRuntime().exec("getprop " + name);
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
line = input.readLine();
input.close();
} catch (IOException ex) {
return null;
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return line;
}
}
package com.ruiwenliu.wrapper.statusbar;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import com.ruiwenliu.wrapper.R;
public class StatusBarHeightView extends LinearLayout {
private int statusBarHeight;
private int type;
public StatusBarHeightView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
public StatusBarHeightView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(attrs);
}
public StatusBarHeightView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr);
init(attrs);
}
private void init(@Nullable AttributeSet attrs) {
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if(resourceId>0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
}else{
//低版本 直接设置0
statusBarHeight = 0;
}
if (attrs != null) {
TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.StatusBarHeightView);
type = typedArray.getInt(R.styleable.StatusBarHeightView_use_type, 0);
typedArray.recycle();
}
if (type == 1) {
setPadding(getPaddingLeft(), statusBarHeight, getPaddingRight(), getPaddingBottom());
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (type == 0) {
setMeasuredDimension(getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec),
statusBarHeight);
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
}
package com.ruiwenliu.wrapper.statusbar;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.support.annotation.IntDef;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class StatusBarUtil {
public final static int TYPE_MIUI = 0;
public final static int TYPE_FLYME = 1;
public final static int TYPE_M = 3;//6.0
@IntDef({TYPE_MIUI,
TYPE_FLYME,
TYPE_M})
@Retention(RetentionPolicy.SOURCE)
@interface ViewType {
}
/**
* 修改状态栏颜色,支持4.4以上版本
*
* @param colorId 颜色
*/
public static void setStatusBarColor(Activity activity, int colorId) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = activity.getWindow();
window.setStatusBarColor(colorId);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//使用SystemBarTintManager,需要先将状态栏设置为透明
setTranslucentStatus(activity);
SystemBarTintManager systemBarTintManager = new SystemBarTintManager(activity);
systemBarTintManager.setStatusBarTintEnabled(true);//显示状态栏
systemBarTintManager.setStatusBarTintColor(colorId);//设置状态栏颜色
}
}
/**
* 设置状态栏透明
*/
@TargetApi(19)
public static void setTranslucentStatus(Activity activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//5.x开始需要把颜色设置透明,否则导航栏会呈现系统默认的浅灰色
Window window = activity.getWindow();
View decorView = window.getDecorView();
//两个 flag 要结合使用,表示让应用的主体内容占用系统状态栏的空间
int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(option);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
//导航栏颜色也可以正常设置
//window.setNavigationBarColor(Color.TRANSPARENT);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window window = activity.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
int flagTranslucentStatus = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
attributes.flags |= flagTranslucentStatus;
//int flagTranslucentNavigation = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
//attributes.flags |= flagTranslucentNavigation;
window.setAttributes(attributes);
}
}
/**
* 代码实现android:fitsSystemWindows
*
* @param activity
*/
public static void setRootViewFitsSystemWindows(Activity activity, boolean fitSystemWindows) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
ViewGroup winContent = (ViewGroup) activity.findViewById(android.R.id.content);
if (winContent.getChildCount() > 0) {
ViewGroup rootView = (ViewGroup) winContent.getChildAt(0);
if (rootView != null) {
rootView.setFitsSystemWindows(fitSystemWindows);
}
}
}
}
/**
* 设置状态栏深色浅色切换
*/
public static boolean setStatusBarDarkTheme(Activity activity, boolean dark) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
setStatusBarFontIconDark(activity, TYPE_M, dark);
} else if (OSUtils.isMiui()) {
setStatusBarFontIconDark(activity, TYPE_MIUI, dark);
} else if (OSUtils.isFlyme()) {
setStatusBarFontIconDark(activity, TYPE_FLYME, dark);
} else {//其他情况
return false;
}
return true;
}
return false;
}
/**
* 设置 状态栏深色浅色切换
*/
public static boolean setStatusBarFontIconDark(Activity activity, @ViewType int type,boolean dark) {
switch (type) {
case TYPE_MIUI:
return setMiuiUI(activity, dark);
case TYPE_FLYME:
return setFlymeUI(activity, dark);
case TYPE_M:
default:
return setCommonUI(activity,dark);
}
}
//设置6.0 状态栏深色浅色切换
public static boolean setCommonUI(Activity activity, boolean dark) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
View decorView = activity.getWindow().getDecorView();
if (decorView != null) {
int vis = decorView.getSystemUiVisibility();
if (dark) {
vis |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
} else {
vis &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
}
if (decorView.getSystemUiVisibility() != vis) {
decorView.setSystemUiVisibility(vis);
}
return true;
}
}
return false;
}
//设置Flyme 状态栏深色浅色切换
public static boolean setFlymeUI(Activity activity, boolean dark) {
try {
Window window = activity.getWindow();
WindowManager.LayoutParams lp = window.getAttributes();
Field darkFlag = WindowManager.LayoutParams.class.getDeclaredField("MEIZU_FLAG_DARK_STATUS_BAR_ICON");
Field meizuFlags = WindowManager.LayoutParams.class.getDeclaredField("meizuFlags");
darkFlag.setAccessible(true);
meizuFlags.setAccessible(true);
int bit = darkFlag.getInt(null);
int value = meizuFlags.getInt(lp);
if (dark) {
value |= bit;
} else {
value &= ~bit;
}
meizuFlags.setInt(lp, value);
window.setAttributes(lp);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
//设置MIUI 状态栏深色浅色切换
public static boolean setMiuiUI(Activity activity, boolean dark) {
try {
Window window = activity.getWindow();
Class<?> clazz = activity.getWindow().getClass();
@SuppressLint("PrivateApi") Class<?> layoutParams = Class.forName("android.view.MiuiWindowManager$LayoutParams");
Field field = layoutParams.getField("EXTRA_FLAG_STATUS_BAR_DARK_MODE");
int darkModeFlag = field.getInt(layoutParams);
Method extraFlagField = clazz.getDeclaredMethod("setExtraFlags", int.class, int.class);
extraFlagField.setAccessible(true);
if (dark) { //状态栏亮色且黑色字体
extraFlagField.invoke(window, darkModeFlag, darkModeFlag);
} else {
extraFlagField.invoke(window, 0, darkModeFlag);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
//获取状态栏高度
public static int getStatusBarHeight(Context context) {
int result = 0;
int resourceId = context.getResources().getIdentifier(
"status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = context.getResources().getDimensionPixelSize(resourceId);
}
return result;
}
}
package com.ruiwenliu.wrapper.statusbar;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import java.lang.reflect.Method;
public class SystemBarTintManager {
static {
// Android allows a system property to override the presence of the navigation bar.
// Used by the emulator.
// See https://github.com/android/platform_frameworks_base/blob/master/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java#L1076
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
try {
Class c = Class.forName("android.os.SystemProperties");
Method m = c.getDeclaredMethod("get", String.class);
m.setAccessible(true);
sNavBarOverride = (String) m.invoke(null, "qemu.hw.mainkeys");
} catch (Throwable e) {
sNavBarOverride = null;
}
}
}
/**
* The default system bar tint color value.
*/
public static final int DEFAULT_TINT_COLOR = 0x99000000;
private static String sNavBarOverride;
private final SystemBarConfig mConfig;
private boolean mStatusBarAvailable;
private boolean mNavBarAvailable;
private boolean mStatusBarTintEnabled;
private boolean mNavBarTintEnabled;
private View mStatusBarTintView;
private View mNavBarTintView;
/**
* Constructor. Call this in the host activity onCreate method after its
* content view has been set. You should always create new instances when
* the host activity is recreated.
*
* @param activity The host activity.
*/
@TargetApi(19)
public SystemBarTintManager(Activity activity) {
Window win = activity.getWindow();
ViewGroup decorViewGroup = (ViewGroup) win.getDecorView();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// check theme attrs
int[] attrs = {android.R.attr.windowTranslucentStatus,
android.R.attr.windowTranslucentNavigation};
TypedArray a = activity.obtainStyledAttributes(attrs);
try {
mStatusBarAvailable = a.getBoolean(0, false);
mNavBarAvailable = a.getBoolean(1, false);
} finally {
a.recycle();
}
// check window flags
WindowManager.LayoutParams winParams = win.getAttributes();
int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
if ((winParams.flags & bits) != 0) {
mStatusBarAvailable = true;
}
bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
if ((winParams.flags & bits) != 0) {
mNavBarAvailable = true;
}
}
mConfig = new SystemBarConfig(activity, mStatusBarAvailable, mNavBarAvailable);
// device might not have virtual navigation keys
if (!mConfig.hasNavigtionBar()) {
mNavBarAvailable = false;
}
if (mStatusBarAvailable) {
setupStatusBarView(activity, decorViewGroup);
}
if (mNavBarAvailable) {
setupNavBarView(activity, decorViewGroup);
}
}
/**
* Enable tinting of the system status bar.
*
* If the platform is running Jelly Bean or earlier, or translucent system
* UI modes have not been enabled in either the theme or via window flags,
* then this method does nothing.
*
* @param enabled True to enable tinting, false to disable it (default).
*/
public void setStatusBarTintEnabled(boolean enabled) {
mStatusBarTintEnabled = enabled;
if (mStatusBarAvailable) {
mStatusBarTintView.setVisibility(enabled ? View.VISIBLE : View.GONE);
}
}
/**
* Enable tinting of the system navigation bar.
*
* If the platform does not have soft navigation keys, is running Jelly Bean
* or earlier, or translucent system UI modes have not been enabled in either
* the theme or via window flags, then this method does nothing.
*
* @param enabled True to enable tinting, false to disable it (default).
*/
public void setNavigationBarTintEnabled(boolean enabled) {
mNavBarTintEnabled = enabled;
if (mNavBarAvailable) {
mNavBarTintView.setVisibility(enabled ? View.VISIBLE : View.GONE);
}
}
/**
* Apply the specified color tint to all system UI bars.
*
* @param color The color of the background tint.
*/
public void setTintColor(int color) {
setStatusBarTintColor(color);
setNavigationBarTintColor(color);
}
/**
* Apply the specified drawable or color resource to all system UI bars.
*
* @param res The identifier of the resource.
*/
public void setTintResource(int res) {
setStatusBarTintResource(res);
setNavigationBarTintResource(res);
}
/**
* Apply the specified drawable to all system UI bars.
*
* @param drawable The drawable to use as the background, or null to remove it.
*/
public void setTintDrawable(Drawable drawable) {
setStatusBarTintDrawable(drawable);
setNavigationBarTintDrawable(drawable);
}
/**
* Apply the specified alpha to all system UI bars.
*
* @param alpha The alpha to use
*/
public void setTintAlpha(float alpha) {
setStatusBarAlpha(alpha);
setNavigationBarAlpha(alpha);
}
/**
* Apply the specified color tint to the system status bar.
*
* @param color The color of the background tint.
*/
public void setStatusBarTintColor(int color) {
if (mStatusBarAvailable) {
mStatusBarTintView.setBackgroundColor(color);
}
}
/**
* Apply the specified drawable or color resource to the system status bar.
*
* @param res The identifier of the resource.
*/
public void setStatusBarTintResource(int res) {
if (mStatusBarAvailable) {
mStatusBarTintView.setBackgroundResource(res);
}
}
/**
* Apply the specified drawable to the system status bar.
*
* @param drawable The drawable to use as the background, or null to remove it.
*/
@SuppressWarnings("deprecation")
public void setStatusBarTintDrawable(Drawable drawable) {
if (mStatusBarAvailable) {
mStatusBarTintView.setBackgroundDrawable(drawable);
}
}
/**
* Apply the specified alpha to the system status bar.
*
* @param alpha The alpha to use
*/
@TargetApi(11)
public void setStatusBarAlpha(float alpha) {
if (mStatusBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mStatusBarTintView.setAlpha(alpha);
}
}
/**
* Apply the specified color tint to the system navigation bar.
*
* @param color The color of the background tint.
*/
public void setNavigationBarTintColor(int color) {
if (mNavBarAvailable) {
mNavBarTintView.setBackgroundColor(color);
}
}
/**
* Apply the specified drawable or color resource to the system navigation bar.
*
* @param res The identifier of the resource.
*/
public void setNavigationBarTintResource(int res) {
if (mNavBarAvailable) {
mNavBarTintView.setBackgroundResource(res);
}
}
/**
* Apply the specified drawable to the system navigation bar.
*
* @param drawable The drawable to use as the background, or null to remove it.
*/
@SuppressWarnings("deprecation")
public void setNavigationBarTintDrawable(Drawable drawable) {
if (mNavBarAvailable) {
mNavBarTintView.setBackgroundDrawable(drawable);
}
}
/**
* Apply the specified alpha to the system navigation bar.
*
* @param alpha The alpha to use
*/
@TargetApi(11)
public void setNavigationBarAlpha(float alpha) {
if (mNavBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mNavBarTintView.setAlpha(alpha);
}
}
/**
* Get the system bar configuration.
*
* @return The system bar configuration for the current device configuration.
*/
public SystemBarConfig getConfig() {
return mConfig;
}
/**
* Is tinting enabled for the system status bar?
*
* @return True if enabled, False otherwise.
*/
public boolean isStatusBarTintEnabled() {
return mStatusBarTintEnabled;
}
/**
* Is tinting enabled for the system navigation bar?
*
* @return True if enabled, False otherwise.
*/
public boolean isNavBarTintEnabled() {
return mNavBarTintEnabled;
}
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
mStatusBarTintView = new View(context);
ActionBar.LayoutParams params = new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
params.gravity = Gravity.TOP;
if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
params.rightMargin = mConfig.getNavigationBarWidth();
}
mStatusBarTintView.setLayoutParams(params);
mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
mStatusBarTintView.setVisibility(View.GONE);
decorViewGroup.addView(mStatusBarTintView);
}
private void setupNavBarView(Context context, ViewGroup decorViewGroup) {
mNavBarTintView = new View(context);
ActionBar.LayoutParams params;
if (mConfig.isNavigationAtBottom()) {
params = new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT, mConfig.getNavigationBarHeight());
params.gravity = Gravity.BOTTOM;
} else {
params = new ActionBar.LayoutParams(mConfig.getNavigationBarWidth(), ActionBar.LayoutParams.MATCH_PARENT);
params.gravity = Gravity.RIGHT;
}
mNavBarTintView.setLayoutParams(params);
mNavBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
mNavBarTintView.setVisibility(View.GONE);
decorViewGroup.addView(mNavBarTintView);
}
/**
* Class which describes system bar sizing and other characteristics for the current
* device configuration.
*
*/
public static class SystemBarConfig {
private static final String STATUS_BAR_HEIGHT_RES_NAME = "status_bar_height";
private static final String NAV_BAR_HEIGHT_RES_NAME = "navigation_bar_height";
private static final String NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME = "navigation_bar_height_landscape";
private static final String NAV_BAR_WIDTH_RES_NAME = "navigation_bar_width";
private static final String SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar";
private final boolean mTranslucentStatusBar;
private final boolean mTranslucentNavBar;
private final int mStatusBarHeight;
private final int mActionBarHeight;
private final boolean mHasNavigationBar;
private final int mNavigationBarHeight;
private final int mNavigationBarWidth;
private final boolean mInPortrait;
private final float mSmallestWidthDp;
private SystemBarConfig(Activity activity, boolean translucentStatusBar, boolean traslucentNavBar) {
Resources res = activity.getResources();
mInPortrait = (res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
mSmallestWidthDp = getSmallestWidthDp(activity);
mStatusBarHeight = getInternalDimensionSize(res, STATUS_BAR_HEIGHT_RES_NAME);
mActionBarHeight = getActionBarHeight(activity);
mNavigationBarHeight = getNavigationBarHeight(activity);
mNavigationBarWidth = getNavigationBarWidth(activity);
mHasNavigationBar = (mNavigationBarHeight > 0);
mTranslucentStatusBar = translucentStatusBar;
mTranslucentNavBar = traslucentNavBar;
}
@TargetApi(14)
private int getActionBarHeight(Context context) {
int result = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
TypedValue tv = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true);
result = TypedValue.complexToDimensionPixelSize(tv.data, context.getResources().getDisplayMetrics());
}
return result;
}
@TargetApi(14)
private int getNavigationBarHeight(Context context) {
Resources res = context.getResources();
int result = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
if (hasNavBar(context)) {
String key;
if (mInPortrait) {
key = NAV_BAR_HEIGHT_RES_NAME;
} else {
key = NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME;
}
return getInternalDimensionSize(res, key);
}
}
return result;
}
@TargetApi(14)
private int getNavigationBarWidth(Context context) {
Resources res = context.getResources();
int result = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
if (hasNavBar(context)) {
return getInternalDimensionSize(res, NAV_BAR_WIDTH_RES_NAME);
}
}
return result;
}
@TargetApi(14)
private boolean hasNavBar(Context context) {
Resources res = context.getResources();
int resourceId = res.getIdentifier(SHOW_NAV_BAR_RES_NAME, "bool", "android");
if (resourceId != 0) {
boolean hasNav = res.getBoolean(resourceId);
// check override flag (see static block)
if ("1".equals(sNavBarOverride)) {
hasNav = false;
} else if ("0".equals(sNavBarOverride)) {
hasNav = true;
}
return hasNav;
} else { // fallback
return !ViewConfiguration.get(context).hasPermanentMenuKey();
}
}
private int getInternalDimensionSize(Resources res, String key) {
int result = 0;
int resourceId = res.getIdentifier(key, "dimen", "android");
if (resourceId > 0) {
result = res.getDimensionPixelSize(resourceId);
}
return result;
}
@SuppressLint("NewApi")
private float getSmallestWidthDp(Activity activity) {
DisplayMetrics metrics = new DisplayMetrics();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
activity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
} else {
// TODO this is not correct, but we don't really care pre-kitkat
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
}
float widthDp = metrics.widthPixels / metrics.density;
float heightDp = metrics.heightPixels / metrics.density;
return Math.min(widthDp, heightDp);
}
/**
* Should a navigation bar appear at the bottom of the screen in the current
* device configuration? A navigation bar may appear on the right side of
* the screen in certain configurations.
*
* @return True if navigation should appear at the bottom of the screen, False otherwise.
*/
public boolean isNavigationAtBottom() {
return (mSmallestWidthDp >= 600 || mInPortrait);
}
/**
* Get the height of the system status bar.
*
* @return The height of the status bar (in pixels).
*/
public int getStatusBarHeight() {
return mStatusBarHeight;
}
/**
* Get the height of the action bar.
*
* @return The height of the action bar (in pixels).
*/
public int getActionBarHeight() {
return mActionBarHeight;
}
/**
* Does this device have a system navigation bar?
*
* @return True if this device uses soft key navigation, False otherwise.
*/
public boolean hasNavigtionBar() {
return mHasNavigationBar;
}
/**
* Get the height of the system navigation bar.
*
* @return The height of the navigation bar (in pixels). If the device does not have
* soft navigation keys, this will always return 0.
*/
public int getNavigationBarHeight() {
return mNavigationBarHeight;
}
/**
* Get the width of the system navigation bar when it is placed vertically on the screen.
*
* @return The width of the navigation bar (in pixels). If the device does not have
* soft navigation keys, this will always return 0.
*/
public int getNavigationBarWidth() {
return mNavigationBarWidth;
}
/**
* Get the layout inset for any system UI that appears at the top of the screen.
*
* @param withActionBar True to include the height of the action bar, False otherwise.
* @return The layout inset (in pixels).
*/
public int getPixelInsetTop(boolean withActionBar) {
return (mTranslucentStatusBar ? mStatusBarHeight : 0) + (withActionBar ? mActionBarHeight : 0);
}
/**
* Get the layout inset for any system UI that appears at the bottom of the screen.
*
* @return The layout inset (in pixels).
*/
public int getPixelInsetBottom() {
if (mTranslucentNavBar && isNavigationAtBottom()) {
return mNavigationBarHeight;
} else {
return 0;
}
}
/**
* Get the layout inset for any system UI that appears at the right of the screen.
*
* @return The layout inset (in pixels).
*/
public int getPixelInsetRight() {
if (mTranslucentNavBar && !isNavigationAtBottom()) {
return mNavigationBarWidth;
} else {
return 0;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="StatusBarHeightView">
<attr name="use_type" format="integer">
<enum name="use_height" value="0" />
<enum name="use_padding_top" value="1" />
</attr>
</declare-styleable>
</resources>
package com.rv.component.dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.ViewGroup;
import com.ruiwenliu.wrapper.dialog.BaseDialog;
/**
* 提示
*/
public class BottomPromptDialog extends BaseDialog {
public BottomPromptDialog(@NonNull Context context) {
super(context);
setDialogParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
}
@Override
public int getViewLayout() {
return R.layout.dialog_prompt_bottom;
}
}
......@@ -13,7 +13,7 @@ public class PaymentTypeSelection extends BaseDialog {
public PaymentTypeSelection(@NonNull Context context) {
super(context);
setDialogParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
findViewById(R.id.rb_alipay).setEnabled(false);
findViewById(R.id.iv_wx_select).setSelected(true);
}
@Override
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/btn1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:padding="13dp"
android:text=""
android:textColor="@color/text_Main"
android:textSize="16sp" />
<include layout="@layout/common_line" />
<Button
android:id="@+id/btn2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:padding="13dp"
android:text=""
android:textColor="@color/text_Main"
android:textSize="16sp" />
<include layout="@layout/common_line" />
<Button
android:id="@+id/btn3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:padding="13dp"
android:text=""
android:textColor="@color/text_Main"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -74,12 +74,11 @@
android:layout_height="match_parent"
android:layout_weight="1"/>
<CheckBox
android:id="@+id/rb_wechat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:button="@drawable/selector_rv_check" />
<ImageView
android:id="@+id/iv_wx_select"
android:layout_width="@dimen/size_16"
android:layout_height="@dimen/size_16"
android:src="@drawable/selector_rv_icon_mark" />
</LinearLayout>
......@@ -112,11 +111,11 @@
android:layout_height="match_parent"
android:layout_weight="1"/>
<CheckBox
android:id="@+id/rb_alipay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/selector_rv_check" />
<ImageView
android:id="@+id/iv_alipy_select"
android:layout_width="@dimen/size_16"
android:layout_height="@dimen/size_16"
android:src="@drawable/selector_rv_icon_mark" />
</LinearLayout>
<View
......
......@@ -40,6 +40,7 @@ dependencies {
api project(':RvWrapper')
api project(':component_control')
api project(':component_resource')
api project(':component_dialog')
}
......@@ -28,6 +28,7 @@ import com.rv.camp.api.CampApi;
import com.rv.camp.bean.CampListBean;
import com.rv.camp.bean.CampTypeBean;
import com.rv.camp.camp.CampDetailActivity;
import com.rv.camp.camp.CampShopShowActivity;
import com.rv.camp.presenter.CampPresenter;
import java.util.LinkedHashMap;
......@@ -86,7 +87,7 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
permissionProcess();
campAdapter = new CampListAdapter();
rvContent.setLayoutManager(new GridLayoutManager(_mActivity, 2));
rvContent.addItemDecoration(new AbSpacesItemDecoration(15));// 分割线。
rvContent.addItemDecoration(new AbSpacesItemDecoration(20,10));// 分割线。
rvContent.setNestedScrollingEnabled(false);
rvContent.setAdapter(campAdapter);
......@@ -155,7 +156,7 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
isOpen = !isOpen;
} else if (id == R.id.iv_camp_map) {
//地图
showToast("亲,该功能还在开发中。。。");
startActivity(CampShopShowActivity.getIntent(_mActivity));
} else if (id == R.id.v_shadow) {
rvType.setVisibility(View.GONE);
vShadow.setVisibility(View.GONE);
......@@ -296,20 +297,31 @@ public class CampFragment extends BaseFragment<CampPresenter> implements BaseQui
}
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space;
private int left;
private int right;
public AbSpacesItemDecoration(int space) {
this.space = space;
public AbSpacesItemDecoration(int left,int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
outRect.left = space;
outRect.right = space;
outRect.bottom = space;
outRect.top = space;
int childCount = parent.getChildCount();
if ((childCount -1) % 2==0){
outRect.left = left;
outRect.right = right;
outRect.bottom = right;
outRect.top = right;
}else {
outRect.left = right;
outRect.right = left;
outRect.bottom = right;
outRect.top = right;
}
}
}
......
......@@ -18,7 +18,7 @@ public class CampListAdapter extends BaseQuickAdapter<CampListBean.DataBeanX.Dat
}
@Override
protected void convert(BaseViewHolder helper, final CampListBean.DataBeanX.DataBean item) {
GlideManager.getInstance(mContext).loadImage(item.getLogo(), (ImageView)helper.getView(R.id.iv_icon));
GlideManager.getInstance(mContext).loadRoundImage(item.getLogo(), (ImageView)helper.getView(R.id.iv_icon),8);
helper.setText(R.id.tv_type,item.getStoreTypeName());
helper.setText(R.id.tv_name,item.getName());
helper.setText(R.id.tv_city,item.getCityName());
......
......@@ -79,8 +79,10 @@ public class CampListBean extends BaseBean {
private String cityName;//": "广州市",
private String storeTypeName;//": "上海游", --->店铺类型
private String storeld;//": "1", ---->店铺类型id
private String longitude;//": 116.308479,--->经度
private String latitude;//": 39.983171---->纬度
private double longitude;//": 116.308479,--->经度
private double latitude;//": 39.983171---->纬度
private String phone;
private String address;
public String getId() {
......@@ -147,21 +149,37 @@ public class CampListBean extends BaseBean {
this.storeld = storeld;
}
public String getLongitude() {
public double getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public String getLatitude() {
public double getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
}
}
package com.rv.camp.camp;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.BitmapDescriptor;
import com.baidu.mapapi.map.BitmapDescriptorFactory;
import com.baidu.mapapi.map.InfoWindow;
import com.baidu.mapapi.map.MapStatus;
import com.baidu.mapapi.map.MapStatusUpdateFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.Marker;
import com.baidu.mapapi.map.MarkerOptions;
import com.baidu.mapapi.map.MyLocationData;
import com.baidu.mapapi.map.OverlayOptions;
import com.baidu.mapapi.model.LatLng;
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.util.LocationManager;
import com.ruiwenliu.wrapper.util.MapUtil;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.camp.R;
import com.rv.camp.R2;
import com.rv.camp.api.CampApi;
import com.rv.camp.bean.CampListBean;
import com.rv.camp.presenter.CampPresenter;
import com.rv.component.dialog.BottomPromptDialog;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import butterknife.BindView;
import butterknife.OnClick;
import io.reactivex.Observable;
import io.reactivex.observers.DisposableObserver;
/**
* 门店地图
*/
public class CampShopShowActivity extends BaseStatusActivity<CampPresenter> {
@BindView(R2.id.bmapView)
MapView mMapView;
@BindView(R2.id.tv_name)
TextView tvName;
@BindView(R2.id.tv_address)
TextView tvAddress;
@BindView(R2.id.ll_visible)
LinearLayout rlVisible;
@BindView(R2.id.tv_phone)
TextView tvPhone;
private LocationManager locationManager;
BaiduMap mBaiduMap;
boolean isFirstLoc = true; // 是否首次定位
List<OverlayOptions> list;
private double mLat;
private double mLon;
private boolean isClick;//是否第一次点击
private CampListBean.DataBeanX.DataBean selectBean;
public static Intent getIntent(Context context) {
return new Intent(context, CampShopShowActivity.class);
}
@Override
protected int setLayout() {
return R.layout.activity_act_shop_show;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
// titleView.setTitle(mActivity.getString(R.string.rv_shop_map));
showTitle(false);
initMap();
}
@Override
protected void loadData(Bundle savedInstanceState, Intent intent) {
super.loadData(savedInstanceState, intent);
getShopList(1);
}
@Override
public void onShowResult(int requestType, BaseBean result) {
processData((CampListBean) result);
}
@Override
public void onResume() {
super.onResume();
//在activity执行onResume时执行mMapView. onResume (),实现地图生命周期管理
mMapView.onResume();
}
@Override
protected void onPause() {
super.onPause();
//在activity执行onPause时执行mMapView. onPause (),实现地图生命周期管理
mMapView.onPause();
}
@Override
public void onDestroy() {
MapUtil.getInstance(mActivity).onDestroy();
// 退出时销毁定位
if (locationManager != null) {
locationManager.onDestroy();
locationManager = null;
}
// 关闭定位图层
mBaiduMap.setMyLocationEnabled(false);
//在activity执行onDestroy时执行mMapView.onDestroy(),实现地图生命周期管理
mMapView.onDestroy();
mMapView = null;
super.onDestroy();
}
@OnClick({R2.id.iv_back, R2.id.iv_location, R2.id.rl_navigation})
public void onViewClicked(View view) {
int i = view.getId();
if (i == R.id.iv_back) {
finish();
} else if (i == R.id.iv_location) {
isVisible(View.GONE);
if (locationManager != null) {
locationManager.startLocation();
}
} else if (i == R.id.rl_navigation) {
if (selectBean != null) {
showPickerDialog(new LatLng(selectBean.getLatitude(), selectBean.getLongitude()), selectBean.getAddress());
}
}
}
/**
* 获取门店列表
*/
private void getShopList(int page) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("page", 1000);
mPresenter.getData(RvFrameConfig.VEHICLE_CAMPLIST, 0, CampApi.TRAVEL_CAMPSITESHOP, CampListBean.class, map, page == 1 ? false : false);
}
private void processData(CampListBean bean) {
list = new ArrayList<>();
Observable.fromIterable(bean.getData().getData()).subscribe(new DisposableObserver<CampListBean.DataBeanX.DataBean>() {
@Override
public void onNext(CampListBean.DataBeanX.DataBean dataBean) {
list.add(getMark(dataBean));
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
mBaiduMap.addOverlays(list);
dispose();
}
});
}
/**
* 初始化地图
*/
private void initMap() {
mBaiduMap = mMapView.getMap();
// 开启定位图层
mBaiduMap.setMyLocationEnabled(true);
locationManager = new LocationManager(this, new BDAbstractLocationListener() {
@Override
public void onReceiveLocation(BDLocation bdLocation) {
locationManager.stopLocation();
if (isFirstLoc == false) {
updateMap(new LatLng(bdLocation.getLatitude(),
bdLocation.getLongitude()));
} else {
intiMapLocation(bdLocation);
}
// locationManager.onDestroy();
}
});
mBaiduMap.setOnMarkerClickListener(new BaiduMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(final Marker marker) {
isClick = true;
isVisible(View.VISIBLE);
Bundle bundle = marker.getExtraInfo();
selectBean= (CampListBean.DataBeanX.DataBean) bundle.getSerializable("info");
tvAddress.setText(String.format("%1$s%2$s", "地址:", selectBean.getAddress()));
tvPhone.setText(String.format("%1$s%2$s", "联系电话:", selectBean.getPhone()));
tvName.setText(selectBean.getName());
updateMap(marker.getPosition());
return true;
}
});
mBaiduMap.setOnMapStatusChangeListener(new BaiduMap.OnMapStatusChangeListener() {
@Override
public void onMapStatusChangeStart(MapStatus mapStatus) {
}
@Override
public void onMapStatusChangeStart(MapStatus mapStatus, int i) {
}
@Override
public void onMapStatusChange(MapStatus mapStatus) {
}
@Override
public void onMapStatusChangeFinish(MapStatus mapStatus) {
if (isClick == true) {
isClick = false;
createWin(mapStatus.bound.getCenter());
}
}
});
}
/**
* 初始化map
*
* @param location
*/
private void intiMapLocation(BDLocation location) {
if (location == null || mMapView == null) {
return;
}
MyLocationData locData = new MyLocationData.Builder()
.accuracy(location.getRadius())
// 此处设置开发者获取到的方向信息,顺时针0-360
.direction(location.getDirection()).latitude(location.getLatitude())
.longitude(location.getLongitude()).build();
mBaiduMap.setMyLocationData(locData);
if (isFirstLoc) {
isFirstLoc = false;
updateMap(new LatLng(mLat > 0 ? mLat : location.getLatitude(), mLon > 0 ? 0 :
location.getLongitude()));
}
}
/**
* 设置mark信息
*
* @param bean
* @return
*/
private OverlayOptions getMark(CampListBean.DataBeanX.DataBean bean) {
//定义Maker坐标点
LatLng point = new LatLng(bean.getLatitude(), bean.getLongitude());
//构建Marker图标
BitmapDescriptor bitmap = BitmapDescriptorFactory
.fromResource(R.drawable.rv_map_shop);
//构建MarkerOption,用于在地图上添加Marker
Bundle bundle = new Bundle();
bundle.putSerializable("info", bean);
return new MarkerOptions()
.position(point)
.title(bean.getName())
.icon(bitmap)
.extraInfo(bundle)
.animateType(MarkerOptions.MarkerAnimateType.drop);
}
/**
* 更新地图
*
* @param latLng
*/
private void updateMap(LatLng latLng) {
MapStatus.Builder builder = new MapStatus.Builder();
builder.target(latLng).zoom(10.0f);
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}
/**
* 是否显示
*
* @param visible
*/
private void isVisible(int visible) {
if (rlVisible == null) {
return;
}
rlVisible.setVisibility(visible);
}
private void createWin(final LatLng latLng) {
ImageView imageView = new ImageView(getApplicationContext());
imageView.setBackgroundResource(R.drawable.rv_max_map_shop);
mBaiduMap.showInfoWindow(new InfoWindow(imageView, latLng, 0));
}
/**
* 显示地图弹窗
*/
private void showPickerDialog(final LatLng latLng, final String address) {
new BottomPromptDialog(mActivity) {
@Override
public void helper(ViewHolder helper) {
super.helper(helper);
helper.setText(R.id.btn1, "百度地图");
helper.setText(R.id.btn2, "高德地图");
helper.setText(R.id.btn3, "取消");
helper.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int i = v.getId();
if (i == R.id.btn1) {
MapUtil.getInstance(mActivity).goToBaiduMap(latLng, address, false);
dismiss();
} else if (i == R.id.btn2) {
MapUtil.getInstance(mActivity).goToGaodeMap(latLng, address, true);
dismiss();
} else if (i == R.id.btn3) {
dismiss();
}
}
}, R.id.btn1, R.id.btn2, R.id.btn3);
}
}.show();
}
}
......@@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<LinearLayout
......@@ -12,6 +13,13 @@
android:background="@color/colorWrite"
android:orientation="vertical">
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical"
app:use_type="use_padding_top">
<RelativeLayout
android:background="@color/colorWrite"
android:layout_width="match_parent"
......@@ -42,6 +50,8 @@
</RelativeLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
<include layout="@layout/common_line" />
<RelativeLayout
......@@ -57,8 +67,6 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_content"
android:paddingLeft="@dimen/size_12"
android:paddingRight="@dimen/size_12"
android:layout_width="match_parent"
android:layout_height="match_parent" />
......
......@@ -7,12 +7,12 @@
android:orientation="vertical">
<RelativeLayout
android:layout_width="@dimen/size_150"
android:layout_width="match_parent"
android:layout_height="@dimen/size_180">
<ImageView
android:id="@+id/iv_icon"
android:layout_width="@dimen/size_150"
android:layout_width="match_parent"
android:layout_height="@dimen/size_180"
android:scaleType="centerCrop" />
......@@ -43,7 +43,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:layout_marginBottom="@dimen/size_10"
android:paddingLeft="@dimen/size_5"
android:drawablePadding="@dimen/size_5"
android:drawableLeft="@drawable/campsite_icon_citylocation"
......
package com.xxfc.discovery.adapter;
import android.view.View;
import android.widget.ImageView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
......@@ -19,7 +17,6 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryRecomme
super(R.layout.rv_item_discovery_recommend);
}
@Override
protected void convert(BaseViewHolder helper, DiscoveryRecommendBean.DataBeanX.DataBean item) {
if (item == null) {
......
......@@ -4,6 +4,8 @@ import android.graphics.Rect;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.util.TypedValue;
import android.view.View;
import com.alibaba.android.arouter.launcher.ARouter;
......@@ -37,7 +39,7 @@ import io.reactivex.schedulers.Schedulers;
/**
* 拍拍
*/
public class PatFragment extends BaseFragment<DiscoveryPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
public class PatFragment extends BaseFragment<DiscoveryPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.rv_content)
RecyclerView rvContent;
......@@ -70,8 +72,25 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Si
mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
initRxbus();
mAdapter = new DiscoveryRecommendAdapter();
rvContent.setLayoutManager(new GridLayoutManager(_mActivity, 2));
rvContent.addItemDecoration(new AbSpacesItemDecoration(15));// 分割线。
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
rvContent.setItemAnimator(null);
rvContent.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
int[] first = new int[2];
staggeredGridLayoutManager.findFirstCompletelyVisibleItemPositions(first);
if (newState == RecyclerView.SCROLL_STATE_IDLE && (first[0] == 1 || first[1] == 1)) {
recyclerView.invalidateItemDecorations();
}
}
});
rvContent.setLayoutManager(staggeredGridLayoutManager);
// rvContent.setLayoutManager(new GridLayoutManager(_mActivity, 2));
rvContent.addItemDecoration(new AbSpacesItemDecoration(20, 10));// 分割线。
rvContent.setAdapter(mAdapter);
mAdapter.bindToRecyclerView(rvContent);
mAdapter.setEnableLoadMore(true);
......@@ -92,7 +111,8 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Si
});
mAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override public void onLoadMoreRequested() {
@Override
public void onLoadMoreRequested() {
if (rvContent != null) {
rvContent.postDelayed(new Runnable() {
@Override
......@@ -110,14 +130,13 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Si
}, rvContent);
mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
itemDatabean = (DiscoveryRecommendBean.DataBeanX.DataBean) adapter.getItem(position);
int id = view.getId();
if (id == R.id.ll_item_islike){
isLike();
if (id == R.id.ll_item_islike) {
isLike();
}
}
});
......@@ -126,8 +145,8 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Si
private void isLike() {
if (OkGoUtil.getToken() != null) {
Map<String, Object> headMap = new LinkedHashMap<>();
headMap.put("Authorization",OkGoUtil.getToken());
mPresenter.postData(RvFrameConfig.HOST,2, DiscoveryApi.DISCOVERY_IM_LOGIN, DiscoveryIMTokenBean.class,headMap, headMap,true);
headMap.put("Authorization", OkGoUtil.getToken());
mPresenter.postData(RvFrameConfig.HOST, 2, DiscoveryApi.DISCOVERY_IM_LOGIN, DiscoveryIMTokenBean.class, headMap, headMap, true);
}
}
......@@ -168,13 +187,13 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Si
Map<String, Object> map = new LinkedHashMap<>();
map.put("page", page);
map.put("type", 2);
mPresenter.postData(RvFrameConfig.HOST,0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, headMap,page == 1 ? false : false);
mPresenter.postData(RvFrameConfig.HOST, 0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, headMap, page == 1 ? false : false);
}
@Override
public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete();
switch (requestType){
switch (requestType) {
case 0:
processData((DiscoveryRecommendBean) result);
break;
......@@ -195,14 +214,14 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Si
private void setIMData(DiscoveryIMTokenBean bean) {
if ("0".equals(itemDatabean.getIsPraise())) {//0:未点赞 1:已点赞
Map<String, Object> map = new LinkedHashMap<>();
map.put("access_token",bean.getData());
map.put("messageId",itemDatabean.getMsgId());
mPresenter.postData(3, DiscoveryApi.DISCOVERY_PRAISE_ADD, BaseBean.class, map,true);
map.put("access_token", bean.getData());
map.put("messageId", itemDatabean.getMsgId());
mPresenter.postData(3, DiscoveryApi.DISCOVERY_PRAISE_ADD, BaseBean.class, map, true);
} else {
Map<String, Object> map = new LinkedHashMap<>();
map.put("access_token",bean.getData());
map.put("messageId",itemDatabean.getMsgId());
mPresenter.postData(4, DiscoveryApi.DISCOVERY_PRAISE_DELETE, BaseBean.class, map,true);
map.put("access_token", bean.getData());
map.put("messageId", itemDatabean.getMsgId());
mPresenter.postData(4, DiscoveryApi.DISCOVERY_PRAISE_DELETE, BaseBean.class, map, true);
}
}
......@@ -239,18 +258,29 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Si
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space;
private int left;
private int right;
public AbSpacesItemDecoration(int space) {
this.space = space;
public AbSpacesItemDecoration(int left, int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
outRect.left = space;
outRect.right = space;
outRect.bottom = space;
outRect.top = space;
int position = parent.getChildAdapterPosition(view);
StaggeredGridLayoutManager.LayoutParams lp = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
if (lp.getSpanIndex() % 2 == 0) {
outRect.left = left;
outRect.right = right;
} else {
outRect.left = right;
outRect.right = left;
}
outRect.top = left;
}
}
}
......@@ -4,6 +4,7 @@ import android.graphics.Rect;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import com.alibaba.android.arouter.launcher.ARouter;
......@@ -18,6 +19,7 @@ import com.xxfc.discovery.R;
import com.xxfc.discovery.R2;
import com.xxfc.discovery.adapter.DiscoveryRecommendAdapter;
import com.xxfc.discovery.api.DiscoveryApi;
import com.xxfc.discovery.bean.DiscoveryIMTokenBean;
import com.xxfc.discovery.bean.DiscoveryRecommendBean;
import com.xxfc.discovery.presenter.DiscoveryPresenter;
import com.yuyife.okgo.OkGoUtil;
......@@ -41,6 +43,8 @@ public class RecommendFragment extends BaseFragment<DiscoveryPresenter> implemen
private int countPage;
private int mPage;
private DiscoveryRecommendBean.DataBeanX.DataBean itemDatabean;
public static RecommendFragment getInstance(int type) {
Bundle bundl = new Bundle();
bundl.putInt("type", type);
......@@ -59,8 +63,24 @@ public class RecommendFragment extends BaseFragment<DiscoveryPresenter> implemen
mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(_mActivity));
mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
mRecommendAdapter = new DiscoveryRecommendAdapter();
rvContent.setLayoutManager(new GridLayoutManager(_mActivity, 2));
rvContent.addItemDecoration(new AbSpacesItemDecoration(15));// 分割线。
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
rvContent.setItemAnimator(null);
rvContent.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
int[] first = new int[2];
staggeredGridLayoutManager.findFirstCompletelyVisibleItemPositions(first);
if (newState == RecyclerView.SCROLL_STATE_IDLE && (first[0] == 1 || first[1] == 1)) {
recyclerView.invalidateItemDecorations();
}
}
});
rvContent.setLayoutManager(staggeredGridLayoutManager);
rvContent.addItemDecoration(new AbSpacesItemDecoration(20,10));// 分割线。
rvContent.setAdapter(mRecommendAdapter);
mRecommendAdapter.bindToRecyclerView(rvContent);
mRecommendAdapter.setEnableLoadMore(true);
......@@ -111,7 +131,27 @@ public class RecommendFragment extends BaseFragment<DiscoveryPresenter> implemen
}
}, rvContent);
mRecommendAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
itemDatabean = (DiscoveryRecommendBean.DataBeanX.DataBean) adapter.getItem(position);
int id = view.getId();
if (id == R.id.ll_item_islike){
isLike();
}
}
});
}
private void isLike() {
if (OkGoUtil.getToken() != null) {
Map<String, Object> headMap = new LinkedHashMap<>();
headMap.put("Authorization",OkGoUtil.getToken());
mPresenter.postData(RvFrameConfig.HOST,2, DiscoveryApi.DISCOVERY_IM_LOGIN, DiscoveryIMTokenBean.class,headMap, headMap,true);
}
}
......@@ -142,9 +182,38 @@ public class RecommendFragment extends BaseFragment<DiscoveryPresenter> implemen
@Override
public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete();
processData((DiscoveryRecommendBean) result);
switch (requestType){
case 0:
processData((DiscoveryRecommendBean) result);
break;
case 2:
DiscoveryIMTokenBean intokenBean = (DiscoveryIMTokenBean) result;
setIMData(intokenBean);
break;
case 3:
onFresh();
break;
case 4:
onFresh();
break;
}
}
private void setIMData(DiscoveryIMTokenBean bean) {
if ("0".equals(itemDatabean.getIsPraise())) {//0:未点赞 1:已点赞
Map<String, Object> map = new LinkedHashMap<>();
map.put("access_token",bean.getData());
map.put("messageId",itemDatabean.getMsgId());
mPresenter.postData(3, DiscoveryApi.DISCOVERY_PRAISE_ADD, BaseBean.class, map,true);
} else {
Map<String, Object> map = new LinkedHashMap<>();
map.put("access_token",bean.getData());
map.put("messageId",itemDatabean.getMsgId());
mPresenter.postData(4, DiscoveryApi.DISCOVERY_PRAISE_DELETE, BaseBean.class, map,true);
}
}
private void processData(DiscoveryRecommendBean bean) {
if (mPage == 1) {
countPage = bean.getData().getTotalPage();
......@@ -177,20 +246,27 @@ public class RecommendFragment extends BaseFragment<DiscoveryPresenter> implemen
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space;
private int left;
private int right;
public AbSpacesItemDecoration(int space) {
this.space = space;
public AbSpacesItemDecoration(int left, int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int childCount = parent.getChildCount();
outRect.left = space;
outRect.right = space;
outRect.bottom = space;
outRect.top = space;
int position = parent.getChildAdapterPosition(view);
StaggeredGridLayoutManager.LayoutParams lp = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
if (lp.getSpanIndex() % 2 == 0) {
outRect.left = left;
outRect.right = right;
} else {
outRect.left = right;
outRect.right = left;
}
outRect.top = left;
}
}
}
......@@ -33,11 +33,14 @@ import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.util.LocationManager;
import com.ruiwenliu.wrapper.util.MapUtil;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.util.permission.RxPermission;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.control.MyGridView;
import com.rv.component.control.SquareCenterImageView;
import com.rv.component.dialog.BottomPromptDialog;
import com.rv.component.utils.DateUtils;
import com.rv.component.utils.Inc;
import com.xxfc.discovery.R;
......@@ -124,13 +127,12 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
if (viewType == 1) {
showSelectPictureDialog();
} else {
// showPictureActionDialog(position);
showPictureActionDialog(position);
}
}
});
}
@Override
public void onShowResult(int requestType, BaseBean result) {
switch (requestType){
......@@ -240,6 +242,34 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
mPresenter.postBodyData(RvFrameConfig.VEHICLE_UPLOAD, 0, DiscoveryApi.HTTP_URL_FILE_UPLOADS, DiscoveryUploadImageBean.class, new Image("app", imags), true);
}
private void showPictureActionDialog(int position) {
new BottomPromptDialog(mActivity) {
@Override
public void helper(ViewHolder helper) {
super.helper(helper);
helper.setText(R.id.btn1, "删除");
helper.setText(R.id.btn2, "取消");
helper.setVisible(R.id.btn3,false);
helper.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int i = v.getId();
if (i == R.id.btn1) {
mPhotoList.remove(position);
mAdapter.notifyDataSetInvalidated();
dismiss();
} else if (i == R.id.btn2) {
dismiss();
}
}
}, R.id.btn1, R.id.btn2);
}
}.show();
}
private void showSelectPictureDialog() {
String[] items = new String[]{"拍照", "相片"};
AlertDialog.Builder builder = new AlertDialog.Builder(this).setSingleChoiceItems(items, 0,
......
......@@ -3,9 +3,16 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context=".DiscoveryFragment">
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:use_type="use_padding_top">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -36,7 +43,7 @@
</LinearLayout>
</LinearLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
<include layout="@layout/common_line" />
......
......@@ -13,12 +13,12 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_180">
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_icon"
android:layout_width="match_parent"
android:layout_height="@dimen/size_180"
android:layout_height="wrap_content"
android:scaleType="centerCrop" />
<ImageView
......
......@@ -161,7 +161,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
private OrderPriceDetailPw detailPw;//显示订单价格明细弹窗
private OrderPriceDetailBean orderPriceDetailBean;//订单价格明细实体类
private IWXAPI api;
private int payType;//选择支付类型
private int payType = 1;//选择支付类型
private OrderPriceBean priceBean;
BeanUserInfo.UserInfo info = null;
private int deductiblePriceType;
......@@ -467,13 +467,12 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
dismiss();
} else if (i == R.id.ll_item_wechat) {
payType = 1;
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
helper.getView(R.id.iv_wx_select).setSelected(true);
helper.getView(R.id.iv_alipy_select).setSelected(false);
} else if (i == R.id.ll_item_alipay) {
payType = 2;
helper.setChecked(R.id.rb_wechat, false);
helper.setChecked(R.id.rb_alipay, true);
helper.getView(R.id.iv_wx_select).setSelected(false);
helper.getView(R.id.iv_alipy_select).setSelected(true);
} else if (i == R.id.tv_pay_immediately) {
dismiss();
createOrder(1);
......
......@@ -138,8 +138,6 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
ImageView travelServerImage;
@BindView(R2.id.tv_rv_city)
TextView tvRvCity;
@BindView(R2.id.tv_book_now)
TextView tvBookNow;
@BindView(R2.id.tv_rv_hot_label1)
TextView tvRvHotLabel1;
@BindView(R2.id.tv_rv_hot_label2)
......
......@@ -49,6 +49,7 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
private int mPage;
private int countPage;
private IWXAPI api;
private int payType =1;//选择支付类型
public static AllOrderFragment getInstance(int type) {
Bundle bundl = new Bundle();
......@@ -215,10 +216,14 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
if (id == R.id.iv_close) {
dismiss();
} else if (id == R.id.ll_item_wechat) {
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
payType = 1;
helper.getView(R.id.iv_wx_select).setSelected(true);
helper.getView(R.id.iv_alipy_select).setSelected(false);
} else if (id == R.id.ll_item_alipay) {
showToast("该功能还没有开通!");
payType = 2;
helper.getView(R.id.iv_wx_select).setSelected(false);
helper.getView(R.id.iv_alipy_select).setSelected(true);
} else if (id == R.id.tv_pay_immediately) {
dismiss();
createOrder(no, 1, 1);
......
......@@ -67,7 +67,7 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
private int mPage;
private int countPage;
private IWXAPI api;
private int payType;//选择支付类型
private int payType = 1;//选择支付类型
private static final int SDK_ALI_PAY_FLAG = 11;
......@@ -265,12 +265,12 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
dismiss();
} else if (id == R.id.ll_item_wechat) {
payType = 1;
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
helper.getView(R.id.iv_wx_select).setSelected(true);
helper.getView(R.id.iv_alipy_select).setSelected(false);
} else if (id == R.id.ll_item_alipay) {
payType = 2;
helper.setChecked(R.id.rb_wechat, false);
helper.setChecked(R.id.rb_alipay, true);
helper.getView(R.id.iv_wx_select).setSelected(false);
helper.getView(R.id.iv_alipy_select).setSelected(true);
} else if (id == R.id.tv_pay_immediately) {
dismiss();
createOrder(no);
......
......@@ -281,10 +281,13 @@ public class MemberOrderDetailsActivity extends BaseStatusActivity<PickerPresent
if (id == R.id.iv_close) {
dismiss();
} else if (id == R.id.ll_item_wechat) {
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
// payType = 1;
helper.getView(R.id.iv_wx_select).setSelected(true);
helper.getView(R.id.iv_alipy_select).setSelected(false);
} else if (id == R.id.ll_item_alipay) {
showToast("该功能还没有开通!");
// payType = 2;
helper.getView(R.id.iv_wx_select).setSelected(false);
helper.getView(R.id.iv_alipy_select).setSelected(true);
} else if (id == R.id.tv_pay_immediately) {
dismiss();
createOrder(no, 1, 1);
......
......@@ -95,7 +95,7 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
private String webUrl;
private int status;
private String no;
private int payType;//选择支付类型
private int payType = 1;//选择支付类型
private final int TYPE_REQUEST_EVALUATION = 1;
private IWXAPI api;
......@@ -320,12 +320,12 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
dismiss();
} else if (id == R.id.ll_item_wechat) {
payType = 1;
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
helper.getView(R.id.iv_wx_select).setSelected(true);
helper.getView(R.id.iv_alipy_select).setSelected(false);
} else if (id == R.id.ll_item_alipay) {
payType = 2;
helper.setChecked(R.id.rb_wechat, false);
helper.setChecked(R.id.rb_alipay, true);
helper.getView(R.id.iv_wx_select).setSelected(false);
helper.getView(R.id.iv_alipy_select).setSelected(true);
} else if (id == R.id.tv_pay_immediately) {
dismiss();
createOrder(no);
......
......@@ -84,7 +84,7 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent
private IWXAPI api;
private double orderAmount;
private OrderListBean.DataBeanX.DataBean dataBean;
private int payType;//选择支付类型
private int payType = 1;//选择支付类型
public static Intent getIntent(Context context, OrderListBean.DataBeanX.DataBean dataBean) {
......@@ -294,12 +294,12 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent
dismiss();
} else if (id == R.id.ll_item_wechat) {
payType = 1;
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
helper.getView(R.id.iv_wx_select).setSelected(true);
helper.getView(R.id.iv_alipy_select).setSelected(false);
} else if (id == R.id.ll_item_alipay) {
payType = 2;
helper.setChecked(R.id.rb_wechat, false);
helper.setChecked(R.id.rb_alipay, true);
helper.getView(R.id.iv_wx_select).setSelected(false);
helper.getView(R.id.iv_alipy_select).setSelected(true);
} else if (id == R.id.tv_pay_immediately) {
dismiss();
createOrder(no);
......
......@@ -6,13 +6,15 @@
android:background="@color/colorLine"
android:orientation="vertical">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.rv.component.utils.ObservableScrollView
android:id="@+id/scrollview"
android:scrollbars="none"
android:layout_width="match_parent"
android:layout_height="wrap_content">
......@@ -284,16 +286,16 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
<Button
android:id="@+id/tv_select_car"
android:layout_width="0dp"
android:layout_height="@dimen/size_40"
android:layout_weight="1"
android:background="@drawable/home_button_select_car"
android:background="@drawable/shape_rv_bg_shallow_dark_yellow_circle"
android:gravity="center"
android:text="立即选车"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_14" />
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_car_rental_guide"
......@@ -342,12 +344,12 @@
<include layout="@layout/common_line" />
<TextView
<Button
android:id="@+id/tv_book_now"
android:layout_width="match_parent"
android:layout_height="@dimen/size_40"
android:layout_marginTop="@dimen/size_20"
android:background="@drawable/home_button_select_car"
android:background="@drawable/shape_rv_bg_shallow_dark_yellow_circle"
android:gravity="center"
android:text="立即预订"
android:textColor="@color/colorWrite"
......@@ -586,7 +588,9 @@
<LinearLayout
android:id="@+id/ll_item_activity_all"
android:layout_width="match_parent"
android:layout_height="@dimen/size_25"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/size_15"
......@@ -628,8 +632,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:layout_marginBottom="@dimen/size_5"
android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:text="精选优质旅游路线,满足你的出行需求"
......@@ -675,7 +679,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:layout_marginTop="@dimen/size_10"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:text="分享精彩时刻"
......@@ -685,7 +689,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_15"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_15"
android:layout_marginBottom="@dimen/size_15"
android:orientation="horizontal">
......@@ -1017,8 +1021,14 @@
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
<LinearLayout
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/ll_item_title"
android:orientation="vertical"
app:use_type="use_padding_top">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:gravity="center"
......@@ -1115,6 +1125,6 @@
android:textSize="@dimen/text_8" />
</LinearLayout>
</LinearLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
</RelativeLayout>
\ No newline at end of file
......@@ -33,6 +33,7 @@ import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.browse.ActivityImageBrowseInt;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
......
......@@ -6,8 +6,7 @@
android:background="@color/colorLine"
android:orientation="vertical">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
......@@ -24,7 +23,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_220">
android:layout_height="@dimen/size_240">
<LinearLayout
android:layout_width="match_parent"
......@@ -32,36 +31,45 @@
android:background="@drawable/mycenter_image_bg"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:layout_marginLeft="@dimen/size_8"
android:layout_marginRight="@dimen/size_8"
android:orientation="horizontal">
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/size_5"
android:orientation="vertical"
app:use_type="use_padding_top">
<ImageView
android:id="@+id/iv_item_setting"
android:layout_width="@dimen/size_35"
android:layout_height="@dimen/size_35"
android:padding="@dimen/size_8"
android:src="@drawable/mycenter_icon_setting"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_8"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_8"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_item_message"
android:layout_width="@dimen/size_35"
android:layout_height="@dimen/size_35"
android:layout_alignParentRight="true"
android:padding="@dimen/size_8"
android:src="@drawable/mycenter_icon_message"/>
</RelativeLayout>
<ImageView
android:id="@+id/iv_item_setting"
android:layout_width="@dimen/size_35"
android:layout_height="@dimen/size_35"
android:padding="@dimen/size_8"
android:src="@drawable/mycenter_icon_setting" />
<ImageView
android:id="@+id/iv_item_message"
android:layout_width="@dimen/size_35"
android:layout_height="@dimen/size_35"
android:layout_alignParentRight="true"
android:padding="@dimen/size_8"
android:src="@drawable/mycenter_icon_message" />
</RelativeLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_200"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_70"
android:layout_marginTop="@dimen/size_80"
android:layout_marginRight="@dimen/size_15"
android:background="@drawable/shape_rv_bg_write"
android:orientation="vertical"
......@@ -76,8 +84,8 @@
android:id="@+id/iv_avatar"
android:layout_width="@dimen/size_60"
android:layout_height="@dimen/size_60"
android:transitionName="sharedView"
android:src="@drawable/common_icon_avatar_default" />
android:src="@drawable/common_icon_avatar_default"
android:transitionName="sharedView" />
<LinearLayout
......@@ -96,11 +104,11 @@
android:id="@+id/tv_nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:visibility="gone"
android:singleLine="true"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
android:textSize="@dimen/text_16"
android:visibility="gone" />
<TextView
android:id="@+id/tv_user_identity"
......@@ -109,13 +117,13 @@
android:layout_marginLeft="@dimen/size_5"
android:background="@drawable/common_icon_user_type"
android:maxLines="1"
android:visibility="gone"
android:paddingLeft="@dimen/size_3"
android:paddingTop="@dimen/size_1"
android:paddingRight="@dimen/size_3"
android:paddingBottom="@dimen/size_1"
android:textColor="@color/colorGray"
android:textSize="@dimen/text_10" />
android:textSize="@dimen/text_10"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
......@@ -145,8 +153,8 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:paddingRight="@dimen/size_30"
android:gravity="center_vertical"
android:paddingRight="@dimen/size_30"
android:text="点击登录"
android:textColor="@color/colorYellow"
android:textSize="@dimen/text_16"
......@@ -169,8 +177,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="@dimen/size_10"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
......@@ -285,8 +293,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_alignParentBottom="true"
android:layout_marginTop="@dimen/size_15"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_marginBottom="@dimen/size_15"
android:background="@drawable/resource_drawable_shape_member_bg"
......@@ -310,10 +318,10 @@
android:id="@+id/tv_membership_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="会员特权"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_14" />
android:textSize="@dimen/text_14"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_member_hint"
......@@ -333,10 +341,10 @@
android:drawableRight="@drawable/common_icon_rig_black"
android:drawablePadding="@dimen/size_8"
android:gravity="center_vertical"
android:textStyle="bold"
android:text="会员中心"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
android:textSize="@dimen/text_12"
android:textStyle="bold" />
</LinearLayout>
......@@ -344,9 +352,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_rv_bg_write"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:background="@drawable/shape_rv_bg_write"
android:orientation="vertical"
android:paddingLeft="@dimen/size_15"
android:paddingTop="@dimen/size_15"
......@@ -368,13 +376,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:drawablePadding="@dimen/size_8"
android:paddingLeft="@dimen/size_30"
android:layout_centerVertical="true"
android:drawableRight="@drawable/common_icon_rig_gray"
android:textSize="@dimen/text_12"
android:drawablePadding="@dimen/size_8"
android:paddingLeft="@dimen/size_30"
android:text="查看全部"
android:textColor="@color/text_Gray"
android:text="查看全部"/>
android:textSize="@dimen/text_12" />
</RelativeLayout>
<LinearLayout
......@@ -486,10 +494,10 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@drawable/shape_rv_bg_write"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:background="@drawable/shape_rv_bg_write"
android:orientation="horizontal"
android:paddingTop="@dimen/size_25"
android:paddingBottom="@dimen/size_15">
......@@ -595,10 +603,10 @@
<com.yuyife.banner.Banner
android:id="@+id/mine_banner"
android:layout_width="match_parent"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_height="@dimen/size_100"
android:layout_marginTop="@dimen/size_15" />
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_15"
android:layout_marginRight="@dimen/size_15" />
</LinearLayout>
</ScrollView>
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
......
......@@ -128,14 +128,14 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
//热门游
mPopularBrigadeAdapter = new PopularBrigadeAdapter();
rvPopularBrigade.setLayoutManager(new LinearLayoutManager(_mActivity, LinearLayoutManager.HORIZONTAL, false));
rvPopularBrigade.addItemDecoration(new AbSpacesItemDecoration(5));// 分割线。
// rvPopularBrigade.addItemDecoration(new AbSpacesItemDecoration(20,10));// 分割线。
rvPopularBrigade.setNestedScrollingEnabled(false);
rvPopularBrigade.setAdapter(mPopularBrigadeAdapter);
//全部热门旅游
mAllPopularAdapter = new AllPopularAdapter();
rvPopularMore.setLayoutManager(new GridLayoutManager(_mActivity, 3));
rvPopularMore.addItemDecoration(new AbSpacesItemDecoration(23));// 分割线。
rvPopularMore.addItemDecoration(new AbSpacesItemDecoration2(20,10));// 分割线。
// rvPopularMore.setNestedScrollingEnabled(false);
rvPopularMore.setAdapter(mAllPopularAdapter);
......@@ -444,20 +444,61 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space;
private int left;
private int right;
public AbSpacesItemDecoration(int space) {
this.space = space;
public AbSpacesItemDecoration(int left,int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
outRect.left = space;
outRect.right = space;
outRect.bottom = space;
//注释这两行是为了上下间距相同
// if(parent.getChildAdapterPosition(view)==0){
outRect.top = space;
int childCount = parent.getChildCount();
if ((childCount -1) % 2==0){
outRect.left = left;
outRect.right = right;
outRect.bottom = right;
outRect.top = right;
}else {
outRect.left = right;
outRect.right = left;
outRect.bottom = right;
outRect.top = right;
}
}
}
public class AbSpacesItemDecoration2 extends RecyclerView.ItemDecoration {
private int left;
private int right;
public AbSpacesItemDecoration2(int left,int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int childCount = parent.getChildCount();
if (childCount % 3==1){
outRect.left = left;
outRect.right = right;
outRect.bottom = right;
outRect.top = right;
}else if (childCount % 3 == 2){
outRect.left = right;
outRect.right = right;
outRect.bottom = right;
outRect.top = right;
}else if (childCount % 3 ==0){
outRect.left = right;
outRect.right = left;
outRect.bottom = right;
outRect.top = right;
}
}
}
......
......@@ -18,7 +18,7 @@ public class AllPopularAdapter extends BaseQuickAdapter<BeanPopularBrigadeAll.Da
@Override
protected void convert(BaseViewHolder helper, BeanPopularBrigadeAll.DataBeanX.DataBean item) {
GlideManager.getInstance(mContext).loadImage(item.getImg(), (ImageView)helper.getView(R.id.iv_icon));
GlideManager.getInstance(mContext).loadRoundImage(item.getImg(), (ImageView)helper.getView(R.id.iv_icon),8);
helper.setText(R.id.tv_hot,item.getName());
}
}
......@@ -17,7 +17,7 @@ public class PopularBrigadeAdapter extends BaseQuickAdapter<BeanPopularBrigade.D
@Override
protected void convert(BaseViewHolder helper, BeanPopularBrigade.DataBean item) {
GlideManager.getInstance(mContext).loadImage(item.getImg(), (ImageView)helper.getView(R.id.iv_icon));
GlideManager.getInstance(mContext).loadRoundImage(item.getImg(), (ImageView)helper.getView(R.id.iv_icon),8);
helper.setText(R.id.tv_hot,item.getName());
}
}
......@@ -18,7 +18,7 @@ public class RecommendedRouteAdapter extends BaseQuickAdapter<BeanTourAround.Dat
@Override
protected void convert(BaseViewHolder helper, BeanTourAround.DataBeanX.DataBean item) {
GlideManager.getInstance(mContext).loadImage(item.getCover(), (ImageView)helper.getView(R.id.iv_icon));
GlideManager.getInstance(mContext).loadRoundImage(item.getCover(), (ImageView)helper.getView(R.id.iv_icon),8);
helper.setText(R.id.tv_title,item.getName());
helper.setText(R.id.tv_price,String.format("¥%1$s%2$s",item.getPrice(),item.getUnit()));
}
......
......@@ -24,6 +24,7 @@ import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.tourism.R;
import com.rv.tourism.R2;
import com.rv.tourism.TourismFragment;
import com.rv.tourism.adapter.AllPopularAdapter;
import com.rv.tourism.adapter.RecommendedRouteAdapter;
import com.rv.tourism.api.TourismApi;
......@@ -87,6 +88,7 @@ public class PopularTourListActivity extends BaseStatusActivity<TourismPresenter
protected void initView(Bundle savedInstanceState, final TitleView titleView, Intent intent) {
name = intent.getStringExtra("name");
titleView.setTitle(name);
titleView.setDividerDrawable(getResources().getDrawable(R.drawable.common_icon_rig_gray));
id = intent.getStringExtra("id");
......@@ -99,7 +101,7 @@ public class PopularTourListActivity extends BaseStatusActivity<TourismPresenter
//全部热门旅游
mAllPopularAdapter = new AllPopularAdapter();
rvPopularMore.setLayoutManager(new GridLayoutManager(mActivity, 3));
rvPopularMore.addItemDecoration(new AbSpacesItemDecoration(23));// 分割线。
rvPopularMore.addItemDecoration(new AbSpacesItemDecoration2(20,10));// 分割线。
// rvPopularMore.setNestedScrollingEnabled(false);
rvPopularMore.setAdapter(mAllPopularAdapter);
......@@ -302,22 +304,35 @@ public class PopularTourListActivity extends BaseStatusActivity<TourismPresenter
// }
public class AbSpacesItemDecoration extends RecyclerView.ItemDecoration {
public class AbSpacesItemDecoration2 extends RecyclerView.ItemDecoration {
private int space;
private int left;
private int right;
public AbSpacesItemDecoration(int space) {
this.space = space;
public AbSpacesItemDecoration2(int left,int right) {
this.left = left;
this.right = right;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
outRect.left = space;
outRect.right = space;
outRect.bottom = space;
//注释这两行是为了上下间距相同
// if(parent.getChildAdapterPosition(view)==0){
outRect.top = space;
int childCount = parent.getChildCount();
if (childCount % 3==1){
outRect.left = left;
outRect.right = right;
outRect.bottom = right;
outRect.top = right;
}else if (childCount % 3 == 2){
outRect.left = right;
outRect.right = right;
outRect.bottom = right;
outRect.top = right;
}else if (childCount % 3 ==0){
outRect.left = right;
outRect.right = left;
outRect.bottom = right;
outRect.top = right;
}
}
}
......
......@@ -133,7 +133,7 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
private OrderPriceDetailBean orderPriceDetailBean;//订单价格明细实体类
private OrderPriceDetailPw detailPw;//显示订单价格明细弹窗
private BeanConfirmOrder info;
private int payType;//选择支付类型
private int payType = 1;//选择支付类型
private List<CouponBean.DataBean> couponDataList;//优惠券数据
......@@ -493,13 +493,12 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
dismiss();
} else if (i == R.id.ll_item_wechat) {
payType = 1;
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
helper.getView(R.id.iv_wx_select).setSelected(true);
helper.getView(R.id.iv_alipy_select).setSelected(false);
} else if (i == R.id.ll_item_alipay) {
payType = 2;
helper.setChecked(R.id.rb_wechat, false);
helper.setChecked(R.id.rb_alipay, true);
helper.getView(R.id.iv_wx_select).setSelected(false);
helper.getView(R.id.iv_alipy_select).setSelected(true);
} else if (i == R.id.tv_pay_immediately) {
dismiss();
......
......@@ -20,7 +20,7 @@
android:layout_marginTop="@dimen/size_20"
android:layout_marginBottom="@dimen/size_20"
android:layout_height="wrap_content"
android:text="推荐路线"/>
android:text="— 推荐路线 —"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_recommended_route"
......@@ -42,7 +42,7 @@
android:textColor="@color/colorWrite"
android:gravity="center"
android:textSize="@dimen/text_16"
android:text="选择旅游类型"/>
android:text="— 选择旅游类型 —"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_popular_more"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/travel_fragment_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:focusable="true"
android:focusableInTouchMode="true"
android:background="@color/colorLine"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorLine"
android:orientation="vertical">
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical"
app:use_type="use_padding_top">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_height="@dimen/size_60"
android:background="@color/colorWrite"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_60"
android:background="@color/colorWrite"
android:id="@+id/travel_city_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_15"
android:clickable="true"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/travel_city_layout"
<TextView
android:id="@+id/travel_city_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_15"
android:clickable="true"
android:gravity="center"
android:orientation="horizontal">
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/size_3"
android:text="东莞市"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/travel_city_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/size_3"
android:text="东莞市"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/rv_common_icon_up_arrow" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/rv_common_icon_up_arrow" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_item_search"
android:layout_width="0dp"
android:layout_height="@dimen/size_40"
android:layout_marginLeft="@dimen/size_10"
android:layout_weight="1"
android:background="@drawable/shape_rv_textview_home_search"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_item_search"
<TextView
android:id="@+id/search_input"
android:layout_width="0dp"
android:layout_height="@dimen/size_40"
android:layout_marginLeft="@dimen/size_10"
android:layout_weight="1"
android:background="@drawable/shape_rv_textview_home_search"
android:gravity="center"
android:orientation="horizontal">
android:background="@null"
android:gravity="center_vertical"
android:hint="搜索目的地/旅游线"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/text_12" />
</LinearLayout>
<TextView
android:id="@+id/search_input"
android:layout_width="0dp"
android:layout_height="@dimen/size_40"
android:layout_weight="1"
android:background="@null"
android:gravity="center_vertical"
android:hint="搜索目的地/旅游线"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/text_12" />
<ImageView
android:id="@+id/travel_server_image"
android:layout_width="@dimen/size_50"
android:layout_height="@dimen/size_35"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:scaleType="centerInside"
android:src="@drawable/common_journey_service_gray" />
</LinearLayout>
</LinearLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
<ImageView
android:id="@+id/travel_server_image"
android:layout_width="@dimen/size_50"
android:layout_height="@dimen/size_35"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:scaleType="centerInside"
android:src="@drawable/common_journey_service_gray" />
</LinearLayout>
<include layout="@layout/common_line" />
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="@+id/refresh"
android:layout_height="match_parent">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.widget.NestedScrollView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">
<com.yuyife.banner.Banner
android:id="@+id/travel_banner"
android:layout_width="match_parent"
android:layout_height="@dimen/size_220" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical">
<com.yuyife.banner.Banner
android:id="@+id/travel_banner"
android:layout_width="match_parent"
android:layout_height="@dimen/size_220" />
<LinearLayout
android:id="@+id/ll_item_popular_brigade_many"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_item_popular_brigade_many"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="@dimen/size_12"
android:paddingBottom="@dimen/size_12">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_weight="1"
android:text="热门游"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<ImageView
android:id="@+id/iv_popular_brigade_many"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingRight="@dimen/size_15"
android:clickable="true"
android:paddingLeft="@dimen/size_15"
android:scaleType="center"
android:src="@mipmap/rv_common_icon_right_arrow" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_popular_brigade"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/size_10" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:orientation="vertical">
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="@dimen/size_12"
android:paddingBottom="@dimen/size_12">
<TextView
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_12"
android:layout_marginBottom="@dimen/size_12"
android:text="周边游"
android:layout_weight="1"
android:text="热门游"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_tour_around"
android:layout_width="match_parent"
<TextView
android:id="@+id/iv_popular_brigade_many"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/size_10" />
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:drawablePadding="@dimen/size_5"
android:text="全部"
android:textSize="@dimen/text_10" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_popular_brigade"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/size_10" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:orientation="vertical">
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_12"
android:layout_marginBottom="@dimen/size_12"
android:text="周边游"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<LinearLayout
android:id="@+id/ll_layout_popular_more"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_ba242525"
android:orientation="vertical"
android:visibility="gone">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_tour_around"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/size_10" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/size_60"
android:gravity="center"
android:text="选择旅游类型"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_16" />
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_popular_more"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/size_40"
android:layout_weight="1" />
</LinearLayout>
<ImageView
android:id="@+id/travel_hot_more_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/size_20"
android:padding="@dimen/size_10"
android:scaleType="centerInside"
android:src="@mipmap/rv_common_icon_close" />
<LinearLayout
android:id="@+id/ll_layout_popular_more"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_ba242525"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/size_60"
android:gravity="center"
android:text="— 选择旅游类型 —"
android:layout_marginTop="@dimen/size_20"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_16" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_popular_more"
android:layout_width="match_parent"
android:layout_height="0dp"
android:paddingBottom="@dimen/size_40"
android:layout_weight="1" />
<ImageView
android:id="@+id/travel_hot_more_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/size_20"
android:padding="@dimen/size_10"
android:scaleType="centerInside"
android:src="@mipmap/rv_common_icon_close" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/size_110"
android:layout_width="match_parent"
android:gravity="center_horizontal"
android:layout_height="@dimen/size_70">
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginLeft="@dimen/size_15"
android:layout_width="@dimen/size_130"
android:layout_height="@dimen/size_80">
......
......@@ -373,12 +373,12 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
dismiss();
} else if (i == R.id.ll_item_wechat) {
payType = 1;
helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false);
} else if (i == R.id.ll_item_alipay) {
payType = 2 ;
helper.setChecked(R.id.rb_wechat,false);
helper.setChecked(R.id.rb_alipay,true);
helper.getView(com.rv.home.R.id.iv_wx_select).setSelected(true);
helper.getView(com.rv.home.R.id.iv_alipy_select).setSelected(false);
} else if (i == com.rv.home.R.id.ll_item_alipay) {
payType = 2;
helper.getView(com.rv.home.R.id.iv_wx_select).setSelected(false);
helper.getView(com.rv.home.R.id.iv_alipy_select).setSelected(true);
} else if (i == R.id.tv_pay_immediately) {
dismiss();
......
......@@ -33,9 +33,8 @@
android:drawablePadding="@dimen/size_15"
android:hint="搜索目的地/旅游线"
android:paddingLeft="@dimen/size_15"
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_search"
......
......@@ -17,6 +17,7 @@ import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.bean.BeanUserInfo;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.dialog.VerifiedTipsDialog;
......@@ -66,6 +67,12 @@ public class WalletActivity extends BaseStatusActivity<WalletPresenter> {
return R.layout.activity_wallet;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StatusBarUtil.setRootViewFitsSystemWindows(mActivity,false);
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
showTitle(false);
......
......@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="@color/colorLine"
tools:context=".activity.WalletActivity">
......@@ -13,6 +14,12 @@
android:layout_height="@dimen/size_220"
android:orientation="vertical">
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:use_type="use_padding_top">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
......@@ -35,6 +42,8 @@
android:text="我的钱包"/>
</RelativeLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_weight="1"
......
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