4 changed files with 223 additions and 66 deletions
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
package cc.niushuai.dididone.ui.statistic; |
||||
|
||||
import android.os.Bundle; |
||||
import android.view.LayoutInflater; |
||||
import android.view.View; |
||||
import android.view.ViewGroup; |
||||
import android.widget.TextView; |
||||
|
||||
import androidx.fragment.app.Fragment; |
||||
|
||||
import cc.niushuai.dididone.R; |
||||
|
||||
/** |
||||
* Created by Administrator on 2016/7/8. |
||||
*/ |
||||
public class MyFragment extends Fragment { |
||||
|
||||
private TextView tv; |
||||
private String name; |
||||
|
||||
public MyFragment(String fName) { |
||||
this.name = fName; |
||||
} |
||||
|
||||
@Override |
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
||||
View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_test, container, false); |
||||
tv = (TextView) view.findViewById(R.id.fragment_tv); |
||||
tv.setText(name); |
||||
tv.setOnClickListener(new View.OnClickListener() { |
||||
@Override |
||||
public void onClick(View v) { |
||||
tv.setText("我变了-" + name); |
||||
} |
||||
}); |
||||
return view; |
||||
} |
||||
} |
@ -1,38 +1,52 @@
@@ -1,38 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tl="http://schemas.android.com/apk/res-auto" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:background="#ffffff" |
||||
android:orientation="vertical"> |
||||
|
||||
<com.google.android.material.tabs.TabLayout |
||||
android:id="@+id/stat_tab_layout" |
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
/> |
||||
<!-- stat_tab_layout --> |
||||
<!--<com.flyco.tablayout.SlidingTabLayout |
||||
android:id="@+id/stat_tab_layout2" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="48dp" |
||||
android:background="#EEEEEE" |
||||
tl:tl_divider_color="#1A000000" |
||||
tl:tl_divider_padding="13dp" |
||||
tl:tl_divider_width="1dp" |
||||
tl:tl_indicator_color="#000000" |
||||
tl:tl_indicator_height="1.5dp" |
||||
tl:tl_indicator_width_equal_title="true" |
||||
tl:tl_tab_padding="22dp" |
||||
tl:tl_tab_space_equal="true" |
||||
tl:tl_textBold="SELECT" |
||||
tl:tl_textSelectColor="@color/red" |
||||
tl:tl_textUnselectColor="@color/gray_light_less" |
||||
tl:tl_underline_height="2dp" />--> |
||||
android:layout_height="48dp"> |
||||
|
||||
<Button |
||||
android:id="@+id/btn1" |
||||
android:layout_width="0dp" |
||||
android:layout_height="match_parent" |
||||
android:layout_weight="1" |
||||
android:background="#ffffff" |
||||
android:text="消息" /> |
||||
|
||||
<Button |
||||
android:id="@+id/btn2" |
||||
android:layout_width="0dp" |
||||
android:layout_height="match_parent" |
||||
android:layout_weight="1" |
||||
android:background="#ffffff" |
||||
android:text="联系人" /> |
||||
|
||||
<Button |
||||
android:id="@+id/btn3" |
||||
android:layout_width="0dp" |
||||
android:layout_height="match_parent" |
||||
android:layout_weight="1" |
||||
android:background="#ffffff" |
||||
android:text="动态" /> |
||||
|
||||
<Button |
||||
android:id="@+id/btn4" |
||||
android:layout_width="0dp" |
||||
android:layout_height="match_parent" |
||||
android:layout_weight="1" |
||||
android:background="#ffffff" |
||||
android:text="其他" /> |
||||
</LinearLayout> |
||||
|
||||
<androidx.viewpager.widget.ViewPager |
||||
android:id="@+id/stat_viewpager" |
||||
<FrameLayout |
||||
android:id="@+id/main_frame_layout" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="0px" |
||||
android:layout_height="0dp" |
||||
android:layout_weight="1" |
||||
android:background="@android:color/white" /> |
||||
android:background="#dddddd"></FrameLayout> |
||||
|
||||
</LinearLayout> |
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:background="#dddddd"> |
||||
|
||||
<TextView |
||||
android:id="@+id/fragment_tv" |
||||
android:layout_centerInParent="true" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="#000000"/> |
||||
|
||||
</RelativeLayout> |
Loading…
Reference in new issue