2
This commit is contained in:
@@ -1199,6 +1199,20 @@ public class MainActivity extends BaseActivity implements
|
|||||||
|
|
||||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||||
|
|
||||||
|
if (!UIUtils.isLogined() && (checkedId == R.id.tab_rbn_kepu || checkedId == R.id.tab_rbn_donation)) {
|
||||||
|
BaseApplication.auto_show_unimp = false;
|
||||||
|
main_radiogroup.setOnCheckedChangeListener(null);
|
||||||
|
if (checkedId == R.id.tab_rbn_donation) {
|
||||||
|
mRb_meeting.setTextColor(getResources().getColor(R.color.tab_text_nor));
|
||||||
|
mRb_meeting.setCompoundDrawablesWithIntrinsicBounds(null,
|
||||||
|
getResources().getDrawable(R.drawable.home_my_meeting_nor), null, null);
|
||||||
|
mRb_meeting.setChecked(false);
|
||||||
|
}
|
||||||
|
main_radiogroup.check(current_tab_id);
|
||||||
|
main_radiogroup.setOnCheckedChangeListener(this);
|
||||||
|
UIUtils.checkLoginAndJump(MainActivity.this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
BaseApplication.auto_show_unimp = true;
|
BaseApplication.auto_show_unimp = true;
|
||||||
|
|
||||||
/** 改变文字的颜色 */
|
/** 改变文字的颜色 */
|
||||||
@@ -1303,7 +1317,9 @@ public class MainActivity extends BaseActivity implements
|
|||||||
mRb_meeting.setCompoundDrawablesWithIntrinsicBounds(null,
|
mRb_meeting.setCompoundDrawablesWithIntrinsicBounds(null,
|
||||||
getResources().getDrawable(R.drawable.home_my_meeting_nor), null, null);
|
getResources().getDrawable(R.drawable.home_my_meeting_nor), null, null);
|
||||||
|
|
||||||
|
main_radiogroup.setOnCheckedChangeListener(null);
|
||||||
mRb_meeting.setChecked(false);
|
mRb_meeting.setChecked(false);
|
||||||
|
main_radiogroup.setOnCheckedChangeListener(this);
|
||||||
|
|
||||||
// if(current_tab_id == R.id.tab_rbn_home){
|
// if(current_tab_id == R.id.tab_rbn_home){
|
||||||
// mRb_home.setTextColor(getResources().getColor(R.color.tab_text_sel));
|
// mRb_home.setTextColor(getResources().getColor(R.color.tab_text_sel));
|
||||||
@@ -2100,7 +2116,7 @@ public class MainActivity extends BaseActivity implements
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
||||||
LogUtil.i("onResume: ", current_tab_id+"");
|
LogUtil.i("onResume: ", current_tab_id+"");
|
||||||
if((current_tab_id == R.id.tab_rbn_donation || current_tab_id == R.id.tab_rbn_kepu) && BaseApplication.auto_show_unimp){
|
if(UIUtils.isLogined() && (current_tab_id == R.id.tab_rbn_donation || current_tab_id == R.id.tab_rbn_kepu) && BaseApplication.auto_show_unimp){
|
||||||
long current_timestmp = System.currentTimeMillis();
|
long current_timestmp = System.currentTimeMillis();
|
||||||
//防止无限循环打开
|
//防止无限循环打开
|
||||||
if(current_timestmp - BaseApplication.auto_show_unimp_timestamp > 1.5 * 1000){
|
if(current_timestmp - BaseApplication.auto_show_unimp_timestamp > 1.5 * 1000){
|
||||||
|
|||||||
@@ -717,6 +717,9 @@ public class SettingAndHelpActivity extends BaseActivity implements OnCallBackFr
|
|||||||
SharePrefUtil.saveString(ctx, Constant.USERID, "");
|
SharePrefUtil.saveString(ctx, Constant.USERID, "");
|
||||||
SharePrefUtil.saveString(ctx, "access_token", "");
|
SharePrefUtil.saveString(ctx, "access_token", "");
|
||||||
SharePrefUtil.saveString(ctx, "refresh_token", "");
|
SharePrefUtil.saveString(ctx, "refresh_token", "");
|
||||||
|
SharePrefUtil.saveString(ctx, Constant.realName, "");
|
||||||
|
SharePrefUtil.saveString(ctx, "hospitalName", "");
|
||||||
|
SharePrefUtil.saveString(ctx, Constant.photo, "");
|
||||||
addUMToken("");
|
addUMToken("");
|
||||||
Intent intent = new Intent(ctx, LoginNewActivity.class);
|
Intent intent = new Intent(ctx, LoginNewActivity.class);
|
||||||
intent.putExtra("flag", true);
|
intent.putExtra("flag", true);
|
||||||
|
|||||||
@@ -676,7 +676,14 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
|||||||
private void initBanner( List<HomeBean.NewsBean> datas)
|
private void initBanner( List<HomeBean.NewsBean> datas)
|
||||||
{
|
{
|
||||||
List<CustomViewsInfo> data = new ArrayList<>();
|
List<CustomViewsInfo> data = new ArrayList<>();
|
||||||
for (HomeBean.NewsBean bean:datas)
|
final boolean showStudioSlide = UIUtils.isLogined();
|
||||||
|
if (datas != null) {
|
||||||
|
int startIndex = (showStudioSlide || datas.size() <= 1) ? 0 : 1;
|
||||||
|
for (int i = startIndex; i < datas.size(); i++) {
|
||||||
|
data.add(new CustomViewsInfo(datas.get(i)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (false) for (HomeBean.NewsBean bean:datas)
|
||||||
{
|
{
|
||||||
data.add(new CustomViewsInfo(bean));
|
data.add(new CustomViewsInfo(bean));
|
||||||
}
|
}
|
||||||
@@ -699,7 +706,7 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
|||||||
TextView mIv_name = view.findViewById(R.id.doctor_name);
|
TextView mIv_name = view.findViewById(R.id.doctor_name);
|
||||||
TextView mIv_positionName = view.findViewById(R.id.positionName);
|
TextView mIv_positionName = view.findViewById(R.id.positionName);
|
||||||
ImageView im_gg=view.findViewById(R.id.im_gg);
|
ImageView im_gg=view.findViewById(R.id.im_gg);
|
||||||
if(position==0)
|
if(showStudioSlide && position==0)
|
||||||
{
|
{
|
||||||
|
|
||||||
// //得到AssetManager
|
// //得到AssetManager
|
||||||
@@ -757,7 +764,7 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
|||||||
// startReport(reportBeans);
|
// startReport(reportBeans);
|
||||||
|
|
||||||
MobclickAgent.onEvent(mainActivity, EXPERT_HOME_SHUFFLING);
|
MobclickAgent.onEvent(mainActivity, EXPERT_HOME_SHUFFLING);
|
||||||
if(position==0)
|
if(showStudioSlide && position==0)
|
||||||
{
|
{
|
||||||
startActivity(new Intent(mActivity, MyDetailInfoActivity.class));
|
startActivity(new Intent(mActivity, MyDetailInfoActivity.class));
|
||||||
needreportHome("首页",realName+"专家工作室");
|
needreportHome("首页",realName+"专家工作室");
|
||||||
|
|||||||
@@ -187,12 +187,20 @@ public class UIUtils {
|
|||||||
* @param context 上下文
|
* @param context 上下文
|
||||||
* @return true 已登录;false 未登录(已跳转登录页)
|
* @return true 已登录;false 未登录(已跳转登录页)
|
||||||
*/
|
*/
|
||||||
|
private static long lastJumpLoginTime = 0L;
|
||||||
|
|
||||||
public static boolean checkLoginAndJump(Context context) {
|
public static boolean checkLoginAndJump(Context context) {
|
||||||
if (isLogined()) {
|
if (isLogined()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
if (now - lastJumpLoginTime < 800) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
lastJumpLoginTime = now;
|
||||||
Context targetContext = context != null ? context : getContext();
|
Context targetContext = context != null ? context : getContext();
|
||||||
Intent intent = new Intent(targetContext, LoginNewActivity.class);
|
Intent intent = new Intent(targetContext, LoginNewActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
if (!(targetContext instanceof Activity)) {
|
if (!(targetContext instanceof Activity)) {
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public class UniappUtil {
|
|||||||
public static void showUniMp(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) {
|
public static void showUniMp(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
if (!UIUtils.checkLoginAndJump(context)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
checkWgt(context, targetPath, pageParams);
|
checkWgt(context, targetPath, pageParams);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user