Android Button_Radio Box_Multiple Select Box_Text Box

1 <?xml version=”1.0″ encoding=”utf-8″?> 2 <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” 3 xmlns:tools=”http://schemas.android.com/tools” 4 android:layout_width=”match_parent” 5 android:layout_height=”match_parent” 6 tools:context=”.MainActivity” 7 android:orientation=”vertical”> 8 9 10 <!–Multiple selection box–> 11<CheckBox 12 android:id=”@ + id/cb_cg” 13 android:layout_width=”wrap_content” 14 android:layout_height=”wrap_content” 15 android:text=”Singing” 16 android:checked=”true” 17> 18 </CheckBox> 19 <CheckBox 20 android:id=”@ + id/cb_gm” 21 android:layout_width=”wrap_content” 22 android:layout_height=”wrap_content” 23 android:text=”playing games” 24 android:checked=”false” 25> […]

4 ways to write Android button events

After the previous two blogs have laid the groundwork, let’s warm up today and give a simple example. The directory structure still refers to the screenshot of the previous blog. Specific implementation code: public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Method 1. Use a class that implements […]

Android button animation (menu button popup from center point button)

Example: xml code: <?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” android:orientation=”vertical” tools:context=”.MainActivity”> <ImageView android:id=”@ + id/iv1″ android:layout_width=”30dp” android:layout_height=”30dp” android:layout_marginTop=”110dp” android:layout_marginRight=”15dp” android:layout_alignParentRight=”true” android:layout_alignParentTop=”true” android:background=”@mipmap/ic_launcher” /> <ImageView android:id=”@ + id/iv2″ android:layout_width=”30dp” android:layout_height=”30dp” android:layout_marginTop=”110dp” android:layout_marginRight=”15dp” android:layout_alignParentRight=”true” android:layout_alignParentTop=”true” android:background=”@mipmap/ic_launcher” /> <ImageView android:id=”@ + id/iv3″ android:layout_width=”30dp” android:layout_height=”30dp” android:layout_marginTop=”110dp” android:layout_marginRight=”15dp” android:layout_alignParentRight=”true” android:layout_alignParentTop=”true” android:background=”@mipmap/ic_launcher” /> <ImageView android:id=”@ + id/iv4″ android:layout_width=”30dp” […]