Beispiel #1
0
 @Override
 public void onHiddenChanged(boolean hidden) {
   super.onHiddenChanged(hidden);
   if (!hidden) {
     handleAddButtonFromNew();
   }
 }
Beispiel #2
0
  @Override
  public void onResume() {
    super.onResume();

    if (!Utils.checkForExternalStorageAvailableAndDisplayErrorIfNot(getActivity())) {
      return;
    }

    if (lookRenamedReceiver == null) {
      lookRenamedReceiver = new LookRenamedReceiver();
    }

    if (lookDeletedReceiver == null) {
      lookDeletedReceiver = new LookDeletedReceiver();
    }

    IntentFilter intentFilterRenameLook = new IntentFilter(ScriptActivity.ACTION_LOOK_RENAMED);
    getActivity().registerReceiver(lookRenamedReceiver, intentFilterRenameLook);

    IntentFilter intentFilterDeleteLook = new IntentFilter(ScriptActivity.ACTION_LOOK_DELETED);
    getActivity().registerReceiver(lookDeletedReceiver, intentFilterDeleteLook);

    SharedPreferences settings =
        PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());

    setShowDetails(settings.getBoolean(SHARED_PREFERENCE_NAME, false));

    handleAddButtonFromNew();

    if (isResultHandled) {
      isResultHandled = false;

      ScriptActivity scriptActivity = (ScriptActivity) getActivity();
      if (scriptActivity.getIsLookFragmentFromSetLookBrickNew()
          && scriptActivity.getIsLookFragmentHandleAddButtonHandled()) {
        switchToScriptFragment();
      }
    }
  }