|
@@ -7,6 +7,7 @@ import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
import android.util.SparseArray;
|
|
import android.util.SparseArray;
|
|
|
|
|
+import android.view.Gravity;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.MotionEvent;
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
@@ -24,6 +25,7 @@ import com.sheep.gamegroup.di.modules.AskGetMoneyModule;
|
|
|
import com.sheep.gamegroup.model.entity.AskAward;
|
|
import com.sheep.gamegroup.model.entity.AskAward;
|
|
|
import com.sheep.gamegroup.model.entity.AskTop;
|
|
import com.sheep.gamegroup.model.entity.AskTop;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
|
|
+import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
|
import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
|
|
import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
@@ -91,6 +93,8 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
MarqueeView ask_award_info;
|
|
MarqueeView ask_award_info;
|
|
|
@BindView(R.id.ask_scroll_view)
|
|
@BindView(R.id.ask_scroll_view)
|
|
|
NestedScrollView scrollView;
|
|
NestedScrollView scrollView;
|
|
|
|
|
+ @BindView(R.id.empty_view)
|
|
|
|
|
+ View empty_view;
|
|
|
|
|
|
|
|
private FriendAndAwardEntity mEntity;
|
|
private FriendAndAwardEntity mEntity;
|
|
|
|
|
|
|
@@ -118,7 +122,7 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
" <head>\n" +
|
|
" <head>\n" +
|
|
|
" <title>HTML字符串</title>\n" +
|
|
" <title>HTML字符串</title>\n" +
|
|
|
" <metahttp-equivmetahttp-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n" +
|
|
" <metahttp-equivmetahttp-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n" +
|
|
|
- " <meta name=\"viewport\" content=\"width="+G.WIDTH+", user-scalable=no\">\n" +
|
|
|
|
|
|
|
+ " <meta name=\"viewport\" content=\"width=" + G.WIDTH + ", user-scalable=no\">\n" +
|
|
|
" <style type=\"text/css\">\n" +
|
|
" <style type=\"text/css\">\n" +
|
|
|
" body {\n" +
|
|
" body {\n" +
|
|
|
" margin: 0;\n" +
|
|
" margin: 0;\n" +
|
|
@@ -131,17 +135,17 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
" </style>\n" +
|
|
" </style>\n" +
|
|
|
" </head>\n" +
|
|
" </head>\n" +
|
|
|
" <body>\n" +
|
|
" <body>\n" +
|
|
|
- " <img src=\"http://cdngame.kuaifazs.com/ask_bg.png\" width=\"100%\">\n" +
|
|
|
|
|
|
|
+ " <img src=\"http://cdngame.kuaifazs.com/ask_bg2.png\" width=\"100%\">\n" +
|
|
|
" </body>\n" +
|
|
" </body>\n" +
|
|
|
"</html>";
|
|
"</html>";
|
|
|
- ask_bg.getSettings().setDefaultTextEncodingName("UTF-8") ;
|
|
|
|
|
- ask_bg.loadData(content, "text/html", "UTF-8") ;
|
|
|
|
|
|
|
+ ask_bg.getSettings().setDefaultTextEncodingName("UTF-8");
|
|
|
|
|
+ ask_bg.loadData(content, "text/html", "UTF-8");
|
|
|
// 16,18,19
|
|
// 16,18,19
|
|
|
LinearLayout.LayoutParams layoutParams1 = (LinearLayout.LayoutParams) ask_top_1.getLayoutParams();
|
|
LinearLayout.LayoutParams layoutParams1 = (LinearLayout.LayoutParams) ask_top_1.getLayoutParams();
|
|
|
- layoutParams1.height = G.WIDTH * 16 / 18;
|
|
|
|
|
|
|
+ layoutParams1.height = G.WIDTH * 690 / 625;
|
|
|
ask_top_1.setLayoutParams(layoutParams1);
|
|
ask_top_1.setLayoutParams(layoutParams1);
|
|
|
LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) ask_top_2.getLayoutParams();
|
|
LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) ask_top_2.getLayoutParams();
|
|
|
- layoutParams2.height = G.WIDTH * 3 / 18;
|
|
|
|
|
|
|
+ layoutParams2.height = G.WIDTH * 112 / 625;
|
|
|
ask_top_2.setLayoutParams(layoutParams2);
|
|
ask_top_2.setLayoutParams(layoutParams2);
|
|
|
ask_top5_not_you.setVisibility(View.INVISIBLE);
|
|
ask_top5_not_you.setVisibility(View.INVISIBLE);
|
|
|
}
|
|
}
|
|
@@ -175,16 +179,23 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
@Override
|
|
@Override
|
|
|
public void convert(ViewHolder holder, final AskTop item) {
|
|
public void convert(ViewHolder holder, final AskTop item) {
|
|
|
View itemView = holder.itemView;
|
|
View itemView = holder.itemView;
|
|
|
- if (item == null)
|
|
|
|
|
|
|
+ int position = holder.getAdapterPosition();
|
|
|
|
|
+ if (position == 0) {
|
|
|
return;
|
|
return;
|
|
|
|
|
+ }
|
|
|
TextView x_ask_top5_item_user = itemView.findViewById(R.id.x_ask_top5_item_user);
|
|
TextView x_ask_top5_item_user = itemView.findViewById(R.id.x_ask_top5_item_user);
|
|
|
TextView x_ask_top5_item_money = itemView.findViewById(R.id.x_ask_top5_item_money);
|
|
TextView x_ask_top5_item_money = itemView.findViewById(R.id.x_ask_top5_item_money);
|
|
|
TextView x_ask_top5_item_award = itemView.findViewById(R.id.x_ask_top5_item_award);
|
|
TextView x_ask_top5_item_award = itemView.findViewById(R.id.x_ask_top5_item_award);
|
|
|
|
|
+ ImageView ask_top5_item_iv = itemView.findViewById(R.id.ask_top5_item_iv);
|
|
|
|
|
+
|
|
|
|
|
+ if (item == null) {//空数据占位置
|
|
|
|
|
+ itemView.setVisibility(View.INVISIBLE);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
ViewUtil.setText(x_ask_top5_item_user, String.format(Locale.CHINA, "昵称\n%s\n邀请人数:%d", item.getNickname(), item.getSum_friend()));
|
|
ViewUtil.setText(x_ask_top5_item_user, String.format(Locale.CHINA, "昵称\n%s\n邀请人数:%d", item.getNickname(), item.getSum_friend()));
|
|
|
ViewUtil.setText(x_ask_top5_item_money, String.format(Locale.CHINA, "%.0f", item.getSum_amount()));
|
|
ViewUtil.setText(x_ask_top5_item_money, String.format(Locale.CHINA, "%.0f", item.getSum_amount()));
|
|
|
ViewUtil.setText(x_ask_top5_item_award, item.getPrize());
|
|
ViewUtil.setText(x_ask_top5_item_award, item.getPrize());
|
|
|
- ImageView ask_top5_item_iv = itemView.findViewById(R.id.ask_top5_item_iv);
|
|
|
|
|
- switch (holder.getAdapterPosition()){
|
|
|
|
|
|
|
+ switch (position) {
|
|
|
case 1:
|
|
case 1:
|
|
|
ask_top5_item_iv.setImageResource(R.mipmap.ask_top_1);
|
|
ask_top5_item_iv.setImageResource(R.mipmap.ask_top_1);
|
|
|
break;
|
|
break;
|
|
@@ -251,20 +262,15 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
@Override
|
|
@Override
|
|
|
public void onNext(BaseMessage baseMessage) {
|
|
public void onNext(BaseMessage baseMessage) {
|
|
|
List<AskTop> newList = baseMessage.getDataList(AskTop.class);
|
|
List<AskTop> newList = baseMessage.getDataList(AskTop.class);
|
|
|
- if(ListUtil.isEmpty(newList)){
|
|
|
|
|
|
|
+ if (ListUtil.isEmpty(newList)) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(BuildConfig.DEBUG) {
|
|
|
|
|
- while (newList.size() < 5){
|
|
|
|
|
- newList.add(newList.get(0));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
list.addAll(newList);
|
|
list.addAll(newList);
|
|
|
- adapter.notifyDataSetChanged();
|
|
|
|
|
|
|
+ notifyDataSetChanged();
|
|
|
String userId = DataUtil.getInstance().getUserId();
|
|
String userId = DataUtil.getInstance().getUserId();
|
|
|
boolean hasMe = false;
|
|
boolean hasMe = false;
|
|
|
for (AskTop item : newList) {
|
|
for (AskTop item : newList) {
|
|
|
- if(TextUtils.equals(userId, item.getUser_id())){
|
|
|
|
|
|
|
+ if (TextUtils.equals(userId, item.getUser_id())) {
|
|
|
hasMe = true;
|
|
hasMe = true;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -274,7 +280,8 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onError(BaseMessage baseMessage) {
|
|
public void onError(BaseMessage baseMessage) {
|
|
|
-
|
|
|
|
|
|
|
+ notifyDataSetChanged();
|
|
|
|
|
+ ask_top5_not_you.setVisibility(View.VISIBLE);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().getInvitationTopRecord()
|
|
SheepApp.getInstance().getNetComponent().getApiService().getInvitationTopRecord()
|
|
@@ -298,6 +305,14 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void notifyDataSetChanged() {
|
|
|
|
|
+ CommonUtil.getInstance().updateEmptyView(empty_view, list.size() == 1, true);
|
|
|
|
|
+ while (list.size() < 5) {
|
|
|
|
|
+ list.add(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void NetSuccess(int code, String msg, String s) {
|
|
public void NetSuccess(int code, String msg, String s) {
|
|
@@ -326,7 +341,6 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
private SparseArray<FgtFriendExtractPage> mTestFragments;
|
|
private SparseArray<FgtFriendExtractPage> mTestFragments;
|
|
|
|
|
|
|
|
public void setFriendExtractCount(int count, int page, int size) {
|
|
public void setFriendExtractCount(int count, int page, int size) {
|
|
@@ -367,7 +381,7 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
@Override
|
|
@Override
|
|
|
public void onPageSelected(int i) {
|
|
public void onPageSelected(int i) {
|
|
|
curPage = i + 1;
|
|
curPage = i + 1;
|
|
|
- friend_extract_page_tv.setText(String.format(Locale.CHINA,"%d", curPage));
|
|
|
|
|
|
|
+ friend_extract_page_tv.setText(String.format(Locale.CHINA, "%d", curPage));
|
|
|
checkAddPage(curPage, mTestFragments.get(curPage).getList().size());
|
|
checkAddPage(curPage, mTestFragments.get(curPage).getList().size());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -399,10 +413,24 @@ public class AskGetMoneyAct extends BaseUMActivity implements AskGetMoneyContrac
|
|
|
ask_award_info.stopFlipping();
|
|
ask_award_info.stopFlipping();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//显示分享对话框
|
|
//显示分享对话框
|
|
|
public void showShareView(View view) {
|
|
public void showShareView(View view) {
|
|
|
String url = userEntity.getShareLink();
|
|
String url = userEntity.getShareLink();
|
|
|
String description = mEntity.getShare_desc();
|
|
String description = mEntity.getShare_desc();
|
|
|
ViewUtil.showShareDialog(activity, url, description);
|
|
ViewUtil.showShareDialog(activity, url, description);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //显示邀请好友排行榜top5的规则的对话框
|
|
|
|
|
+ public void showAstTop5Tip(View view) {
|
|
|
|
|
+ ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("活动说明")
|
|
|
|
|
+ .setMsg(".每天实时更新排行数据。\n" +
|
|
|
|
|
+ ".根据当月已赚赏金(定向货币除外)和邀请人数进行排行\n" +
|
|
|
|
|
+ ".每个月前5名可获取排行奖励。\n" +
|
|
|
|
|
+ ".每个月月底最后一天24:00可公布结果,获奖的用户需通过“小绵羊领头羊”公众号发送获奖截图证明及收货信息,核对信息真实后,会第一时间发放!\n" +
|
|
|
|
|
+ ".本活动最终解释权归成都橙风有量科技有限公司所有!")
|
|
|
|
|
+ .setMsgGravity(Gravity.START)
|
|
|
|
|
+ .setTheme(DialogConfig.THEME_PURPLE)
|
|
|
|
|
+ .setBtnLeftText("我知道了"));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|