2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
🍎personal blog:Homepage
🏆Personal Column:Android
⛳️ No effort is wasted, success is achieved
Table of contents
7.11 res+AndroidManifest Notes
AndroidMainifest.xml file under main
appComponentFactory="androidx.core.app.CorecomponentFactory"
requestLegacyExternalStorage="true"
dataExtractionRules="@xml/data_extraction_rules"
fullBackupContent="@xml/backup_rules"
android:name=".MainActivity" android.:exported="true"
android:name ="android.intent.action.MAIN"
android:name=“android.intent.categoty.LAUNCHER"
android:layout_height='match_parent' defines the layout height to match the parent container
android: orientation="vertical" arranges subviews vertically
tools:context sets the context for previewing to: . . . .
android:backgroung: Set the background to black
android:id sets this unique identifier id
android:editable Sets whether the EditText can be edited android:orientation="horizontal" Specifies the subview arrangement direction of LinearLayout or other layout containers that support direction. hori is the horizontal arrangement of the view android:gravity="center_horizontal"> is used to set the horizontal alignment of the view content within its available space. center aligns the view horizontally in the center
android:background="@drawable/selector"/><!-- 设置按钮的背景为selector资源 -->
android:state_pressed
: Pressed state.
android:state_focused
: Focus status.
android:state_checked
: Selected state.
android:state_enabled
: Enabled state.
android:state_selected
: Selected state.
android:state_hovered
: Hover state (usually used for mouse hover).
selector
It is a resource file in Android that is used to define the appearance of UI elements (such as buttons, images, etc.) in different states.selector
You can specify different backgrounds, images or colors for a UI element in different states (such as pressed, focused, selected, etc.) to achieve dynamic effects.
``: This is the root element, indicating that this is a selector resource.
``: Each item
An element represents a state.
android:drawable
: Specifies the resources used in this state, such as colors or images.
android:state_pressed="true"
: Indicates the state of the button being pressed. There are other states that can be used, such as state_focused
(Focus),state_checked
(selected),state_enabled
(Enable), etc.
Default state item
: Resources used when no other state is satisfied. Usually placed last.
<!-- 当按钮被按下时,使用 gray 作为背景 --> <item android:drawable="@drawable/gray" android:state_pressed="true"/> <!-- 当按钮处于默认状态时,使用 white 作为背景 --> <item android:drawable="@drawable/white"/>
It is a resource file that defines drawable geometric shapes. It allows you to create simple graphic elements, such as rectangles, rounded rectangles, ellipses, and background dividing lines of buttons.
`` is the root element in the Android resource file, which is used to define various types of resources, such as strings, colors, sizes, etc. These resources can be referenced and used in different parts of the application, thereby achieving centralized management and reuse of resources.
Contains application-related properties and component declarations
Do you want to allow application data backup?
Defines the application icon
Defines a circular icon for devices that support circular icons
Whether to support right-to-left layout direction
The application theme specifies the style used by the application
Define the application component factory class to instantiate application components
Request to use the legacy external storage permission, applicable to Android Q (29) and above
Specifying the target API level of the tool does not affect the actual runtime behavior
Specify the location of the data extraction rules file (can be deleted if not needed)
Specifies the location of the full backup content file (can be deleted)
Define an activity component 'android:name' to specify the activity class name
android:exported specifies whether the activity can be started by other applications
The activity's intent filter determines which intents the activity can respond to.
Specify the activity as the main entry activity, the default activity when the application starts
Add the activity to the launcher so that it appears in the list of applications.
[JAVA] What is the difference between run() and start() of a thread? -CSDN Blog
[JAVA] Java8 starts ConcurrentHashMap, why abandon segment locks? -CSDN Blog
[JAVA] How to ensure that a collection cannot be modified - CSDN blog
[Mybatis] How to prevent SQL injection in Mybatis-CSDN Blog