Commit 530c8dd1 authored by jianglx's avatar jianglx

修改Im的界面,修复我的待支付订单页面刷新闪退的问题。修改缓存

parent 4d6e9821
...@@ -630,13 +630,13 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -630,13 +630,13 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void remoteLogin(MessageEventRemoteLogin remoteLogin){ public void remoteLogin(MessageEventRemoteLogin remoteLogin) {
//退出登录 //退出登录
Toast.makeText(getApplicationContext(), "账号远程登录", Toast.LENGTH_SHORT).show(); Toast.makeText(getApplicationContext(), "账号远程登录", Toast.LENGTH_SHORT).show();
hasBindService = false; hasBindService = false;
UtilsManager.getInstance(getApplicationContext()).clearShareData("city_json"); UtilsManager.getInstance(getApplicationContext()).clearShareData("city_json");
UtilsManager.getInstance(getApplicationContext()).setShNull(); UtilsManager.getInstance(getApplicationContext()).setShNull();
RvCache.getInstance(getApplicationContext()).clear(); RvCache.getInstance().clear();
Cookie.clear(getApplicationContext()); Cookie.clear(getApplicationContext());
OkGoUtil.clearToken(); OkGoUtil.clearToken();
ImSetting.logout(); ImSetting.logout();
......
...@@ -21,7 +21,9 @@ import com.frame.base.bean.BeanHeartbeat; ...@@ -21,7 +21,9 @@ import com.frame.base.bean.BeanHeartbeat;
import com.frame.base.manager.MyFrameManager; import com.frame.base.manager.MyFrameManager;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.util.LogUtils; import com.ruiwenliu.wrapper.util.LogUtils;
import com.rv.component.utils.Cookie;
import com.rv.component.utils.LogUtil; import com.rv.component.utils.LogUtil;
import com.rv.component.utils.RvCache;
import com.rv.im.ImSetting; import com.rv.im.ImSetting;
import com.sh.sdk.shareinstall.ShareInstall; import com.sh.sdk.shareinstall.ShareInstall;
import com.squareup.leakcanary.LeakCanary; import com.squareup.leakcanary.LeakCanary;
...@@ -52,6 +54,8 @@ public class RvClientApplication extends FrameApp { ...@@ -52,6 +54,8 @@ public class RvClientApplication extends FrameApp {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
RvCache.init(this);
Cookie.init(this);
ViewTarget.setTagId(R.id.glideIndexTag); ViewTarget.setTagId(R.id.glideIndexTag);
Log.e("xxxxxxxxxxxxxxxxxxxxx", "RvClientApplication_onCreate"); Log.e("xxxxxxxxxxxxxxxxxxxxx", "RvClientApplication_onCreate");
ImSetting.init(this); ImSetting.init(this);
......
...@@ -44,7 +44,7 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> { ...@@ -44,7 +44,7 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
LogUtil.e("zq", "获取网络配置成功,使用服务端返回的配置并更新本地配置"); LogUtil.e("zq", "获取网络配置成功,使用服务端返回的配置并更新本地配置");
config = bean.getData(); config = bean.getData();
AppConfig appConfig = AppConfig.initConfig(config); AppConfig appConfig = AppConfig.initConfig(config);
RvCache.getInstance(mActivity).save(appConfig, CacheEnum.IM_CONFIG); RvCache.getInstance().save(appConfig, CacheEnum.IM_CONFIG);
} }
} }
} }
......
...@@ -79,9 +79,10 @@ dependencies { ...@@ -79,9 +79,10 @@ dependencies {
api 'com.github.bumptech.glide:okhttp3-integration:4.3.1' api 'com.github.bumptech.glide:okhttp3-integration:4.3.1'
api 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0' api 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
implementation 'com.alibaba:fastjson:1.2.21' implementation 'com.alibaba:fastjson:1.2.21'
implementation project(':component_utils') api project(':component_utils')
// implementation files('libs/tbs_sdk_thirdapp_v3.6.0.1310_43612_sharewithdownload_withoutGame_obfs_20180706_163319.jar') // implementation files('libs/tbs_sdk_thirdapp_v3.6.0.1310_43612_sharewithdownload_withoutGame_obfs_20180706_163319.jar')
api 'cn.jiguang.sdk:jpush:3.3.4'
api 'cn.jiguang.sdk:jpush:3.3.4' // 此处以JPush 3.3.4 版本为例。 // 此处以JPush 3.3.4 版本为例。
api 'cn.jiguang.sdk:jcore:2.1.2' // 此处以JCore 2.1.2 版本为例。 api 'cn.jiguang.sdk:jcore:2.1.2'
// 此处以JCore 2.1.2 版本为例。
} }
...@@ -14,7 +14,7 @@ public class AppUtils { ...@@ -14,7 +14,7 @@ public class AppUtils {
public static void logout(Context context) { public static void logout(Context context) {
UtilsManager.getInstance(context).clearShareData("city_json"); UtilsManager.getInstance(context).clearShareData("city_json");
UtilsManager.getInstance(context).setShNull(); UtilsManager.getInstance(context).setShNull();
RvCache.getInstance(context).clear(); RvCache.getInstance().clear();
Cookie.clear(context); Cookie.clear(context);
OkGoUtil.clearToken(); OkGoUtil.clearToken();
EventBus.getDefault().post(new MessageEventLogout()); EventBus.getDefault().post(new MessageEventLogout());
......
...@@ -3,37 +3,45 @@ package com.rv.component.utils; ...@@ -3,37 +3,45 @@ package com.rv.component.utils;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import java.lang.ref.WeakReference;
public class Cookie { public class Cookie {
private final static String COOKIE_FILE = "cookie"; private final static String COOKIE_FILE = "cookie";
private static SharedPreferences preferences; private static SharedPreferences preferences;
private static SharedPreferences getPreference(Context context) { private static WeakReference<Context> weakReference = null;
public static void init(Context context) {
weakReference = new WeakReference<>(context);
}
private static SharedPreferences getPreference() {
if (preferences == null) { if (preferences == null) {
preferences = context.getSharedPreferences(COOKIE_FILE, Context.MODE_PRIVATE); preferences = weakReference.get().getSharedPreferences(COOKIE_FILE, Context.MODE_PRIVATE);
} }
return preferences; return preferences;
} }
public static void save(Context context, String key, String s) { public static void save(Context context, String key, String s) {
getPreference(context).edit().putString(key, s).commit(); getPreference().edit().putString(key, s).commit();
} }
public static void save(Context context, String key, int i) { public static void save(Context context, String key, int i) {
getPreference(context).edit().putInt(key, i).commit(); getPreference().edit().putInt(key, i).commit();
} }
public static void save(Context context, String key, long l) { public static void save(Context context, String key, long l) {
getPreference(context).edit().putLong(key, l).commit(); getPreference().edit().putLong(key, l).commit();
} }
public static void save(Context context, String key, boolean b) { public static void save(Context context, String key, boolean b) {
getPreference(context).edit().putBoolean(key, b).commit(); getPreference().edit().putBoolean(key, b).commit();
} }
public static void save(Context context, String key, float f) { public static void save(Context context, String key, float f) {
getPreference(context).edit().putFloat(key, f).commit(); getPreference().edit().putFloat(key, f).commit();
} }
public static String getStringValue(Context context, String key) { public static String getStringValue(Context context, String key) {
...@@ -41,7 +49,7 @@ public class Cookie { ...@@ -41,7 +49,7 @@ public class Cookie {
} }
public static String getStringValue(Context context, String key, String def) { public static String getStringValue(Context context, String key, String def) {
return getPreference(context).getString(key, def); return getPreference().getString(key, def);
} }
public static int getIntValue(Context context, String key) { public static int getIntValue(Context context, String key) {
...@@ -49,7 +57,7 @@ public class Cookie { ...@@ -49,7 +57,7 @@ public class Cookie {
} }
public static int getIntValue(Context context, String key, int def) { public static int getIntValue(Context context, String key, int def) {
return getPreference(context).getInt(key, def); return getPreference().getInt(key, def);
} }
public static long getLongValue(Context context, String key) { public static long getLongValue(Context context, String key) {
...@@ -57,7 +65,7 @@ public class Cookie { ...@@ -57,7 +65,7 @@ public class Cookie {
} }
public static long getLongValue(Context context, String key, long def) { public static long getLongValue(Context context, String key, long def) {
return getPreference(context).getLong(key, def); return getPreference().getLong(key, def);
} }
public static float getFloatValue(Context context, String key) { public static float getFloatValue(Context context, String key) {
...@@ -65,7 +73,7 @@ public class Cookie { ...@@ -65,7 +73,7 @@ public class Cookie {
} }
public static float getFloatValue(Context context, String key, float def) { public static float getFloatValue(Context context, String key, float def) {
return getPreference(context).getFloat(key, def); return getPreference().getFloat(key, def);
} }
public static boolean getBooleanValue(Context context, String key) { public static boolean getBooleanValue(Context context, String key) {
...@@ -73,10 +81,10 @@ public class Cookie { ...@@ -73,10 +81,10 @@ public class Cookie {
} }
public static boolean getBooleanValue(Context context, String key, boolean def) { public static boolean getBooleanValue(Context context, String key, boolean def) {
return getPreference(context).getBoolean(key, def); return getPreference().getBoolean(key, def);
} }
public static void clear(Context context) { public static void clear(Context context) {
getPreference(context).edit().clear().commit(); getPreference().edit().clear().commit();
} }
} }
...@@ -10,23 +10,28 @@ import java.io.IOException; ...@@ -10,23 +10,28 @@ import java.io.IOException;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
import java.io.ObjectOutputStream; import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.lang.ref.WeakReference;
/****** /******
* 缓存管理 * 缓存管理
*/ */
public class RvCache<T extends Serializable> { public class RvCache<T extends Serializable> {
private static RvCache instance = null; private static RvCache instance = null;
private Context mContext;
private RvCache(Context context) { private static WeakReference<Context> weakReference = null;
this.mContext = context;
private RvCache() {
}
public static void init(Context context) {
weakReference = new WeakReference<>(context);
} }
public static <T> RvCache getInstance(Context context) { public static <T> RvCache getInstance() {
if (instance == null) { if (instance == null) {
synchronized (RvCache.class) { synchronized (RvCache.class) {
if (instance == null) { if (instance == null) {
instance = new RvCache(context); instance = new RvCache();
} }
} }
...@@ -72,7 +77,7 @@ public class RvCache<T extends Serializable> { ...@@ -72,7 +77,7 @@ public class RvCache<T extends Serializable> {
} }
private String getSavePath(CacheEnum anEnum) { private String getSavePath(CacheEnum anEnum) {
return mContext.getCacheDir().getPath() + File.separator + anEnum.getFileName(); return weakReference.get().getCacheDir().getPath() + File.separator + anEnum.getFileName();
} }
......
...@@ -20,6 +20,7 @@ public class MyTimerView extends TextView { ...@@ -20,6 +20,7 @@ public class MyTimerView extends TextView {
private Timer timer; private Timer timer;
private TimerListener mListener; private TimerListener mListener;
private RecyclerView.ViewHolder holder; private RecyclerView.ViewHolder holder;
private MyTimerTask task;
public MyTimerView(Context context, AttributeSet attrs) { public MyTimerView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
...@@ -33,6 +34,10 @@ public class MyTimerView extends TextView { ...@@ -33,6 +34,10 @@ public class MyTimerView extends TextView {
* @param listener * @param listener
*/ */
public void setTime(long efftiveTime, long crTime, RecyclerView.ViewHolder holder, TimerListener listener) { public void setTime(long efftiveTime, long crTime, RecyclerView.ViewHolder holder, TimerListener listener) {
if (task != null) {
task.cancel();
}
task = new MyTimerTask();
this.efftiveTime = efftiveTime; this.efftiveTime = efftiveTime;
this.crTime = crTime; this.crTime = crTime;
this.mListener = listener; this.mListener = listener;
...@@ -109,15 +114,17 @@ public class MyTimerView extends TextView { ...@@ -109,15 +114,17 @@ public class MyTimerView extends TextView {
*/ */
public void startTimer() { public void startTimer() {
timer = new Timer(); timer = new Timer();
timer.schedule(schedule, 0, 1000); timer.schedule(task, 0, 1000);
} }
private TimerTask schedule = new TimerTask() { private class MyTimerTask extends TimerTask {
@Override @Override
public void run() { public void run() {
handler.sendEmptyMessage(0); handler.sendEmptyMessage(0);
} }
}; }
;
private Handler handler = new Handler(Looper.getMainLooper()) { private Handler handler = new Handler(Looper.getMainLooper()) {
@Override @Override
......
...@@ -244,7 +244,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl ...@@ -244,7 +244,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
public void onNext(SignOutEvent event) { public void onNext(SignOutEvent event) {
UtilsManager.getInstance(_mActivity).clearShareData("city_json"); UtilsManager.getInstance(_mActivity).clearShareData("city_json");
UtilsManager.getInstance(_mActivity).setShNull(); UtilsManager.getInstance(_mActivity).setShNull();
RvCache.getInstance(_mActivity).clear(); RvCache.getInstance().clear();
Cookie.clear(_mActivity); Cookie.clear(_mActivity);
OkGoUtil.clearToken(); OkGoUtil.clearToken();
signOut(); signOut();
...@@ -318,7 +318,6 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl ...@@ -318,7 +318,6 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
} else if (id == R.id.tv_item_view_privileges) { } else if (id == R.id.tv_item_view_privileges) {
//会员中心 //会员中心
if (isLogin()) return;
startActivity(MemberCenterActivity.getIntent(_mActivity)); startActivity(MemberCenterActivity.getIntent(_mActivity));
} else if (id == R.id.rl_item_order_all) { } else if (id == R.id.rl_item_order_all) {
...@@ -503,7 +502,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl ...@@ -503,7 +502,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
switch (requestType) { switch (requestType) {
case 0: case 0:
if (result != null) { if (result != null) {
RvCache.getInstance(getContext()).save((UserInfoBean) result, CacheEnum.USER); RvCache.getInstance().save((UserInfoBean) result, CacheEnum.USER);
} }
userInfoData((UserInfoBean) result); userInfoData((UserInfoBean) result);
break; break;
......
...@@ -14,6 +14,10 @@ import android.widget.TextView; ...@@ -14,6 +14,10 @@ import android.widget.TextView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.RvCache;
import com.rv.im.ChatHolderFactory; import com.rv.im.ChatHolderFactory;
import com.rv.im.R; import com.rv.im.R;
import com.rv.im.audio_x.VoiceAnimView; import com.rv.im.audio_x.VoiceAnimView;
...@@ -37,6 +41,7 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -37,6 +41,7 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
private String mLoginUserId; private String mLoginUserId;
private SmileyParser parser; private SmileyParser parser;
private OnClickItemListener listener; private OnClickItemListener listener;
private String myHeaderUrl;
public interface OnClickItemListener { public interface OnClickItemListener {
...@@ -50,6 +55,9 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -50,6 +55,9 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
} }
public ChatContentAdapter(Context context, String mLoginUserId, List<ChatMessage> list, OnClickItemListener listener) { public ChatContentAdapter(Context context, String mLoginUserId, List<ChatMessage> list, OnClickItemListener listener) {
UserInfoBean userInfoBean = (UserInfoBean) RvCache.getInstance().get(CacheEnum.USER);
myHeaderUrl = userInfoBean.getData().getHeadimgurl();
this.mContext = context; this.mContext = context;
this.mLoginUserId = mLoginUserId; this.mLoginUserId = mLoginUserId;
this.messageList = list; this.messageList = list;
...@@ -159,6 +167,10 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -159,6 +167,10 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
listener.call(true); listener.call(true);
} }
}); });
if (!TextUtils.isEmpty(myHeaderUrl)) {
GlideManager.getInstance(mContext).loadImage(myHeaderUrl, holder.ivHeader);
}
} }
private void setToVideoCallContentView(ChatMessage bean, MsgToVideoCallHolder holder) { private void setToVideoCallContentView(ChatMessage bean, MsgToVideoCallHolder holder) {
...@@ -171,6 +183,9 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -171,6 +183,9 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
listener.call(false); listener.call(false);
} }
}); });
if (!TextUtils.isEmpty(myHeaderUrl)) {
GlideManager.getInstance(mContext).loadImage(myHeaderUrl, holder.ivHeader);
}
} }
private void setToTextContentView(ChatMessage bean, MsgToTextHolder holder) { private void setToTextContentView(ChatMessage bean, MsgToTextHolder holder) {
...@@ -190,6 +205,9 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -190,6 +205,9 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
holder.tvRead.setVisibility(View.GONE); holder.tvRead.setVisibility(View.GONE);
} }
holder.ivFailed.setOnClickListener(v -> listener.reSend(bean)); holder.ivFailed.setOnClickListener(v -> listener.reSend(bean));
if (!TextUtils.isEmpty(myHeaderUrl)) {
GlideManager.getInstance(mContext).loadImage(myHeaderUrl, holder.ivHeader);
}
} }
private void setFromTextContentView(ChatMessage bean, MsgFromTextHolder holder) { private void setFromTextContentView(ChatMessage bean, MsgFromTextHolder holder) {
...@@ -240,6 +258,10 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -240,6 +258,10 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
} else { } else {
fillFileInco(holder, bean); fillFileInco(holder, bean);
} }
if (!TextUtils.isEmpty(myHeaderUrl)) {
GlideManager.getInstance(mContext).loadImage(myHeaderUrl, holder.ivHeader);
}
String fileName = null; String fileName = null;
if (bean.getFilePath().contains("/")) { if (bean.getFilePath().contains("/")) {
fileName = bean.getFilePath().substring(bean.getFilePath().lastIndexOf("/") + 1); fileName = bean.getFilePath().substring(bean.getFilePath().lastIndexOf("/") + 1);
...@@ -288,16 +310,20 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -288,16 +310,20 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
.into(new TransformationUtils(holder.chatPic)); .into(new TransformationUtils(holder.chatPic));
} }
if (!TextUtils.isEmpty(myHeaderUrl)) {
GlideManager.getInstance(mContext).loadImage(myHeaderUrl, holder.ivHeader);
}
holder.chatPic.setOnClickListener(v -> listener.onClick(v.getId(), bean)); holder.chatPic.setOnClickListener(v -> listener.onClick(v.getId(), bean));
holder.ivFailed.setOnClickListener(v -> listener.reSend(bean)); holder.ivFailed.setOnClickListener(v -> listener.reSend(bean));
if(bean.getUpLoadStatus() == 1){ if (bean.getUpLoadStatus() == 1) {
holder.progressBar.setVisibility(View.GONE); holder.progressBar.setVisibility(View.GONE);
holder.ivFailed.setVisibility(View.GONE); holder.ivFailed.setVisibility(View.GONE);
holder.tvRead.setVisibility(View.GONE); holder.tvRead.setVisibility(View.GONE);
holder.cycleProgress.setVisibility(View.VISIBLE); holder.cycleProgress.setVisibility(View.VISIBLE);
holder.cycleProgress.setmProgress(bean.getUploadSchedule()); holder.cycleProgress.setmProgress(bean.getUploadSchedule());
}else if (bean.getUpLoadStatus() == 2) { // 上传 成功 } else if (bean.getUpLoadStatus() == 2) { // 上传 成功
holder.cycleProgress.setVisibility(View.GONE); holder.cycleProgress.setVisibility(View.GONE);
if (bean.getMessageStatus() == 0) { if (bean.getMessageStatus() == 0) {
holder.progressBar.setVisibility(View.VISIBLE); holder.progressBar.setVisibility(View.VISIBLE);
...@@ -380,6 +406,9 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -380,6 +406,9 @@ public class ChatContentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
holder.tvRead.setVisibility(View.GONE); holder.tvRead.setVisibility(View.GONE);
} }
holder.ivFailed.setOnClickListener(v -> listener.reSend(bean)); holder.ivFailed.setOnClickListener(v -> listener.reSend(bean));
if (!TextUtils.isEmpty(myHeaderUrl)) {
GlideManager.getInstance(mContext).loadImage(myHeaderUrl, holder.ivHeader);
}
} }
......
...@@ -36,9 +36,7 @@ public class VoiceAnimView extends RelativeLayout { ...@@ -36,9 +36,7 @@ public class VoiceAnimView extends RelativeLayout {
AudioManager mAudioMgr; AudioManager mAudioMgr;
private ImageView ivAnim; private ImageView ivAnim;
private TextView tvTime; private TextView tvTime;
private XSeekBar mSeekBar;
private Context mContext; private Context mContext;
private FrameLayout mFlSeek;
private AnimationDrawable anim; private AnimationDrawable anim;
private String path; private String path;
private boolean showSeekBar; private boolean showSeekBar;
...@@ -75,8 +73,6 @@ public class VoiceAnimView extends RelativeLayout { ...@@ -75,8 +73,6 @@ public class VoiceAnimView extends RelativeLayout {
*/ */
private void setChatDirection(boolean direction) { private void setChatDirection(boolean direction) {
this.direction = direction; this.direction = direction;
mSeekBar = findViewById(R.id.voice_seekbar);
mFlSeek = findViewById(R.id.fl_seek);
if (direction) { if (direction) {
ivAnim = findViewById(R.id.voice_anim_iv_right); ivAnim = findViewById(R.id.voice_anim_iv_right);
tvTime = findViewById(R.id.voice_time_tv_right); tvTime = findViewById(R.id.voice_time_tv_right);
...@@ -98,21 +94,17 @@ public class VoiceAnimView extends RelativeLayout { ...@@ -98,21 +94,17 @@ public class VoiceAnimView extends RelativeLayout {
path = filePath; path = filePath;
content = url; content = url;
mFlSeek.setVisibility(VISIBLE);
tvTime.setText(length + "''"); tvTime.setText(length + "''");
if (length >= SHOW_PRO) { // 10秒显示进度条出来 // if (length >= SHOW_PRO) { // 10秒显示进度条出来
showSeekBar = true; // showSeekBar = true;
} else { // } else {
showSeekBar = false; showSeekBar = false;
} // }
mSeekBar.setMax(length);
mSeekBar.setVisibility(GONE);
LayoutParams params = (LayoutParams) mFlSeek.getLayoutParams(); // LayoutParams params = (LayoutParams) mFlSeek.getLayoutParams();
params.width = DisplayUtil.getVoiceViewWidth(mContext, length); // params.width = DisplayUtil.getVoiceViewWidth(mContext, length);
mFlSeek.setLayoutParams(params);
initListener(); initListener();
initAnim(); initAnim();
...@@ -188,14 +180,14 @@ public class VoiceAnimView extends RelativeLayout { ...@@ -188,14 +180,14 @@ public class VoiceAnimView extends RelativeLayout {
private void initAnim() { private void initAnim() {
anim = (AnimationDrawable) ivAnim.getBackground(); anim = (AnimationDrawable) ivAnim.getBackground();
mSeekBar.stop(); // mSeekBar.stop();
} }
private void initListener() { private void initListener() {
mSeekBar.addOnProgressChangeListener(progress -> { // mSeekBar.addOnProgressChangeListener(progress -> {
int mesc = progress; // int mesc = progress;
VoicePlayer.instance().playSeek(mesc, VoiceAnimView.this); // VoicePlayer.instance().playSeek(mesc, VoiceAnimView.this);
}); // });
} }
// 请求焦点 // 请求焦点
...@@ -241,9 +233,9 @@ public class VoiceAnimView extends RelativeLayout { ...@@ -241,9 +233,9 @@ public class VoiceAnimView extends RelativeLayout {
requestAudioFocus(); requestAudioFocus();
anim.start(); anim.start();
if (showSeekBar) { if (showSeekBar) {
mSeekBar.setProgress(VoiceManager.instance().getProgress()); // mSeekBar.setProgress(VoiceManager.instance().getProgress());
mSeekBar.start(); // 进度滚动开始 // mSeekBar.start(); // 进度滚动开始
mSeekBar.setVisibility(VISIBLE); // mSeekBar.setVisibility(VISIBLE);
} }
} }
...@@ -256,11 +248,11 @@ public class VoiceAnimView extends RelativeLayout { ...@@ -256,11 +248,11 @@ public class VoiceAnimView extends RelativeLayout {
public void stopAnim() { public void stopAnim() {
abandonAudioFocus(); abandonAudioFocus();
mSeekBar.setProgress(0); // mSeekBar.setProgress(0);
resetAnim(); resetAnim();
if (showSeekBar) { if (showSeekBar) {
mSeekBar.stop(); // 进度滚动结束 // mSeekBar.stop(); // 进度滚动结束
mSeekBar.setVisibility(GONE); // mSeekBar.setVisibility(GONE);
} }
} }
......
...@@ -36,10 +36,6 @@ public class MessageDao { ...@@ -36,10 +36,6 @@ public class MessageDao {
} }
} }
public static final MessageDao getInstance(Context context) {
return new MessageDao(context);
}
@Override @Override
protected void finalize() throws Throwable { protected void finalize() throws Throwable {
super.finalize(); super.finalize();
......
...@@ -16,8 +16,8 @@ public class ChatMessageServiceImp implements IChatMessageService { ...@@ -16,8 +16,8 @@ public class ChatMessageServiceImp implements IChatMessageService {
private static ChatMessageServiceImp instance = null; private static ChatMessageServiceImp instance = null;
private ConversationDao conversationDao = null; private ConversationDao conversationDao = null;
private ChatMessageServiceImp(Context context) { public ChatMessageServiceImp(Context context) {
dao = MessageDao.getInstance(context); dao = new MessageDao(context);
conversationDao = ConversationDao.getInstance(context); conversationDao = ConversationDao.getInstance(context);
} }
......
package com.rv.im.util;
/******
* 缓存类型
*/
public enum CacheEnum {
MEMBER(0, "member"), // 会员
USER(1, "user"), // 用户
CONSUMER_RECORD(2, "consumer_record"), // 消费记录
VISTOR_LIST(3, "vistor_list"), //出游人列表
IM_CONFIG(4,"im_config") ;
private int type;
private String fileName;
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
CacheEnum(int type, String fileName) {
this.type = type;
this.fileName = fileName;
}
}
package com.rv.im.util;
import android.content.Context;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
/******
* 缓存管理
*/
public class RvCache<T extends Serializable> {
private static RvCache instance = null;
private Context mContext;
private RvCache(Context context) {
this.mContext = context;
}
public static <T> RvCache getInstance(Context context) {
if (instance == null) {
instance = new RvCache(context);
}
return instance;
}
/********
* 保存
* @param bean
*/
public void save(T bean, CacheEnum anEnum) {
if (bean == null) {
return;
}
saveObject(bean, anEnum);
}
private void saveObject(T bean, CacheEnum anEnum) {
FileOutputStream fos = null;
ObjectOutputStream oos = null;
File f = new File(getSavePath(anEnum));
try {
fos = new FileOutputStream(f);
oos = new ObjectOutputStream(fos);
oos.writeObject(bean);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (oos != null) {
oos.close();
}
if (fos != null) {
fos.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
private String getSavePath(CacheEnum anEnum) {
return mContext.getCacheDir().getPath() + File.separator + anEnum.getFileName();
}
public T get(CacheEnum cacheEnum) {
FileInputStream fis = null;
ObjectInputStream ois = null;
T o = null;
File f = new File(getSavePath(cacheEnum));
if (!f.exists()) {
return null;
}
try {
fis = new FileInputStream(f);
ois = new ObjectInputStream(fis);
o = (T) ois.readObject();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} finally {
try {
if (ois != null) {
ois.close();
}
if (fis != null) {
fis.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return o;
}
public void clear() {
clear(CacheEnum.USER);
clear(CacheEnum.MEMBER);
clear(CacheEnum.VISTOR_LIST);
clear(CacheEnum.CONSUMER_RECORD);
}
public void clear(CacheEnum cacheEnum) {
File f = new File(getSavePath(cacheEnum));
if (f.exists()) {
f.delete();
}
}
}
...@@ -8,6 +8,8 @@ import com.loopj.android.http.AsyncHttpClient; ...@@ -8,6 +8,8 @@ import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler; import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestHandle; import com.loopj.android.http.RequestHandle;
import com.loopj.android.http.RequestParams; import com.loopj.android.http.RequestParams;
import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.RvCache;
import com.rv.im.AppConfig; import com.rv.im.AppConfig;
import com.rv.im.bean.UploadFileResult; import com.rv.im.bean.UploadFileResult;
import com.rv.im.db.table.ChatMessage; import com.rv.im.db.table.ChatMessage;
...@@ -36,7 +38,7 @@ public class UploadEngine { ...@@ -36,7 +38,7 @@ public class UploadEngine {
} }
params.put("validTime", "7"); params.put("validTime", "7");
AsyncHttpClient client = new AsyncHttpClient(true, 0, 0); AsyncHttpClient client = new AsyncHttpClient(true, 0, 0);
AppConfig config = (AppConfig) RvCache.getInstance(context).get(CacheEnum.IM_CONFIG); AppConfig config = (AppConfig) RvCache.getInstance().get(CacheEnum.IM_CONFIG);
if (config == null || TextUtils.isEmpty(config.UPLOAD_URL)) return; if (config == null || TextUtils.isEmpty(config.UPLOAD_URL)) return;
RequestHandle requestHandle = client.post(config.UPLOAD_URL, params, new AsyncHttpResponseHandler() { RequestHandle requestHandle = client.post(config.UPLOAD_URL, params, new AsyncHttpResponseHandler() {
...@@ -50,7 +52,7 @@ public class UploadEngine { ...@@ -50,7 +52,7 @@ public class UploadEngine {
} else { } else {
if (totalSize != 0) { if (totalSize != 0) {
message.setUpLoadStatus(1); message.setUpLoadStatus(1);
int progress = bytesWritten * 100 / totalSize ; int progress = bytesWritten * 100 / totalSize;
message.setUploadSchedule(progress); message.setUploadSchedule(progress);
response.onUpProgress(toUserId, message); response.onUpProgress(toUserId, message);
} }
......
...@@ -2,12 +2,12 @@ package com.rv.im.xmpp; ...@@ -2,12 +2,12 @@ package com.rv.im.xmpp;
import android.util.Log; import android.util.Log;
import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.RvCache;
import com.rv.im.AppConfig; import com.rv.im.AppConfig;
import com.rv.im.ImService; import com.rv.im.ImService;
import com.rv.im.ImSetting; import com.rv.im.ImSetting;
import com.rv.im.db.table.ChatMessage; import com.rv.im.db.table.ChatMessage;
import com.rv.im.util.CacheEnum;
import com.rv.im.util.RvCache;
import com.rv.im.util.ThreadManager; import com.rv.im.util.ThreadManager;
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.SmackException;
...@@ -45,7 +45,7 @@ public class XChatManager { ...@@ -45,7 +45,7 @@ public class XChatManager {
mService = coreService; mService = coreService;
mConnection = connection; mConnection = connection;
mLoginUserId = mService.getUserId(); mLoginUserId = mService.getUserId();
mServerName = ((AppConfig) RvCache.getInstance(ImSetting.getContext()).get(CacheEnum.IM_CONFIG)).XMPPDomain; mServerName = ((AppConfig) RvCache.getInstance().get(CacheEnum.IM_CONFIG)).XMPPDomain;
initXChat(); initXChat();
} }
......
...@@ -11,13 +11,13 @@ import android.os.Message; ...@@ -11,13 +11,13 @@ import android.os.Message;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.RvCache;
import com.rv.im.AppConfig; import com.rv.im.AppConfig;
import com.rv.im.Constants; import com.rv.im.Constants;
import com.rv.im.ImSetting; import com.rv.im.ImSetting;
import com.rv.im.util.AsyncUtils; import com.rv.im.util.AsyncUtils;
import com.rv.im.util.CacheEnum;
import com.rv.im.util.NetworkUtil; import com.rv.im.util.NetworkUtil;
import com.rv.im.util.RvCache;
import org.jivesoftware.smack.AbstractConnectionListener; import org.jivesoftware.smack.AbstractConnectionListener;
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.SmackException;
...@@ -195,7 +195,7 @@ public class XmppConnectionManager { ...@@ -195,7 +195,7 @@ public class XmppConnectionManager {
} }
private void initConfig() { private void initConfig() {
staticConfig = (AppConfig) RvCache.getInstance(mContext).get(CacheEnum.IM_CONFIG); staticConfig = (AppConfig) RvCache.getInstance().get(CacheEnum.IM_CONFIG);
} }
private AppConfig staticConfig = null; private AppConfig staticConfig = null;
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners <corners
android:bottomLeftRadius="@dimen/size_100" android:bottomLeftRadius="@dimen/dp20"
android:bottomRightRadius="@dimen/size_100" android:bottomRightRadius="@dimen/dp20"
android:topLeftRadius="0dp" android:topLeftRadius="0dp"
android:topRightRadius="@dimen/size_100" /> android:topRightRadius="@dimen/dp20" />
<solid android:color="@android:color/white" /> <solid android:color="@android:color/white" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners <corners
android:bottomLeftRadius="@dimen/size_100" android:bottomLeftRadius="@dimen/dp20"
android:bottomRightRadius="@dimen/size_100" android:bottomRightRadius="@dimen/dp20"
android:topLeftRadius="@dimen/size_100" android:topLeftRadius="@dimen/dp20"
android:topRightRadius="0dp" /> android:topRightRadius="0dp" />
<solid android:color="#FFB74B" /> <solid android:color="#FFB74B" />
</shape> </shape>
\ No newline at end of file
...@@ -33,16 +33,16 @@ ...@@ -33,16 +33,16 @@
<ImageButton <ImageButton
android:id="@+id/voice_img_btn" android:id="@+id/voice_img_btn"
android:layout_width="30dp" android:layout_width="27dp"
android:layout_height="30dp" android:layout_height="27dp"
android:background="@drawable/icon_voice" android:background="@drawable/icon_voice"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:padding="3dp" /> android:padding="3dp" />
<ImageButton <ImageButton
android:id="@+id/ib_keyword" android:id="@+id/ib_keyword"
android:layout_width="30dp" android:layout_width="27dp"
android:layout_height="30dp" android:layout_height="27dp"
android:background="@drawable/icon_keyword" android:background="@drawable/icon_keyword"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:padding="3dp" android:padding="3dp"
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
android:background="@drawable/im_voice_button_normal2" android:background="@drawable/im_voice_button_normal2"
android:gravity="center" android:gravity="center"
android:text="@string/motalk_voice_chat_tip_1" android:text="@string/motalk_voice_chat_tip_1"
android:textColor="@color/light_grey" android:textColor="@color/colorMain"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:visibility="gone" /> android:visibility="gone" />
...@@ -99,8 +99,8 @@ ...@@ -99,8 +99,8 @@
<ImageButton <ImageButton
android:id="@+id/emotion_btn" android:id="@+id/emotion_btn"
android:layout_width="@dimen/size_30" android:layout_width="27dp"
android:layout_height="@dimen/size_30" android:layout_height="27dp"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:background="@drawable/emoje" android:background="@drawable/emoje"
...@@ -114,8 +114,8 @@ ...@@ -114,8 +114,8 @@
<ImageButton <ImageButton
android:id="@+id/ib_photo" android:id="@+id/ib_photo"
android:layout_width="@dimen/size_30" android:layout_width="27dp"
android:layout_height="27dp" android:layout_height="25dp"
android:background="@drawable/icon_photo" android:background="@drawable/icon_photo"
android:contentDescription="@string/app_name" /> android:contentDescription="@string/app_name" />
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
android:id="@+id/ll_card" android:id="@+id/ll_card"
android:layout_width="240dp" android:layout_width="240dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp10"
android:background="@drawable/chat_to_warp_bg" android:background="@drawable/chat_to_warp_bg"
android:gravity="right" android:gravity="right"
android:orientation="vertical"> android:orientation="vertical">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
android:layout_width="120dp" android:layout_width="120dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/dp5" android:layout_marginLeft="@dimen/dp10"
android:layout_marginTop="@dimen/chat_head_top" android:layout_marginTop="@dimen/chat_head_top"
android:gravity="left|center_vertical" android:gravity="left|center_vertical"
android:minHeight="30dp" android:minHeight="30dp"
......
...@@ -38,15 +38,14 @@ ...@@ -38,15 +38,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/dp5" android:layout_marginLeft="@dimen/dp10"
android:layout_marginTop="@dimen/chat_head_top" android:layout_marginTop="@dimen/chat_head_top"
android:background="@drawable/shape_from_chat_msg" android:background="@drawable/shape_from_chat_msg"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:maxWidth="210dp" android:maxWidth="210dp"
android:minHeight="30dp" android:minHeight="30dp"
android:paddingLeft="@dimen/dp_10" android:padding="@dimen/dp10"
android:paddingRight="@dimen/dp_10"
android:textColor="@color/colorMain" android:textColor="@color/colorMain"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
tools:text="sdfsdfsdfs" /> tools:text="sdfsdfsdfs" />
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/dp5" android:layout_marginLeft="@dimen/dp10"
android:layout_marginTop="@dimen/chat_head_top" android:layout_marginTop="@dimen/chat_head_top"
android:background="@drawable/chat_to_warp_bg" android:background="@drawable/chat_to_warp_bg"
android:clickable="true" android:clickable="true"
......
...@@ -36,8 +36,9 @@ ...@@ -36,8 +36,9 @@
android:id="@+id/chat_voice" android:id="@+id/chat_voice"
android:layout_width="120dp" android:layout_width="120dp"
android:layout_height="35dp" android:layout_height="35dp"
android:layout_marginLeft="@dimen/dp10"
android:layout_marginBottom="-4dp" android:layout_marginBottom="-4dp"
android:background="@drawable/chat_to_warp_bg" /> android:background="@drawable/shape_from_chat_msg" />
<ImageView <ImageView
android:id="@+id/img_state" android:id="@+id/img_state"
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/dp5" android:layout_marginLeft="@dimen/dp10"
android:layout_marginTop="@dimen/chat_head_top" android:layout_marginTop="@dimen/chat_head_top"
android:background="@drawable/chat_to_warp_bg" android:background="@drawable/chat_to_warp_bg"
android:clickable="true" android:clickable="true"
......
...@@ -76,9 +76,9 @@ ...@@ -76,9 +76,9 @@
<ImageView <ImageView
android:id="@+id/iv_file_icon" android:id="@+id/iv_file_icon"
android:scaleType="centerCrop"
android:layout_width="45dp" android:layout_width="45dp"
android:layout_height="45dp" /> android:layout_height="45dp"
android:scaleType="centerCrop" />
<TextView <TextView
android:id="@+id/tv_file_name" android:id="@+id/tv_file_name"
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
android:id="@+id/iv_header" android:id="@+id/iv_header"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="38dp" android:layout_height="38dp"
android:layout_marginLeft="@dimen/dp10"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:src="@drawable/common_icon_avatar_default" android:src="@drawable/common_icon_avatar_default"
android:transitionName="sharedView" /> android:transitionName="sharedView" />
......
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
android:id="@+id/iv_header" android:id="@+id/iv_header"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="38dp" android:layout_height="38dp"
android:layout_marginLeft="@dimen/dp10"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:src="@drawable/common_icon_avatar_default" android:src="@drawable/common_icon_avatar_default"
android:transitionName="sharedView" /> android:transitionName="sharedView" />
......
...@@ -75,11 +75,10 @@ ...@@ -75,11 +75,10 @@
android:background="@drawable/shape_to_chat_msg" android:background="@drawable/shape_to_chat_msg"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:gravity="right|center_vertical" android:gravity="left|center_vertical"
android:maxWidth="210dp" android:maxWidth="210dp"
android:minHeight="@dimen/size_30" android:minHeight="@dimen/size_30"
android:paddingLeft="@dimen/dp_10" android:padding="@dimen/dp10"
android:paddingRight="@dimen/dp_10"
android:textColor="@color/colorMain" android:textColor="@color/colorMain"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
tools:text="sdfsdfsdfs" /> tools:text="sdfsdfsdfs" />
...@@ -88,6 +87,7 @@ ...@@ -88,6 +87,7 @@
android:id="@+id/iv_header" android:id="@+id/iv_header"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="38dp" android:layout_height="38dp"
android:layout_marginLeft="@dimen/dp10"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:src="@drawable/common_icon_avatar_default" android:src="@drawable/common_icon_avatar_default"
android:transitionName="sharedView" /> android:transitionName="sharedView" />
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
android:id="@+id/iv_header" android:id="@+id/iv_header"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="38dp" android:layout_height="38dp"
android:layout_marginLeft="@dimen/dp10"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:src="@drawable/common_icon_avatar_default" android:src="@drawable/common_icon_avatar_default"
android:transitionName="sharedView" /> android:transitionName="sharedView" />
......
...@@ -66,16 +66,17 @@ ...@@ -66,16 +66,17 @@
</RelativeLayout> </RelativeLayout>
<com.rv.im.audio_x.VoiceAnimView <com.rv.im.audio_x.VoiceAnimView
android:background="@drawable/chat_from_warp_bg"
android:id="@+id/chat_voice" android:id="@+id/chat_voice"
android:layout_width="120dp" android:layout_width="120dp"
android:layout_height="35dp" android:layout_height="35dp"
android:layout_marginBottom="-4dp" /> android:layout_marginBottom="-4dp"
android:background="@drawable/shape_to_chat_msg" />
<com.rv.im.view.RoundImageView <com.rv.im.view.RoundImageView
android:id="@+id/iv_header" android:id="@+id/iv_header"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="38dp" android:layout_height="38dp"
android:layout_marginLeft="@dimen/dp10"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:src="@drawable/common_icon_avatar_default" android:src="@drawable/common_icon_avatar_default"
android:transitionName="sharedView" /> android:transitionName="sharedView" />
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
android:id="@+id/iv_header" android:id="@+id/iv_header"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="38dp" android:layout_height="38dp"
android:layout_marginLeft="@dimen/dp10"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:src="@drawable/common_icon_avatar_default" android:src="@drawable/common_icon_avatar_default"
android:transitionName="sharedView" /> android:transitionName="sharedView" />
......
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
android:layout_height="52dp" android:layout_height="52dp"
android:drawablePadding="8dp" android:drawablePadding="8dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/dialog_normal"/> android:textColor="@color/colorMain" />
</LinearLayout> </LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="@color/Grey_400"/> android:background="@color/Grey_400" />
<LinearLayout <LinearLayout
android:id="@+id/dialog_select_voice_ll" android:id="@+id/dialog_select_voice_ll"
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
android:layout_height="52dp" android:layout_height="52dp"
android:drawablePadding="8dp" android:drawablePadding="8dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/dialog_normal"/> android:textColor="@color/colorMain" />
</LinearLayout> </LinearLayout>
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
android:layout_marginTop="@dimen/dialog_bottom_cancel_margin" android:layout_marginTop="@dimen/dialog_bottom_cancel_margin"
android:background="@color/white" android:background="@color/white"
android:gravity="center" android:gravity="center"
android:text="@string/cancel" android:text="@string/cancel" />
android:textColor="@color/dialog_normal"
android:textStyle="bold"/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
</RelativeLayout> </RelativeLayout>
<FrameLayout <FrameLayout
android:visibility="invisible"
android:id="@+id/fl_seek" android:id="@+id/fl_seek"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="30dp" android:layout_height="30dp"
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<!-- MessageFragment --> <!-- MessageFragment -->
<string name="send">发送</string> <string name="send">发送</string>
<string name="motalk_voice_chat_tip_1">按住 说话</string> <string name="motalk_voice_chat_tip_1">按住 说话</string>
<string name="motalk_voice_chat_tip_2">松开 发送</string> <string name="motalk_voice_chat_tip_2">松开 结束</string>
<string name="motalk_voice_chat_tip_3">手指上滑,取消发送</string> <string name="motalk_voice_chat_tip_3">手指上滑,取消发送</string>
<string name="motalk_voice_chat_tip_4">松开手指,取消发送</string> <string name="motalk_voice_chat_tip_4">松开手指,取消发送</string>
<!-- after add --> <!-- after add -->
......
...@@ -15,15 +15,15 @@ ...@@ -15,15 +15,15 @@
<!-- All customizations that are NOT specific to a particular API-level can go here. --> <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style> </style>
<!-- 给Theme设置backgroud,解决启动黑屏问题,不过这样的启动速度好像变得更慢了一些--> <!--&lt;!&ndash; 给Theme设置backgroud,解决启动黑屏问题,不过这样的启动速度好像变得更慢了一些&ndash;&gt;-->
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!--<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">-->
<item name="android:windowBackground">@drawable/live_backgroud3</item> <!--<item name="android:windowBackground">@drawable/live_backgroud3</item>-->
<item name="windowNoTitle">true</item> <!--<item name="windowNoTitle">true</item>-->
<item name="windowActionBar">false</item> <!--<item name="windowActionBar">false</item>-->
<item name="android:windowContentOverlay">@null</item> <!--<item name="android:windowContentOverlay">@null</item>-->
<item name="android:windowNoTitle">true</item> <!--<item name="android:windowNoTitle">true</item>-->
<item name="android:windowFullscreen">true</item> <!--<item name="android:windowFullscreen">true</item>-->
</style> <!--</style>-->
<style name="IMAnimationStyle" parent="@android:style/Animation.Activity"> <style name="IMAnimationStyle" parent="@android:style/Animation.Activity">
<item name="android:activityOpenEnterAnimation">@anim/pop_in</item> <item name="android:activityOpenEnterAnimation">@anim/pop_in</item>
......
...@@ -119,12 +119,12 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -119,12 +119,12 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayout.VERTICAL, false)); recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayout.VERTICAL, false));
// MemberListBean listBean = MemberCache.getInstance(MemberCenterActivity.this).get(); // MemberListBean listBean = MemberCache.getInstance(MemberCenterActivity.this).get();
MemberListBean listBean = (MemberListBean) RvCache.getInstance(MemberCenterActivity.this).get(CacheEnum.MEMBER); MemberListBean listBean = (MemberListBean) RvCache.getInstance().get(CacheEnum.MEMBER);
if (listBean != null && listBean.getData() != null) { if (listBean != null && listBean.getData() != null) {
adapter = new MemberListAdapter(listBean.getData(), memberLevel, freeUseDay, MemberCenterActivity.this, payListener); adapter = new MemberListAdapter(listBean.getData(), memberLevel, freeUseDay, MemberCenterActivity.this, payListener);
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);
} }
UserInfoBean bean = (UserInfoBean) RvCache.getInstance(MemberCenterActivity.this).get(CacheEnum.USER); UserInfoBean bean = (UserInfoBean) RvCache.getInstance().get(CacheEnum.USER);
if (bean != null) { if (bean != null) {
setUserInfoData(bean); setUserInfoData(bean);
} }
...@@ -192,7 +192,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -192,7 +192,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
case 0: case 0:
MemberListBean listBean = (MemberListBean) result; MemberListBean listBean = (MemberListBean) result;
if (listBean != null && listBean.isRel() && listBean.getData() != null && !listBean.getData().isEmpty()) { if (listBean != null && listBean.isRel() && listBean.getData() != null && !listBean.getData().isEmpty()) {
RvCache.getInstance(getApplicationContext()).save(listBean, CacheEnum.MEMBER); RvCache.getInstance().save(listBean, CacheEnum.MEMBER);
// MemberCache.getInstance(getApplicationContext()).save(listBean); // MemberCache.getInstance(getApplicationContext()).save(listBean);
if (adapter == null) { if (adapter == null) {
adapter = new MemberListAdapter(listBean.getData(), memberLevel, freeUseDay, MemberCenterActivity.this, payListener); adapter = new MemberListAdapter(listBean.getData(), memberLevel, freeUseDay, MemberCenterActivity.this, payListener);
...@@ -203,7 +203,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -203,7 +203,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
} }
break; break;
case 1: case 1:
RvCache.getInstance(getApplicationContext()).save((UserInfoBean) result, CacheEnum.USER); RvCache.getInstance().save((UserInfoBean) result, CacheEnum.USER);
setUserInfoData((UserInfoBean) result); setUserInfoData((UserInfoBean) result);
break; break;
case 2: case 2:
......
...@@ -75,7 +75,7 @@ public class PointsActivity extends BaseStatusActivity<PointPresenter> { ...@@ -75,7 +75,7 @@ public class PointsActivity extends BaseStatusActivity<PointPresenter> {
finish(); finish();
} }
}); });
userInfo = (UserInfoBean) RvCache.getInstance(getApplicationContext()).get(CacheEnum.USER); userInfo = (UserInfoBean) RvCache.getInstance().get(CacheEnum.USER);
if (userInfo != null && userInfo.getData() != null) { if (userInfo != null && userInfo.getData() != null) {
if (!TextUtils.isEmpty(userInfo.getData().getHeadimgurl())) { if (!TextUtils.isEmpty(userInfo.getData().getHeadimgurl())) {
GlideManager.getInstance(getApplicationContext()).loadImage(userInfo.getData().getHeadimgurl(), imageView); GlideManager.getInstance(getApplicationContext()).loadImage(userInfo.getData().getHeadimgurl(), imageView);
......
...@@ -105,7 +105,7 @@ public class PosterActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -105,7 +105,7 @@ public class PosterActivity extends BaseStatusActivity<CommonPresenter> {
.disallowHardwareConfig()) .disallowHardwareConfig())
.into(utils); .into(utils);
UserInfoBean userInfoBean = (UserInfoBean) RvCache.getInstance(getApplicationContext()).get(CacheEnum.USER); UserInfoBean userInfoBean = (UserInfoBean) RvCache.getInstance().get(CacheEnum.USER);
if (userInfoBean != null && userInfoBean.getData() != null) { if (userInfoBean != null && userInfoBean.getData() != null) {
String name = userInfoBean.getData().getNickname(); String name = userInfoBean.getData().getNickname();
String url = userInfoBean.getData().getHeadimgurl(); String url = userInfoBean.getData().getHeadimgurl();
......
...@@ -60,7 +60,7 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter ...@@ -60,7 +60,7 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter
@BindView(R2.id.ll_bill_content) @BindView(R2.id.ll_bill_content)
CardView llBillContent; CardView llBillContent;
@BindView(R2.id.img_bill_top) @BindView(R2.id.img_bill_top)
ImageView imgBillTop ; ImageView imgBillTop;
// @BindView(R2.id.ll_content) // @BindView(R2.id.ll_content)
// LinearLayout llContent; // LinearLayout llContent;
...@@ -80,7 +80,7 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter ...@@ -80,7 +80,7 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter
titleView.setVisibility(View.GONE); titleView.setVisibility(View.GONE);
url = intent.getStringExtra("url"); url = intent.getStringExtra("url");
if (!TextUtils.isEmpty(url)) { if (!TextUtils.isEmpty(url)) {
Bitmap bitmap = ZxingUtils.createQRImage(url, DisplayUtil.dip2px(this, 150), DisplayUtil.dip2px(this, 150), BitmapFactory.decodeResource(getResources(),R.mipmap.logo)); Bitmap bitmap = ZxingUtils.createQRImage(url, DisplayUtil.dip2px(this, 150), DisplayUtil.dip2px(this, 150), BitmapFactory.decodeResource(getResources(), R.mipmap.logo));
imgQrcode.setImageBitmap(bitmap); imgQrcode.setImageBitmap(bitmap);
} }
...@@ -96,12 +96,12 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter ...@@ -96,12 +96,12 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter
.disallowHardwareConfig()) .disallowHardwareConfig())
.into(utils); .into(utils);
UserInfoBean userInfoBean = (UserInfoBean) RvCache.getInstance(getApplicationContext()).get(CacheEnum.USER); UserInfoBean userInfoBean = (UserInfoBean) RvCache.getInstance().get(CacheEnum.USER);
String name = userInfoBean.getData().getNickname(); String name = userInfoBean.getData().getNickname();
String url = userInfoBean.getData().getHeadimgurl(); String url = userInfoBean.getData().getHeadimgurl();
if (!TextUtils.isEmpty(url)) { if (!TextUtils.isEmpty(url)) {
GlideManager.getInstance(getApplicationContext()).loadImage(url, roundImageView,R.drawable.icon_bill_defult); GlideManager.getInstance(getApplicationContext()).loadImage(url, roundImageView, R.drawable.icon_bill_defult);
} }
if (!TextUtils.isEmpty(name)) { if (!TextUtils.isEmpty(name)) {
tvPhone.setText(name); tvPhone.setText(name);
......
...@@ -114,7 +114,7 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> { ...@@ -114,7 +114,7 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> {
@Override @Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) { protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("我的邀请码"); titleView.setTitle("推广有奖");
} }
private void getPersonShareInfo() { private void getPersonShareInfo() {
......
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