parent
74810e5586
commit
097c4a7f16
@ -0,0 +1,46 @@
|
||||
package com.example.myapplication.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class ShowFragment extends Fragment {
|
||||
TextView tvText;
|
||||
String type;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Bundle bundle = getArguments();
|
||||
if(bundle != null ){
|
||||
type = bundle.getString("type");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Fragment getShowFragment(String type){
|
||||
ShowFragment showFragment = new ShowFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("type",type);
|
||||
showFragment.setArguments(bundle);
|
||||
return showFragment;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_show,null);
|
||||
tvText = view.findViewById(R.id.tv_content);
|
||||
tvText.setText(type);
|
||||
return view;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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=".IdolTagMainActivity"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/mListview"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:background="#ebebeb"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/mFrame"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="match_parent"></FrameLayout>
|
||||
</LinearLayout>
|
@ -0,0 +1,14 @@
|
||||
<?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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="30sp"
|
||||
android:gravity="center"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,29 @@
|
||||
<?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">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_line"
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="invisible"
|
||||
android:background="@color/blue"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,4 +1,6 @@
|
||||
<resources>
|
||||
<string name="app_name"></string>
|
||||
<string name = "hello">你好,世界! </string>
|
||||
<string name="hello">你好,世界! </string>
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
</resources>
|
Loading…
Reference in new issue