ConstraintLayout2.0 MotionEffect, simple code to achieve cool dynamic effect!

MotionEffectMotionEffect is a new MotionHelper in 2.1, which allows you to automatically add keys to the view it refers to according to the overall motion direction of the view. It can simplify the creation of many transition animations.To better understand its role, take a look at the following example. This example only uses the start and end ...

Posted by PGTibs on Fri, 17 Dec 2021 10:20:12 +0100

Android kotlin: beginners can understand it. Analysis of real interview questions of aliqiu recruitment

1. Remote control story: Generic Girlfriend: I really want a universal remote control. Me: why don't I teach you to implement one with Kotlin's generics! Girlfriend: cut, you want to fool me to learn Kotlin. [white eyes] Me: it's really simple. I'm sure you'll see it at a glance. 1-1 generic class Me: This is a universal remote ...

Posted by dustbuster on Fri, 17 Dec 2021 01:05:23 +0100

Detailed explanation of Android MediaPlayer audio player, tearful finishing experience

stop() stops playback prepare() resource preparation prepareAsync() prepares asynchronously and does not block UI threads seekTo(int msec) locates the specified location in milliseconds Is isLooping looping Isplayingplayback status Duration total duration currentPosition current position release() resource release Component Tree === ...

Posted by kabucek on Fri, 17 Dec 2021 00:58:04 +0100

Android gradle automated multi-channel packaging, introduction to Android development tutorial

} // Download address of reinforcement protection def downloadUrl = isWindows() ? packers["jiagubao_windows"] : packers["jiagubao_mac"] // mac comes with curl command. windows needs to download curl installation def cmd = "curl -o ${packers["zipPath"]} ${downloadUrl}" println cmd cmd.execute().waitForProcessOutput(S ...

Posted by FijiSmithy on Fri, 17 Dec 2021 00:49:19 +0100

Android sideslip return analysis and Implementation (not high imitation wechat, college student)

stay styles The following two properties are configured in: ``` <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowIsTranslucent">true</item> ``` Then monitor the sideslip event and move the top layer Activity of ContentView,You can reall ...

Posted by Warz on Thu, 16 Dec 2021 23:47:57 +0100

Android image Bitmap parsing

1, Introduction Main uses of Bitmap: Set background for ImageView Use as canvas imageView.setImageBitmap(Bitmap bm); // Set background for ImageView Canvas canvas = new Canvas(Bitmap bm); // Use as canvas 2, Bitmap compression Load Bitmap Bitmap in Android refers to a picture, which can be png format or jpg and other common picture format ...

Posted by billiondevil on Thu, 16 Dec 2021 22:04:06 +0100

Android has been working on Android for 6 years to obtain the location and coordinates of the sub View

public View(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { } ``` View constructor in source code Through the comments of the source code, we can see that: If the view is new in Java code, call the first constructor – > View (context); If the view is declared in xml, the second constructo ...

Posted by socio on Thu, 16 Dec 2021 22:00:02 +0100

Detailed explanation of Android external storage and internal storage, from entry to mastery

The complete code is as follows: public class ExternalActivity extends AppCompatActivity { private EditText infoEdt; private TextView txt; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_external); infoEdt = ...

Posted by hammerloaf on Thu, 16 Dec 2021 21:42:49 +0100

Android custom View minimum necessary knowledge, advanced Android Development Technology

The custom View includes three parts: LayoutDrawingTouch feedback (Event Handling) Layout stage: determine the position and size of the View. Drawing stage: draw the contents of the View. Touch feedback: determine where the user clicked. The layout stage includes two processes: Measurement and layout. In addition, the layout stage supports t ...

Posted by Jaguar83 on Thu, 16 Dec 2021 20:45:58 +0100

Analysis of OkHttp source code (very thin and very long)

prefaceThis article is a detailed analysis of the OkHttp open source library. If you feel you don't know enough about OkHttp, you want to learn more. I believe this article will be helpful to you.This article contains a detailed analysis of the request process, the interpretation of major interceptors and a summary of my reflection. The article ...

Posted by akrocks_extreme on Thu, 16 Dec 2021 18:05:44 +0100