mirror of
https://github.com/Dark98/SliceBeam.git
synced 2026-12-06 14:47:16 +00:00
Public source code release
This commit is contained in:
1 parent
20b730b1c8
commit
0b2ba24c7f
6691 files changed
+2325292
-1
No files matched your search
@@ -0,0 +1,62 @@
|
||||
package ru.ytkab0bp.slicebeam.navigation;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
|
||||
import ru.ytkab0bp.slicebeam.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