|
|
|
@ -1,10 +1,34 @@
|
|
|
|
|
package com.example.leudaemialikeme;
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.widget.ImageButton;
|
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class MainActivity extends AppCompatActivity {
|
|
|
|
|
//装载Fragment的集合
|
|
|
|
|
private List<Fragment> fragmentList;
|
|
|
|
|
//四个tab对应的布局
|
|
|
|
|
private LinearLayout tabHome;
|
|
|
|
|
private LinearLayout tabCommunity;
|
|
|
|
|
private LinearLayout tabMessage;
|
|
|
|
|
private LinearLayout tabMy;
|
|
|
|
|
//四个 Tab 对应的 ImageButton
|
|
|
|
|
private ImageButton imgHome;
|
|
|
|
|
private ImageButton imgCommunity;
|
|
|
|
|
private ImageButton imgMessage;
|
|
|
|
|
private ImageButton imgMy;
|
|
|
|
|
//四个Tab对应的文本
|
|
|
|
|
private TextView textHome;
|
|
|
|
|
private TextView textCommunity;
|
|
|
|
|
private TextView textMessage;
|
|
|
|
|
private TextView textMy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|