Commit 4deb65da authored by linfeng's avatar linfeng

发现和优惠券

parents ac00b86a 6320e5dc
......@@ -7,10 +7,9 @@ android {
applicationId "com.xxfc.rv"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
// versionCode 113
versionCode 130
// versionName "1.1.3"
versionName "1.3.0"
versionCode 113
versionName "1.1.3"
multiDexEnabled true
//新版Gradle 是 implementation 为了兼容compile,写上这句话
......
......@@ -28,11 +28,13 @@ import com.ruiwenliu.wrapper.adapter.TabAdapter;
import com.rv.home.rv.module.ui.main.home.HomeFragment;
import com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean;
import com.rv.rvmine.MineFragment;
import com.rv.share.view.PromotionDialog;
import com.rv.tourism.R2;
import com.rv.tourism.TourismFragment;
import com.rv.version.bean.VersionCheckBean;
import com.rv.version.util.UpdateAppUtils;
import com.xxfc.discovery.DiscoveryFragment;
import com.yuyife.okgo.OkGoUtil;
import java.util.ArrayList;
import java.util.LinkedHashMap;
......@@ -108,6 +110,16 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
protected void loadData(Bundle savedInstanceState, Intent intent) {
checkVersion();
getEffectiveTime();
if (isLogin()) { // 已经登录
PromotionDialog dialog = new PromotionDialog.Builder(this, new View.OnClickListener() {
@Override
public void onClick(View view) {
}
}).create();
dialog.show();
}
}
@Override
......@@ -226,15 +238,14 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (intent != null && "use_member".equals(intent.getStringExtra("from"))) {
if (intent != null && "home".equals(intent.getStringExtra("to"))) {
setCurrent(TYPE_HOME_PAGE);
}
if (intent != null && "traveldetail".equals(intent.getStringExtra("from"))) {
if (intent != null && "travel".equals(intent.getStringExtra("to"))) {
setCurrent(TYPE_TRAVEL);
}
if (intent != null && "orderdetail".equals(intent.getStringExtra("from"))) {
setCurrent(TYPE_HOME_PAGE);
if (intent != null && "discovery".equals(intent.getStringExtra("to"))) {
setCurrent(TYPE_FOUND);
}
}
......@@ -264,4 +275,16 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
finish();
}
}
/**
* 判断是否登录
*
* @return
*/
private boolean isLogin() {
if (TextUtils.isEmpty(OkGoUtil.getToken())) {
return false;
}
return true;
}
}
......@@ -53,6 +53,7 @@ public class RvClientApplication extends FrameApp {
if (isMainProcess()) {
ShareInstall.getInstance().init(getApplicationContext());
}
ShareInstall.getInstance().reportRegister();
LogUtil.setLogEnable(true, getApplicationContext());
......
......@@ -10,6 +10,7 @@ import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.Cooker;
import com.rv.component.utils.LogUtil;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.sh.sdk.shareinstall.ShareInstall;
......@@ -54,9 +55,16 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
LogUtil.d("ShareInstall", "info = " + info);
try {
JSONObject object = new JSONObject(info);
// 通过该方法拿到设置的渠道值,剩余值为自定义的其他参数
String channel = object.optString("channel");
LogUtil.d("ShareInstall", "channel = " + channel);
String inviteCode = object.optString("token");
if(!TextUtils.isEmpty(inviteCode)){
Cooker.save(getApplicationContext(),"invite_code",inviteCode);
}
// // 通过该方法拿到设置的渠道值,剩余值为自定义的其他参数
// String channel = object.optString("channel");
// LogUtil.d("ShareInstall", "channel = " + channel);
} catch (JSONException e) {
e.printStackTrace();
}
......
......@@ -12,6 +12,10 @@ public interface RvFrameConfig extends RvFrameConstant {
// String HOST = "http://10.1.37.192:8765";
String HOST = "https://dev.dfangche.com";
// String HOST = "http://10.5.52.4:8765";
// String HOST = "http://10.1.37.245:8765";
// String HOST = "http://10.1.37.248:8765";
// String HOST = "http://10.1.37.244:9527";
String ADMIN_POST =HOST + "/api/admin/";
String AUTH_POST = HOST + "/api/auth/";
......
package com.rv.rvmine.bean;
package com.ruiwenliu.wrapper.bean;
import com.google.gson.annotations.SerializedName;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
import java.io.Serializable;
/**
* 获取用户信息
*/
public class UserInfoBean extends BaseBean {
public class UserInfoBean extends BaseBean implements Serializable {
private static final long serialVersionUID = -2037885960862296967L;
private UserInfo data;
private boolean rel;
......@@ -70,11 +71,11 @@ public class UserInfoBean extends BaseBean {
//备注
private String remark;
// 剩余天数
private int rentFreeDays ;
private int rentFreeDays;
// 会员消费次数
private int payCount;
// 购买会员册数
private int buyCount ;
private int buyCount;
// 会员等级
private int memberLevel;
......@@ -82,6 +83,7 @@ public class UserInfoBean extends BaseBean {
private String positionName;// 职位名称
public Integer getId() {
return id;
}
......@@ -266,6 +268,14 @@ public class UserInfoBean extends BaseBean {
this.memberLevel = memberLevel;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public int getDiscount() {
return discount;
}
......@@ -281,13 +291,5 @@ public class UserInfoBean extends BaseBean {
public void setPositionName(String positionName) {
this.positionName = positionName;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
}
}
......@@ -80,5 +80,4 @@ ext {
storeReleaseFile: "../keystore/debug.keystore",
storeDebugFile : "../keystore/debug.keystore"
]
}
\ No newline at end of file
......@@ -70,4 +70,8 @@ public class ApiConfig {
public static String HTTP_URL_FIND_BANNERLIST = RvFrameConfig.HOST + "/api/app/banner/app/unauth/findBannerlist"; // banner图接口
public static String HTTP_URL_EFFECTIVE_TIME = RvFrameConfig.VEHICLE_ORDER + "/baseOrder/app/unauth/getOrderParam"; // 获取订单失效时间
public static String HTTP_URR_USER_POINT = RvFrameConfig.HOST + "/api/activity/integralUserTotal/getByUser";
public static String HTTP_URL_POINT_LIST =RvFrameConfig.HOST + "/api/activity/integralRule/list";
}
......@@ -48,6 +48,7 @@ import com.ruiwenliu.wrapper.util.permission.RxPermission;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.rv.component.utils.DateUtils;
import com.rv.component.utils.LogUtil;
import com.rv.component.utils.MyUtils;
import com.rv.component.utils.ObservableScrollView;
import com.rv.home.R;
......@@ -886,12 +887,16 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
.setOnBannerListener(new OnBannerListener() {
@Override
public void OnBannerClick(int position) {
LogUtil.d("position=" + position);
/* if (localImages != null && localImages.size() > 0) {
Bundle bundle = new Bundle();
bundle.putInt(ActivityImageBrowseInt.KEY_BACKGROUND, R.color.colorPrimary);
bundle.putIntegerArrayList(ActivityImageBrowseInt.KEY_IMAGE, (ArrayList<Integer>) localImages);
IntentUtil.startActivity(_mActivity, ActivityImageBrowseInt.class, bundle);
}*/
}
})
.start();
......
......@@ -478,7 +478,7 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
public void showMore() {
ComponentName cmn = new ComponentName(getApplicationContext(), "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.putExtra("from", "orderdetail");
intent.putExtra("to", "home");
intent.setComponent(cmn);
startActivity(intent);
finish();
......
......@@ -446,7 +446,7 @@ public class TravelOrderDetailsActivity extends BaseStatusActivity<PickerPresent
public void showMore() {
ComponentName cmn = new ComponentName(getApplicationContext(), "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.putExtra("from", "traveldetail");
intent.putExtra("to", "travel");
intent.setComponent(cmn);
startActivity(intent);
finish();
......
......@@ -49,4 +49,5 @@ dependencies {
implementation 'com.alibaba:fastjson:1.2.21'
api project(':plugin_share')
api project(':plugin_coupon')
implementation project(':plugin_points')
}
......@@ -18,10 +18,10 @@ import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.base.utils.tools.android.IntentUtil;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.base.utils.ui.image.round.RoundImageView;
import com.frame.base.url.Constance;
import com.ruiwenliu.wrapper.bean.BeanUserInfo;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.browse.ActivityImageBrowseInt;
import com.frame.base.bus.LoginSuccessfulEvent;
import com.frame.base.bus.Observer;
......@@ -34,15 +34,16 @@ import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.rv.component.utils.Cache;
import com.rv.component.utils.CacheEnum;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.LoginRvActivity;
import com.rv.home.rv.module.ui.main.home.DrivingListActivity;
import com.rv.home.rv.module.ui.main.home.ShareImageActivity;
import com.rv.home.rv.module.ui.main.home.bean.BeanHomeBanner;
import com.rv.home.rv.module.ui.main.home.order.OrderListActivity;
import com.rv.member.MemberCenterActivity;
import com.rv.rvmine.bean.UserInfoBean;
import com.rv.points.PointsActivity;
import com.rv.rvmine.personal.IDCardCertificationActivity;
import com.rv.rvmine.rxbusevent.UserInfoEvent;
import com.rv.rvmine.traveler.ChooseAVisitorActivity;
......@@ -278,6 +279,9 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
.build(Constance.ACTIVITY_URL_COUPONALL)
.navigation();
}
// else if (id == R.id.rl_item_share) {
// startActivity(new Intent(_mActivity, PointsActivity.class));
// }
}
@Override
......@@ -369,7 +373,8 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
* @return
*/
private boolean isLogin() {
if (TextUtils.isEmpty(OkGoUtil.getToken())) {
String token = OkGoUtil.getToken();
if (TextUtils.isEmpty(token)) {
startActivity(LoginRvActivity.getIntent(_mActivity));
return true;
}
......@@ -381,6 +386,9 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
mSimpleRefreshLayout.onRefreshComplete();
switch (requestType) {
case 0:
if (result != null) {
Cache.getInstance(getContext()).save((UserInfoBean) result, CacheEnum.USER);
}
userInfoData((UserInfoBean) result);
break;
case 1:
......
......@@ -7,7 +7,6 @@ import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
......@@ -19,6 +18,7 @@ import com.frame.base.bus.RxBus;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.util.permission.RxPermission;
......@@ -27,11 +27,7 @@ import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.dialog.PickerDialog;
import com.rv.home.rv.module.basic.presenter.PickerPresenter;
import com.rv.home.rv.module.ui.main.home.bean.ImageUploadBean;
import com.rv.home.rv.module.ui.main.home.dialog.TipsDialog;
import com.rv.home.rv.module.ui.main.home.order.CancelTheTripActivity;
import com.rv.home.rv.module.ui.main.home.order.bean.CancelTheTripBean;
import com.rv.rvmine.R;
import com.rv.rvmine.bean.UserInfoBean;
import com.rv.rvmine.R2;
import com.rv.rvmine.dialog.ChooseGenderDialog;
import com.rv.rvmine.rxbusevent.UserInfoEvent;
......@@ -152,7 +148,7 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
if (data != null && data.getData() != null) {
mPresenter.cropPhoto(data.getData());
}
} else if (requestCode == mPresenter.TYPE_CAMERA_CODE && resultCode == RESULT_OK ) {
} else if (requestCode == mPresenter.TYPE_CAMERA_CODE && resultCode == RESULT_OK) {
mPresenter.cropPhoto(Uri.fromFile(new File(mPresenter.gerCameraStoreUrl())));
} else if (requestCode == mPresenter.TYPE_CROP_CODE && resultCode == RESULT_OK) {
String url = mPresenter.gerCameraStoreUrl();
......@@ -198,9 +194,9 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
public void helper(final ViewHolder helper) {
super.helper(helper);
if (sex == 0) { // 0-女,1-男
helper.setChecked(R.id.cb_girl,true);
helper.setChecked(R.id.cb_girl, true);
} else if (sex == 1) {
helper.setChecked(R.id.cb_man,true);
helper.setChecked(R.id.cb_man, true);
}
helper.setOnClickListener(new View.OnClickListener() {
......@@ -209,10 +205,10 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
int id = v.getId();
if (id == R.id.cb_man) {
sex = 1;
helper.setChecked(R.id.cb_girl,false);
helper.setChecked(R.id.cb_girl, false);
} else if (id == R.id.cb_girl) {
sex = 0;
helper.setChecked(R.id.cb_man,false);
helper.setChecked(R.id.cb_man, false);
} else if (id == R.id.tv_ok) {
if (sex == 0) { // 0-女,1-男
tvSex.setText("女");
......@@ -335,7 +331,7 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
showToast("生日不为空!");
return;
}
mPresenter.postBodyData(RvFrameConfig.ADMIN_POST, 1, ApiConfig.HTTP_URL_UPUSER_EDIT, BaseBean.class, new UserInfo(info.getId() + "", info.getUserid() + "", info.getUsername(), "0", nickName, info.getRealname(), ivAvatarUrl, dataBirth,sex), getHeadMap(), true);
mPresenter.postBodyData(RvFrameConfig.ADMIN_POST, 1, ApiConfig.HTTP_URL_UPUSER_EDIT, BaseBean.class, new UserInfo(info.getId() + "", info.getUserid() + "", info.getUsername(), "0", nickName, info.getRealname(), ivAvatarUrl, dataBirth, sex), getHeadMap(), true);
}
private Map<String, Object> getHeadMap() {
......
......@@ -7,6 +7,7 @@ import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.ruiwenliu.wrapper.base.BaseBean;
......@@ -27,6 +28,7 @@ import com.yuyife.okgo.OkGoUtil;
import java.util.LinkedHashMap;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
......@@ -36,7 +38,10 @@ import butterknife.OnClick;
public class SettingActivity extends BaseStatusActivity<CommonPresenter> {
@BindView(R2.id.tv_version)
TextView tvVersion;
private UpdateAppUtils updateAppUtils;
private VersionCheckBean versionCheckBean = null;
@Override
protected int setLayout() {
......@@ -53,30 +58,27 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> {
titleView.setTitle(getString(R.string.setting_title));
}
@Override
protected void loadData(Bundle savedInstanceState, Intent intent) {
super.loadData(savedInstanceState, intent);
checkVersion();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
switch (requestType) {
case 0:
VersionCheckBean versionCheckBean = (VersionCheckBean) result;
if (versionCheckBean != null && versionCheckBean.isRel() == false) {
if (versionCheckBean != null && !TextUtils.isEmpty(versionCheckBean.getData().getDownloadUrl())) {
updateAppUtils.serverVersionCode(versionCheckBean.getData().getWeigh())
.serverVersionName(versionCheckBean.getData().getVersionName())
.apkPath(versionCheckBean.getData().getDownloadUrl())
.updateInfo(versionCheckBean.getData().getContent())
.apkSize(versionCheckBean.getData().getPackagesize())
.isForce(versionCheckBean.getData().getIsCompe() == 0 ? false : true)
.update();
versionCheckBean = (VersionCheckBean) result;
if (versionCheckBean == null || versionCheckBean.isRel() == true) {
if (tvVersion != null) {
tvVersion.setText("已是最新版本V" + UpdateAppUtils.getAppVersionName(this));
}
} else {
Toast.makeText(getApplicationContext(), "当前已是最新版本", Toast.LENGTH_SHORT).show();
}
break;
default:
break;
}
}
@Override
......@@ -89,6 +91,7 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> {
}
@OnClick({R2.id.rl_item_change_password, R2.id.ll_item_app_push, R2.id.rl_item_clear_cache, R2.id.rl_item_check_for_updates, R2.id.rl_item_about_us, R2.id.tv_out_sign})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.rl_item_change_password) {
......@@ -103,7 +106,21 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> {
showToast("亲,该功能还在开发中。。。");
} else if (id == R.id.rl_item_check_for_updates) {
//检查更新
checkVersion();
if (versionCheckBean != null && versionCheckBean.isRel() == false) {
if (versionCheckBean != null && !TextUtils.isEmpty(versionCheckBean.getData().getDownloadUrl())) {
updateAppUtils.serverVersionCode(versionCheckBean.getData().getWeigh())
.serverVersionName(versionCheckBean.getData().getVersionName())
.apkPath(versionCheckBean.getData().getDownloadUrl())
.updateInfo(versionCheckBean.getData().getContent())
.apkSize(versionCheckBean.getData().getPackagesize())
.isForce(versionCheckBean.getData().getIsCompe() == 0 ? false : true)
.update();
}
} else {
Toast.makeText(getApplicationContext(), "当前已是最新版本", Toast.LENGTH_SHORT).show();
}
} else if (id == R.id.rl_item_about_us) {
//关于我们
startActivity(AboutUsActivity.getIntent(mActivity));
......@@ -128,7 +145,7 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> {
Map<String, Object> headMap = new LinkedHashMap<>();
String versionName = UpdateAppUtils.getAppVersionName(this);
if (!TextUtils.isEmpty(versionName)) {
mPresenter.getData(0, String.format(ApiConfig.HTTP_URL_VERSION_CHECK, versionName), VersionCheckBean.class, headMap, true);
mPresenter.getData(0, String.format(ApiConfig.HTTP_URL_VERSION_CHECK, versionName), VersionCheckBean.class, headMap, false);
}
}
......
......@@ -9,9 +9,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:orientation="vertical">
android:paddingRight="@dimen/size_15">
<RelativeLayout
android:id="@+id/rl_item_change_password"
......@@ -22,19 +22,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="修改密码"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16"
android:text="修改密码"/>
android:textSize="@dimen/text_16" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@drawable/common_icon_rig_black"/>
android:layout_centerVertical="true"
android:src="@drawable/common_icon_rig_black" />
</RelativeLayout>
<include layout="@layout/common_line"/>
<include layout="@layout/common_line" />
<LinearLayout
android:id="@+id/ll_item_app_push"
......@@ -46,35 +46,35 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="APP推送"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16"
android:text="APP推送"/>
android:textSize="@dimen/text_16" />
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textColor="@color/colorGray"
android:layout_marginLeft="@dimen/size_8"
android:textSize="@dimen/text_10"
android:text="重要信息通知,我们会计时通知您"/>
android:layout_weight="1"
android:text="重要信息通知,我们会计时通知您"
android:textColor="@color/colorGray"
android:textSize="@dimen/text_10" />
<com.suke.widget.SwitchButton
android:id="@+id/switch_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:layout_width="match_parent"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:orientation="vertical"
android:layout_height="wrap_content">
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15">
<RelativeLayout
android:id="@+id/rl_item_clear_cache"
......@@ -85,19 +85,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="清除缓存"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16"
android:text="清除缓存"/>
android:textSize="@dimen/text_16" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@drawable/common_icon_rig_black"/>
android:layout_centerVertical="true"
android:src="@drawable/common_icon_rig_black" />
</RelativeLayout>
<include layout="@layout/common_line"/>
<include layout="@layout/common_line" />
<RelativeLayout
android:id="@+id/rl_item_check_for_updates"
......@@ -108,19 +108,23 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="检查更新"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16"
android:text="检查更新"/>
android:textSize="@dimen/text_16" />
<ImageView
<TextView
android:textSize="@dimen/sp_12"
android:id="@+id/tv_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@drawable/common_icon_rig_black"/>
android:layout_centerVertical="true"
android:drawableRight="@drawable/common_icon_rig_black"
android:drawablePadding="@dimen/size_3"
android:textColor="#999999" />
</RelativeLayout>
<include layout="@layout/common_line"/>
<include layout="@layout/common_line" />
<RelativeLayout
android:id="@+id/rl_item_about_us"
......@@ -131,16 +135,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="关于我们"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16"
android:text="关于我们"/>
android:textSize="@dimen/text_16" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@drawable/common_icon_rig_black"/>
android:layout_centerVertical="true"
android:src="@drawable/common_icon_rig_black" />
</RelativeLayout>
</LinearLayout>
......@@ -149,13 +153,13 @@
android:id="@+id/tv_out_sign"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginTop="@dimen/size_70"
android:layout_marginLeft="@dimen/size_40"
android:layout_marginTop="@dimen/size_70"
android:layout_marginRight="@dimen/size_40"
android:gravity="center"
android:textColor="@color/colorWrite"
android:background="@drawable/shape_rv_button_light_gray"
android:text="退出登录"/>
android:gravity="center"
android:text="退出登录"
android:textColor="@color/colorWrite" />
</LinearLayout>
......@@ -25,7 +25,7 @@ import com.ruiwenliu.wrapper.weight.horizontal.SpaceItemDecoration;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.ruiwenliu.wrapper.adapter.TabAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.OrderMenuAdapter;
import com.rv.member.bean.UserInfoBean;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.rv.member.fragment.AllDayDetailFragment;
import com.rv.member.fragment.GiveDetailFragment;
import com.rv.member.fragment.UserDetailFragment;
......
......@@ -35,7 +35,7 @@ import com.rv.member.bean.MemberListBean;
import com.rv.member.adapter.MemberListAdapter;
import com.rv.member.bean.BeanTourOrderPay;
import com.rv.member.bean.MemberOrderBean;
import com.rv.member.bean.UserInfoBean;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.rv.member.presenter.MemberPresenter;
import com.rv.component.utils.Cache;
import com.rv.component.utils.CacheEnum;
......
......@@ -180,7 +180,7 @@ public class MemberListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
private void toMainActivity() {
ComponentName componentName = new ComponentName(mContext, "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.putExtra("from", "use_member");
intent.putExtra("to", "home");
intent.setComponent(componentName);
mContext.startActivity(intent);
}
......
package com.rv.member.bean;
import com.google.gson.annotations.SerializedName;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
/**
* 获取用户信息
*/
public class UserInfoBean extends BaseBean implements Serializable {
private static final long serialVersionUID = -2037885960862296967L;
private UserInfo data;
private boolean rel;
public UserInfo getData() {
return data;
}
public void setData(UserInfo data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class UserInfo implements Serializable {
private Integer id;
private String icon ;
//用户id
private Integer userid;
//imid
private Integer imUserid;
///账号(手机号)
private String username;
//微信openid
private String wxOpenid;
//微信unionid
private String unionid;
//qq
private String openid;
//状态:0-启用,1-禁用
private Integer status;
//身份证号
private String idNumber;
//实名认证状态:0-未认证,1-已认证
private Integer certificationStatus;
//会员
private Integer isMember; // 是否为会员 0-普通用户 1-会员
//昵称
private String nickname;
//真实姓名
private String realname;
//头像
private String headimgurl;
//邮箱
private String email;
//性别 0-女,1-男
private Integer sex;
//生日
private String birthday;
//个性签名
private String personSign;
//备注
private String remark;
// 剩余天数
private int rentFreeDays;
// 会员消费次数
private int payCount;
// 购买会员册数
private int buyCount;
// 会员等级
private int memberLevel;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public Integer getImUserid() {
return imUserid;
}
public void setImUserid(Integer imUserid) {
this.imUserid = imUserid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getWxOpenid() {
return wxOpenid;
}
public void setWxOpenid(String wxOpenid) {
this.wxOpenid = wxOpenid;
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getIdNumber() {
return idNumber;
}
public void setIdNumber(String idNumber) {
this.idNumber = idNumber;
}
public Integer getCertificationStatus() {
return certificationStatus;
}
public void setCertificationStatus(Integer certificationStatus) {
this.certificationStatus = certificationStatus;
}
public Integer getIsMember() {
return isMember;
}
public void setIsMember(Integer isMember) {
this.isMember = isMember;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getRealname() {
return realname;
}
public void setRealname(String realname) {
this.realname = realname;
}
public String getHeadimgurl() {
return headimgurl;
}
public void setHeadimgurl(String headimgurl) {
this.headimgurl = headimgurl;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getPersonSign() {
return personSign;
}
public void setPersonSign(String personSign) {
this.personSign = personSign;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public int getRentFreeDays() {
return rentFreeDays;
}
public void setRentFreeDays(int rentFreeDays) {
this.rentFreeDays = rentFreeDays;
}
public int getPayCount() {
return payCount;
}
public void setPayCount(int payCount) {
this.payCount = payCount;
}
public int getBuyCount() {
return buyCount;
}
public void setBuyCount(int buyCount) {
this.buyCount = buyCount;
}
public int getMemberLevel() {
return memberLevel;
}
public void setMemberLevel(int memberLevel) {
this.memberLevel = memberLevel;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
}
}
apply plugin: 'com.android.library'
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':RvWrapper')
implementation project(':module_home')
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rv.points">
<application>
<activity android:name=".PointsActivity"></activity>
</application>
</manifest>
\ No newline at end of file
package com.rv.points;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import com.alibaba.android.arouter.launcher.ARouter;
import com.frame.base.url.Constance;
public class Actions {
public Actions() {
}
/*******
* 分享
*/
public void share(Context context) {
ComponentName name = new ComponentName(context, "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.setComponent(name);
intent.putExtra("to", "home");
context.startActivity(intent);
}
/******
* 实名认证
* @param context
*/
public void cretification(Context context) {
ARouter.getInstance().build(Constance.ACTIVITY_URL_IDCARDCERTIFICATION)
.navigation((Activity) context, 1000);
}
/******
* 购买会员
* @param context
*/
public void buymember(Context context) {
ComponentName name = new ComponentName(context, "com.rv.member.MemberCenterActivity");
Intent intent = new Intent();
intent.setComponent(name);
((Activity) context).startActivityForResult(intent, 1001);
}
/*******
* 图文评论
* @param context
*/
public void commentandpic(Context context) {
ARouter.getInstance().build(Constance.ACTIVITY_URL_ORDERLIST)
.withInt("position", 3)
.navigation((Activity) context, 1002);
}
/******
* 评论
* @param context
*/
public void comment(Context context) {
ARouter.getInstance().build(Constance.ACTIVITY_URL_ORDERLIST)
.withInt("position", 3)
.navigation((Activity) context, 1002);
}
/*****
* 签到
* @param context
*/
public void sign(Context context) {
}
/******
* 绑定微信
* @param context
*/
public void bindwechat(Context context) {
}
/*****
* 注册
* @param context
*/
public void register(Context context) {
}
/*****
* 房车租赁
* @param context
*/
public void rentrv(Context context) {
ComponentName name = new ComponentName(context, "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.setComponent(name);
intent.putExtra("to", "home");
context.startActivity(intent);
}
/****
* 房车购买
* @param context
*/
public void buyrout(Context context) {
ComponentName name = new ComponentName(context, "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.setComponent(name);
intent.putExtra("to", "travel");
context.startActivity(intent);
}
/*****
* 参与官方活动
*/
public void official(Context context) {
ComponentName name = new ComponentName(context, "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.setComponent(name);
intent.putExtra("to", "home");
context.startActivity(intent);
}
/****
* 发表动态
* @param context
*/
public void publish(Context context) {
ComponentName name = new ComponentName(context, "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.setComponent(name);
intent.putExtra("to", "discovery");
context.startActivity(intent);
}
public void commentpublish(Context context) {
ComponentName name = new ComponentName(context, "com.xxfc.rv.MainActivity");
Intent intent = new Intent();
intent.setComponent(name);
intent.putExtra("to", "discovery");
context.startActivity(intent);
}
}
This diff is collapsed.
package com.rv.points.adapter;
import android.graphics.Color;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.ImageView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
import com.rv.points.R;
import com.rv.points.bean.PointBean;
import java.util.List;
public class PointAdapter extends BaseQuickAdapter<PointBean.RvPointItem, BaseViewHolder> {
public PointAdapter() {
super(R.layout.item_point);
}
@Override
protected void convert(BaseViewHolder helper, PointBean.RvPointItem item) {
if (!TextUtils.isEmpty(item.getImg())) {
GlideManager.getInstance(mContext).loadImage(item.getImg(), (ImageView) helper.itemView.findViewById(R.id.img_icon));
}
if (!TextUtils.isEmpty(item.getName())) {
helper.setText(R.id.tv_name, item.getName());
}
if (!TextUtils.isEmpty(item.getRegulation())) {
if ("SIGN".equals(item.getCode())) {
helper.setText(R.id.tv_regulation, "签到规则");
helper.setTextColor(R.id.tv_regulation, Color.parseColor("#FFB74B"));
helper.addOnClickListener(R.id.tv_regulation);
} else {
helper.setText(R.id.tv_regulation, item.getRegulation());
helper.setTextColor(R.id.tv_regulation, Color.parseColor("#999999"));
}
}
if (item.getPoint() != 0) {
helper.setText(R.id.tv_points, item.getPoint() + "分");
}
if (!TextUtils.isEmpty(item.getBtnWord())) {
helper.setText(R.id.btn_state, item.getBtnWord());
}
helper.setBackgroundRes(R.id.btn_state, item.isIntegralStatus() ? R.drawable.shape_rv_bg_member_top_grap : R.drawable.shape_rv_bg_dark_yellow);
if (item.isIntegralStatus()) {
helper.itemView.findViewById(R.id.btn_state).setEnabled(false);
} else {
helper.itemView.findViewById(R.id.btn_state).setEnabled(true);
}
helper.addOnClickListener(R.id.btn_state);
}
}
package com.rv.points.bean;
import com.google.gson.annotations.SerializedName;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.util.List;
public class PointBean extends BaseBean {
@SerializedName("data")
private RvPoint data;
@SerializedName("rel")
private boolean rel;
public RvPoint getData() {
return data;
}
public void setData(RvPoint data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class RvPoint {
@SerializedName("totalCount")
private int totalCount;
@SerializedName("totalPage")
private int totalPage;
@SerializedName("pageNum")
private int pageNum;
@SerializedName("pageSize")
private int pageSize;
@SerializedName("data")
private List<RvPointItem> data;
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public List<RvPointItem> getData() {
return data;
}
public void setData(List<RvPointItem> data) {
this.data = data;
}
}
public static class RvPointItem {
@SerializedName("id")
private int id;
@SerializedName("period")
private int period;
@SerializedName("number")
private int number;
@SerializedName("point")
private int point;
@SerializedName("price")
private float price;
@SerializedName("isContinuity")
private boolean isContinuity;
@SerializedName("finishDay")
private int finishDay;
@SerializedName("finishPoint")
private int finishPoint;
@SerializedName("status")
private boolean status;
@SerializedName("crtTime")
private long crtTime;
@SerializedName("isdel")
private boolean isdel;
@SerializedName("startTime")
private long startTime;
@SerializedName("endTime")
private long endTime;
@SerializedName("updTime")
private long updTime;
@SerializedName("img")
private String img;
@SerializedName("orderId")
private int orderId;
@SerializedName("name")
private String name;
@SerializedName("code")
private String code;
@SerializedName("regulation")
private String regulation;
@SerializedName("otherRule")
private String otherRule;
@SerializedName("btnWord")
private String btnWord;
@SerializedName("integralStatus")
private boolean integralStatus;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPeriod() {
return period;
}
public void setPeriod(int period) {
this.period = period;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public int getPoint() {
return point;
}
public void setPoint(int point) {
this.point = point;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
public boolean isContinuity() {
return isContinuity;
}
public void setContinuity(boolean continuity) {
isContinuity = continuity;
}
public int getFinishDay() {
return finishDay;
}
public void setFinishDay(int finishDay) {
this.finishDay = finishDay;
}
public int getFinishPoint() {
return finishPoint;
}
public void setFinishPoint(int finishPoint) {
this.finishPoint = finishPoint;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
public long getCrtTime() {
return crtTime;
}
public void setCrtTime(long crtTime) {
this.crtTime = crtTime;
}
public boolean isIsdel() {
return isdel;
}
public void setIsdel(boolean isdel) {
this.isdel = isdel;
}
public long getStartTime() {
return startTime;
}
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public long getEndTime() {
return endTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public long getUpdTime() {
return updTime;
}
public void setUpdTime(long updTime) {
this.updTime = updTime;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public int getOrderId() {
return orderId;
}
public void setOrderId(int orderId) {
this.orderId = orderId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getRegulation() {
return regulation;
}
public void setRegulation(String regulation) {
this.regulation = regulation;
}
public String getOtherRule() {
return otherRule;
}
public void setOtherRule(String otherRule) {
this.otherRule = otherRule;
}
public String getBtnWord() {
return btnWord;
}
public void setBtnWord(String btnWord) {
this.btnWord = btnWord;
}
public boolean isIntegralStatus() {
return integralStatus;
}
public void setIntegralStatus(boolean integralStatus) {
this.integralStatus = integralStatus;
}
}
}
package com.rv.points.bean;
import com.google.gson.annotations.SerializedName;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.math.BigDecimal;
public class RulerBean extends BaseBean {
@SerializedName("rel")
private boolean rel;
@SerializedName("data")
private Ruler data;
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public Ruler getData() {
return data;
}
public void setData(Ruler data) {
this.data = data;
}
public static class Ruler {
@SerializedName("id")
private int id;
@SerializedName("period")
private int period;
@SerializedName("number")
private int number;
@SerializedName("point")
private int point;
@SerializedName("price")
private BigDecimal price;
@SerializedName("isContinuity")
private boolean isContinuity;
private int finishDay;
@SerializedName("finishPoint")
private int finishPoint;
@SerializedName("status")
private boolean status;
@SerializedName("crtTime")
private long crtTime;
@SerializedName("isdel")
private boolean isdel;
@SerializedName("startTime")
private long startTime;
@SerializedName("endTime")
private long endTime;
@SerializedName("updTime")
private long updTime;
@SerializedName("detail")
private String detail;
@SerializedName("img")
private String img;
@SerializedName("orderId")
private int orderId;
@SerializedName("name")
private String name;
@SerializedName("code")
private String code;
@SerializedName("regulation")
private String regulation;
@SerializedName("otherRule")
private String otherRule;
@SerializedName("btnWord")
private String btnWord;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPeriod() {
return period;
}
public void setPeriod(int period) {
this.period = period;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public int getPoint() {
return point;
}
public void setPoint(int point) {
this.point = point;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public boolean isContinuity() {
return isContinuity;
}
public void setContinuity(boolean continuity) {
isContinuity = continuity;
}
public int getFinishDay() {
return finishDay;
}
public void setFinishDay(int finishDay) {
this.finishDay = finishDay;
}
public int getFinishPoint() {
return finishPoint;
}
public void setFinishPoint(int finishPoint) {
this.finishPoint = finishPoint;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
public long getCrtTime() {
return crtTime;
}
public void setCrtTime(long crtTime) {
this.crtTime = crtTime;
}
public boolean isIsdel() {
return isdel;
}
public void setIsdel(boolean isdel) {
this.isdel = isdel;
}
public long getStartTime() {
return startTime;
}
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public long getEndTime() {
return endTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public long getUpdTime() {
return updTime;
}
public void setUpdTime(long updTime) {
this.updTime = updTime;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public int getOrderId() {
return orderId;
}
public void setOrderId(int orderId) {
this.orderId = orderId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getRegulation() {
return regulation;
}
public void setRegulation(String regulation) {
this.regulation = regulation;
}
public String getOtherRule() {
return otherRule;
}
public void setOtherRule(String otherRule) {
this.otherRule = otherRule;
}
public String getBtnWord() {
return btnWord;
}
public void setBtnWord(String btnWord) {
this.btnWord = btnWord;
}
}
}
package com.rv.points.bean;
import com.google.gson.annotations.SerializedName;
import com.ruiwenliu.wrapper.base.BaseBean;
public class UserPointInfoBean extends BaseBean {
@SerializedName("rel")
private boolean rel;
@SerializedName("data")
private UserPointInfo data;
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public UserPointInfo getData() {
return data;
}
public void setData(UserPointInfo data) {
this.data = data;
}
public static class UserPointInfo {
@SerializedName("userId")
private long userId;
@SerializedName("restPoint")
private int restPoint;
@SerializedName("totalPoint")
private int totalPoint;
@SerializedName("crtTime")
private long crtTime;
@SerializedName("updTime")
private long updTime;
@SerializedName("isdel")
private boolean isdel;
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
public int getRestPoint() {
return restPoint;
}
public void setRestPoint(int restPoint) {
this.restPoint = restPoint;
}
public int getTotalPoint() {
return totalPoint;
}
public void setTotalPoint(int totalPoint) {
this.totalPoint = totalPoint;
}
public long getCrtTime() {
return crtTime;
}
public void setCrtTime(long crtTime) {
this.crtTime = crtTime;
}
public long getUpdTime() {
return updTime;
}
public void setUpdTime(long updTime) {
this.updTime = updTime;
}
public boolean isIsdel() {
return isdel;
}
public void setIsdel(boolean isdel) {
this.isdel = isdel;
}
}
}
package com.rv.points.presenter;
import android.app.Activity;
import android.content.Context;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.points.Actions;
import com.rv.points.view.RegulationDialog;
import java.lang.reflect.Method;
public class PointPresenter extends CommonPresenter {
private Class<?> userClass;
private Actions actions;
public void go(String methodName) {
try {
if (userClass == null || actions == null) {
userClass = Actions.class;
actions = (Actions) userClass.newInstance();
}
Method method = userClass.getMethod(methodName, Context.class);
method.invoke(actions, getPresenterContext());
} catch (Exception e) {
e.printStackTrace();
}
}
/*******
* 显示签到规则
* @param activity
*/
public void showRegulationDialog(Activity activity, String content) {
new RegulationDialog.Builder(activity).setContent(content).create().show();
}
}
package com.rv.points.view;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.rv.component.utils.DisplayUtil;
import com.rv.points.R;
public class RegulationDialog extends Dialog {
public RegulationDialog(@NonNull Context context) {
super(context);
}
public RegulationDialog(Context context, int themeResId) {
super(context, themeResId);
}
public static class Builder {
private Context mContext;
private TextView tvRuler;
private TextView tvTitle ;
private ImageView imgClose;
private View.OnClickListener mListener;
private String content;
public Builder(Context context, View.OnClickListener listener) {
mContext = context;
this.mListener = listener;
}
public Builder(Context context) {
mContext = context;
}
public Builder setContent(String content) {
this.content = content;
return this;
}
public Builder show() {
final RegulationDialog dialog = create();
dialog.show();
return this;
}
/**
* 创建定制的对话框
*/
public RegulationDialog create() {
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final RegulationDialog dialog = new RegulationDialog(mContext, R.style.DialogActivityTheme);
// 获取对话框的布局
View layout = inflater.inflate(R.layout.dialog_regulation, null);
// 为对话框添加布局和设置大小
dialog.addContentView(layout, new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT));
this.tvRuler = layout.findViewById(R.id.tv_ruler);
if (!TextUtils.isEmpty(this.content)) {
this.tvRuler.setText(this.content);
}
this.imgClose = layout.findViewById(R.id.img_close);
this.imgClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
this.tvTitle = layout.findViewById(R.id.tv_title) ;
Drawable drawable = mContext.getResources().getDrawable(R.drawable.icon_point_ruler);
drawable.setBounds(0, 0, DisplayUtil.dip2px(mContext, 20), DisplayUtil.dip2px(mContext, 20));
tvTitle.setCompoundDrawables(drawable, null, null, null);
tvTitle.setVisibility(View.VISIBLE);
//默认不能点击对话框其他区域退出 和按返回键退出
dialog.setCancelable(true);
dialog.setContentView(layout);
return dialog;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!--背景颜色-->
<solid android:color="#ffffff" />
<!--设置圆角的角度-->
<corners android:radius="3dp" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp" />
<solid android:color="#cccccc" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".PointsActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_48">
<ImageView
android:id="@+id/img_back"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:layout_centerVertical="true"
android:padding="@dimen/size_10"
android:src="@drawable/rv_common_icon_back_white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="我的积分"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_100"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/bg_points_userinfo"
android:orientation="horizontal">
<com.base.utils.ui.image.round.RoundImageView
android:id="@+id/rimg_avatar"
android:layout_width="@dimen/size_50"
android:layout_height="@dimen/size_50"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_30"
android:src="@drawable/common_icon_avatar_default" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@id/rimg_avatar"
android:text="房车旅行家Rose"
android:textColor="@color/white"
android:textSize="@dimen/text_18" />
<TextView
android:id="@+id/tv_point"
android:layout_width="wrap_content"
android:layout_height="@dimen/size_100"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_50"
android:gravity="center"
android:text="600"
android:textColor="@color/white"
android:textSize="@dimen/text_22" />
</RelativeLayout>
<include layout="@layout/common_rv" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:background="@drawable/dialog_point_content_bg"
android:gravity="center_horizontal"
android:minWidth="300dp"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:drawablePadding="@dimen/size_5"
android:gravity="center"
android:text="积分规则"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_ruler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/size_5"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:singleLine="false"
android:textColor="#ff5e5e5e"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<ImageView
android:id="@+id/img_close"
android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_30"
android:layout_marginTop="10dp"
android:src="@drawable/home_icon_close" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:background="@color/white"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="49dp">
<ImageView
android:id="@+id/img_icon"
android:layout_width="@dimen/size_32"
android:layout_height="@dimen/size_32"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@id/img_icon"
android:text="注册"
android:textColor="#000000"
android:textSize="@dimen/text_15" />
<TextView
android:id="@+id/tv_points"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@id/tv_name"
android:drawableLeft="@drawable/icon_point"
android:drawablePadding="@dimen/size_2"
android:text="10分"
android:textColor="@color/tv_gr999999"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_regulation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_toLeftOf="@+id/btn_state"
android:layout_toRightOf="@id/tv_points"
android:textColor="@color/tv_gr999999"
android:textSize="@dimen/sp_12" />
<Button
android:id="@+id/btn_state"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:background="@drawable/shape_rv_bg_dark_yellow"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<include layout="@layout/common_line" />
</LinearLayout>
<resources>
<string name="app_name">plugin_points</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DialogActivityTheme" parent="Theme.AppCompat.Dialog">
<item name="android:windowFrame">@null</item>
<!-- 边框 -->
<item name="android:windowIsFloating">true</item>
<!-- 是否浮现在activity之上 -->
<item name="android:windowIsTranslucent">true</item>
<!-- 半透明 -->
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:backgroundDimEnabled">true</item>
<!-- 模糊 -->
<item name="android:windowCloseOnTouchOutside">false</item>
<!-- 重点,去掉标题 -->
<item name="windowNoTitle">true</item>
</style>
</resources>
package com.rv.share;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.base.utils.ui.image.round.RoundImageView;
import com.frame.base.url.Constance;
import com.ruiwenliu.wrapper.base.BaseActivity;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.DisplayUtil;
import com.rv.component.utils.ZxingUtils;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.share.presenter.BillPresenter;
import com.rv.share.view.RvWebView;
import butterknife.BindView;
import butterknife.OnClick;
......@@ -39,38 +27,46 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
TextView tvBackTitle;
@BindView(R2.id.btn_share)
Button btnShare;
@BindView(R2.id.rimg_avatar)
RoundImageView imageView;
@BindView(R2.id.tv_name)
TextView tvName;
@BindView(R2.id.img_zxing)
ImageView imgZxing;
@BindView(R2.id.ll_long_click)
LinearLayout llLongClick;
@BindView(R2.id.ll_bill_content)
LinearLayout llBillContent;
private String testUrl = "https://xxtest.upyuns.com/renovate/Dripcar_2019-7-10_4_1-1-13.apk";
@BindView(R2.id.ll_webview)
LinearLayout llWebView;
private String url;
public static Intent getIntent(Context var1, String var2) {
Intent intent = new Intent(var1, BillActivity.class);
intent.putExtra("billUrl", var2);
return intent;
}
@Override
protected int setLayout() {
return R.layout.activity_bill;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
url = intent.getStringExtra("billUrl");
titleView.setVisibility(View.GONE);
llLongClick.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
mPresenter.showShareDialog(llBillContent);
return false;
}
});
Bitmap success = ZxingUtils.createQRImage(testUrl, DisplayUtil.dip2px(this, 80f), DisplayUtil.dip2px(this, 80f),
BitmapFactory.decodeResource(getResources(), com.rv.home.R.mipmap.ic_launcher));
imgZxing.setImageBitmap(success);
RvWebView view = new RvWebView(getApplicationContext(), listener);
llWebView.addView(view);
view.loadUrl("https://www.baidu.com");
// llLongClick.setOnLongClickListener(new View.OnLongClickListener() {
// @Override
// public boolean onLongClick(View view) {
// mPresenter.showShareDialog(llBillContent);
// return false;
// }
// });
// Bitmap success = ZxingUtils.createQRImage(testUrl, DisplayUtil.dip2px(this, 80f), DisplayUtil.dip2px(this, 80f),
// BitmapFactory.decodeResource(getResources(), com.rv.home.R.mipmap.ic_launcher));
// imgZxing.setImageBitmap(success);
}
@Override
......@@ -83,13 +79,38 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
}
@OnClick({R2.id.tv_back_title, R2.id.btn_share, R2.id.ll_long_click})
@Override
public void onDestroy() {
llWebView.removeAllViews();
super.onDestroy();
}
@OnClick({R2.id.tv_back_title, R2.id.btn_share})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.tv_back_title) {
finish();
} else if (id == R.id.btn_share) {
mPresenter.showShareDialog(llBillContent);
mPresenter.showShareDialog(llWebView);
}
}
private RvWebView.WebViewListener listener = new RvWebView.WebViewListener() {
@Override
public void share(String url, String title, String desc) {
}
@Override
public void shareBill() {
mPresenter.showShareDialog(llWebView);
}
@Override
public void finish() {
}
};
}
package com.rv.share;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.Toast;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.DisplayUtil;
import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.share.presenter.SharePresenter;
import com.rv.share.view.RvWebView;
import butterknife.BindView;
import butterknife.OnClick;
public class ShareActivity extends BaseStatusActivity<SharePresenter> {
@BindView(R2.id.ll_webview_content)
LinearLayout llWebViewContent;
@Override
protected int setLayout() {
return R.layout.activity_share;
......@@ -17,17 +37,66 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> {
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("邀请有礼");
titleView.setImageResource(R.id.iv_title_right, R.drawable.tourism_rv_rentingcar_icon_share);
titleView.setChildClickListener(R.id.iv_title_right, new View.OnClickListener() {
@Override
public void onClick(View view) {
mPresenter.showShareDialog("https://xxtest.upyuns.com/h5/appHtml/view/download.html?userid=1234&test=xxxx", "测试", null);
}
});
// titleView.setVisibility(View.GONE);
RvWebView view = new RvWebView(getApplicationContext(), mListener);
llWebViewContent.addView(view);
view.loadUrl("https://xxtest.upyuns.com/h5/appHtml/view/invitationCourtesy.html");
}
@Override
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_SCROLL:
Log.e("xxxx", "ACTION_SCROLL");
break;
}
return super.onTouchEvent(event);
}
@Override
protected void loadData(Bundle savedInstanceState, Intent intent) {
super.loadData(savedInstanceState, intent);
mPresenter.showShareDialog();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
@Override
public void onDestroy() {
llWebViewContent.removeAllViews();
super.onDestroy();
}
private RvWebView.WebViewListener mListener = new RvWebView.WebViewListener() {
@Override
public void share(String url, String title, String des) {
mPresenter.showShareDialog(url, title, des);
}
@Override
public void shareBill() {
startActivity(new Intent(getApplicationContext(), BillActivity.class));
}
@Override
public void finish() {
ShareActivity.this.finish();
}
};
}
......@@ -6,23 +6,35 @@ import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.share.BillActivity;
import com.rv.share.R;
import com.rv.share.view.ShareChoiceDialog;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.UMShareListener;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMWeb;
import java.io.File;
public class SharePresenter extends CommonPresenter {
private ShareChoiceDialog dialog = null;
private ShareAction shareAction = null;
private String mUrl = null;
private String mTitle = null;
private String mDescript = null;
public void showShareDialog() {
public void showShareDialog(String url, String title, String descript) {
this.mUrl = url;
this.mTitle = title;
this.mDescript = descript;
if (dialog == null) {
dialog = new ShareChoiceDialog.Builder(getPresenterContext())
.setShareListener(myListener)
......@@ -38,29 +50,51 @@ public class SharePresenter extends CommonPresenter {
/******
* 分享地址
* @param var1
* @param var2
*/
private void share(SHARE_MEDIA var1, String var2) {
private void shareWx() {
if (shareAction == null) {
shareAction = new ShareAction((Activity) getPresenterContext()).setCallback(shareListener);
}
shareAction.setPlatform(var1)//传入平台
.withText(var2);//分享内容
UMImage image = new UMImage(getPresenterContext(), R.drawable.common_icon_wechat_pay);
UMWeb web = new UMWeb(mUrl);
web.setTitle(mTitle);//标题
web.setThumb(image); //缩略图
web.setDescription(mDescript);//描述
shareAction.setPlatform(SHARE_MEDIA.WEIXIN)//传入平台
.withMedia(web);
shareAction.share();
}
/******
* 分享地址
*/
private void shareWxC() {
if (shareAction == null) {
shareAction = new ShareAction((Activity) getPresenterContext()).setCallback(shareListener);
}
UMImage image = new UMImage(getPresenterContext(), R.drawable.common_icon_wechat_pay);
UMWeb web = new UMWeb(mUrl);
web.setTitle(mTitle);//标题
web.setThumb(image); //缩略图
shareAction.setPlatform(SHARE_MEDIA.WEIXIN_CIRCLE)//传入平台
.withMedia(web);
shareAction.share();
}
/******
* 分享文件
* @param var1
* @param var2
*/
private void share(SHARE_MEDIA var1, File var2) {
private void shareQQ(SHARE_MEDIA var1, String var2) {
if (shareAction == null) {
shareAction = new ShareAction((Activity) getPresenterContext()).setCallback(shareListener);
}
shareAction.setPlatform(var1)//传入平台
.withFile(var2);//分享内容
.withText(var2);//分享内容
shareAction.share();
}
......@@ -101,27 +135,33 @@ public class SharePresenter extends CommonPresenter {
private ShareChoiceDialog.ShareListener myListener = new ShareChoiceDialog.ShareListener() {
@Override
public void copyShare() {
copy("http://www.baidu.com");
if (!TextUtils.isEmpty(mUrl)) {
copy(mUrl);
}
}
@Override
public void wxShare() {
share(SHARE_MEDIA.WEIXIN, "hello");
if (!TextUtils.isEmpty(mUrl))
shareWx();
}
@Override
public void wxCShare() {
share(SHARE_MEDIA.WEIXIN_CIRCLE, "hello");
if (!TextUtils.isEmpty(mUrl))
shareWxC();
}
@Override
public void qqShare() {
if (!TextUtil.isEmpty(mUrl)) {
shareQQ(SHARE_MEDIA.QQ, mUrl);
}
}
@Override
public void billShare() {
getPresenterContext().startActivity(new Intent(getPresenterContext(), BillActivity.class));
getPresenterContext().startActivity(BillActivity.getIntent(getPresenterContext(), mUrl));
}
@Override
......
package com.rv.share.view;
import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.rv.share.R;
public class ActRuleDialog extends Dialog {
public ActRuleDialog(@NonNull Context context) {
super(context);
}
public ActRuleDialog(Context context, int themeResId) {
super(context, themeResId);
}
// public static class Builder {
//
// private Context mContext;
// private UpdateBean updateBean;
// private Button btn_update;
// private TextView txtContent;
// private TextView tv_version_name;
// private ImageView imgClose;
// private DownloadListener mListener;
//
// public Builder(Context context, DownloadListener listener) {
// mContext = context;
// this.mListener = listener;
// }
//
// public interface DownloadListener {
// void download();
// }
//
// public Builder show() {
// final VersionUpdateDialog dialog = create();
// dialog.show();
// return this;
// }
//
// public Builder setData(UpdateBean updateBean) {
// this.updateBean = updateBean;
// return this;
// }
//
// /**
// * 创建定制的对话框
// */
// public ActRuleDialog create() {
// LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// final VersionUpdateDialog dialog = new VersionUpdateDialog(mContext, R.style.DialogActivityTheme);
// // 获取对话框的布局
// View layout = inflater.inflate(R.layout.dialog_update_view, null);
// // 为对话框添加布局和设置大小
// dialog.addContentView(layout, new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT));
// this.tv_version_name = layout.findViewById(R.id.tv_version_name);
// this.txtContent = layout.findViewById(R.id.txt_content);
// this.btn_update = layout.findViewById(R.id.btn_update);
// this.imgClose = layout.findViewById(R.id.img_close);
// this.btn_update.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// if (mListener != null) {
// mListener.download();
// }
// dialog.dismiss();
// }
// });
//
// this.imgClose.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// dialog.dismiss();
// }
// });
//
// if (this.updateBean != null) {
// if (!TextUtils.isEmpty(this.updateBean.getUpdateInfo())) {
// txtContent.setText(this.updateBean.getUpdateInfo());
// }
//
// if (!TextUtils.isEmpty(this.updateBean.getServerVersionName())) {
// tv_version_name.setText(this.updateBean.getServerVersionName());
// }
// if (updateBean.getForce()) {
// this.imgClose.setVisibility(View.GONE);
// } else {
// this.imgClose.setVisibility(View.VISIBLE);
// }
// }
//
// //默认不能点击对话框其他区域退出 和按返回键退出
// dialog.setCancelable(false);
// dialog.setContentView(layout);
// return dialog;
// }
// }
}
package com.rv.share.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import com.ruiwenliu.wrapper.util.ScaleUtils;
public class ProgressTab extends TextView {
private Paint bgPaint;
private int width;
private int height;
public ProgressTab(Context context, AttributeSet attrs) {
super(context, attrs);
initPaint();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
width = MeasureSpec.getSize(widthMeasureSpec);
height = MeasureSpec.getSize(heightMeasureSpec);
}
/********
* 初始化画笔
*/
private void initPaint() {
bgPaint = new Paint();
bgPaint.setColor(Color.parseColor("#FE6E2F"));
bgPaint.setAntiAlias(true);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
}
}
package com.rv.share.view;
import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.rv.share.R;
public class PromotionDialog extends Dialog {
public PromotionDialog(@NonNull Context context) {
super(context);
}
public PromotionDialog(Context context, int themeResId) {
super(context, themeResId);
}
public static class Builder {
private Context mContext;
private Button button;
private ImageView imgBg;
private ImageView imgClose;
private View.OnClickListener mListener;
public Builder(Context context, View.OnClickListener listener) {
mContext = context;
this.mListener = listener;
}
public Builder show() {
final PromotionDialog dialog = create();
dialog.show();
return this;
}
/**
* 创建定制的对话框
*/
public PromotionDialog create() {
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final PromotionDialog dialog = new PromotionDialog(mContext, R.style.DialogActivityTheme);
// 获取对话框的布局
View layout = inflater.inflate(R.layout.dialog_promotion, null);
// 为对话框添加布局和设置大小
dialog.addContentView(layout, new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT));
this.button = layout.findViewById(R.id.button);
this.imgBg = layout.findViewById(R.id.img_bg);
this.imgClose = layout.findViewById(R.id.img_close);
this.button.setOnClickListener(mListener);
this.imgClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
//默认不能点击对话框其他区域退出 和按返回键退出
dialog.setCancelable(true);
dialog.setContentView(layout);
return dialog;
}
}
}
package com.rv.share.view;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import com.yuyife.okgo.OkGoUtil;
import static com.ruiwenliu.wrapper.weight.webview.SafeWebView.hasKitkat;
public class RvWebView extends WebView {
private ProgressBar progressBar;
private WebViewListener listener;
public RvWebView(Context context, WebViewListener listener) {
super(context);
this.listener = listener;
progressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
progressBar.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 3));//设置宽高属性
addView(progressBar);
initWebview();
}
private void initWebview() {
WebSettings webSettings = getSettings();
if (webSettings == null) return;
// 支持 Js 使用
webSettings.setJavaScriptEnabled(true);
// 开启DOM缓存,默认状态下是不支持LocalStorage的
webSettings.setDomStorageEnabled(true);
// 开启数据库缓存
webSettings.setDatabaseEnabled(true);
// 支持自动加载图片
webSettings.setLoadsImagesAutomatically(hasKitkat());
// 设置 WebView 的缓存模式
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
// 支持启用缓存模式
webSettings.setAppCacheEnabled(true);
// 设置 AppCache 最大缓存值(现在官方已经不提倡使用,已废弃)
// webSettings.setAppCacheMaxSize(8 * 1024 * 1024);
// Android 私有缓存存储,如果你不调用setAppCachePath方法,WebView将不会产生这个目录
webSettings.setAppCachePath(getContext().getCacheDir().getAbsolutePath());
// 数据库路径
// if (!hasKitkat()) {
// webSettings.setDatabasePath(getDatabasePath("html").getPath());
// }
// 关闭密码保存提醒功能
// webSettings.setSavePassword(false);
// 支持缩放
webSettings.setSupportZoom(true);
// 设置 UserAgent 属性
webSettings.setUserAgentString("");
// 允许加载本地 html 文件/false
webSettings.setAllowFileAccess(true);
// 允许通过 file url 加载的 Javascript 读取其他的本地文件,Android 4.1 之前默认是true,在 Android 4.1 及以后默认是false,也就是禁止
webSettings.setAllowFileAccessFromFileURLs(true);
// 允许通过 file url 加载的 Javascript 可以访问其他的源,包括其他的文件和 http,https 等其他的源,
// Android 4.1 之前默认是true,在 Android 4.1 及以后默认是false,也就是禁止
// 如果此设置是允许,则 setAllowFileAccessFromFileURLs 不起做用
webSettings.setAllowUniversalAccessFromFileURLs(true);
addJavascriptInterface(new AndroidJs(), "AndroidJs");
setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
return super.shouldOverrideUrlLoading(view, request);
}
});
setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100) {
progressBar.setVisibility(View.GONE);//加载完网页进度条消失
} else {
progressBar.setVisibility(View.VISIBLE);//开始加载网页时显示进度条
progressBar.setProgress(newProgress);//设置进度值
}
}
});
}
private class AndroidJs {
@JavascriptInterface
public String getToken() {
return OkGoUtil.getToken();
}
@JavascriptInterface
public void share(String url, String title,String desc) {
if (listener != null) {
listener.share(url, title,desc);
}
}
@JavascriptInterface
public void shareBill() {
if (listener != null) {
listener.shareBill();
}
}
@JavascriptInterface
public void finish() {
listener.finish();
}
}
public interface WebViewListener {
void share(String url, String title,String desc);
void shareBill();
void finish();
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
stopLoading();// 停止当前加载
clearMatches();// 清除网页查找的高亮匹配字符。
clearHistory();// 清除当前 WebView 访问的历史记录
clearSslPreferences();//清除ssl信息
clearCache(true);//清空网页访问留下的缓存数据。需要注意的时,由于缓存是全局的,所以只要是WebView用到的缓存都会被清空,即便其他地方也会使用到。该方法接受一个参数,从命名即可看出作用。若设为false,则只清空内存里的资源缓存,而不清空磁盘里的。
loadUrl("about:blank");// 清空当前加载
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
removeJavascriptInterface("AndroidNative");// 向 Web端注入 java 对象
}
destroy();// 生命周期销毁
}
}
package com.rv.share.view;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.design.widget.BottomSheetDialog;
import android.view.View;
import android.widget.TextView;
import com.rv.component.utils.DisplayUtil;
import com.rv.share.R;
/*****
......@@ -29,6 +31,7 @@ public class ShareChoiceDialog implements View.OnClickListener {
private boolean isShowWx = false;
private boolean isShowWxC = false;
private boolean isShowQQ = false;
private int drawableSize = 50;
private ShareChoiceDialog(Context context) {
mContext = context;
......@@ -44,18 +47,33 @@ public class ShareChoiceDialog implements View.OnClickListener {
tvBill = view.findViewById(R.id.tv_bill);
tvCancle = view.findViewById(R.id.tv_cancel);
if (isShowCopy) {
Drawable drawable = mContext.getResources().getDrawable(R.drawable.icon_share_copy);
drawable.setBounds(0, 0, DisplayUtil.dip2px(mContext, drawableSize), DisplayUtil.dip2px(mContext, drawableSize));
tvCopy.setCompoundDrawables(null, drawable, null, null);
tvCopy.setVisibility(View.VISIBLE);
}
if (isShowWx) {
Drawable drawable = mContext.getResources().getDrawable(R.drawable.icon_share_wx);
drawable.setBounds(0, 0, DisplayUtil.dip2px(mContext, drawableSize), DisplayUtil.dip2px(mContext, drawableSize));
tvWx.setCompoundDrawables(null, drawable, null, null);
tvWx.setVisibility(View.VISIBLE);
}
if (isShowWxC) {
Drawable drawable = mContext.getResources().getDrawable(R.drawable.icon_share_cir);
drawable.setBounds(0, 0, DisplayUtil.dip2px(mContext, drawableSize), DisplayUtil.dip2px(mContext, drawableSize));
tvWXC.setCompoundDrawables(null, drawable, null, null);
tvWXC.setVisibility(View.VISIBLE);
}
if (isShowQQ) {
Drawable drawable = mContext.getResources().getDrawable(R.drawable.icon_share_qq);
drawable.setBounds(0, 0, DisplayUtil.dip2px(mContext, drawableSize), DisplayUtil.dip2px(mContext, drawableSize));
tvQQ.setCompoundDrawables(null, drawable, null, null);
tvQQ.setVisibility(View.VISIBLE);
}
if (isShowBill) {
Drawable drawable = mContext.getResources().getDrawable(R.drawable.icon_share_bill);
drawable.setBounds(0, 0, DisplayUtil.dip2px(mContext, drawableSize), DisplayUtil.dip2px(mContext, drawableSize));
tvBill.setCompoundDrawables(null, drawable, null, null);
tvBill.setVisibility(View.VISIBLE);
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="30dp" />
<solid android:color="@color/gray_FFB74B" />
</shape>
\ No newline at end of file
......@@ -53,89 +53,16 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ll_bill_content"
android:id="@+id/ll_webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="380dp"
android:layout_above="@id/ll_bottom"
android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/size_20"
android:background="@drawable/shape_rv_bg_bill"
android:orientation="vertical">
<ImageView
android:scaleType="fitXY"
android:src="@drawable/icon_bill_test"
android:layout_width="match_parent"
android:layout_height="280dp" />
android:orientation="vertical" />
<LinearLayout
android:gravity="left|center_vertical"
android:id="@+id/ll_long_click"
android:layout_width="match_parent"
android:layout_height="@dimen/size_120"
android:orientation="horizontal">
<com.base.utils.ui.image.round.RoundImageView
android:id="@+id/rimg_avatar"
android:layout_width="@dimen/size_60"
android:layout_height="@dimen/size_60"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:src="@drawable/common_icon_avatar_default" />
<LinearLayout
android:layout_marginLeft="@dimen/size_5"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignRight="@id/rimg_avatar"
android:layout_centerVertical="true"
android:gravity="left"
android:orientation="vertical">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="房车旅行家Rose"
android:textSize="@dimen/sp_16" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="邀请你一起参加"
android:textColor="@color/gray_50000000"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_10"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/img_zxing"
android:layout_width="@dimen/size_80"
android:layout_height="@dimen/size_80"
android:scaleType="centerCrop" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="长按领50元现金"
android:textColor="@color/gray_50000000"
android:textSize="@dimen/dp_10" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -7,33 +7,10 @@
android:orientation="vertical"
tools:context=".ShareActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_200"
android:background="@drawable/shape_rv_bg_purple">
<ImageButton
android:id="@+id/imb_act"
android:layout_width="@dimen/size_80"
android:layout_height="@dimen/size_30"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/size_20" />
<LinearLayout
android:layout_width="@dimen/size_200"
android:layout_height="@dimen/dp_40"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<!--<ImageView-->
<!--android:layout_width=""-->
<!--android:layout_height="" />-->
</LinearLayout>
</RelativeLayout>
android:id="@+id/ll_webview_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="300dp"
android:layout_height="300dp"
android:gravity="center_horizontal"
android:minWidth="300dp"
android:orientation="vertical">
<ImageView
android:id="@+id/img_bg"
android:layout_width="300dp"
android:layout_height="300dp"
/>
<Button
android:layout_gravity="bottom"
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="@dimen/size_40"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/size_15"
android:background="@drawable/bg_dialog_btn"
android:gravity="center"
android:text="查看详情"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
</FrameLayout>
<ImageView
android:id="@+id/img_close"
android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_30"
android:layout_marginTop="10dp"
android:src="@drawable/home_icon_close" />
</LinearLayout>
......@@ -2,15 +2,15 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#66ffffff"
android:background="#f7f7f7"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:weightSum="5"
android:orientation="horizontal">
android:orientation="horizontal"
android:weightSum="5">
<TextView
android:id="@+id/tv_copy"
......@@ -19,6 +19,8 @@
android:layout_marginTop="13dp"
android:layout_marginBottom="13dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_copy"
android:drawablePadding="@dimen/dp_10"
android:gravity="center"
android:text="复制链接"
android:visibility="gone" />
......@@ -30,6 +32,8 @@
android:layout_marginTop="13dp"
android:layout_marginBottom="13dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_wx"
android:drawablePadding="@dimen/dp_10"
android:gravity="center"
android:text="微信"
android:visibility="gone" />
......@@ -42,6 +46,8 @@
android:layout_marginTop="13dp"
android:layout_marginBottom="13dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_cir"
android:drawablePadding="@dimen/dp_10"
android:gravity="center"
android:text="朋友圈"
android:visibility="gone" />
......@@ -54,6 +60,8 @@
android:layout_marginTop="13dp"
android:layout_marginBottom="13dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_qq"
android:drawablePadding="@dimen/dp_10"
android:gravity="center"
android:text="QQ"
android:visibility="gone" />
......@@ -66,6 +74,9 @@
android:layout_marginTop="13dp"
android:layout_marginBottom="13dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_bill"
android:drawablePadding="@dimen/dp_10"
android:gravity="center"
android:text="生成海报"
android:visibility="gone" />
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DialogActivityTheme" parent="Theme.AppCompat.Dialog">
<item name="android:windowFrame">@null</item>
<!-- 边框 -->
<item name="android:windowIsFloating">true</item>
<!-- 是否浮现在activity之上 -->
<item name="android:windowIsTranslucent">true</item>
<!-- 半透明 -->
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:backgroundDimEnabled">true</item>
<!-- 模糊 -->
<item name="android:windowCloseOnTouchOutside">false</item>
<!-- 重点,去掉标题 -->
<item name="windowNoTitle">true</item>
</style>
</resources>
//include ':WXPay'
include ':RvFrame', ':plugin_calendar', ':plugin_time', ':module_discovery', ':plugin_imcamera', ':plugin_coupon'
include ':RvFrame'
include ':RvTravel'
include ':RvClient'
include ':RvWrapper'
......@@ -13,9 +13,10 @@ include ':MyFrame'
include ':Banner'
include ':module_mine'
include ':module_camp'
include ':module_tourism'
include ':component_dialog'
include ':component_resource'
include ':module_tourism'
include ':module_discovery'
include ':plugin_login'
include ':plugin_search'
include ':component_utils'
......@@ -23,5 +24,9 @@ include ':plugin_member'
include ':plugin_version'
include ':component_control'
include ':plugin_share'
include ':plugin_calendar'
include ':plugin_time'
include ':plugin_coupon'
include ':plugin_share'
include ':plugin_points'
include ':plugin_imcamera'
\ No newline at end of file
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