【Java转Android】60

<?xml version="1.0" encoding="utf-8"?>

<android.support.design.widget.CoordinatorLayout

xmlns:android=“http://schemas.android.com/apk/res/android”

xmlns:app=“http://schemas.android.com/apk/res-auto”

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:fitsSystemWindows=“true”>

<android.support.design.widget.AppBarLayout

android:id=“@+id/appBar”

android:layout_width=“match_parent”

android:layout_height=“250dp”

android:fitsSystemWindows=“true”>

<android.support.design.widget.CollapsingToolbarLayout

android:id=“@+id/collapsing_toolbar”

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:theme=“@style/ThemeOverlay.AppCompat.Dark.ActionBar”

android:fitsSystemWindows=“true”

app:contentScrim=“?attr/colorPrimary”

app:layout_scrollFlags=“scroll|exitUntilCollapsed”>

<ImageView

android:id=“@+id/fruit_image_view”

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:scaleType=“centerCrop”

android:fitsSystemWindows=“true”

app:layout_collapseMode=“parallax” />

<android.support.v7.widget.Toolbar

android:id=“@+id/toolbar”

android:layout_width=“match_parent”

android:layout_height=“?attr/actionBarSize”

app:layout_collapseMode=“pin” />

</android.support.design.widget.CollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout>

<android.support.v4.widget.NestedScrollView

android:layout_width=“match_parent”

android:layout_height=“match_parent”

app:layout_behavior=“@string/appbar_scrolling_view_behavior”>

<LinearLayout

android:orientation=“vertical”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”>

<android.support.v7.widget.CardView

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginBottom=“15dp”

android:layout_marginLeft=“15dp”

android:layout_marginRight=“15dp”

android:layout_marginTop=“35dp”

app:cardCornerRadius=“4dp”>

<TextView

android:id=“@+id/fruit_content_text”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_margin=“10dp” />

</android.support.v7.widget.CardView>

</android.support.v4.widget.NestedScrollView>

<android.support.design.widget.FloatingActionButton

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_margin=“16dp”

android:src=“@drawable/ic_comment”

app:layout_anchor=“@id/appBar”

app:layout_anchorGravity=“bottom|end” />

</android.support.design.widget.CoordinatorLayout>

@Override

public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

if (mContext == null) {

mContext = parent.getContext();

}

View view = LayoutInflater.from(mContext).inflate(R.layout.fruit_item, parent, false);

final ViewHolder holder = new ViewHolder(view);

holder.cardView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

int position = holder.getAdapterPosition();

Fruit fruit = mFruitList.get(position);

Intent intent = new Intent(mContext, FruitActivity.class);

intent.putExtra(FruitActivity.FRUIT_NAME, fruit.getName());

intent.putExtra(FruitActivity.FRUIT_IMAGE_ID, fruit.getImageId());

mContext.startActivity(intent);

}

});

return holder;
}

总结

其他的内容都可以按照路线图里面整理出来的知识点逐一去熟悉,学习,消化,不建议你去看书学习,最好是多看一些视频,把不懂地方反复看,学习了一节视频内容第二天一定要去复习,并总结成思维导图,形成树状知识网络结构,方便日后复习。

这里还有一份很不错的《Java基础核心总结笔记》,特意跟大家分享出来

目录:

部分内容截图:

,形成树状知识网络结构,方便日后复习。

这里还有一份很不错的《Java基础核心总结笔记》,特意跟大家分享出来

目录:

[外链图片转存中…(img-K4xv6e4e-1714511925105)]

部分内容截图:

[外链图片转存中…(img-eJokbhuP-1714511925106)]

[外链图片转存中…(img-BZdRYb1k-1714511925106)]

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

  • 22
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值