mirror of
https://github.com/Dark98/SliceBeam.git
synced 2026-07-03 08:39:04 +00:00
Srat Refactoring To Santoku
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package com.dark98.santoku.navigation;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
|
||||
import com.dark98.santoku.theme.ThemesRepo;
|
||||
|
||||
public abstract class Fragment {
|
||||
private View mView;
|
||||
private Context context;
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
public void onCreate() {}
|
||||
|
||||
@CallSuper
|
||||
public void onResume() {}
|
||||
|
||||
@CallSuper
|
||||
public void onPause() {}
|
||||
|
||||
@CallSuper
|
||||
public void onDestroy() {
|
||||
mView = null;
|
||||
}
|
||||
|
||||
public void onApplyTheme() {
|
||||
mView.setBackgroundColor(ThemesRepo.getColor(android.R.attr.windowBackground));
|
||||
}
|
||||
|
||||
public abstract View onCreateView(Context ctx);
|
||||
|
||||
@CallSuper
|
||||
public void onViewCreated(View v) {
|
||||
mView = v;
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
return mView;
|
||||
}
|
||||
|
||||
public boolean onBackPressed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public SlotChangeCallback onCheckDelayForSlotChange() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public interface SlotChangeCallback {
|
||||
boolean needDelay(Runnable callback);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user