|
|
@@ -1,13 +1,18 @@
|
|
|
package com.sheep.gamegroup.view.activity;
|
|
|
|
|
|
import android.app.AlertDialog;
|
|
|
+import android.app.Fragment;
|
|
|
+import android.support.v4.view.ViewPager;
|
|
|
import android.text.TextUtils;
|
|
|
+import android.util.SparseArray;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.kfzs.duanduan.fragment.FgtFriendExtractPage;
|
|
|
+import com.kfzs.duanduan.fragment.PagerAdapter;
|
|
|
import com.sheep.gamegroup.absBase.BaseUMActivity;
|
|
|
import com.sheep.gamegroup.di.components.DaggerAskGetMoneyComponent;
|
|
|
import com.sheep.gamegroup.di.modules.AskGetMoneyModule;
|
|
|
@@ -21,6 +26,7 @@ import com.sheep.gamegroup.util.StringUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
import com.umeng.socialize.ShareAction;
|
|
|
@@ -61,6 +67,12 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
|
|
|
RelativeLayout rlQr;
|
|
|
@BindView(R.id.rl_link)
|
|
|
RelativeLayout rlLink;
|
|
|
+ @BindView(R.id.friend_extract_vp)
|
|
|
+ ViewPager friend_extract_vp;
|
|
|
+ @BindView(R.id.friend_extract_count_tv)
|
|
|
+ TextView friend_extract_count_tv;
|
|
|
+ @BindView(R.id.friend_extract_page_tv)
|
|
|
+ TextView friend_extract_page_tv;
|
|
|
|
|
|
private FriendAndAwardEntity mEntity;
|
|
|
|
|
|
@@ -78,7 +90,7 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
|
|
|
.netComponent(SheepApp.get(this).getNetComponent())
|
|
|
.build()
|
|
|
.inject(this);
|
|
|
- test();
|
|
|
+ initFriendExtractList();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -209,24 +221,37 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- private void test(){
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService().getUserFriendList(1, 5)
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(AskGetMoneyAct.this) {
|
|
|
- @Override
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
- List<Friend> friendList = baseMessage.getDatas(Friend.class);
|
|
|
- if(BuildConfig.DEBUG)
|
|
|
- System.out.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
- if(BuildConfig.DEBUG)
|
|
|
- System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
|
|
|
- G.showToast(TextUtils.isEmpty(baseMessage.getMsg()) ? "服务器错误,请稍候再试" : baseMessage.getMsg());
|
|
|
- }
|
|
|
- });
|
|
|
+ private SparseArray<FgtFriendExtractPage> mTestFragments;
|
|
|
+ public void setFriendExtractCount(int count){
|
|
|
+ friend_extract_count_tv.setText(getString(R.string.friend_extract_count, count));
|
|
|
+ }
|
|
|
+ private PagerAdapter mPagerAdapter;
|
|
|
+ private void initFriendExtractList(){
|
|
|
+ mTestFragments = new SparseArray<>();
|
|
|
+ mTestFragments.put(1, FgtFriendExtractPage.newInstance(1));
|
|
|
+ mPagerAdapter = new PagerAdapter(getSupportFragmentManager(), mTestFragments);
|
|
|
+ friend_extract_vp.setAdapter(mPagerAdapter);
|
|
|
+ friend_extract_vp.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
|
|
+ @Override
|
|
|
+ public void onPageScrolled(int i, float v, int i1) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onPageSelected(int i) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onPageScrollStateChanged(int i) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+//
|
|
|
+// mTestFragments.put(key++,TestFragment.newInstance("第"+key));
|
|
|
+// mPagerAdapter.notifyDataSetChanged();
|
|
|
+// ViewPager friend_extract_vp;
|
|
|
+// TextView friend_extract_count_tv;
|
|
|
+// TextView friend_extract_page_tv;
|
|
|
}
|
|
|
}
|