Commit 08ab87f5 by mReturn

微信号复制功能

parent d760c979
......@@ -157,7 +157,7 @@ public class MediaChooseAdapter extends RecyclerView.Adapter<MediaChooseAdapter.
.hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
.compressSavePath(getPath())//压缩图片保存地址
.previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
// .minimumCompressSize(100)// 小于100kb的图片不压缩
.minimumCompressSize(Constants.MINIMUM_COMPRESSSIZE)// 小于100kb的图片不压缩
.synOrAsy(true);//同步true或异步false 压缩 默认同步、
// .enableCrop(true)//是否裁剪
// .freeStyleCropEnabled(true)
......
......@@ -130,7 +130,7 @@ public class PhotoViewAdapter extends RecyclerView.Adapter<PhotoViewAdapter.Hold
.hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
.compressSavePath(getPath())//压缩图片保存地址
.previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
.minimumCompressSize(2*1024)// 小于**kb的图片不压缩
.minimumCompressSize(Constants.MINIMUM_COMPRESSSIZE)// 小于**kb的图片不压缩
.synOrAsy(true);//同步true或异步false 压缩 默认同步、
// .enableCrop(true)//是否裁剪
// .freeStyleCropEnabled(true)
......
......@@ -246,6 +246,7 @@ public class Constants {
public static final int CAMERA_CODE = 100;
public static final int CAMERA_IMG = 101;
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<>(); //地址数据
/**
......
......@@ -13,6 +13,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.dayu.baselibrary.R;
import com.dayu.common.BaseApplication;
import com.dayu.common.Constants;
import com.umeng.analytics.MobclickAgent;
import com.umeng.socialize.Config;
......@@ -68,6 +69,11 @@ public class CommonUtils {
imm.showSoftInput(view, InputMethodManager.SHOW_FORCED);
}
public static void dialPhone(String phoneNum) {
dialPhone(BaseApplication.getContext(),phoneNum);
}
/**
* 拨打电话(跳转到拨号界面,用户手动点击拨打)
*/
......
......@@ -3,6 +3,7 @@ package com.dayu.utils;
import android.app.Activity;
import android.os.Environment;
import com.dayu.common.Constants;
import com.luck.picture.lib.PictureSelectionModel;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
......@@ -83,7 +84,7 @@ public class MediaChooseUtils {
.hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
.compressSavePath(getPath())//压缩图片保存地址
.previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
.minimumCompressSize(100)// 小于100kb的图片不压缩
.minimumCompressSize(Constants.MINIMUM_COMPRESSSIZE)// 小于100kb的图片不压缩
// .enableCrop(true)//是否裁剪
// .freeStyleCropEnabled(true)
.synOrAsy(true);
......
......@@ -369,4 +369,18 @@
<item name="android:textColor">@color/white</item>
</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>
......@@ -5,8 +5,8 @@ buildscript {
ext.build_tools_version = "27.0.3"
ext.min_sdk_version = 16
ext.target_sdk_version = 26
ext.version_code = 252
ext.verson_name = "2.5.2"
ext.version_code = 253
ext.verson_name = "2.5.3"
ext.gradle_version = '3.1.4'
ext.isReleaseMinify = false
ext.isDebugMinify = false
......
......@@ -28,6 +28,8 @@ public interface HomeUserContract {
void toCommonRecord(int type);
void copyWechat(String wechatNum);
/**
* 跳转到设置.
......
......@@ -12,6 +12,7 @@ import com.dayu.usercenter.ui.activity2.CashRecordActivity;
import com.dayu.usercenter.ui.activity2.InvateNewActivity;
import com.dayu.usercenter.ui.activity2.UserInfoActivity;
import com.dayu.usercenter.ui.activity2.UserLicenceActivity;
import com.dayu.utils.CommonUtils;
/**
* Created by luofan
......@@ -102,6 +103,13 @@ public class HomeUserPresenter extends HomeUserContract.Presenter {
public void toCommonRecord(int 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;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
......@@ -148,16 +151,16 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
// mBind.tvSaleReward.setText(""+record.getSalesPrice());
//// mBind.tvSaleRecord.setText(record.getSalesCount() + "");
// mBind.tvServiceIncome.setText(""+record.getServiceTotalPrice());
mBind.tvBusinessType.setText(record.getCategoryCounts()+"");
mBind.tvBusinessType.setText(record.getCategoryCounts() + "");
}
@Override
public void setIncomData(UserIncomeBean data) {
mBind.tvCashArrive.setText("¥"+data.getWithdrawPrice());
mBind.tvSaleReward.setText("¥"+data.getSalesRewardPrice());
mBind.tvServiceIncome.setText("¥"+data.getServicePrice());
mBind.tvInvateReward.setText("¥"+data.getInviteRewardPrice());
mBind.tvPlatformReward.setText("¥"+data.getPlatformRewardPrice());
mBind.tvCashArrive.setText("¥" + data.getWithdrawPrice());
mBind.tvSaleReward.setText("¥" + data.getSalesRewardPrice());
mBind.tvServiceIncome.setText("¥" + data.getServicePrice());
mBind.tvInvateReward.setText("¥" + data.getInviteRewardPrice());
mBind.tvPlatformReward.setText("¥" + data.getPlatformRewardPrice());
}
......@@ -173,7 +176,15 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
@Override
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
}
private void showAlertDialog() {
CustomDialog dialog = new CustomDialog(mActivity, R.style.CustomDialog, mActivity.getString(R.string.not_set_account)
, (dialog1, confirm) -> {
......@@ -301,12 +310,12 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
}
@Subscribe
public void refreshRecord(RefreshUserRecordEvent event){
public void refreshRecord(RefreshUserRecordEvent event) {
mPresenter.getRecordInfo();
}
@Subscribe
public void refreshUser(RefreshUserInfoEvent event){
public void refreshUser(RefreshUserInfoEvent event) {
mPresenter.getUserInfo();
}
}
......@@ -185,8 +185,8 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<TextView
......@@ -224,7 +224,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_height="50dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/personal_center_selector"
......@@ -362,10 +362,83 @@
android:text="0" />
</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>
</android.support.v4.widget.NestedScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
<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"
......@@ -375,10 +448,12 @@
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:layout_margin="15dp"
android:onClick="@{()->presenter.dumpToInvate()}"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -40,4 +40,7 @@
<string name="share_finish">分享结束</string>
<string name="invite_new_share_title">大鱼师傅</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>
......@@ -11,7 +11,7 @@
<style name="ll_user_bottom2">
<item name="android:layout_width">0dp</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:gravity">center_horizontal</item>
<item name="android:background">@drawable/personal_center_selector</item>
......@@ -20,7 +20,7 @@
<style name="tv_user_bottom1">
<item name="android:layout_width">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:textSize">14sp</item>
</style>
......@@ -33,4 +33,18 @@
<item name="android:textSize">22sp</item>
</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>
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