parent
68abe66553
commit
48545bca10
@ -1,41 +0,0 @@
|
||||
package com.example.HomeContent;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.cmknowledgegraph.R;
|
||||
|
||||
public class MainContent extends Fragment {
|
||||
protected int res;
|
||||
|
||||
private RecyclerView rvFeed;
|
||||
|
||||
AppCompatActivity appCompatActivity;
|
||||
|
||||
public AppCompatActivity getAppCompatActivity() {
|
||||
return appCompatActivity;
|
||||
}
|
||||
|
||||
public void setAppCompatActivity(AppCompatActivity appCompatActivity) {
|
||||
this.appCompatActivity = appCompatActivity;
|
||||
}
|
||||
//创建视图
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate( R.layout.activity_home, container, false ); //要加载的layout文件
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.example.PersonalCenter;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.cmknowledgegraph.LoginActivity;
|
||||
|
||||
public class avatarOnclickListener implements View.OnClickListener {
|
||||
AppCompatActivity appCompatActivity;
|
||||
Fragment personFragment;
|
||||
public avatarOnclickListener(AppCompatActivity appCompatActivity,Fragment fragment){
|
||||
this.personFragment = fragment;
|
||||
this.appCompatActivity = appCompatActivity;
|
||||
}
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//这里监听就是如果未登录就跳到登录界面
|
||||
if(User.isLogin()){
|
||||
//登陆了
|
||||
}else{
|
||||
//没有登录
|
||||
//跳转到登录界面
|
||||
Intent intent=new Intent();
|
||||
intent.setClass(appCompatActivity, LoginActivity.class);
|
||||
personFragment.startActivity(intent);
|
||||
}
|
||||
//如果登录了就跳到个人信息界面
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/home_back_1"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--在个人中心的第二个菜单日历Layout-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<com.prolificinteractive.materialcalendarview.MaterialCalendarView
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/calendarView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:mcv_showOtherDates="all"
|
||||
app:mcv_selectionColor="#a9a"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in new issue