First look at the code :
[java]?[view plain]( )[copy]( )[print]( )[?]( )
-
package?com.xys.flexible;??
-
import?android.content.Context;??
-
import?android.util.AttributeSet;??
-
import?android.util.DisplayMetrics;??
-
import?android.widget.ScrollView;??
-
public?class?FlexibleScrollView?extends?ScrollView?{??
-
????private?Context?mContext;??
-
????private?static?int?mMaxOverDistance?=?50;??
-
????public?FlexibleScrollView(Context?context,?AttributeSet?attrs,??
-
????????????int?defStyleAttr)?{??
-
????????super(context,?attrs,?defStyleAttr);??
-
????????this.mContext?=?context;??
-
????????initView();??
-
????}??
-
????public?FlexibleScrollView(Context?context,?AttributeSet?attrs)?{??
-
????????super(context,?attrs);??
-
????????this.mContext?=?context;??
-
????????initView();??
-
????}??
-
????public?FlexibleScrollView(Context?context)?{??
- ????????supe
《Android Summary of learning notes + Latest mobile architecture video + Big Android interview questions + Project actual combat source code handout 》
【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 Open source sharing of complete information
r(context);??
-
????????this.mContext?=?context;??
-
????????initView();??
-
????}??
-
????private?void?initView()?{??
-
????????DisplayMetrics?metrics?=?mContext.getResources().getDisplayMetrics();??
-
????????float?density?=?metrics.density;??
-
????????mMaxOverDistance?=?(int)?(density?*?mMaxOverDistance);??
-
????}??
-
????protected?boolean?overScrollBy(int?deltaX,?int?deltaY,?int?scrollX,??
-
????????????int?scrollY,?int?scrollRangeX,?int?scrollRangeY,??
-
????????????int?maxOverScrollX,?int?maxOverScrollY,?boolean?isTouchEvent)?{??
-
????????return?super.overScrollBy(deltaX,?deltaY,?scrollX,?scrollY,??
-
????????????????scrollRangeX,?scrollRangeY,?maxOverScrollX,?mMaxOverDistance,??
-
????????????????isTouchEvent);??
-
????}??
- }??
In fact, although we have rewritten ScrollView( perhaps ListView), But only one value of one of its methods has been changed !
Also is to overScrollBy Medium maxOverScrollY It's changed to our own values .
Test layout :
[html]?[view plain]( )[copy]( )[print]( )[?]( )
-
<RelativeLayout?xmlns:android\=" http://schemas.android.com/apk/res/android"??
-
????xmlns:tools\=" http://schemas.android.com/tools"??
-
????android:layout_width\="match_parent"??
-
????android:layout_height\="match_parent"??
-
????android:paddingBottom\="@dimen/activity_vertical_margin"??
-
????android:paddingLeft\="@dimen/activity_horizontal_margin"??
- ????android:paddingRight\="@dimen/activity_horizontal_margin"??
Last
Actually Android There are so many knowledge points in development , There are still so many things to ask about in the interview . So there's no other trick to an interview , It depends on how well you are prepared for these knowledge points .so, When you go out for an interview, you should first see which stage you have reviewed .
Shared above tencent 、 headlines 、 Ali 、 Meituan 、 Byte skipping and so on 2019-2021 High frequency interview questions in , Bloggers also organized these technical points into videos and PDF( In fact, it took a lot more energy than expected ), contain The context of knowledge + A lot of details , Due to limited space , The above is just a part of the picture .
【Android Mind map ( The skill tree )】
Knowledge system is not perfect ? And here's what's sorted out Android Mind map for advanced learning , Here's a direction for your reference .
【Android Advanced architecture video learning resources 】
This article has been CODING Open source project :《Android Summary of learning notes + Mobile architecture video + The real interview question of Dachang + Project source code 》 Included
thank