Merge remote-tracking branch 'origin/temp' into dev
This commit is contained in:
@ -3,11 +3,14 @@ package com.gh.base.fragment;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.LayoutRes;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.gh.base.BaseActivity;
|
||||
import com.gh.base.BaseToolBarActivity;
|
||||
import com.gh.base.OnListClickListener;
|
||||
import com.gh.base.OnRequestCallBackListener;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
@ -29,9 +32,9 @@ import rx.schedulers.Schedulers;
|
||||
* Fragment 基类
|
||||
*/
|
||||
public abstract class BaseFragment<T> extends Fragment implements OnRequestCallBackListener<T>,
|
||||
View.OnClickListener, OnListClickListener{
|
||||
View.OnClickListener, OnListClickListener {
|
||||
|
||||
private View view;
|
||||
protected View view;
|
||||
|
||||
protected boolean isEverPause;
|
||||
|
||||
@ -54,6 +57,16 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
|
||||
handleOnClick(v);
|
||||
}
|
||||
|
||||
protected void setNavigationTitle(@StringRes int res) {
|
||||
setNavigationTitle(getString(res));
|
||||
}
|
||||
|
||||
protected void setNavigationTitle(String title) {
|
||||
if (getActivity() instanceof BaseToolBarActivity) {
|
||||
((BaseToolBarActivity) getActivity()).setNavigationTitle(title);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initView(View view) {
|
||||
}
|
||||
|
||||
@ -111,10 +124,22 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
public void toast(@StringRes int res) {
|
||||
toast(getString(res));
|
||||
}
|
||||
|
||||
public void toast(String msg) {
|
||||
Utils.toast(getContext(), msg);
|
||||
}
|
||||
|
||||
public void toastLong(@StringRes int msg) {
|
||||
toastLong(getString(msg));
|
||||
}
|
||||
|
||||
public void toastLong(String msg) {
|
||||
RuntimeUtils.getInstance().toastLong(getContext(), msg);
|
||||
}
|
||||
|
||||
public boolean isEverPause() {
|
||||
return isEverPause;
|
||||
}
|
||||
@ -125,7 +150,7 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadDone(Object obj) {
|
||||
public void loadDone(T obj) {
|
||||
|
||||
}
|
||||
|
||||
@ -140,7 +165,7 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void onListClick(View view, int position, T data) {
|
||||
public <LIST> void onListClick(View view, int position, LIST data) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user