Category:Android

  • ellipsize_end textview

    Time:2021-5-6

    Most of the time, the text display is limited, there is a Maxine, and then you are required to intercept at the end of the last line, and the end of the last line is… (XXX text…), so just set the ellipsize in your XML_ Just end,howeverSometimes the demand is strange, system controls can not […]

  • Android custom view to achieve cool progress bar

    Time:2021-5-6

    This example for you to share the Android cool progress bar specific code, for your reference, the specific content is as follows Let’s achieve the following effect: Step one:Create attrs folder and customize its properties <?xml version=”1.0″ encoding=”utf-8″?> <resources> <declare-styleable name=”MyProgress”> <attr name=”out_color” format=”color”/> <attr name=”inner_color” format=”color”/> <attr name=”border_width” format=”dimension”/> <attr name=”text_color” format=”color”/> <attr name=”text_size” […]

  • Android custom view imitating QQ movement steps effect

    Time:2021-5-5

    This example for you to share the Android QQ movement steps of the specific code, for your reference, the specific content is as follows Today we achieve the following effect: First, customize the attributes: <?xml version=”1.0″ encoding=”utf-8″?> <resources> <declare-styleable name=”MyQQStep”> <attr name=”out_color” format=”color”/> <attr name=”inner_color” format=”color”/> <attr name=”border_width” format=”dimension”/> <attr name=”text_size” format=”dimension”/> <attr name=”text_color” format=”color”/> […]

  • Adventure of activity display interface

    Time:2021-5-4

    preface stayActivity display viewThere are some important roles that people can’t understand clearly, such asPhoneWindow、DecorView、ViewRootImpl。 Also often have the interview question to be able to ask, between them four relations? When to create it? When is the first time view draws? And so on. So today, let’s start with youActivityStart to see what steps will […]

  • Why GraphQL? Six questions

    Time:2021-5-3

    Why GraphQL? Six questions Graphql is an API standardspecification. For each new technology, there are six issues to be clarified: 1. The background of this technology, the original intention, what kind of goal to achieve or what kind of problem to solve 2. What are the advantages and disadvantages of this technology, or what is […]

  • Implementation of Gobang with Android simple custom view

    Time:2021-5-3

    This example for you to share the Android custom view to achieve Gobang specific code, for your reference, the specific content is as follows Let’s talk about it first. Android’s custom view is to implement a class to inherit view and implement its methods. I’m most interested in the OnDraw method, because you need to […]

  • How to use graphql client: Apollo Android

    Time:2021-5-2

    How to use graphql client: Apollo Android An android app, how to use graphqlThis article takes the most popular Apollo android as an example Add dependency First, add the dependency: https://www.apollographql.com/docs/android/essentials/get-started-kotlin/ Note that in Android block, the following two things should be added: compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = ‘1.8’ […]

  • Android custom view to achieve Gobang games

    Time:2021-5-2

    This example for you to share the Android Gobang game specific code, for your reference, the specific content is as follows Picture: code: package com.example.fiveson; import java.util.LinkedList; import java.util.List; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; public class FiveSon extends View { public FiveSon(Context context) { super(context); // […]

  • App startup page optimization

    Time:2021-5-1

    There are many app startup pages that are still the same splash activity, and then jump to mainactivity. First, splash loads the data once, and then it loads the data after entering main, so you have to wait for two loads. What if the reverse is true Here, mainactivity can be loaded first, and then […]

  • Implementation of Gobang game with Android custom view

    Time:2021-5-1

    This example for you to share the specific code of Android Gobang game, for your reference, the specific content is as follows 1. Effect picture: 2. Gobangpanel: public class GobangPanel extends View { private int mPanelWidth;// The width of the chessboard private float mLineHeight;// All right, float private int MAX_ LINE = 15;// Chessboard rows […]

  • 1.3.0-alpha04 Fragment result api

    Time:2021-4-30

    On April 29, 2020, the  androidx. fragment:fragment : version 1.3.0-alpha 04, the modified version discards the previous fragment data transmission mode and adds a new API, as shown in the figure below   In the past, fragments should have been used to transfer data. There are many ways to obtain fragment instances, arguments, callbacks, and […]

  • Android custom view to achieve jigsaw puzzle games

    Time:2021-4-30

    This example for you to share the Android jigsaw puzzle specific code, for your reference, the specific content is as follows 1. Effect picture: Run time: At the end: 2、PuzzleLayoutView: public class PuzzleLayoutView extends RelativeLayout implements View.OnClickListener { //It means to cut it into 2 * 2 pieces (default 4 pieces) private int mColumn = […]