AS add lo

这个博客展示了如何在Android应用中使用LinearLayout和RelativeLayout来创建布局,并详细介绍了如何集成并使用FloatingActionButton。示例代码包括了一个包含EditText的LinearLayout以及一个在RelativeLayout中居中显示的TextView和一个位于底部的FloatingActionButton,后者用于添加新的输入项。
<?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">

    <EditText
        android:id="@+id/et"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="top">
    </EditText>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:layout_marginBottom="36dp"
        android:layout_marginEnd="23dp"
        android:clickable="true"
        app:srcCompat="@android:drawable/ic_input_add" />

</RelativeLayout>

#!/bin/sh # This script is executed as part of the hotplug event with # HOTPLUG_TYPE=iface, triggered by various scripts when an interface # is configured (ACTION=ifup) or deconfigured (ACTION=ifdown). The # interface is available as INTERFACE, the real device as DEVICE. [ -n "$VNET_BOOTING" ] && exit 0 [ "$DEVICE" == "lo" ] && exit 0 . /lib/functions.sh . /lib/zone/zone_api.sh . /lib/imb/core_global.sh # 针对interface的创建 # 1. 全配置下发(Force Provision): notify NETWORKX + commit null(ZACTION=) # 2. 预配置下发: notify NETWORK1 + add NETWORKother + commit null(ZACTION=LANX=add LANY=add) # 3. 增删: add/delete NETWORKX + commit null(ZACTION=LANX=add/delete) # 4. 更新(部分配置): notify NETWORKX + commit null(ZACTION=) # 5. 更新(其他配置): delete NETWROKX + add NETWORKX + commit null(ZACTION=LANX=delete,add) # 针对vlan的创建 # 1. 增删: add/delete + commit null(ZACTION=) # 2. 批量删除: delete + delete + ... + commit null(ZACTION=) # 3. 更新: delete + add + commit null(ZACTION=) # imb模块和NETWORK耦合的功能主要分为两部分, # 一是和zone相关的配置,理论上仅在network删除时,需要将这部分配置删除。但在新增和更新时不处理,因此放到commit中操作 # 二是和interface本身相关的配置,包括iptables规则和ipset,由于更新时,可能ip会发生变化,因此需要放到add/delete中操作 case "$ACTION" in add) fw_imb_event_interface "$INTERFACE" add LAN ;; delete) fw_imb_event_interface "$INTERFACE" del LAN ;; commit) if [ -n "$ZACTION" ]; then for zact in $ZACTION do zone=${zact%%=*} op=${zact##*=} option=0 for act in ${op//,/ } do [ "$act" == "delete" ] && option=$(($option - 1)) [ "$act" == "add" ] && option=$(($option + 1)) done [ "$option" == "-1" ] && { # 仅在delete场景下需要对imb的config做处理 imb_zone_config "$zone" } done else #do nothing return 0 fi ;; *) # (notify) do nothing ;; esac
12-02
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值