Commit 71414eba by 王佳洋

IP属地信息展示

parent 39de8632
...@@ -20,11 +20,11 @@ public class MemberFragment extends DynamicFragment { ...@@ -20,11 +20,11 @@ public class MemberFragment extends DynamicFragment {
private View view; private View view;
private Context context; private Context context;
private TextView member_age_tv,member_emotional_state_tv,member_job_tv,member_address_tv,member_introduction_tv; private TextView member_age_tv,member_emotional_state_tv,member_job_tv,member_address_tv,member_introduction_tv,member_ip_tv;
String age,emotional_state,job,address,introduction; String age,emotional_state,job,address,introduction,ipProvince;
public static MemberFragment newInstance(String age, String emotional_state, String job, String address, String introduction){ public static MemberFragment newInstance(String age, String emotional_state, String job, String address, String introduction, String ipProvince){
MemberFragment memberFragment=new MemberFragment(); MemberFragment memberFragment=new MemberFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("age", age); args.putString("age", age);
...@@ -32,6 +32,7 @@ public class MemberFragment extends DynamicFragment { ...@@ -32,6 +32,7 @@ public class MemberFragment extends DynamicFragment {
args.putString("job", job); args.putString("job", job);
args.putString("address", address); args.putString("address", address);
args.putString("introduction", introduction); args.putString("introduction", introduction);
args.putString("ipProvince", ipProvince);
memberFragment.setArguments(args); memberFragment.setArguments(args);
return memberFragment; return memberFragment;
} }
...@@ -46,18 +47,21 @@ public class MemberFragment extends DynamicFragment { ...@@ -46,18 +47,21 @@ public class MemberFragment extends DynamicFragment {
member_job_tv=(TextView)view.findViewById(R.id.member_job_tv); member_job_tv=(TextView)view.findViewById(R.id.member_job_tv);
member_address_tv=(TextView)view.findViewById(R.id.member_address_tv); member_address_tv=(TextView)view.findViewById(R.id.member_address_tv);
member_introduction_tv=(TextView)view.findViewById(R.id.member_introduction_tv); member_introduction_tv=(TextView)view.findViewById(R.id.member_introduction_tv);
member_ip_tv = view.findViewById(R.id.member_ip_tv);
age=getArguments().getString("age"); age=getArguments().getString("age");
emotional_state=getArguments().getString("emotional_state"); emotional_state=getArguments().getString("emotional_state");
job=getArguments().getString("job"); job=getArguments().getString("job");
address=getArguments().getString("address"); address=getArguments().getString("address");
introduction=getArguments().getString("introduction"); introduction=getArguments().getString("introduction");
ipProvince=getArguments().getString("ipProvince");
member_age_tv.setText(age); member_age_tv.setText(age);
member_emotional_state_tv.setText(emotional_state); member_emotional_state_tv.setText(emotional_state);
member_job_tv.setText(job); member_job_tv.setText(job);
member_address_tv.setText(address); member_address_tv.setText(address);
member_introduction_tv.setText(introduction); member_introduction_tv.setText(introduction);
member_ip_tv.setText(ipProvince);
return view; return view;
} }
} }
...@@ -83,7 +83,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -83,7 +83,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
List<String> reportReasons;//举报内容列表 List<String> reportReasons;//举报内容列表
private FragmentManager fragmentManager; private FragmentManager fragmentManager;
String age, emotional_state, job, address, introduction; String age, emotional_state, job, address, introduction, ipProvince;
String focus_state;//关注状态 String focus_state;//关注状态
boolean zan_state; boolean zan_state;
...@@ -250,6 +250,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -250,6 +250,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
job = person.profession; job = person.profession;
address = person.address; address = person.address;
introduction = person.description; introduction = person.description;
ipProvince = person.ipProvince;
String bg = person.bg; String bg = person.bg;
GlideApp.with(MembersActivity.this) GlideApp.with(MembersActivity.this)
.load(head) .load(head)
...@@ -488,7 +489,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -488,7 +489,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
private void RightSet() { private void RightSet() {
final List<String> dialog_datas = new ArrayList<String>(); final List<String> dialog_datas = new ArrayList<String>();
if (shielding == false) { if (!shielding) {
dialog_datas.add("屏蔽ta"); dialog_datas.add("屏蔽ta");
} else { } else {
dialog_datas.add("解除屏蔽"); dialog_datas.add("解除屏蔽");
...@@ -507,22 +508,20 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -507,22 +508,20 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
builder1.SetOnItemClickLister(new ListDialog.Builder.OnItemClickLister() { builder1.SetOnItemClickLister(new ListDialog.Builder.OnItemClickLister() {
@Override @Override
public void onItemClick(Dialog dialog, View view, int position) { public void onItemClick(Dialog dialog, View view, int position) {
if (dialog_datas.size() == 2) {//不含取消关注 switch (position) {
switch (position) { case 0:
case 0: if (!shielding) {
if (shielding == false) { shieldHint();
shieldHint(); } else {
} else { RemoveShielding();
RemoveShielding(); }
} break;
break; case 1:
case 1: report();
report(); break;
break; case 2:
case 2: ARouter.getInstance().build("/mine/FeedBackActivity").navigation();
ARouter.getInstance().build("/mine/FeedBackActivity").navigation(); break;
break;
}
} }
dialog.dismiss(); dialog.dismiss();
} }
...@@ -743,7 +742,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -743,7 +742,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
members_information_tv.setTextColor(getResources().getColor(R.color.platform_main_theme)); members_information_tv.setTextColor(getResources().getColor(R.color.platform_main_theme));
members_information_hint_tv.setBackgroundColor(getResources().getColor(R.color.platform_main_theme)); members_information_hint_tv.setBackgroundColor(getResources().getColor(R.color.platform_main_theme));
if (memberfragment == null) { if (memberfragment == null) {
memberfragment = MemberFragment.newInstance(age, emotional_state, job, address, introduction); memberfragment = MemberFragment.newInstance(age, emotional_state, job, address, introduction, ipProvince);
transaction.add(R.id.members_content_frm, memberfragment); transaction.add(R.id.members_content_frm, memberfragment);
} else { } else {
transaction.show(memberfragment); transaction.show(memberfragment);
......
...@@ -35,6 +35,7 @@ public class CommentBean { ...@@ -35,6 +35,7 @@ public class CommentBean {
private ShareData share_data; private ShareData share_data;
private int isAvailable; //是否空闲 0-否 1-是 private int isAvailable; //是否空闲 0-否 1-是
private int isOpenListen; //是否开通倾诉 0-否 1-是 private int isOpenListen; //是否开通倾诉 0-否 1-是
private String ipProvince;
private String listenLinkUrl; //统一路由url private String listenLinkUrl; //统一路由url
...@@ -52,6 +53,14 @@ public class CommentBean { ...@@ -52,6 +53,14 @@ public class CommentBean {
return isOpenListen; return isOpenListen;
} }
public String getIpProvince() {
return ipProvince;
}
public void setIpProvince(String ipProvince) {
this.ipProvince = ipProvince;
}
public ShareData getShare_data() { public ShareData getShare_data() {
return share_data; return share_data;
} }
......
...@@ -24,5 +24,7 @@ public class MemberInfoBean { ...@@ -24,5 +24,7 @@ public class MemberInfoBean {
public String description; public String description;
public String address; public String address;
public String bg; public String bg;
public String ipProvince;
} }
} }
...@@ -76,6 +76,7 @@ public class TrendsDetailInfoBean { ...@@ -76,6 +76,7 @@ public class TrendsDetailInfoBean {
public String uid; public String uid;
public String multitextType;//动态类型 public String multitextType;//动态类型
public ExtAd ext; public ExtAd ext;
public String ipProvince;
} }
//图片 //图片
......
...@@ -948,6 +948,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -948,6 +948,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
holder.setHeadImageWithUrl(R.id.item_recommend_trend_user_head_iv, data.getHeader()); //头像 holder.setHeadImageWithUrl(R.id.item_recommend_trend_user_head_iv, data.getHeader()); //头像
holder.setText(R.id.text_userName, data.getName()); //用户名 holder.setText(R.id.text_userName, data.getName()); //用户名
holder.setText(R.id.text_time, data.getTime_str()); //发布时间 holder.setText(R.id.text_time, data.getTime_str()); //发布时间
holder.setText(R.id.tv_ip, "IP属地: " + data.getIpProvince()); // IP属地
holder.setImageResource(R.id.img_comment_sex, data.getGender() == 1 ? R.drawable.dynamic_male : R.drawable.dynamic_female); holder.setImageResource(R.id.img_comment_sex, data.getGender() == 1 ? R.drawable.dynamic_male : R.drawable.dynamic_female);
holder.setImageResource(R.id.img_comment_zan, data.getIs_zan() == 1 ? R.drawable.dynamic_reply_zan_sel : R.drawable.dynamic_reply_zan); holder.setImageResource(R.id.img_comment_zan, data.getIs_zan() == 1 ? R.drawable.dynamic_reply_zan_sel : R.drawable.dynamic_reply_zan);
showCommentItemContent(holder, data); showCommentItemContent(holder, data);
...@@ -1406,6 +1407,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1406,6 +1407,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
return commentCount > commentListAdapter.getDatas().size(); return commentCount > commentListAdapter.getDatas().size();
} }
@SuppressLint("SetTextI18n")
private void fillContent() { private void fillContent() {
linComment.setVisibility(VISIBLE); linComment.setVisibility(VISIBLE);
linContent.setVisibility(View.VISIBLE); linContent.setVisibility(View.VISIBLE);
...@@ -1420,8 +1422,8 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1420,8 +1422,8 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
tvContent.setVisibility(View.GONE); tvContent.setVisibility(View.GONE);
} }
tvUserName.setText(mTrendBody.name); tvUserName.setText(mTrendBody.name);
tvTime.setText(mTrendBody.timeStr + "-"); //发布时间 tvTime.setText(mTrendBody.timeStr); //发布时间
tvFrom.setText(mTrendBody.from); //来源 tvFrom.setText("IP属地: " + mTrendBody.ipProvince); // IP属地
if (TextUtils.isEmpty(mTrendBody.title)) { if (TextUtils.isEmpty(mTrendBody.title)) {
tvTrendInfoTitle.setVisibility(GONE); tvTrendInfoTitle.setVisibility(GONE);
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:visibility="visible"
android:visibility="gone"> android:visibility="gone">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
...@@ -148,7 +149,6 @@ ...@@ -148,7 +149,6 @@
</RelativeLayout> </RelativeLayout>
<TextView <TextView
android:id="@+id/text_time" android:id="@+id/text_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -166,11 +166,12 @@ ...@@ -166,11 +166,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/text_userName_rel" android:layout_below="@+id/text_userName_rel"
android:layout_marginStart="10dp"
android:layout_marginTop="7dp" android:layout_marginTop="7dp"
android:layout_toRightOf="@id/text_time" android:layout_toRightOf="@id/text_time"
android:textColor="@color/dynamic_text_trend_defult" android:textColor="@color/dynamic_text_trend_defult"
android:textSize="12sp" android:textSize="12sp"
tools:text=" - 来自安卓客户端" /> tools:text="IP属地: XX" />
<TextView <TextView
android:id="@+id/text_guanzhu" android:id="@+id/text_guanzhu"
...@@ -498,6 +499,7 @@ ...@@ -498,6 +499,7 @@
<com.ydl.ydlcommon.ui.LogoLoadingView <com.ydl.ydlcommon.ui.LogoLoadingView
android:id="@+id/v_loading" android:id="@+id/v_loading"
tools:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/> android:layout_height="match_parent"/>
......
...@@ -114,4 +114,25 @@ ...@@ -114,4 +114,25 @@
android:text="" android:text=""
android:textSize="18sp"/> android:textSize="18sp"/>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/dynamic_black"
android:text="IP属地"
android:textSize="18sp"
android:layout_marginRight="15dp"/>
<TextView
android:id="@+id/member_ip_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/dynamic_black"
android:textSize="18sp"/>
</LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -112,6 +112,17 @@ ...@@ -112,6 +112,17 @@
tools:text="23分钟前" /> tools:text="23分钟前" />
<TextView <TextView
android:id="@+id/tv_ip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/color_9d9ea7"
android:layout_toEndOf="@id/text_time"
android:layout_marginStart="10dp"
android:textSize="12sp"
android:layout_alignBaseline="@id/text_time"
tools:text="IP属地: XX"/>
<TextView
android:id="@+id/text_chat" android:id="@+id/text_chat"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="30dp" android:layout_height="30dp"
......
...@@ -127,7 +127,6 @@ ...@@ -127,7 +127,6 @@
<color name="color_1C1F28">#1C1F28</color> <color name="color_1C1F28">#1C1F28</color>
<color name="color_1DA1F2">#1DA1F2</color> <color name="color_1DA1F2">#1DA1F2</color>
<color name="color_EB892C">#EB892C</color> <color name="color_EB892C">#EB892C</color>
<color name="color_9D9EA7">#9D9EA7</color>
<color name="color_EFEFF1">#EFEFF1</color> <color name="color_EFEFF1">#EFEFF1</color>
<color name="color_FAFAFF">#FAFAFF</color> <color name="color_FAFAFF">#FAFAFF</color>
<color name="color_242424">#242424</color> <color name="color_242424">#242424</color>
......
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