Esempio n. 1
0
 private void setTypeOfTheme() {
   if (MainPrefs.THEME_LIGHT_ICS_AB.equals(currentTheme)) {
     setTheme(R.style.ThemeHoloLightDarkActonBar);
   } else if (MainPrefs.THEME_LIGHT.equals(currentTheme)) {
     setTheme(R.style.ThemeHoloLight);
   } else {
     setTheme(R.style.ThemeHolo);
   }
 }
Esempio n. 2
0
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      // Make sure to set themes before this
      super.onCreate(savedInstanceState);

      if (UI_DEBUG_PRINTS) Log.d("NotesEditorActivity", "onCreate");

      if (MainPrefs.THEME_LIGHT_ICS_AB.equals(FragmentLayout.currentTheme)) {
        setTheme(R.style.ThemeHoloLightDarkActonBar);
      } else if (MainPrefs.THEME_LIGHT.equals(FragmentLayout.currentTheme)) {
        setTheme(R.style.ThemeHoloLight);
      } else {
        setTheme(R.style.ThemeHolo);
      }

      // Set up navigation (adds nice arrow to icon)
      ActionBar actionBar = getActionBar();
      if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowTitleEnabled(false);
      }

      if (getResources().getBoolean(R.bool.useLandscapeView)) {
        // If the screen is now in landscape mode, we can show the
        // dialog in-line with the list so we don't need this activity.
        Log.d("NotesEditorActivity", "Landscape mode detected, killing myself");
        finish();
        return;
      }

      setContentView(R.layout.note_editor_activity);

      this.currentId = getIntent().getExtras().getLong(NotesEditorFragment.KEYID);

      if (UI_DEBUG_PRINTS) Log.d("NotesEditorActivity", "Time to show the note!");
      // if (savedInstanceState == null) {
      // During initial setup, plug in the details fragment.
      // Set this as delete listener
      editorFragment =
          (NotesEditorFragment) getFragmentManager().findFragmentById(R.id.portrait_editor);
      if (editorFragment != null) {
        editorFragment.setValues(currentId);
      }
    }