|
|
|
@ -1,19 +1,22 @@
|
|
|
|
|
package com.example.leudaemialikeme.Fragment;
|
|
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
|
|
|
|
import com.example.leudaemialikeme.Activity.InfoActivity;
|
|
|
|
|
import com.example.leudaemialikeme.Activity.MdctRmdActivity;
|
|
|
|
|
import com.example.leudaemialikeme.Activity.SearchActivity;
|
|
|
|
|
import com.example.leudaemialikeme.R;
|
|
|
|
|
import com.example.leudaemialikeme.Recnews;
|
|
|
|
|
import com.example.leudaemialikeme.adapter.RecnewsAdapter;
|
|
|
|
|
import com.example.leudaemialikeme.Adapter.RecnewsAdapter;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -25,7 +28,7 @@ import java.util.List;
|
|
|
|
|
*/
|
|
|
|
|
public class IndexFragment extends Fragment {
|
|
|
|
|
|
|
|
|
|
private List<Recnews> recNews=new ArrayList<>();;
|
|
|
|
|
private List<Recnews> recNews=new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
// TODO: Rename parameter arguments, choose names that match
|
|
|
|
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
|
|
|
@ -91,35 +94,94 @@ public class IndexFragment extends Fragment {
|
|
|
|
|
LinearLayout recLinear=view.findViewById(R.id.rec_linear);
|
|
|
|
|
LinearLayout kepuLinear=view.findViewById(R.id.kepu_linear);
|
|
|
|
|
LinearLayout clockLinear=view.findViewById(R.id.clock_linear);
|
|
|
|
|
LinearLayout companyLinear=view.findViewById(R.id.company);
|
|
|
|
|
LinearLayout tenLinear=view.findViewById(R.id.ten);
|
|
|
|
|
LinearLayout governmentLinear=view.findViewById(R.id.government);
|
|
|
|
|
LinearLayout charity=view.findViewById(R.id.charity);
|
|
|
|
|
LinearLayout all=view.findViewById(R.id.all);
|
|
|
|
|
|
|
|
|
|
searchLinear.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
Intent intent=new Intent(getContext(), SearchActivity.class);
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
recLinear.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
kepuLinear.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
clockLinear.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
// Toast.makeText(view.getContext(),"x1233",Toast.LENGTH_SHORT).show();
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
Intent intent=new Intent(getContext(), MdctRmdActivity.class);
|
|
|
|
|
startActivity(intent); }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
companyLinear.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
Intent intent=new Intent(getContext(), InfoActivity.class);
|
|
|
|
|
int data=0;
|
|
|
|
|
intent.putExtra("info_type",data);
|
|
|
|
|
startActivity(intent); }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
tenLinear.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
Intent intent=new Intent(getContext(), InfoActivity.class);
|
|
|
|
|
int data=1;
|
|
|
|
|
intent.putExtra("info_type",data);
|
|
|
|
|
startActivity(intent); }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
governmentLinear.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
Intent intent=new Intent(getContext(), InfoActivity.class);
|
|
|
|
|
int data=2;
|
|
|
|
|
intent.putExtra("info_type",data);
|
|
|
|
|
startActivity(intent); }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
charity.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
Intent intent=new Intent(getContext(), InfoActivity.class);
|
|
|
|
|
int data=3;
|
|
|
|
|
intent.putExtra("info_type",data);
|
|
|
|
|
startActivity(intent); }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
all.setOnClickListener(new View.OnClickListener(){
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
Intent intent=new Intent(getContext(), InfoActivity.class);
|
|
|
|
|
int data=4;
|
|
|
|
|
intent.putExtra("info_type",data);
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -130,7 +192,7 @@ public class IndexFragment extends Fragment {
|
|
|
|
|
"儿童急性B淋巴细胞白血病,除了传统疗法还有哪些前沿治疗方法呢?",
|
|
|
|
|
"急性淋巴细胞白血病(ALL)是儿童最常见的恶性肿瘤,其中约85%为……"
|
|
|
|
|
,102,"2021-11-6 09:19:54"
|
|
|
|
|
);
|
|
|
|
|
);
|
|
|
|
|
recNews.add(news1);
|
|
|
|
|
Recnews news2=new Recnews(R.drawable.rec_news2,
|
|
|
|
|
"儿童急性B淋巴细胞白血病,除了传统疗法还有哪些前沿治疗方法呢?",
|
|
|
|
|