4 changed files with 223 additions and 66 deletions
@ -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 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
<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_width="match_parent" |
||||||
android:layout_height="match_parent" |
android:layout_height="match_parent" |
||||||
|
android:background="#ffffff" |
||||||
android:orientation="vertical"> |
android:orientation="vertical"> |
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout |
<LinearLayout |
||||||
android:id="@+id/stat_tab_layout" |
|
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="wrap_content" |
android:layout_height="48dp"> |
||||||
/> |
|
||||||
<!-- stat_tab_layout --> |
<Button |
||||||
<!--<com.flyco.tablayout.SlidingTabLayout |
android:id="@+id/btn1" |
||||||
android:id="@+id/stat_tab_layout2" |
android:layout_width="0dp" |
||||||
android:layout_width="match_parent" |
android:layout_height="match_parent" |
||||||
android:layout_height="48dp" |
android:layout_weight="1" |
||||||
android:background="#EEEEEE" |
android:background="#ffffff" |
||||||
tl:tl_divider_color="#1A000000" |
android:text="消息" /> |
||||||
tl:tl_divider_padding="13dp" |
|
||||||
tl:tl_divider_width="1dp" |
<Button |
||||||
tl:tl_indicator_color="#000000" |
android:id="@+id/btn2" |
||||||
tl:tl_indicator_height="1.5dp" |
android:layout_width="0dp" |
||||||
tl:tl_indicator_width_equal_title="true" |
android:layout_height="match_parent" |
||||||
tl:tl_tab_padding="22dp" |
android:layout_weight="1" |
||||||
tl:tl_tab_space_equal="true" |
android:background="#ffffff" |
||||||
tl:tl_textBold="SELECT" |
android:text="联系人" /> |
||||||
tl:tl_textSelectColor="@color/red" |
|
||||||
tl:tl_textUnselectColor="@color/gray_light_less" |
<Button |
||||||
tl:tl_underline_height="2dp" />--> |
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 |
<FrameLayout |
||||||
android:id="@+id/stat_viewpager" |
android:id="@+id/main_frame_layout" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="0px" |
android:layout_height="0dp" |
||||||
android:layout_weight="1" |
android:layout_weight="1" |
||||||
android:background="@android:color/white" /> |
android:background="#dddddd"></FrameLayout> |
||||||
|
|
||||||
</LinearLayout> |
</LinearLayout> |
@ -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