Skip to content

Commit

Permalink
更换日志 TAG
Browse files Browse the repository at this point in the history
  • Loading branch information
listenzz committed May 17, 2021
1 parent 94bee17 commit 4ed2428
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class Garden {

private static final String TAG = "ReactNative";
private static final String TAG = "Navigation";

private static GlobalStyle globalStyle;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

public class GardenModule extends ReactContextBaseJavaModule {

private static final String TAG = "ReactNative";
private static final String TAG = "Navigation";


static final Handler sHandler = NavigationModule.sHandler;
Expand Down Expand Up @@ -73,7 +73,6 @@ public void setStyle(final ReadableMap style) {
ReactContext context = getReactApplicationContext();
if (context.hasActiveCatalystInstance()) {
ReactAppCompatActivity activity = (ReactAppCompatActivity) getCurrentActivity();
// 即使 Activity 真的存在,`getCurrentActivity` 依然可能返回 null,尤其是启动时应用被切换到后台
if (activity != null) {
activity.inflateStyle();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

public class GlobalStyle {

private static final String TAG = "ReactNative";
private static final String TAG = "Navigation";

private Bundle options;
private final Bundle options;

public Bundle getOptions() {
return options;
Expand All @@ -36,11 +36,11 @@ public GlobalStyle(Bundle options) {

public void inflateStyle(Context context, Style style) {
if (options == null) {
FLog.w(TAG, "style options is null");
FLog.w(TAG, "Style options is null");
return;
}

FLog.i(TAG, "custom global style");
FLog.i(TAG, "GlobalStyle#inflateStyle");

// screenBackgroundColor
String screenBackgroundColor = options.getString("screenBackgroundColor");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class HBDReactRootView extends ReactRootView {

protected static final String TAG = "ReactNative";
protected static final String TAG = "Navigation";

public HBDReactRootView(Context context) {
super(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
public class NavigationModule extends ReactContextBaseJavaModule implements LifecycleEventListener {

static final String TAG = "ReactNative";
static final String TAG = "Navigation";
static final Handler sHandler = new Handler(Looper.getMainLooper());

private final ReactBridgeManager bridgeManager;
Expand Down Expand Up @@ -357,6 +357,4 @@ private AwesomeFragment findFragmentBySceneId(String sceneId) {
}
return null;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

public class ReactAppCompatActivity extends AwesomeActivity implements DefaultHardwareBackBtnHandler, PermissionAwareActivity, ReactBridgeManager.ReactModuleRegisterListener {

protected static final String TAG = "ReactNative";
protected static final String TAG = "Navigation";

private final ReactAppCompatActivityDelegate activityDelegate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class ReactAppCompatActivityDelegate {

private static final String TAG = "ReactNative";
private static final String TAG = "Navigation";

private final int REQUEST_OVERLAY_PERMISSION_CODE = 1111;
private static final String REDBOX_PERMISSION_GRANTED_MESSAGE =
Expand All @@ -57,10 +57,10 @@ public ReactAppCompatActivityDelegate(@NonNull AppCompatActivity activity, React

private void askPermission() {
if (getReactNativeHost().getUseDeveloperSupport() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
FLog.i(TAG, "check overlay permission");
FLog.i(TAG, "Check overlay permission");
// Get permission to show redbox in dev builds.
if (!Settings.canDrawOverlays(getContext())) {
FLog.i(TAG, "request overlay permission");
FLog.i(TAG, "Request overlay permission");
Intent serviceIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getContext().getPackageName()));
FLog.w(ReactConstants.TAG, REDBOX_PERMISSION_MESSAGE);
Toast.makeText(getContext(), REDBOX_PERMISSION_MESSAGE, Toast.LENGTH_LONG).show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public interface ReactBridgeReloadListener {
void onReload();
}

private static final String TAG = "ReactNative";
private static final String TAG = "Navigation";
private final static ReactBridgeManager instance = new ReactBridgeManager();

public static ReactBridgeManager get() {
Expand Down Expand Up @@ -71,7 +71,7 @@ public void install(@NonNull ReactNativeHost reactNativeHost) {
private void setup() {
final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
reactInstanceManager.addReactInstanceEventListener(context -> {
FLog.i(TAG, "react instance context initialized.");
FLog.i(TAG, "React instance context initialized.");
rootLayout = null;
pendingTag = 0;
stickyLayout = null;
Expand All @@ -80,7 +80,7 @@ private void setup() {
});

if (!reactInstanceManager.hasStartedCreatingInitialContext()) {
FLog.i(TAG, "create react context");
FLog.i(TAG, "Create react context");
reactInstanceManager.createReactContextInBackground();
}
}
Expand All @@ -104,7 +104,7 @@ public ReactContext getCurrentReactContext() {

private void checkReactNativeHost() {
if (reactNativeHost == null) {
throw new IllegalStateException("must call ReactBridgeManager#install first");
throw new IllegalStateException("Must call ReactBridgeManager#install first");
}
}

Expand Down Expand Up @@ -145,13 +145,14 @@ public void setReactModuleRegisterCompleted(boolean reactModuleRegisterCompleted
}

public void startRegisterReactModule() {
FLog.i(TAG, "ReactBridgeManager#startRegisterReactModule");
reactModules.clear();
setReactModuleRegisterCompleted(false);
}

public void endRegisterReactModule() {
setReactModuleRegisterCompleted(true);
FLog.i(TAG, "react module registry completed");
FLog.i(TAG, "ReactBridgeManager#endRegisterReactModule");
for (ReactModuleRegisterListener listener : reactModuleRegisterListeners) {
listener.onReactModuleRegisterCompleted();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public class ReactFragment extends HybridFragment implements ReactRootViewHolder.VisibilityObserver, ReactBridgeManager.ReactBridgeReloadListener {

protected static final String TAG = "ReactNative";
protected static final String TAG = "Navigation";
private ViewGroup containerLayout;
private ReactRootViewHolder reactRootViewHolder;
private HBDReactRootView reactRootView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.widget.FrameLayout;

public class ReactFrameLayout extends FrameLayout implements ReactRootViewHolder {
protected static final String TAG = "ReactNative";
protected static final String TAG = "Navigation";

private HBDReactRootView mReactRootView;
private VisibilityObserver mVisibilityObserver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class ReactLinearLayout extends LinearLayout implements ReactRootViewHolder {

protected static final String TAG = "ReactNative";
protected static final String TAG = "Navigation";

private VisibilityObserver mVisibilityObserver;
private HBDReactRootView mReactRootView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class ReactTabBarProvider implements TabBarProvider, ReactBridgeManager.ReactBridgeReloadListener {

private static final String TAG = "ReactNative";
private static final String TAG = "Navigation";

private HBDReactRootView reactRootView;
private ReactTabBarFragment tabBarFragment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public class ScreenNavigator implements Navigator {

final static String TAG = "ReactNative";
final static String TAG = "Navigation";

private final List<String> supportActions = Arrays.asList("present", "presentLayout", "dismiss", "showModal", "showModalLayout", "hideModal");

Expand Down
4 changes: 2 additions & 2 deletions example/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ const drawer: Drawer = {
Navigator.setRootLayoutUpdateListener(
() => {
DeepLink.deactivate()
console.log('------------------------inactive router')
console.log('------------------------deactivate router')
},
() => {
const prefix = 'hbd://'
DeepLink.activate(prefix)
console.log('------------------------active router')
console.log('------------------------activate router')
},
)

Expand Down

0 comments on commit 4ed2428

Please sign in to comment.