61 lines
1.6 KiB
Java
61 lines
1.6 KiB
Java
package com.ubtech.view.fragment;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import androidx.fragment.app.Fragment;
|
|
import com.ubtrobot.ubtlib.analytics.JimuAnalytics;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class BaseFragment extends Fragment {
|
|
public final String TAG = getClass().getSimpleName();
|
|
protected Activity mActivity;
|
|
protected View mView;
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public void onAttach(Context context) {
|
|
super.onAttach(context);
|
|
this.mActivity = (Activity) context;
|
|
}
|
|
|
|
public boolean onBackPressed() {
|
|
return false;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public void onCreate(Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
if (this.mActivity == null) {
|
|
this.mActivity = getActivity();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
|
return super.onCreateView(layoutInflater, viewGroup, bundle);
|
|
}
|
|
|
|
protected void onPagePause() {
|
|
}
|
|
|
|
protected void onPageResume() {
|
|
}
|
|
|
|
protected void recordEvent(String str) {
|
|
JimuAnalytics.b().a(str);
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public void setUserVisibleHint(boolean z) {
|
|
super.setUserVisibleHint(z);
|
|
if (z) {
|
|
onPageResume();
|
|
} else {
|
|
onPagePause();
|
|
}
|
|
}
|
|
}
|