既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
<?xml version="1.0" encoding="utf-8"?><RelativeLayout
xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:tools=“http://schemas.android.com/tools”
android:id=“@+id/activity_main”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
tools:context=“com.qj.vrpanoramaviewlist.MainActivity”>
<android.support.v7.widget.RecyclerView
android:id=“@+id/recycleview”
android:layout_width=“match_parent”
android:layout_height=“match_parent”/>
mRecyclerView = (RecyclerView) findViewById(R.id.recycleview);
//全景图控件初始化
vrPanoramaView = new VrPanoramaView(this);
vrPanoramaView.setStereoModeButtonEnabled(false);//眼镜模式按钮禁掉
vrPanoramaView.setFullscreenButtonEnabled(false); //全屏模式按钮禁掉
vrPanoramaView.setInfoButtonEnabled(false); //信息按钮禁掉
vrPanoramaView.setTouchTrackingEnabled(true); //开启手触模式
options = new VrPanoramaView.Options();
options.inputType = VrPanoramaView.Options.TYPE_MONO;
为RecycleView准备数据,设置适配器
//准备数据,这里模拟假数据
mDatas = new ArrayList();
for (int i = ‘A’; i < ‘M’; i++) {
mDatas.add(String.valueOf((char) i));
}
mSize = mDatas.size();
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mAdapter = new HomeAdapter();
mRecyclerView.setAdapter(mAdapter);
看看HomeAdapter的内容:
class HomeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == PANORAMA_ITEM) {
return new VrPanoramaViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_panorama, parent, false));
} else {
return new FooterHolder(LayoutInflater.from(mContext).inflate(R.layout.item_footer, parent, false));
}
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (mSize - position > 2) {
VrPanoramaViewHolder h = (VrPanoramaViewHolder) holder;
h.tv.setText(mDatas.get(position));
h.iv.setBackgroundResource(plan[position]);
if (isFirstTime) {//首次进入要显示第一个item的全景
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), vr[0]);
vrPanoramaView.loadImageFromBitmap(bitmap, options);
h.iv.addView(vrPanoramaView);
currentPos = 0;
isFirstTime = false;
}
} else if (position == mSize - 1) {
FooterHolder h = (FooterHolder) holder;
h.tv.setText(“到底啦…”);
}
Log.e(TAG, "onBindViewHolder: " + position);
}
@Override
public int getItemCount() {
return mSize;
}
@Override
public int getItemViewType(int position) {
if (mSize - position > 2) {
return PANORAMA_ITEM;//全景图类型的item
} else {
return FOOTER_ITEM;//底部填充的两个item
}
}
class VrPanoramaViewHolder extends RecyclerView.ViewHolder {//全景图的Holder
FrameLayout iv;
TextView tv;
public VrPanoramaViewHolder(View view) {
super(view);
iv = (FrameLayout) view.findViewById(R.id.iv_content);
tv = (TextView) view.findViewById(R.id.content_name);
}
}
class FooterHolder extends RecyclerView.ViewHolder {//底部填充的Holder
TextView tv;
public FooterHolder(View view) {
super(view);
tv = (TextView) view.findViewById(R.id.footer_tv);
}
}
}
对RecycleView添加滚动监听:
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!