Android DrawerLayout 高仿QQ5,2024年最新jvvm面试题

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Android开发知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip204888 (备注Android)
img

正文

<RelativeLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content” >

<ImageView

android:id=“@+id/one”

android:layout_width=“50dp”

android:layout_height=“50dp”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_marginTop=“20dp”

android:src=“@drawable/img_1” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_toRightOf=“@id/one”

android:text=“第1个Item”

android:textColor=“#f0f0f0”

android:textSize=“20sp” />

<RelativeLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content” >

<ImageView

android:id=“@+id/two”

android:layout_width=“50dp”

android:layout_height=“50dp”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_marginTop=“20dp”

android:src=“@drawable/img_2” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_toRightOf=“@id/two”

android:text=“第2个Item”

android:textColor=“#f0f0f0”

android:textSize=“20sp” />

<RelativeLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content” >

<ImageView

android:id=“@+id/three”

android:layout_width=“50dp”

android:layout_height=“50dp”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_marginTop=“20dp”

android:src=“@drawable/img_3” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_toRightOf=“@id/three”

android:text=“第3个Item”

android:textColor=“#f0f0f0”

android:textSize=“20sp” />

<RelativeLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content” >

<ImageView

android:id=“@+id/four”

android:layout_width=“50dp”

android:layout_height=“50dp”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_marginTop=“20dp”

android:src=“@drawable/img_4” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_toRightOf=“@id/four”

android:text=“第4个Item”

android:textColor=“#f0f0f0”

android:textSize=“20sp” />

<RelativeLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content” >

<ImageView

android:id=“@+id/five”

android:layout_width=“50dp”

android:layout_height=“50dp”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_marginTop=“20dp”

android:src=“@drawable/img_5” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_marginLeft=“20dp”

android:layout_toRightOf=“@id/five”

android:text=“第5个Item”

android:textColor=“#f0f0f0”

android:textSize=“20sp” />

其实就是堆出来的布局~~没撒意思~

2、MenuRightFragment


package com.zhy.demo_zhy_17_drawerlayout;

import android.os.Bundle;

import android.support.v4.app.Fragment;

import android.view.LayoutInflater;

import android.view.View;

import android.view.ViewGroup;

public class MenuRightFragment extends Fragment

{

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container,

Bundle savedInstanceState)

{

return inflater.inflate(R.layout.menu_layout_right, container, false);

}

}

对应布局文件:

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

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

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:gravity=“center_vertical”

android:orientation=“vertical” >

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_gravity=“center_vertical”

android:layout_marginBottom=“20dp”

android:orientation=“vertical” >

<ImageView

android:layout_width=“60dp”

android:layout_height=“60dp”

android:layout_gravity=“center”

android:src=“@drawable/wode” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:gravity=“center”

android:text=“扫一扫”

android:textColor=“#ffffff” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_gravity=“center_vertical”

android:layout_marginBottom=“20dp”

android:orientation=“vertical” >

<ImageView

android:layout_width=“60dp”

android:layout_height=“60dp”

android:layout_gravity=“center”

android:src=“@drawable/saoma” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:gravity=“center”

android:text=“讨论组”

android:textColor=“#ffffff” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_gravity=“center_vertical”

android:layout_marginBottom=“20dp”

android:orientation=“vertical” >

<ImageView

android:layout_width=“60dp”

android:layout_height=“60dp”

android:layout_gravity=“center”

android:src=“@drawable/wode” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:gravity=“center”

android:text=“扫一扫”

android:textColor=“#ffffff” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_centerVertical=“true”

android:layout_gravity=“center_vertical”

android:layout_marginBottom=“20dp”

android:orientation=“vertical” >

<ImageView

android:layout_width=“60dp”

android:layout_height=“60dp”

android:layout_gravity=“center”

android:src=“@drawable/saoma” />

<TextView

android:layout_width=“fill_parent”

android:layout_height=“wrap_content”

android:gravity=“center”

android:text=“讨论组”

android:textColor=“#ffffff” />

依旧很简单,除了图标比较难找以外~~

3、MainActivity


MainActivity的布局文件已经贴过了~~

package com.zhy.demo_zhy_17_drawerlayout;

import android.os.Bundle;

import android.support.v4.app.FragmentActivity;

import android.support.v4.widget.DrawerLayout;

import android.support.v4.widget.DrawerLayout.DrawerListener;

import android.view.Gravity;

import android.view.View;

import android.view.Window;

import com.nineoldandroids.view.ViewHelper;

public class MainActivity extends FragmentActivity

{

private DrawerLayout mDrawerLayout;

@Override

protected void onCreate(Bundle savedInstanceState)

{

super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.activity_main);

initView();

initEvents();

}

public void OpenRightMenu(View view)

{

mDrawerLayout.openDrawer(Gravity.RIGHT);

mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED,

Gravity.RIGHT);

}

private void initEvents()

{

mDrawerLayout.setDrawerListener(new DrawerListener()

{

@Override

public void onDrawerStateChanged(int newState)

{

}

@Override

public void onDrawerSlide(View drawerView, float slideOffset)

{

View mContent = mDrawerLayout.getChildAt(0);

View mMenu = drawerView;

float scale = 1 - slideOffset;

float rightScale = 0.8f + scale * 0.2f;

if (drawerView.getTag().equals(“LEFT”))

{

float leftScale = 1 - 0.3f * scale;

ViewHelper.setScaleX(mMenu, leftScale);

ViewHelper.setScaleY(mMenu, leftScale);

ViewHelper.setAlpha(mMenu, 0.6f + 0.4f * (1 - scale));

ViewHelper.setTranslationX(mContent,

mMenu.getMeasuredWidth() * (1 - scale));

ViewHelper.setPivotX(mContent, 0);

ViewHelper.setPivotY(mContent,

mContent.getMeasuredHeight() / 2);

mContent.invalidate();

ViewHelper.setScaleX(mContent, rightScale);

ViewHelper.setScaleY(mContent, rightScale);

总结

现在新技术层出不穷,如果每次出新的技术,我们都深入的研究的话,很容易分散精力。新的技术可能很久之后我们才会在工作中用得上,当学的新技术无法学以致用,很容易被我们遗忘,到最后真的需要使用的时候,又要从头来过(虽然上手会更快)。

我觉得身为技术人,针对新技术应该是持拥抱态度的,入了这一行你就应该知道这是一个活到老学到老的行业,所以面对新技术,不要抵触,拥抱变化就好了。

Flutter 明显是一种全新的技术,而对于这个新技术在发布之初,花一个月的时间学习它,成本确实过高。但是周末花一天时间体验一下它的开发流程,了解一下它的优缺点、能干什么或者不能干什么。这个时间,并不是我们不能接受的。

如果有时间,其实通读一遍 Flutter 的文档,是最全面的一次对 Flutter 的了解过程。但是如果我们只有 8 小时的时间,我希望能关注一些最值得关注的点。

(跨平台开发(Flutter)、java基础与原理,自定义view、NDK、架构设计、性能优化、完整商业项目开发等)

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注Android)
img

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

学的新技术无法学以致用,很容易被我们遗忘,到最后真的需要使用的时候,又要从头来过(虽然上手会更快)。

我觉得身为技术人,针对新技术应该是持拥抱态度的,入了这一行你就应该知道这是一个活到老学到老的行业,所以面对新技术,不要抵触,拥抱变化就好了。

Flutter 明显是一种全新的技术,而对于这个新技术在发布之初,花一个月的时间学习它,成本确实过高。但是周末花一天时间体验一下它的开发流程,了解一下它的优缺点、能干什么或者不能干什么。这个时间,并不是我们不能接受的。

如果有时间,其实通读一遍 Flutter 的文档,是最全面的一次对 Flutter 的了解过程。但是如果我们只有 8 小时的时间,我希望能关注一些最值得关注的点。

(跨平台开发(Flutter)、java基础与原理,自定义view、NDK、架构设计、性能优化、完整商业项目开发等)

[外链图片转存中…(img-A3434Nuj-1713714163933)]

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注Android)
[外链图片转存中…(img-29WoCZWH-1713714163933)]

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值