修改首页
This commit is contained in:
@@ -136,7 +136,7 @@ public class DynamicsAdapter extends BaseAdapter {
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
Holder holder = null;
|
||||
if (null == view) {
|
||||
view = View.inflate(mContext, R.layout.item_dynamic_list1, null);
|
||||
view = View.inflate(mContext, R.layout.item_dynamic_list, null);
|
||||
holder = initView(view);
|
||||
} else {
|
||||
holder = (Holder) view.getTag(R.id.tag_second);
|
||||
@@ -155,7 +155,7 @@ public class DynamicsAdapter extends BaseAdapter {
|
||||
holder.newPeopleImageView.setVisibility(View.GONE);
|
||||
holder.realPeopleImageView.setVisibility(View.GONE);
|
||||
|
||||
holder.tv_see_count.setText("已有"+bean.getLike_count()+"次浏览");
|
||||
// holder.tv_see_count.setText("已有"+bean.getLike_count()+"次浏览");
|
||||
|
||||
if (bean.getGender() == 1) {
|
||||
holder.realPeopleImageView.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.xuebiping.bolizhuzi.controller.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.xuebiping.bolizhuzi.R;
|
||||
import com.xuebiping.bolizhuzi.model.main.LookMeBean;
|
||||
import com.xuebiping.bolizhuzi.utils.StrU;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class MainLookMeAdapter extends BaseQuickAdapter<LookMeBean, BaseViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
public MainLookMeAdapter(int layoutResId, Context context) {
|
||||
super(layoutResId);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(@NotNull BaseViewHolder baseViewHolder, LookMeBean lookMeBean) {
|
||||
SimpleDraweeView list_photo = baseViewHolder.getView(R.id.list_photo);
|
||||
|
||||
list_photo.setImageURI(StrU.getResourcePath(lookMeBean.getAvatar_url(), mContext));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.xuebiping.bolizhuzi.controller.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
|
||||
|
||||
/**
|
||||
* 带颜色渐变和缩放的指示器标题
|
||||
* 博客: http://hackware.lucode.net
|
||||
* Created by hackware on 2016/6/26.
|
||||
*/
|
||||
public class ScaleTransitionPagerTitleView extends ColorTransitionPagerTitleView {
|
||||
private float mMinScale = 0.75f;
|
||||
|
||||
public ScaleTransitionPagerTitleView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
|
||||
super.onEnter(index, totalCount, enterPercent, leftToRight); // 实现颜色渐变
|
||||
setScaleX(mMinScale + (1.0f - mMinScale) * enterPercent);
|
||||
setScaleY(mMinScale + (1.0f - mMinScale) * enterPercent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
|
||||
super.onLeave(index, totalCount, leavePercent, leftToRight); // 实现颜色渐变
|
||||
setScaleX(1.0f + (mMinScale - 1.0f) * leavePercent);
|
||||
setScaleY(1.0f + (mMinScale - 1.0f) * leavePercent);
|
||||
}
|
||||
|
||||
public float getMinScale() {
|
||||
return mMinScale;
|
||||
}
|
||||
|
||||
public void setMinScale(float minScale) {
|
||||
mMinScale = minScale;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.xuebiping.bolizhuzi.model.main;
|
||||
|
||||
public class LookMeBean {
|
||||
|
||||
private String id;
|
||||
private String avatar_url;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAvatar_url() {
|
||||
return avatar_url;
|
||||
}
|
||||
|
||||
public void setAvatar_url(String avatar_url) {
|
||||
this.avatar_url = avatar_url;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.xuebiping.bolizhuzi.model.main;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LookMeListBean {
|
||||
|
||||
private List<LookMeBean> list = new ArrayList<>();
|
||||
|
||||
public List<LookMeBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<LookMeBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class DynamicDetailTwoActivity extends BaseActivity {
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_dynamic_detail_two);
|
||||
bean = getIntent().getParcelableExtra("bean");
|
||||
bean = (DynamicsItemBean) getIntent().getSerializableExtra("bean");
|
||||
mImageList.add(bean);
|
||||
setTitleName("动态详情");
|
||||
|
||||
|
||||
@@ -178,15 +178,15 @@ public class RecentDynamicFragment extends Fragment {
|
||||
@Override
|
||||
public void onDetailClicked(int position, String id) {
|
||||
detailPosition = position;
|
||||
/*Intent intent = new Intent(getContext(), DynamicDetailActivity.class);
|
||||
Intent intent = new Intent(getContext(), DynamicDetailActivity.class);
|
||||
intent.putExtra("dynamic_id", id);
|
||||
intent.putExtra("dynamic_from", 0);
|
||||
startActivity(intent);*/
|
||||
|
||||
DynamicsItemBean itemBean = mAdapter.getmDynamicsItemList().get(position);
|
||||
Intent intent = new Intent(getContext(), DynamicDetailTwoActivity.class);
|
||||
intent.putExtra("bean", (Parcelable) itemBean);
|
||||
startActivity(intent);
|
||||
|
||||
// DynamicsItemBean itemBean = mAdapter.getmDynamicsItemList().get(position);
|
||||
// Intent intent = new Intent(getContext(), DynamicDetailTwoActivity.class);
|
||||
// intent.putExtra("bean", itemBean);
|
||||
// startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.xuebiping.bolizhuzi.view.main;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.xuebiping.bolizhuzi.R;
|
||||
import com.xuebiping.bolizhuzi.controller.main.adapter.MainLookMeAdapter;
|
||||
import com.xuebiping.bolizhuzi.model.main.LookMeBean;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LookMeFragment extends Fragment implements OnRefreshLoadMoreListener {
|
||||
|
||||
private View v;
|
||||
|
||||
private SmartRefreshLayout mSmart_refresh;
|
||||
private RecyclerView mRv_recommend_list;
|
||||
private MainLookMeAdapter mMainLookMeAdapter;
|
||||
|
||||
private int mPage = 1;
|
||||
private List<LookMeBean> mData = new ArrayList<>();
|
||||
|
||||
@Nullable
|
||||
@org.jetbrains.annotations.Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
v = inflater.inflate(R.layout.fragment_look_me, container, false);
|
||||
initView(v);
|
||||
getData(mPage);
|
||||
return v;
|
||||
}
|
||||
|
||||
private void initView(View v) {
|
||||
mSmart_refresh = v.findViewById(R.id.smart_refresh);
|
||||
mRv_recommend_list = v.findViewById(R.id.rv_recommend_list);
|
||||
mRv_recommend_list.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mMainLookMeAdapter = new MainLookMeAdapter(R.layout.item_main_look_me, getActivity());
|
||||
mRv_recommend_list.setAdapter(mMainLookMeAdapter);
|
||||
|
||||
mSmart_refresh.setOnRefreshLoadMoreListener(this);
|
||||
}
|
||||
|
||||
private void getData(int page) {
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
|
||||
LookMeBean lookMeBean = new LookMeBean();
|
||||
lookMeBean.setId(i + "");
|
||||
lookMeBean.setAvatar_url("uploads/admin/202403/25/04cf409ab9148f11c0052bb254b5c155.jpg");
|
||||
mData.add(lookMeBean);
|
||||
|
||||
}
|
||||
|
||||
finishFresh();
|
||||
mMainLookMeAdapter.setList(mData);
|
||||
|
||||
}
|
||||
|
||||
public void finishFresh() {
|
||||
mSmart_refresh.finishLoadMore();
|
||||
mSmart_refresh.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore(@NonNull @NotNull RefreshLayout refreshLayout) {
|
||||
mPage++;
|
||||
getData(mPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull @NotNull RefreshLayout refreshLayout) {
|
||||
mPage = 1;
|
||||
getData(mPage);
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public class MainActivity extends BaseActivity implements DemoHelper.AppIdsUpdat
|
||||
private LuckFragment luckFragment;
|
||||
private SwipeCardFragment swipeCardFragment;
|
||||
private DynamicViewPagerFragment mDynamicViewPagerFragment;
|
||||
private MainRecommendFragment mMainRecommendFragment;
|
||||
private MainRecommend2Fragment mMainRecommendFragment;
|
||||
private MainMessageFragment mMainMessageFragment;
|
||||
private SettingFragment mSettingFragment;
|
||||
private Disposable mDisposable;
|
||||
@@ -280,27 +280,27 @@ public class MainActivity extends BaseActivity implements DemoHelper.AppIdsUpdat
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
boolean isFormTask = intent.getBooleanExtra("isFormTask", false);
|
||||
boolean isMain = intent.getBooleanExtra("isMain", false);
|
||||
if (isFormTask) {
|
||||
mBottomTab.change(1);
|
||||
}
|
||||
if (isMain) {
|
||||
int marketStatus = NoClearSPUtils.getInt(this, Constans.MARKET_STATUS, 0);
|
||||
if (marketStatus == 0 || SPUtils.getInt(this, ConsUser.TYPE) == 2) {
|
||||
mBottomTab.change(0);
|
||||
} else {
|
||||
if (UserManager.getUserInfo().isWomen()) {
|
||||
mBottomTab.change(0);
|
||||
} else {
|
||||
mBottomTab.change(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// @Override
|
||||
// protected void onNewIntent(Intent intent) {
|
||||
// super.onNewIntent(intent);
|
||||
// boolean isFormTask = intent.getBooleanExtra("isFormTask", false);
|
||||
// boolean isMain = intent.getBooleanExtra("isMain", false);
|
||||
// if (isFormTask) {
|
||||
// mBottomTab.change(1);
|
||||
// }
|
||||
// if (isMain) {
|
||||
// int marketStatus = NoClearSPUtils.getInt(this, Constans.MARKET_STATUS, 0);
|
||||
// if (marketStatus == 0 || SPUtils.getInt(this, ConsUser.TYPE) == 2) {
|
||||
// mBottomTab.change(0);
|
||||
// } else {
|
||||
// if (UserManager.getUserInfo().isWomen()) {
|
||||
// mBottomTab.change(0);
|
||||
// } else {
|
||||
// mBottomTab.change(2);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 调起使用这个会弹出hms 下载框
|
||||
@@ -876,9 +876,9 @@ public class MainActivity extends BaseActivity implements DemoHelper.AppIdsUpdat
|
||||
if (position == currentPosition) { //第二次点击
|
||||
if (position == 0) {
|
||||
if (isOne) {
|
||||
if (null != mMainRecommendFragment) {
|
||||
mMainRecommendFragment.clickRefresh();
|
||||
}
|
||||
// if (null != mMainRecommendFragment) {
|
||||
// mMainRecommendFragment.clickRefresh();
|
||||
// }
|
||||
}
|
||||
isOne = true;
|
||||
} else if (position == 1) {
|
||||
@@ -888,9 +888,9 @@ public class MainActivity extends BaseActivity implements DemoHelper.AppIdsUpdat
|
||||
}
|
||||
} else if (position == 0) { //重新点击回来,检测版本更新
|
||||
checkUpdate();
|
||||
if (null != mMainRecommendFragment) {
|
||||
mMainRecommendFragment.RefreshFragment();
|
||||
}
|
||||
// if (null != mMainRecommendFragment) {
|
||||
// mMainRecommendFragment.RefreshFragment();
|
||||
// }
|
||||
} else if (position == 3) {
|
||||
// MaleToast.showMessage(MainActivity.this,"点击了消息");
|
||||
getGreet();
|
||||
@@ -1060,7 +1060,7 @@ public class MainActivity extends BaseActivity implements DemoHelper.AppIdsUpdat
|
||||
mDynamicViewPagerFragment = new DynamicViewPagerFragment();
|
||||
}
|
||||
if (mMainRecommendFragment == null) {
|
||||
mMainRecommendFragment = new MainRecommendFragment();
|
||||
mMainRecommendFragment = new MainRecommend2Fragment();
|
||||
}
|
||||
if (mMainMessageFragment == null) {
|
||||
mMainMessageFragment = new MainMessageFragment();
|
||||
@@ -1069,24 +1069,25 @@ public class MainActivity extends BaseActivity implements DemoHelper.AppIdsUpdat
|
||||
mSettingFragment = new SettingFragment();
|
||||
}
|
||||
|
||||
mBottomTab.addTab(mMainRecommendFragment);
|
||||
mBottomTab.addTab(mDynamicViewPagerFragment);
|
||||
if (marketStatus == 0 || SPUtils.getInt(this, ConsUser.TYPE) == 2) {
|
||||
mBottomTab.addTab(swipeCardFragment);
|
||||
} else {
|
||||
mBottomTab.addTab(luckFragment);
|
||||
}
|
||||
mBottomTab.addTab(mDynamicViewPagerFragment);
|
||||
mBottomTab.addTab(mMainRecommendFragment);
|
||||
mBottomTab.addTab(mMainMessageFragment);
|
||||
mBottomTab.addTab(mSettingFragment);
|
||||
if (marketStatus == 0 || SPUtils.getInt(this, ConsUser.TYPE) == 2) {
|
||||
mBottomTab.change(0);
|
||||
} else {
|
||||
if (UserManager.getUserInfo().isWomen()) {
|
||||
mBottomTab.change(0);
|
||||
} else {
|
||||
mBottomTab.change(2);
|
||||
}
|
||||
}
|
||||
mBottomTab.change(0);
|
||||
// if (marketStatus == 0 || SPUtils.getInt(this, ConsUser.TYPE) == 2) {
|
||||
// mBottomTab.change(0);
|
||||
// } else {
|
||||
// if (UserManager.getUserInfo().isWomen()) {
|
||||
// mBottomTab.change(0);
|
||||
// } else {
|
||||
// mBottomTab.change(2);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
|
||||
@@ -0,0 +1,267 @@
|
||||
package com.xuebiping.bolizhuzi.view.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.fengliyan.uikit.UiUtils;
|
||||
import com.fengliyan.uikit.toast.MaleToast;
|
||||
import com.xuebiping.bolizhuzi.R;
|
||||
import com.xuebiping.bolizhuzi.controller.main.adapter.MainViewPagerAdapter;
|
||||
import com.xuebiping.bolizhuzi.controller.main.adapter.ScaleTransitionPagerTitleView;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.ViewPagerHelper;
|
||||
import net.lucode.hackware.magicindicator.buildins.UIUtil;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.CommonPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MainRecommend2Fragment extends Fragment implements View.OnClickListener {
|
||||
|
||||
private View v;
|
||||
private RelativeLayout mRl_home_search;
|
||||
private LinearLayout mLl_select;
|
||||
private MagicIndicator mMagicIndicator;
|
||||
private ViewPager mMainViewPager;
|
||||
|
||||
private MainViewPagerAdapter mViewPagerAdapter;
|
||||
private List<Fragment> mChannelFragments = new ArrayList<>();
|
||||
private List<String> mDataList = new ArrayList<>();
|
||||
private int mIndex = 1;
|
||||
|
||||
private LookMeFragment mLookMeFragment;
|
||||
private RecommendFragment1 mLookMeFragment1;
|
||||
private DefaultRecommendFragment mLookMeFragment2;
|
||||
private MainRecommendActiveFragment mLookMeFragment3;
|
||||
private MainRecommendPeopleFragment mLookMeFragment4;
|
||||
private MainRecommendCityFragment mLookMeFragment5;
|
||||
private LookMeFragment mLookMeFragment6;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
v = inflater.inflate(R.layout.fragment_main_recommend2, container, false);
|
||||
initView(v);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
private void initView(View v) {
|
||||
mLl_select = v.findViewById(R.id.ll_select);
|
||||
mRl_home_search = v.findViewById(R.id.rl_home_search);
|
||||
mMagicIndicator = v.findViewById(R.id.magic_indicator);
|
||||
mMainViewPager = v.findViewById(R.id.main_view_pager);
|
||||
|
||||
mLl_select.setOnClickListener(this);
|
||||
mRl_home_search.setOnClickListener(this);
|
||||
|
||||
mLookMeFragment = new LookMeFragment();
|
||||
mLookMeFragment1 = new RecommendFragment1();
|
||||
mLookMeFragment2 = new DefaultRecommendFragment();
|
||||
mLookMeFragment3 = new MainRecommendActiveFragment();
|
||||
mLookMeFragment4 = new MainRecommendPeopleFragment();
|
||||
mLookMeFragment5 = new MainRecommendCityFragment();
|
||||
mLookMeFragment6 = new LookMeFragment();
|
||||
|
||||
mChannelFragments.add(mLookMeFragment);
|
||||
mChannelFragments.add(mLookMeFragment1);
|
||||
mChannelFragments.add(mLookMeFragment2);
|
||||
mChannelFragments.add(mLookMeFragment3);
|
||||
mChannelFragments.add(mLookMeFragment4);
|
||||
mChannelFragments.add(mLookMeFragment5);
|
||||
mChannelFragments.add(mLookMeFragment6);
|
||||
|
||||
mViewPagerAdapter = new MainViewPagerAdapter(getChildFragmentManager(),
|
||||
mChannelFragments);
|
||||
mMainViewPager.setAdapter(mViewPagerAdapter);
|
||||
|
||||
initMagicIndicator();
|
||||
|
||||
mMainViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
// if (position == 3) {
|
||||
// isReClick = true;
|
||||
// mIv_more_city.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
// isReClick = false;
|
||||
// mIv_more_city.setVisibility(View.INVISIBLE);
|
||||
// }
|
||||
//
|
||||
mIndex = position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mViewPagerAdapter.notifyDataSetChanged();
|
||||
mMainViewPager.setCurrentItem(mIndex);
|
||||
}
|
||||
|
||||
private void initMagicIndicator() {
|
||||
mDataList.clear();
|
||||
mDataList.add("看过我");
|
||||
mDataList.add("推荐");
|
||||
mDataList.add("语聊");
|
||||
mDataList.add("新人");
|
||||
mDataList.add("五星");
|
||||
mDataList.add("四星");
|
||||
mDataList.add("三星");
|
||||
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mDataList == null ? 0 : mDataList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int index) {
|
||||
SimplePagerTitleView simplePagerTitleView = new ScaleTransitionPagerTitleView(context);
|
||||
simplePagerTitleView.setText(mDataList.get(index));
|
||||
simplePagerTitleView.setTextSize(20);
|
||||
simplePagerTitleView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));//加粗
|
||||
simplePagerTitleView.setNormalColor(Color.parseColor("#33000000"));
|
||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#000000"));
|
||||
simplePagerTitleView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// if (isReClick && index == 3) {
|
||||
// Intent intent = new Intent(getActivity(), CityPickerActivity.class);
|
||||
// startActivityForResult(intent, RECOMMEND_CHANGE_CITY_REQUEST);
|
||||
// } else {
|
||||
// mMainViewPager.setCurrentItem(index);
|
||||
// }
|
||||
Log.d("nail", "onClick: " + index);
|
||||
mMainViewPager.setCurrentItem(index);
|
||||
|
||||
}
|
||||
});
|
||||
return simplePagerTitleView;
|
||||
|
||||
// CommonPagerTitleView commonPagerTitleView = new CommonPagerTitleView(getActivity());
|
||||
// commonPagerTitleView.setContentView(R.layout.main_pager_title_layout);
|
||||
//
|
||||
// // 初始化
|
||||
// ImageView iv_selected = (ImageView) commonPagerTitleView.findViewById(R.id.iv_selected);
|
||||
// ImageView iv_no_selected = (ImageView) commonPagerTitleView.findViewById(R.id.iv_no_selected);
|
||||
// final TextView titleText = (TextView) commonPagerTitleView.findViewById(R.id.title_text);
|
||||
// titleText.setText(mDataList.get(index));
|
||||
// commonPagerTitleView.setPadding(UIUtil.dip2px(context, 5),
|
||||
// UIUtil.dip2px(context, 0),
|
||||
// UIUtil.dip2px(context, 5),
|
||||
// UIUtil.dip2px(context, 0));
|
||||
//
|
||||
// commonPagerTitleView.setOnPagerTitleChangeListener(new CommonPagerTitleView.OnPagerTitleChangeListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSelected(int index, int totalCount) {
|
||||
// titleText.setTextSize(16);
|
||||
// titleText.setTextColor(Color.parseColor("#ffffff"));
|
||||
// titleText.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
// iv_selected.setVisibility(View.VISIBLE);
|
||||
// iv_no_selected.setVisibility(View.INVISIBLE);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onDeselected(int index, int totalCount) {
|
||||
// titleText.setTextSize(16);
|
||||
// titleText.setTextColor(Color.parseColor("#33000000"));
|
||||
// titleText.setTypeface(Typeface.DEFAULT);
|
||||
// iv_selected.setVisibility(View.INVISIBLE);
|
||||
// iv_no_selected.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
|
||||
// // rl_title_bg.setScaleX(1.3f + (0.8f - 1.3f) * leavePercent);
|
||||
// //rl_title_bg.setScaleY(1.3f + (0.8f - 1.3f) * leavePercent);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
|
||||
// // rl_title_bg.setScaleX(0.8f + (1.3f - 0.8f) * enterPercent);
|
||||
// // rl_title_bg.setScaleY(0.8f + (1.3f - 0.8f) * enterPercent);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// commonPagerTitleView.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// if (isReClick && index == 3) {
|
||||
// Intent intent = new Intent(getActivity(), CityPickerActivity.class);
|
||||
// startActivityForResult(intent, RECOMMEND_CHANGE_CITY_REQUEST);
|
||||
// } else {
|
||||
// mMainViewPager.setCurrentItem(index);
|
||||
// }
|
||||
// mMainViewPager.setCurrentItem(index);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// return commonPagerTitleView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerIndicator getIndicator(Context context) {
|
||||
// LinePagerIndicator indicator = new LinePagerIndicator(context);
|
||||
// indicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
|
||||
// indicator.setLineHeight(UIUtil.dip2px(context, 10));
|
||||
// indicator.setLineWidth(UIUtil.dip2px(context, 20));
|
||||
// indicator.setRoundRadius(UIUtil.dip2px(context, 0));
|
||||
// indicator.setStartInterpolator(new AccelerateInterpolator());
|
||||
// indicator.setEndInterpolator(new DecelerateInterpolator(2.0f));
|
||||
// indicator.setColors(getResources().getColor(R.color.yellow_ffd33e));
|
||||
// indicator.setYOffset(UIUtil.dip2px(context, 10));
|
||||
// indicator.setXOffset(0);
|
||||
|
||||
LinePagerIndicator indicator = new LinePagerIndicator(context);
|
||||
indicator.setColors(getResources().getColor(R.color.yellow_ffd33e));
|
||||
indicator.setLineHeight(UIUtil.dip2px(context, 10));
|
||||
indicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
mMagicIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mMagicIndicator, mMainViewPager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (view == mRl_home_search) {
|
||||
MaleToast.showMessage(getActivity(), "搜索");
|
||||
}else if (view == mLl_select) {
|
||||
MaleToast.showMessage(getActivity(), "筛选");
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 647 B |
8
app/src/main/res/drawable/look_me_online_bg.xml
Normal file
8
app/src/main/res/drawable/look_me_online_bg.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#6CE4B7"/>
|
||||
<corners android:radius="@dimen/dp16"/>
|
||||
|
||||
</shape>
|
||||
75
app/src/main/res/layout/fragment_look_me.xml
Normal file
75
app/src/main/res/layout/fragment_look_me.xml
Normal file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:viewBindingIgnore="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_content_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible">
|
||||
|
||||
<com.scwang.smartrefresh.layout.header.ClassicsHeader
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:srlEnableLastTime="false" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_no_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp100"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp150"
|
||||
android:layout_height="@dimen/dp88"
|
||||
android:src="@mipmap/icon_img_no_black" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp5"
|
||||
android:text="暂无数据"
|
||||
android:textColor="@color/three_text"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_recommend_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_10" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
65
app/src/main/res/layout/fragment_main_recommend2.xml
Normal file
65
app/src/main/res/layout/fragment_main_recommend2.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_head"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp48">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_select"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="筛选"
|
||||
android:textColor="#ffe472ed"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_main_select_man_and_woman"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="1000dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_home_search"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="@dimen/dp44"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_home_search" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/main_view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/rl_head" />
|
||||
|
||||
</RelativeLayout>
|
||||
108
app/src/main/res/layout/item_main_look_me.xml
Normal file
108
app/src/main/res/layout/item_main_look_me.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:fresco="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:layout_marginBottom="@dimen/dp10"
|
||||
android:layout_marginLeft="@dimen/dp16"
|
||||
android:layout_marginRight="@dimen/dp16"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/dp50"
|
||||
android:layout_height="@dimen/dp50">
|
||||
|
||||
<com.facebook.drawee.view.SimpleDraweeView
|
||||
android:id="@+id/list_photo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
fresco:roundAsCircle="true" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_online_bg"
|
||||
android:layout_width="@dimen/dp30"
|
||||
android:layout_height="@dimen/dp16"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/look_me_online_bg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_online"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="在线"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="瑞恩 Rain"
|
||||
android:textColor="@color/one_text"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp6"
|
||||
android:text="1小时前在线"
|
||||
android:textColor="@color/three_text"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="共 "
|
||||
android:textColor="@color/three_text"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_visit_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1次"
|
||||
android:textColor="@color/yellow_ffd33e"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" 访问"
|
||||
android:textColor="@color/three_text"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
BIN
app/src/main/res/mipmap-xxhdpi/icon_img_no_black.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/icon_img_no_black.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Reference in New Issue
Block a user