mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: format
This commit is contained in:
@@ -1,67 +1,95 @@
|
||||
import { AndroidFragmentCallbacks, setFragmentCallbacks, setFragmentClass } from "./frame";
|
||||
import {
|
||||
AndroidFragmentCallbacks,
|
||||
setFragmentCallbacks,
|
||||
setFragmentClass,
|
||||
} from "./frame";
|
||||
|
||||
@JavaProxy("com.tns.FragmentClass")
|
||||
class FragmentClass extends org.nativescript.widgets.FragmentBase {
|
||||
// This field is updated in the frame module upon `new` (although hacky this eases the Fragment->callbacks association a lot)
|
||||
private _callbacks: AndroidFragmentCallbacks;
|
||||
// This field is updated in the frame module upon `new` (although hacky this eases the Fragment->callbacks association a lot)
|
||||
private _callbacks: AndroidFragmentCallbacks;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
return global.__native(this);
|
||||
}
|
||||
return global.__native(this);
|
||||
}
|
||||
|
||||
public onHiddenChanged(hidden: boolean): void {
|
||||
this._callbacks.onHiddenChanged(this, hidden, super.onHiddenChanged);
|
||||
}
|
||||
public onHiddenChanged(hidden: boolean): void {
|
||||
this._callbacks.onHiddenChanged(this, hidden, super.onHiddenChanged);
|
||||
}
|
||||
|
||||
public onCreateAnimator(transit: number, enter: boolean, nextAnim: number): android.animation.Animator {
|
||||
return this._callbacks.onCreateAnimator(this, transit, enter, nextAnim, super.onCreateAnimator);
|
||||
}
|
||||
public onCreateAnimator(
|
||||
transit: number,
|
||||
enter: boolean,
|
||||
nextAnim: number
|
||||
): android.animation.Animator {
|
||||
return this._callbacks.onCreateAnimator(
|
||||
this,
|
||||
transit,
|
||||
enter,
|
||||
nextAnim,
|
||||
super.onCreateAnimator
|
||||
);
|
||||
}
|
||||
|
||||
public onStop(): void {
|
||||
this._callbacks.onStop(this, super.onStop);
|
||||
}
|
||||
public onStop(): void {
|
||||
this._callbacks.onStop(this, super.onStop);
|
||||
}
|
||||
|
||||
public onPause(): void {
|
||||
this._callbacks.onPause(this, super.onStop);
|
||||
}
|
||||
public onPause(): void {
|
||||
this._callbacks.onPause(this, super.onStop);
|
||||
}
|
||||
|
||||
public onCreate(savedInstanceState: android.os.Bundle) {
|
||||
if (!this._callbacks) {
|
||||
setFragmentCallbacks(this);
|
||||
}
|
||||
public onCreate(savedInstanceState: android.os.Bundle) {
|
||||
if (!this._callbacks) {
|
||||
setFragmentCallbacks(this);
|
||||
}
|
||||
|
||||
this.setHasOptionsMenu(true);
|
||||
this._callbacks.onCreate(this, savedInstanceState, super.onCreate);
|
||||
}
|
||||
this.setHasOptionsMenu(true);
|
||||
this._callbacks.onCreate(this, savedInstanceState, super.onCreate);
|
||||
}
|
||||
|
||||
public onCreateView(inflater: android.view.LayoutInflater, container: android.view.ViewGroup, savedInstanceState: android.os.Bundle) {
|
||||
let result = this._callbacks.onCreateView(this, inflater, container, savedInstanceState, super.onCreateView);
|
||||
public onCreateView(
|
||||
inflater: android.view.LayoutInflater,
|
||||
container: android.view.ViewGroup,
|
||||
savedInstanceState: android.os.Bundle
|
||||
) {
|
||||
let result = this._callbacks.onCreateView(
|
||||
this,
|
||||
inflater,
|
||||
container,
|
||||
savedInstanceState,
|
||||
super.onCreateView
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public onSaveInstanceState(outState: android.os.Bundle) {
|
||||
this._callbacks.onSaveInstanceState(this, outState, super.onSaveInstanceState);
|
||||
}
|
||||
public onSaveInstanceState(outState: android.os.Bundle) {
|
||||
this._callbacks.onSaveInstanceState(
|
||||
this,
|
||||
outState,
|
||||
super.onSaveInstanceState
|
||||
);
|
||||
}
|
||||
|
||||
public onDestroyView() {
|
||||
this._callbacks.onDestroyView(this, super.onDestroyView);
|
||||
}
|
||||
public onDestroyView() {
|
||||
this._callbacks.onDestroyView(this, super.onDestroyView);
|
||||
}
|
||||
|
||||
public onDestroy() {
|
||||
this._callbacks.onDestroy(this, super.onDestroy);
|
||||
}
|
||||
public onDestroy() {
|
||||
this._callbacks.onDestroy(this, super.onDestroy);
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
const callbacks = this._callbacks;
|
||||
if (callbacks) {
|
||||
return callbacks.toStringOverride(this, super.toString);
|
||||
} else {
|
||||
super.toString();
|
||||
}
|
||||
}
|
||||
public toString(): string {
|
||||
const callbacks = this._callbacks;
|
||||
if (callbacks) {
|
||||
return callbacks.toStringOverride(this, super.toString);
|
||||
} else {
|
||||
super.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setFragmentClass(FragmentClass);
|
||||
|
||||
Reference in New Issue
Block a user