Commit 08ab87f5 by mReturn

微信号复制功能

parent d760c979
...@@ -157,7 +157,7 @@ public class MediaChooseAdapter extends RecyclerView.Adapter<MediaChooseAdapter. ...@@ -157,7 +157,7 @@ public class MediaChooseAdapter extends RecyclerView.Adapter<MediaChooseAdapter.
.hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false .hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
.compressSavePath(getPath())//压缩图片保存地址 .compressSavePath(getPath())//压缩图片保存地址
.previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false .previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
// .minimumCompressSize(100)// 小于100kb的图片不压缩 .minimumCompressSize(Constants.MINIMUM_COMPRESSSIZE)// 小于100kb的图片不压缩
.synOrAsy(true);//同步true或异步false 压缩 默认同步、 .synOrAsy(true);//同步true或异步false 压缩 默认同步、
// .enableCrop(true)//是否裁剪 // .enableCrop(true)//是否裁剪
// .freeStyleCropEnabled(true) // .freeStyleCropEnabled(true)
......
...@@ -130,7 +130,7 @@ public class PhotoViewAdapter extends RecyclerView.Adapter<PhotoViewAdapter.Hold ...@@ -130,7 +130,7 @@ public class PhotoViewAdapter extends RecyclerView.Adapter<PhotoViewAdapter.Hold
.hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false .hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
.compressSavePath(getPath())//压缩图片保存地址 .compressSavePath(getPath())//压缩图片保存地址
.previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false .previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
.minimumCompressSize(2*1024)// 小于**kb的图片不压缩 .minimumCompressSize(Constants.MINIMUM_COMPRESSSIZE)// 小于**kb的图片不压缩
.synOrAsy(true);//同步true或异步false 压缩 默认同步、 .synOrAsy(true);//同步true或异步false 压缩 默认同步、
// .enableCrop(true)//是否裁剪 // .enableCrop(true)//是否裁剪
// .freeStyleCropEnabled(true) // .freeStyleCropEnabled(true)
......
...@@ -246,6 +246,7 @@ public class Constants { ...@@ -246,6 +246,7 @@ public class Constants {
public static final int CAMERA_CODE = 100; public static final int CAMERA_CODE = 100;
public static final int CAMERA_IMG = 101; public static final int CAMERA_IMG = 101;
public static final int CAMERA_VIDEO = 102; public static final int CAMERA_VIDEO = 102;
public static final int MINIMUM_COMPRESSSIZE = 4*1024; //图片压缩大小临界值
public static final HashMap<Integer,List<TreeAddressBean>> treeAddressMap = new HashMap<>(); //地址数据 public static final HashMap<Integer,List<TreeAddressBean>> treeAddressMap = new HashMap<>(); //地址数据
/** /**
......
...@@ -13,6 +13,7 @@ import android.widget.ImageView; ...@@ -13,6 +13,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.dayu.baselibrary.R; import com.dayu.baselibrary.R;
import com.dayu.common.BaseApplication;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import com.umeng.socialize.Config; import com.umeng.socialize.Config;
...@@ -68,6 +69,11 @@ public class CommonUtils { ...@@ -68,6 +69,11 @@ public class CommonUtils {
imm.showSoftInput(view, InputMethodManager.SHOW_FORCED); imm.showSoftInput(view, InputMethodManager.SHOW_FORCED);
} }
public static void dialPhone(String phoneNum) {
dialPhone(BaseApplication.getContext(),phoneNum);
}
/** /**
* 拨打电话(跳转到拨号界面,用户手动点击拨打) * 拨打电话(跳转到拨号界面,用户手动点击拨打)
*/ */
......
...@@ -3,6 +3,7 @@ package com.dayu.utils; ...@@ -3,6 +3,7 @@ package com.dayu.utils;
import android.app.Activity; import android.app.Activity;
import android.os.Environment; import android.os.Environment;
import com.dayu.common.Constants;
import com.luck.picture.lib.PictureSelectionModel; import com.luck.picture.lib.PictureSelectionModel;
import com.luck.picture.lib.PictureSelector; import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig; import com.luck.picture.lib.config.PictureConfig;
...@@ -83,7 +84,7 @@ public class MediaChooseUtils { ...@@ -83,7 +84,7 @@ public class MediaChooseUtils {
.hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false .hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
.compressSavePath(getPath())//压缩图片保存地址 .compressSavePath(getPath())//压缩图片保存地址
.previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false .previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
.minimumCompressSize(100)// 小于100kb的图片不压缩 .minimumCompressSize(Constants.MINIMUM_COMPRESSSIZE)// 小于100kb的图片不压缩
// .enableCrop(true)//是否裁剪 // .enableCrop(true)//是否裁剪
// .freeStyleCropEnabled(true) // .freeStyleCropEnabled(true)
.synOrAsy(true); .synOrAsy(true);
......
...@@ -369,4 +369,18 @@ ...@@ -369,4 +369,18 @@
<item name="android:textColor">@color/white</item> <item name="android:textColor">@color/white</item>
</style> </style>
<style name="ll_horizontal">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:orientation">horizontal</item>
<item name="android:gravity">center_vertical</item>
</style>
<style name="fill_horizontal">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">1dp</item>
<item name="android:layout_weight">1</item>
</style>
</resources> </resources>
...@@ -5,8 +5,8 @@ buildscript { ...@@ -5,8 +5,8 @@ buildscript {
ext.build_tools_version = "27.0.3" ext.build_tools_version = "27.0.3"
ext.min_sdk_version = 16 ext.min_sdk_version = 16
ext.target_sdk_version = 26 ext.target_sdk_version = 26
ext.version_code = 252 ext.version_code = 253
ext.verson_name = "2.5.2" ext.verson_name = "2.5.3"
ext.gradle_version = '3.1.4' ext.gradle_version = '3.1.4'
ext.isReleaseMinify = false ext.isReleaseMinify = false
ext.isDebugMinify = false ext.isDebugMinify = false
......
...@@ -28,6 +28,8 @@ public interface HomeUserContract { ...@@ -28,6 +28,8 @@ public interface HomeUserContract {
void toCommonRecord(int type); void toCommonRecord(int type);
void copyWechat(String wechatNum);
/** /**
* 跳转到设置. * 跳转到设置.
......
...@@ -12,6 +12,7 @@ import com.dayu.usercenter.ui.activity2.CashRecordActivity; ...@@ -12,6 +12,7 @@ import com.dayu.usercenter.ui.activity2.CashRecordActivity;
import com.dayu.usercenter.ui.activity2.InvateNewActivity; import com.dayu.usercenter.ui.activity2.InvateNewActivity;
import com.dayu.usercenter.ui.activity2.UserInfoActivity; import com.dayu.usercenter.ui.activity2.UserInfoActivity;
import com.dayu.usercenter.ui.activity2.UserLicenceActivity; import com.dayu.usercenter.ui.activity2.UserLicenceActivity;
import com.dayu.utils.CommonUtils;
/** /**
* Created by luofan * Created by luofan
...@@ -102,6 +103,13 @@ public class HomeUserPresenter extends HomeUserContract.Presenter { ...@@ -102,6 +103,13 @@ public class HomeUserPresenter extends HomeUserContract.Presenter {
public void toCommonRecord(int type) { public void toCommonRecord(int type) {
mView.toCommonRecord(type); mView.toCommonRecord(type);
} }
public void copy(String str) {
mView.copyWechat(str);
}
public void dial(String str) {
CommonUtils.dialPhone(str);
}
} }
package com.dayu.usercenter.ui.fragment; package com.dayu.usercenter.ui.fragment;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
...@@ -148,16 +151,16 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo ...@@ -148,16 +151,16 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
// mBind.tvSaleReward.setText(""+record.getSalesPrice()); // mBind.tvSaleReward.setText(""+record.getSalesPrice());
//// mBind.tvSaleRecord.setText(record.getSalesCount() + ""); //// mBind.tvSaleRecord.setText(record.getSalesCount() + "");
// mBind.tvServiceIncome.setText(""+record.getServiceTotalPrice()); // mBind.tvServiceIncome.setText(""+record.getServiceTotalPrice());
mBind.tvBusinessType.setText(record.getCategoryCounts()+""); mBind.tvBusinessType.setText(record.getCategoryCounts() + "");
} }
@Override @Override
public void setIncomData(UserIncomeBean data) { public void setIncomData(UserIncomeBean data) {
mBind.tvCashArrive.setText("¥"+data.getWithdrawPrice()); mBind.tvCashArrive.setText("¥" + data.getWithdrawPrice());
mBind.tvSaleReward.setText("¥"+data.getSalesRewardPrice()); mBind.tvSaleReward.setText("¥" + data.getSalesRewardPrice());
mBind.tvServiceIncome.setText("¥"+data.getServicePrice()); mBind.tvServiceIncome.setText("¥" + data.getServicePrice());
mBind.tvInvateReward.setText("¥"+data.getInviteRewardPrice()); mBind.tvInvateReward.setText("¥" + data.getInviteRewardPrice());
mBind.tvPlatformReward.setText("¥"+data.getPlatformRewardPrice()); mBind.tvPlatformReward.setText("¥" + data.getPlatformRewardPrice());
} }
...@@ -173,7 +176,15 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo ...@@ -173,7 +176,15 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
@Override @Override
public void toCommonRecord(int type) { public void toCommonRecord(int type) {
CommonRecordActivity.launch(mActivity,type); CommonRecordActivity.launch(mActivity, type);
}
@Override
public void copyWechat(String wechatNum) {
ClipboardManager cm = (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData mClipData = ClipData.newPlainText("", wechatNum);
cm.setPrimaryClip(mClipData);
showToast(R.string.copy_success);
} }
...@@ -190,8 +201,6 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo ...@@ -190,8 +201,6 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
} }
private void showAlertDialog() { private void showAlertDialog() {
CustomDialog dialog = new CustomDialog(mActivity, R.style.CustomDialog, mActivity.getString(R.string.not_set_account) CustomDialog dialog = new CustomDialog(mActivity, R.style.CustomDialog, mActivity.getString(R.string.not_set_account)
, (dialog1, confirm) -> { , (dialog1, confirm) -> {
...@@ -301,12 +310,12 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo ...@@ -301,12 +310,12 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
} }
@Subscribe @Subscribe
public void refreshRecord(RefreshUserRecordEvent event){ public void refreshRecord(RefreshUserRecordEvent event) {
mPresenter.getRecordInfo(); mPresenter.getRecordInfo();
} }
@Subscribe @Subscribe
public void refreshUser(RefreshUserInfoEvent event){ public void refreshUser(RefreshUserInfoEvent event) {
mPresenter.getUserInfo(); mPresenter.getUserInfo();
} }
} }
...@@ -185,8 +185,8 @@ ...@@ -185,8 +185,8 @@
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="15dp" android:layout_marginTop="10dp"
android:layout_marginBottom="15dp" android:layout_marginBottom="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="50dp"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:background="@drawable/personal_center_selector" android:background="@drawable/personal_center_selector"
...@@ -362,23 +362,98 @@ ...@@ -362,23 +362,98 @@
android:text="0" /> android:text="0" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<TextView
style="@style/common_text_style"
android:textSize="15sp"
android:layout_width="match_parent"
android:text="@string/add_service_wechat"
android:paddingLeft="18dp"
/>
<LinearLayout
style="@style/ll_service_wechat"
>
<TextView
style="@style/common_text_style"
android:text="客服1:"
/>
<TextView
style="@style/common_text_style"
android:text="18611425625"
android:textColor="@color/text_common_blue"
android:onClick='@{()->presenter.dial("18611425625")}'
android:layout_marginLeft="10dp"
/>
<View
style="@style/fill_horizontal"
/>
<TextView
style="@style/tv_copy_wecht_btn"
android:onClick='@{()->presenter.copy("18611425625")}'
/>
</LinearLayout>
<LinearLayout
style="@style/ll_service_wechat"
>
<TextView
style="@style/common_text_style"
android:text="客服2:"
/>
<TextView
style="@style/common_text_style"
android:text="18513980231"
android:textColor="@color/text_common_blue"
android:onClick='@{()->presenter.dial("18513980231")}'
android:layout_marginLeft="10dp"
/>
<View
style="@style/fill_horizontal"
/>
<TextView
style="@style/tv_copy_wecht_btn"
android:onClick='@{()->presenter.copy("18513980231")}'
/>
</LinearLayout>
<LinearLayout
style="@style/ll_service_wechat"
android:layout_marginBottom="5dp"
>
<TextView
style="@style/common_text_style"
android:text="客服3:"
/>
<TextView
style="@style/common_text_style"
android:text="18610528225"
android:textColor="@color/text_common_blue"
android:onClick='@{()->presenter.dial("18610528225")}'
android:layout_marginLeft="10dp"
/>
<View
style="@style/fill_horizontal"
/>
<TextView
style="@style/tv_copy_wecht_btn"
android:onClick='@{()->presenter.copy("18610528225")}'
/>
</LinearLayout>
<TextView
android:id="@+id/apply_part"
android:layout_width="match_parent"
android:layout_height="49dp"
android:gravity="center"
android:text="@string/invate_new_reward"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"
android:background="@drawable/btn_blue_commom"
android:layout_margin="15dp"
android:onClick="@{()->presenter.dumpToInvate()}"
/>
</LinearLayout> </LinearLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout> </com.scwang.smartrefresh.layout.SmartRefreshLayout>
<TextView
android:id="@+id/apply_part"
android:layout_width="match_parent"
android:layout_height="49dp"
android:gravity="center"
android:text="@string/invate_new_reward"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"
android:background="@drawable/btn_blue_commom"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="15dp"
android:onClick="@{()->presenter.dumpToInvate()}"
/>
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -40,4 +40,7 @@ ...@@ -40,4 +40,7 @@
<string name="share_finish">分享结束</string> <string name="share_finish">分享结束</string>
<string name="invite_new_share_title">大鱼师傅</string> <string name="invite_new_share_title">大鱼师傅</string>
<string name="invite_new_share_content">邀请师傅瓜分千万佣金!</string> <string name="invite_new_share_content">邀请师傅瓜分千万佣金!</string>
<string name="add_service_wechat">添加客服微信获得更多派单</string>
<string name="copy_wechat_num">复制微信号</string>
<string name="copy_success">复制成功</string>
</resources> </resources>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<style name="ll_user_bottom2"> <style name="ll_user_bottom2">
<item name="android:layout_width">0dp</item> <item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item> <item name="android:layout_weight">1</item>
<item name="android:layout_height">100dp</item> <item name="android:layout_height">86dp</item>
<item name="android:orientation">vertical</item> <item name="android:orientation">vertical</item>
<item name="android:gravity">center_horizontal</item> <item name="android:gravity">center_horizontal</item>
<item name="android:background">@drawable/personal_center_selector</item> <item name="android:background">@drawable/personal_center_selector</item>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<style name="tv_user_bottom1"> <style name="tv_user_bottom1">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">@dimen/dp_16.7</item> <item name="android:layout_marginTop">@dimen/dp_11</item>
<item name="android:textColor">@color/cl_home_title_text_color</item> <item name="android:textColor">@color/cl_home_title_text_color</item>
<item name="android:textSize">14sp</item> <item name="android:textSize">14sp</item>
</style> </style>
...@@ -33,4 +33,18 @@ ...@@ -33,4 +33,18 @@
<item name="android:textSize">22sp</item> <item name="android:textSize">22sp</item>
</style> </style>
<style name="ll_service_wechat" parent="ll_horizontal">
<item name="android:layout_marginLeft">20dp</item>
<item name="android:layout_marginRight">20dp</item>
<item name="android:layout_marginTop">10dp</item>
</style>
<style name="tv_copy_wecht_btn" parent="tv_btn">
<item name="android:layout_width">95dp</item>
<item name="android:layout_height">30dp</item>
<item name="android:text">@string/copy_wechat_num</item>
<item name="android:background">@drawable/btn_blue_commom</item>
<item name="android:textSize">13sp</item>
</style>
</resources> </resources>
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 sign in to comment