Commit 2ab6d2ba authored by mengcuiguang's avatar mengcuiguang

优化来电秀,平台分红等

parent 0c737d5a
package com.android.internal.telephony;
interface ITelephony {
boolean endCall();
void answerRingingCall();
}
......@@ -3,11 +3,13 @@ package com.mints.goodmoney.ad.video;
import android.app.Activity;
import android.text.TextUtils;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.AppConfig;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.mvp.model.VideoAdingBean;
import com.mints.goodmoney.mvp.model.WeightBean;
import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.ToastUtil;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
......@@ -246,9 +248,8 @@ public class VideoAdingManager {
Random r = new Random();
int randomWeight = r.nextInt(weight) + 1;
LogUtil.d(TAG, "2、权重随机值:" + randomWeight);
ToastUtil.show(MintsApplication.getContext(),"权重随机值:" + randomWeight);
for (WeightBean weightBean : weightList) {
// LogUtil.d(TAG, weightBean.getType() + " -> " + weightBean.getWeight());
randomWeight -= weightBean.getWeight();
if (randomWeight <= 0) {
LogUtil.d(TAG, "3、权重结果:" + weightBean.getType());
......
......@@ -80,6 +80,6 @@ public class RingtoneHelper {
}
RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, newUri);
// ToastUtil.show(context,"设置来电铃声成功!");
// ToastUtil.show(context,"设置来电成功!");
}
}
package com.mints.goodmoney.call.preference;
import android.os.Bundle;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
class OpEntry {
static final int OP_TYPE_GET = 1;
static final int OP_TYPE_PUT = 2;
static final int OP_TYPE_CLEAR = 3;
static final int OP_TYPE_REMOVE = 4;
static final int OP_TYPE_COMMIT = 5;
static final int OP_TYPE_APPLY = 6;
static final int VALUE_TYPE_STRING = 1;
static final int VALUE_TYPE_INT = 2;
static final int VALUE_TYPE_LONG = 3;
static final int VALUE_TYPE_FLOAT = 4;
static final int VALUE_TYPE_BOOLEAN = 5;
static final int VALUE_TYPE_STRING_SET = 6;
static final String KEY_KEY = "key_key";
static final String KEY_VALUE = "key_value";
static final String KEY_VALUE_TYPE = "key_value_type";
static final String KEY_OP_TYPE = "key_op_type";
@NonNull
private Bundle bundle;
private OpEntry() {
this.bundle = new Bundle();
}
public OpEntry(@NonNull Bundle bundle) {
this.bundle = bundle;
}
public String getKey() {
return bundle.getString(KEY_KEY, null);
}
public OpEntry setKey(String key) {
bundle.putString(KEY_KEY, key);
return this;
}
public int getValueType() {
return bundle.getInt(KEY_VALUE_TYPE, 0);
}
public OpEntry setValueType(int valueType) {
bundle.putInt(KEY_VALUE_TYPE, valueType);
return this;
}
public int getOpType() {
return bundle.getInt(KEY_OP_TYPE, 0);
}
public OpEntry setOpType(int opType) {
bundle.putInt(KEY_OP_TYPE, opType);
return this;
}
public String getStringValue(String defValue) {
return bundle.getString(KEY_VALUE, defValue);
}
public OpEntry setStringValue(String value) {
bundle.putInt(KEY_VALUE_TYPE, VALUE_TYPE_STRING);
bundle.putString(KEY_VALUE, value);
return this;
}
public int getIntValue(int defValue) {
return bundle.getInt(KEY_VALUE, defValue);
}
public OpEntry setIntValue(int value) {
bundle.putInt(KEY_VALUE_TYPE, VALUE_TYPE_INT);
bundle.putInt(KEY_VALUE, value);
return this;
}
public long getLongValue(long defValue) {
return bundle.getLong(KEY_VALUE, defValue);
}
public OpEntry setLongValue(long value) {
bundle.putInt(KEY_VALUE_TYPE, VALUE_TYPE_LONG);
bundle.putLong(KEY_VALUE, value);
return this;
}
public float getFloatValue(float defValue) {
return bundle.getFloat(KEY_VALUE);
}
public OpEntry setFloatValue(float value) {
bundle.putInt(KEY_VALUE_TYPE, VALUE_TYPE_FLOAT);
bundle.putFloat(KEY_VALUE, value);
return this;
}
public boolean getBooleanValue(boolean defValue) {
return bundle.getBoolean(KEY_VALUE, defValue);
}
public OpEntry setBooleanValue(boolean value) {
bundle.putInt(KEY_VALUE_TYPE, VALUE_TYPE_BOOLEAN);
bundle.putBoolean(KEY_VALUE, value);
return this;
}
public Set<String> getStringSet() {
ArrayList<String> list = bundle.getStringArrayList(KEY_VALUE);
return list == null ? null : new HashSet<>(list);
}
public Bundle getBundle() {
return bundle;
}
public OpEntry setStringSettingsValue(Set<String> value) {
bundle.putInt(KEY_VALUE_TYPE, VALUE_TYPE_STRING_SET);
bundle.putStringArrayList(KEY_VALUE, value == null ? null : new ArrayList<>(value));
return this;
}
static OpEntry obtainGetOperation(String key) {
return new OpEntry()
.setKey(key)
.setOpType(OP_TYPE_GET);
}
static OpEntry obtainPutOperation(String key) {
return new OpEntry()
.setKey(key)
.setOpType(OP_TYPE_PUT);
}
static OpEntry obtainRemoveOperation(String key) {
return new OpEntry()
.setKey(key)
.setOpType(OP_TYPE_REMOVE);
}
static OpEntry obtainClear() {
return new OpEntry()
.setOpType(OP_TYPE_CLEAR);
}
}
package com.mints.goodmoney.call.preference;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import androidx.annotation.NonNull;
import com.mints.goodmoney.common.Constant;
public class PreferenceUtil {
public static final String METHOD_CONTAIN_KEY = "method_contain_key";
public static final String AUTHORITY = Constant.MINTS_PKG_NAME;
public static final Uri URI = Uri.parse("content://" + AUTHORITY);
public static final String METHOD_QUERY_VALUE = "method_query_value";
public static final String METHOD_EIDIT_VALUE = "method_edit";
public static final String METHOD_QUERY_PID = "method_query_pid";
public static final String KEY_VALUES = "key_result";
}
package com.mints.goodmoney.call.preference;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Process;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.collection.ArrayMap;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class SharedPreferenceProvider extends ContentProvider{
private Map<String, MethodProcess> processerMap = new ArrayMap<>();
@Override
public boolean onCreate() {
processerMap.put(PreferenceUtil.METHOD_QUERY_VALUE, methodQueryValues);
processerMap.put(PreferenceUtil.METHOD_CONTAIN_KEY, methodContainKey);
processerMap.put(PreferenceUtil.METHOD_EIDIT_VALUE, methodEditor);
processerMap.put(PreferenceUtil.METHOD_QUERY_PID, methodQueryPid);
return true;
}
@Nullable
@Override
public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) {
throw new UnsupportedOperationException();
}
@Nullable
@Override
public String getType(@NonNull Uri uri) {
throw new UnsupportedOperationException();
}
@Nullable
@Override
public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) {
throw new UnsupportedOperationException();
}
@Override
public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) {
throw new UnsupportedOperationException();
}
@Override
public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) {
throw new UnsupportedOperationException();
}
@Nullable
@Override
public Bundle call(@NonNull String method, @Nullable String arg, @Nullable Bundle extras) {
MethodProcess processer = processerMap.get(method);
return processer == null?null:processer.process(arg, extras);
}
public interface MethodProcess {
Bundle process(@Nullable String arg, @Nullable Bundle extras);
}
private MethodProcess methodQueryPid = new MethodProcess() {
@Override
public Bundle process(@Nullable String arg, @Nullable Bundle extras) {
Bundle bundle = new Bundle();
bundle.putInt(PreferenceUtil.KEY_VALUES, Process.myPid());
return bundle;
}
};
private MethodProcess methodQueryValues = new MethodProcess() {
@Override
public Bundle process(@Nullable String arg, @Nullable Bundle extras) {
if (extras == null) {
throw new IllegalArgumentException("methodQueryValues, extras is null!");
}
Context ctx = getContext();
if (ctx == null) {
throw new IllegalArgumentException("methodQueryValues, ctx is null!");
}
String key = extras.getString(OpEntry.KEY_KEY);
SharedPreferences preferences = ctx.getSharedPreferences(arg, Context.MODE_PRIVATE);
int valueType = extras.getInt(OpEntry.KEY_VALUE_TYPE);
switch (valueType) {
case OpEntry.VALUE_TYPE_BOOLEAN:{
boolean value = preferences.getBoolean(key, extras.getBoolean(OpEntry.KEY_VALUE));
extras.putBoolean(OpEntry.KEY_VALUE, value);
return extras;
}
case OpEntry.VALUE_TYPE_FLOAT:{
float value = preferences.getFloat(key, extras.getFloat(OpEntry.KEY_VALUE));
extras.putFloat(OpEntry.KEY_VALUE, value);
return extras;
}
case OpEntry.VALUE_TYPE_INT:{
int value = preferences.getInt(key, extras.getInt(OpEntry.KEY_VALUE));
extras.putInt(OpEntry.KEY_VALUE, value);
return extras;
}
case OpEntry.VALUE_TYPE_LONG:{
long value = preferences.getLong(key, extras.getLong(OpEntry.KEY_VALUE));
extras.putLong(OpEntry.KEY_VALUE, value);
return extras;
}
case OpEntry.VALUE_TYPE_STRING:{
String value = preferences.getString(key, extras.getString(OpEntry.KEY_VALUE));
extras.putString(OpEntry.KEY_VALUE, value);
return extras;
}
case OpEntry.VALUE_TYPE_STRING_SET:{
Set<String> value = preferences.getStringSet(key, null);
extras.putStringArrayList(OpEntry.KEY_VALUE, value == null?null:new ArrayList<>(value));
return extras;
}
default:{
throw new IllegalArgumentException("unknown valueType:" + valueType);
}
}
}
};
private MethodProcess methodContainKey = new MethodProcess() {
@Override
public Bundle process(@Nullable String arg, @Nullable Bundle extras) {
if (extras == null) {
throw new IllegalArgumentException("methodQueryValues, extras is null!");
}
Context ctx = getContext();
if (ctx == null) {
throw new IllegalArgumentException("methodQueryValues, ctx is null!");
}
String key = extras.getString(OpEntry.KEY_KEY);
SharedPreferences preferences = ctx.getSharedPreferences(arg, Context.MODE_PRIVATE);
extras.putBoolean(PreferenceUtil.KEY_VALUES, preferences.contains(key));
return extras;
}
};
private MethodProcess methodEditor = new MethodProcess() {
@Override
public Bundle process(@Nullable String arg, @Nullable Bundle extras) {
if (extras == null) {
throw new IllegalArgumentException("methodQueryValues, extras is null!");
}
Context ctx = getContext();
if (ctx == null) {
throw new IllegalArgumentException("methodQueryValues, ctx is null!");
}
SharedPreferences preferences = ctx.getSharedPreferences(arg, Context.MODE_PRIVATE);
ArrayList<Bundle> ops = extras.getParcelableArrayList(PreferenceUtil.KEY_VALUES);
if (ops == null) {
ops = new ArrayList<>();
}
SharedPreferences.Editor editor = preferences.edit();
for (Bundle opBundler : ops) {
int opType = opBundler.getInt(OpEntry.KEY_OP_TYPE);
switch (opType) {
case OpEntry.OP_TYPE_PUT: {
editor = editValue(editor, opBundler);
break;
}
case OpEntry.OP_TYPE_REMOVE: {
editor = editor.remove(opBundler.getString(OpEntry.KEY_KEY));
break;
}
case OpEntry.OP_TYPE_CLEAR: {
editor = editor.clear();
break;
}
default: {
throw new IllegalArgumentException("unkonw op type:" + opType);
}
}
}
int applyOrCommit = extras.getInt(OpEntry.KEY_OP_TYPE);
if (applyOrCommit == OpEntry.OP_TYPE_APPLY) {
editor.apply();
return null;
} else if (applyOrCommit == OpEntry.OP_TYPE_COMMIT) {
boolean res = editor.commit();
Bundle bundle = new Bundle();
bundle.putBoolean(PreferenceUtil.KEY_VALUES, res);
return bundle;
} else {
throw new IllegalArgumentException("unknown applyOrCommit:" + applyOrCommit);
}
}
private SharedPreferences.Editor editValue(SharedPreferences.Editor editor, Bundle opBundle) {
String key = opBundle.getString(OpEntry.KEY_KEY);
int valueType = opBundle.getInt(OpEntry.KEY_VALUE_TYPE);
switch (valueType) {
case OpEntry.VALUE_TYPE_BOOLEAN: {
return editor.putBoolean(key, opBundle.getBoolean(OpEntry.KEY_VALUE));
}
case OpEntry.VALUE_TYPE_FLOAT: {
return editor.putFloat(key, opBundle.getFloat(OpEntry.KEY_VALUE));
}
case OpEntry.VALUE_TYPE_INT: {
return editor.putInt(key, opBundle.getInt(OpEntry.KEY_VALUE));
}
case OpEntry.VALUE_TYPE_LONG: {
return editor.putLong(key, opBundle.getLong(OpEntry.KEY_VALUE));
}
case OpEntry.VALUE_TYPE_STRING: {
return editor.putString(key, opBundle.getString(OpEntry.KEY_VALUE));
}
case OpEntry.VALUE_TYPE_STRING_SET: {
ArrayList<String> list = opBundle.getStringArrayList(OpEntry.KEY_VALUE);
if (list == null) {
return editor.putStringSet(key, null);
}
return editor.putStringSet(key, new HashSet<>(list));
}
default: {
throw new IllegalArgumentException("unknown valueType:" + valueType);
}
}
}
};
}
package com.mints.goodmoney.call.util;
import android.content.Context;
import android.text.TextUtils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class Util {
/**
* 复制asset文件到指定目录
*
* @param oldPath asset下的路径
* @param newPath SD卡下保存路径
*/
public static void CopyAssets(Context context, String oldPath, String newPath) {
try {
String[] fileNames = context.getAssets().list(oldPath);// 获取assets目录下的所有文件及目录名
if (fileNames.length > 0) {// 如果是目录
File file = new File(newPath);
file.mkdirs();// 如果文件夹不存在,则递归
for (String fileName : fileNames) {
CopyAssets(context, oldPath + "/" + fileName, newPath + "/" + fileName);
}
} else {// 如果是文件
InputStream is = context.getAssets().open(oldPath);
FileOutputStream fos = new FileOutputStream(new File(newPath));
byte[] buffer = new byte[1024];
int byteCount;
while ((byteCount = is.read(buffer)) != -1) {// 循环从输入流读取
// buffer字节
fos.write(buffer, 0, byteCount);// 将读取的输入流写入到输出流
}
fos.flush();// 刷新缓冲区
is.close();
fos.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static List<String> getAllName(String path) {
if (TextUtils.isEmpty(path)) {
return null;
}
File pathFile = new File(path);
if (pathFile.exists() && pathFile.isDirectory()) {
File[] files = pathFile.listFiles();
if (files == null) {
return null;
}
List<String> result = new ArrayList<>();
for (File file : files) {
result.add(file.getName());
}
return result;
}
return null;
}
}
......@@ -212,10 +212,11 @@ object Constant {
const val MERGE_KEY = "merge_key"
// wrapper type 0-新闻 1-小说
// wrapper type 0-新闻 1-小说 2-平台分红
const val WRAPPER_TYPE = "wrapper_type"
const val WRAPPER_TYPE_NEWS = 0
const val WRAPPER_TYPE_BOOK = 1
const val WRAPPER_TYPE_FRIENDS = 2
//1登录,2提现,3任务
const val RISK_EVENT_ID_LOGIN = 1
......
......@@ -391,7 +391,7 @@ public class UserManager {
return;
}
ps.removeByKey(USER_ID);
// ps.removeByKey(CODE_ID);
ps.removeByKey(CODE_ID);
ps.removeByKey(TOKEN_ID);
ps.removeByKey(REAL_NAME);
ps.removeByKey(IS_TEMP_USER);
......
......@@ -8,6 +8,7 @@ import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.utils.ToastUtil
import com.mints.library.utils.CommonUtils
......@@ -35,9 +36,8 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
ivAboutasIcon.setOnLongClickListener {
ToastUtil.showLong(MintsApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") +
"\n\n 广告代码位:" + AppConfig.user_channel_ad +
"\n\n 头条渠道:" + HumeSDK.getChannel(context) +
"\n\n 头条version:" + HumeSDK.getVersion())
"\n 广告代码位:" + AppConfig.user_channel_ad +
"\n 头条渠道:" + HumeSDK.getChannel(context))
true
}
......
......@@ -17,7 +17,6 @@ import com.mints.goodmoney.mvp.model.VideoAdingBean
import com.mints.goodmoney.mvp.presenters.KylVideoPresenter
import com.mints.goodmoney.mvp.views.KylVideoView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.utils.CacheUtil
import com.mints.goodmoney.utils.MD5
import com.tbruyelle.rxpermissions.RxPermissions
import kotlinx.android.synthetic.main.activity_kyl_video.*
......@@ -66,24 +65,24 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
}
private fun loadVedio(vedioUrl: String) {
jzvdStd.setOnPreparedListener { mp: MediaPlayer ->
cvvVedio.setOnPreparedListener { mp: MediaPlayer ->
mp.start()
mp.isLooping = true
}
jzvdStd?.setVideoPath(vedioUrl)
jzvdStd?.start()
cvvVedio?.setVideoPath(vedioUrl)
cvvVedio?.start()
}
override fun onResume() {
super.onResume()
jzvdStd.resume()
cvvVedio.resume()
}
override fun onPause() {
super.onPause()
jzvdStd.pause()
cvvVedio.pause()
}
override fun onDestroy() {
......@@ -91,10 +90,8 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
if (downloadId != -1) {
PRDownloader.cancel(downloadId)
}
//删除缓存文件
CacheUtil.clearAllCache(context)
videoAdingManager.setVideoAdingListener(null)
videoAdingManager.onDestory()
kylVideoPresenter.detachView()
}
......@@ -194,8 +191,11 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
}
private fun vedioAdingSuccess(adType: String) {
if (downloadVedioSucFlag && !TextUtils.isEmpty(vedioPathName)) {
DetailActivity.startSelf(this@KylVideoActivity, vedioPathName)
if (!downloadVedioSucFlag || TextUtils.isEmpty(vedioPathName)) {
showToast("视频处理中,请稍候")
return
}
DetailActivity.startSelf(this@KylVideoActivity, vedioPathName)
}
}
......@@ -74,7 +74,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_phone.setOnClickListener(this)
item_wechat.setOnClickListener(this)
item_invitedCode.setOnClickListener(this)
// item_invitedCode.setOnClickListener(this)
item_cleanCache.setOnClickListener(this)
item_userAgree.setOnClickListener(this)
item_privacyAgree.setOnClickListener(this)
......@@ -106,13 +106,13 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_wechat.findViewById<TextView>(R.id.tv_right).text = "未授权"
}
// item_invitedCode.findViewById<TextView>(R.id.tv_title).text = "邀请码"
// val invitedCode = resources.getDrawable(R.mipmap.icon_settings_invite)
// invitedCode.setBounds(0, 0, 56, 56)
// item_invitedCode.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(invitedCode, null, null, null)
// item_invitedCode.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
// item_invitedCode.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
// item_invitedCode.findViewById<TextView>(R.id.tv_right).text = "填写邀请码 海量金币等你拿"
item_invitedCode.findViewById<TextView>(R.id.tv_title).text = "邀请码"
val invitedCode = resources.getDrawable(R.mipmap.icon_settings_invite)
invitedCode.setBounds(0, 0, 56, 56)
item_invitedCode.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(invitedCode, null, null, null)
item_invitedCode.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
item_invitedCode.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
item_invitedCode.findViewById<TextView>(R.id.tv_right).text = UserManager.getInstance().codeID
item_cleanCache.findViewById<TextView>(R.id.tv_title).text = "清理缓存"
val cleanCache = ContextCompat.getDrawable(this,R.mipmap.icon_settings_clean)
......
......@@ -5,6 +5,7 @@ import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.fragment.FriendsFragment
import com.mints.goodmoney.ui.fragment.MyZhangyueFragment
import com.mints.goodmoney.ui.fragment.RsNewsFragment
import com.mints.goodmoney.ui.fragment.ZhangyueFragment
......@@ -64,6 +65,15 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
.add(R.id.flWrapper, zhangyueFragment).commit()
}
}
Constant.WRAPPER_TYPE_FRIENDS -> {
tv_title.text = "瓜分百万现金福利"
val friendsFragment = FriendsFragment()
if (!friendsFragment.isAdded) {
// 提交事务
supportFragmentManager.beginTransaction()
.add(R.id.flWrapper, friendsFragment).commit()
}
}
}
}
......
......@@ -197,7 +197,6 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
*/
private fun getDataSuc(list: List<Track>) {
if (::xmlyPlayAdapter.isInitialized) {
xmlyData.clear()
xmlyData.addAll(list)
if (xmlyPage == 1) {
srl_xmly.finishRefresh(true)
......
......@@ -161,7 +161,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) {
// if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FRIENDS) {
if (!TextUtils.isEmpty(UserManager.getInstance().userID)) {
// 刷新分红数据
friendsPresenter.getFriendHallMsg()
......@@ -184,7 +184,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
showRedbox(btn_get_bonus)
}
}
}
// }
}
override fun onPause() {
......
......@@ -415,11 +415,6 @@ class MyFragment : BaseFragment(),
}
var userGold = "0.00"
if (userConfig != null) {
if (BuildConfig.DEBUG) {
item_title_invitecode.text = "-邀请码:" + userConfig!!.userMsg.idcode
} else {
item_title_invitecode.text = "邀请码:" + userConfig!!.userMsg.idcode
}
val allcoinBig = BigDecimal(userConfig!!.userMsg.coin.toString())
val rateBig = BigDecimal("10000")
val cashStr: String = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
......@@ -763,25 +758,10 @@ class MyFragment : BaseFragment(),
readyGo(CoinRecordActivity::class.java)
}
R.id.item_title_invitecode -> {
if (userConfig != null) {
val invitedCode = userConfig!!.userMsg.idcode
if (!TextUtils.isEmpty(invitedCode)) {
showToast("复制成功")
val clipboardManager = mContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
clipboardManager.setPrimaryClip(ClipData.newPlainText("invitecode_copy", invitedCode))
}
}
}
R.id.item_title_invitecode_copy -> {
if (userConfig != null) {
val invitedCode = userConfig!!.userMsg.idcode
if (!TextUtils.isEmpty(invitedCode)) {
showToast("复制成功")
val clipboardManager = mContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
clipboardManager.setPrimaryClip(ClipData.newPlainText("invitecode_copy", invitedCode))
}
}
R.id.item_title_friends -> {
val bundle = Bundle()
bundle.putInt(Constant.WRAPPER_TYPE, Constant.WRAPPER_TYPE_FRIENDS)
readyGo(WrapperActivity::class.java, bundle)
}
}
}
......@@ -1048,8 +1028,7 @@ class MyFragment : BaseFragment(),
iv_right_icon.setOnClickListener(this)
btn_withdraw.setOnClickListener(this)
btn_coinRecord.setOnClickListener(this)
item_title_invitecode.setOnClickListener(this)
item_title_invitecode_copy.setOnClickListener(this)
item_title_friends.setOnClickListener(this)
ll_my_login.setOnClickListener(this)
item_customer_service.setOnClickListener(this)
......
......@@ -16,10 +16,7 @@ import com.mints.goodmoney.mvp.model.PanActionInfo
import com.mints.goodmoney.mvp.model.TurntableBean
import com.mints.goodmoney.mvp.presenters.PanPresenter
import com.mints.goodmoney.mvp.views.PanView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.activitys.MainActivity
import com.mints.goodmoney.ui.activitys.TaskActivity
import com.mints.goodmoney.ui.activitys.WxLoginActivity
import com.mints.goodmoney.ui.activitys.*
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.library.utils.json.JsonUtil
import com.xiangzi.articlesdk.callback.IXzArticleSdkInitCallback
......@@ -148,8 +145,9 @@ class PanFragment : BaseFragment(), PanView {
return
}
val activity: MainActivity? = activity as MainActivity?
activity?.clickTab4Layout()
val bundle = Bundle()
bundle.putInt(Constant.WRAPPER_TYPE, Constant.WRAPPER_TYPE_FRIENDS)
readyGo(WrapperActivity::class.java, bundle)
}
3 -> {
if (!userManager.userIsLogin()) {
......
......@@ -6,7 +6,7 @@
android:background="@color/black">
<com.mints.goodmoney.call.widget.CustomVideoView
android:id="@+id/jzvdStd"
android:id="@+id/cvvVedio"
android:layout_width="match_parent"
android:layout_height="match_parent" />
......@@ -21,13 +21,17 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
<TextView
android:id="@+id/ivSetting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginBottom="100dp"
android:src="@mipmap/ic_launcher_main"
android:layout_marginRight="10dp"
android:layout_marginBottom="120dp"
android:drawableTop="@mipmap/ic_setting_vedio"
android:drawablePadding="4dp"
android:text="设置来电秀"
android:textColor="@color/color_FF9837"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
......
......@@ -26,8 +26,7 @@
<include
android:id="@+id/item_invitedCode"
layout="@layout/item_settings"
android:visibility="gone" />
layout="@layout/item_settings" />
<include
android:id="@+id/item_cleanCache"
......
......@@ -5,7 +5,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<include layout="@layout/header_layout"
android:visibility="gone"/>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_my"
......
......@@ -13,7 +13,7 @@
android:layout_width="70dp"
android:layout_height="70dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
......@@ -28,37 +28,22 @@
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/item_title_invitecode"
app:layout_constraintStart_toEndOf="@id/item_title_avatar"
app:layout_constraintTop_toTopOf="@id/item_title_avatar" />
<TextView
android:id="@+id/item_title_invitecode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:textColor="@color/color_333"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/item_title_avatar"
app:layout_constraintTop_toBottomOf="@id/item_title_id" />
app:layout_constraintLeft_toRightOf="@+id/item_title_avatar"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/item_title_invitecode_copy"
android:id="@+id/item_title_friends"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="6dp"
android:background="@drawable/shape_tv_gold_gury"
android:paddingLeft="10dp"
android:paddingTop="2dp"
android:paddingRight="10dp"
android:paddingBottom="2dp"
android:text="复制"
android:textColor="@color/color_666"
android:textSize="12sp"
android:drawableLeft="@mipmap/ic_friends_enable"
android:drawablePadding="2dp"
android:text="平台分红"
android:textColor="@color/color_FF9837"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/item_title_invitecode"
app:layout_constraintTop_toBottomOf="@id/item_title_id" />
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -3,7 +3,6 @@
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp">
<TextView
......
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