|
@@ -83,7 +83,7 @@ import java.util.List;
|
|
|
public class MainActivity extends BaseActivity implements NetWorkObserver, AuthStateListener {
|
|
public class MainActivity extends BaseActivity implements NetWorkObserver, AuthStateListener {
|
|
|
public final static String SIP_PASSWORD = "ms_2014_0528@sk!@#";
|
|
public final static String SIP_PASSWORD = "ms_2014_0528@sk!@#";
|
|
|
public static String HASHCODE = "MainActivity";
|
|
public static String HASHCODE = "MainActivity";
|
|
|
- private static final String TIME_MAIN = "TIMEMAIN";
|
|
|
|
|
|
|
+ public static final String TIME_MAIN = "TIMEMAIN";
|
|
|
public static long timeMin=-1;
|
|
public static long timeMin=-1;
|
|
|
public static boolean isUnReadWork; //判断我的空间是否有新内容
|
|
public static boolean isUnReadWork; //判断我的空间是否有新内容
|
|
|
public final static int SIP_SERVER_PORT = 5060;// 端口
|
|
public final static int SIP_SERVER_PORT = 5060;// 端口
|
|
@@ -182,13 +182,13 @@ public class MainActivity extends BaseActivity implements NetWorkObserver, AuthS
|
|
|
changeFragment(mBusinessCircleFragment, TAG_BusinessCircle);//发现
|
|
changeFragment(mBusinessCircleFragment, TAG_BusinessCircle);//发现
|
|
|
getSupportActionBar().setTitle("通讯录");
|
|
getSupportActionBar().setTitle("通讯录");
|
|
|
|
|
|
|
|
- } else if (checkedId == R.id.main_tab_three) {
|
|
|
|
|
|
|
+ } else if (checkedId == R.id.main_tab_three) { //点击工作选项
|
|
|
if (mWorksFragment == null) {
|
|
if (mWorksFragment == null) {
|
|
|
mWorksFragment = new WorksFragment();
|
|
mWorksFragment = new WorksFragment();
|
|
|
}
|
|
}
|
|
|
- changeFragment(mWorksFragment, TAG_NEARBY);//附近
|
|
|
|
|
|
|
+ changeFragment(mWorksFragment, TAG_NEARBY);//
|
|
|
getSupportActionBar().setTitle(R.string.nearby);
|
|
getSupportActionBar().setTitle(R.string.nearby);
|
|
|
- PreferenceUtils.putLong(mContext, TIME_MAIN, timeMin);
|
|
|
|
|
|
|
+// PreferenceUtils.putLong(mContext, TIME_MAIN, timeMin);
|
|
|
unWorkReadTV.setVisibility(View.GONE);
|
|
unWorkReadTV.setVisibility(View.GONE);
|
|
|
}
|
|
}
|
|
|
/* else if (checkedId == R.id.main_tab_four) {
|
|
/* else if (checkedId == R.id.main_tab_four) {
|
|
@@ -210,6 +210,13 @@ public class MainActivity extends BaseActivity implements NetWorkObserver, AuthS
|
|
|
private AppConfig config;
|
|
private AppConfig config;
|
|
|
private String mLoginUserId;
|
|
private String mLoginUserId;
|
|
|
|
|
|
|
|
|
|
+ public void changeRedZone(boolean b){
|
|
|
|
|
+ if (b){
|
|
|
|
|
+ unWorkReadTV.setVisibility(View.VISIBLE);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ unWorkReadTV.setVisibility(View.GONE);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
private void requestMyBusiness() {
|
|
private void requestMyBusiness() {
|
|
|
if (config == null) {
|
|
if (config == null) {
|
|
|
config = MyApplication.getInstance().getConfig();
|
|
config = MyApplication.getInstance().getConfig();
|
|
@@ -233,36 +240,19 @@ public class MainActivity extends BaseActivity implements NetWorkObserver, AuthS
|
|
|
if (success) {
|
|
if (success) {
|
|
|
List<CircleMessage> datas = result.getData();
|
|
List<CircleMessage> datas = result.getData();
|
|
|
if (datas != null && datas.size() > 0) { // 没有更多数据
|
|
if (datas != null && datas.size() > 0) { // 没有更多数据
|
|
|
-// FileDataHelper.writeFileData(mContext, mLoginUserId, FileDataHelper.FILE_BUSINESS_CIRCLE, result);
|
|
|
|
|
long newTime=datas.get(0).getTime(); //获取最新时间
|
|
long newTime=datas.get(0).getTime(); //获取最新时间
|
|
|
long oldTime= PreferenceUtils.getLong(mContext, TIME_MAIN); //获取以前时间
|
|
long oldTime= PreferenceUtils.getLong(mContext, TIME_MAIN); //获取以前时间
|
|
|
|
|
+
|
|
|
if (newTime>oldTime){//当有新消息
|
|
if (newTime>oldTime){//当有新消息
|
|
|
|
|
+ Log.i("gongpengming","newTime="+newTime+"@@@ oldTime="+oldTime);
|
|
|
unWorkReadTV.setVisibility(View.VISIBLE);
|
|
unWorkReadTV.setVisibility(View.VISIBLE);
|
|
|
|
|
+
|
|
|
timeMin=newTime;
|
|
timeMin=newTime;
|
|
|
isUnReadWork = true;
|
|
isUnReadWork = true;
|
|
|
}else{
|
|
}else{
|
|
|
unWorkReadTV.setVisibility(View.GONE);
|
|
unWorkReadTV.setVisibility(View.GONE);
|
|
|
isUnReadWork = false;
|
|
isUnReadWork = false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-// if (datas.get(0).getTime() > 0) {
|
|
|
|
|
-// long time;
|
|
|
|
|
-// if (timeMin ==-1) {
|
|
|
|
|
-// time = PreferenceUtils.getLong(mContext, TIME_MILL);
|
|
|
|
|
-// } else {
|
|
|
|
|
-// time = timeMin;
|
|
|
|
|
-// }
|
|
|
|
|
-// if (time != datas.get(0).getTime()) {
|
|
|
|
|
-// unWorkReadTV.setVisibility(View.VISIBLE);
|
|
|
|
|
-// timeMin = datas.get(0).getTime();
|
|
|
|
|
-// isUnReadWork = true;
|
|
|
|
|
-//// mWorksFragment.onClickFragment(true);
|
|
|
|
|
-// } else {
|
|
|
|
|
-//// mWorksFragment.onClickFragment(false);
|
|
|
|
|
-// unWorkReadTV.setVisibility(View.GONE);
|
|
|
|
|
-//// isUnReadWork = false;
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
} else {
|
|
} else {
|
|
|
unWorkReadTV.setVisibility(View.GONE);
|
|
unWorkReadTV.setVisibility(View.GONE);
|
|
|
isUnReadWork = false;
|
|
isUnReadWork = false;
|