Exemplo n.º 1
0
 public void updateTitle(boolean isNewTask) {
   ActionBar actionBar = getSupportActionBar();
   if (actionBar != null) {
     TextView title = ((TextView) actionBar.getCustomView().findViewById(R.id.title));
     if (ActFmPreferenceService.isPremiumUser()) title.setText(""); // $NON-NLS-1$
     else title.setText(isNewTask ? R.string.TEA_new_task : R.string.TAd_contextEditTask);
   }
 }
Exemplo n.º 2
0
 private void showListsHelp() {
   if (!AstridPreferences.canShowPopover()) return;
   if (!Preferences.getBoolean(R.string.p_showed_lists_help, false)) {
     AstridActivity activity = (AstridActivity) getActivity();
     if (activity != null) {
       if (AstridPreferences.useTabletLayout(activity)) {
         FilterListFragment flf = activity.getFilterListFragment();
         if (flf != null) flf.showAddListPopover();
       } else {
         ActionBar ab = activity.getSupportActionBar();
         View anchor = ab.getCustomView().findViewById(R.id.lists_nav);
         HelpInfoPopover.showPopover(activity, anchor, R.string.help_popover_switch_lists, null);
       }
       Preferences.setBoolean(R.string.p_showed_lists_help, true);
     }
   }
 }
Exemplo n.º 3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    boolean bNewEventMode = true;
    // Check if this activity launched from internal activity or not
    if (getIntent().hasExtra(EXTRA_EDIT)) {
      bNewEventMode = false;
    }

    setContentView(R.layout.activity_edit);

    FragmentManager fm = getSupportFragmentManager();
    mEditFragment = (EditFragment) fm.findFragmentById(R.id.fragment_edit);

    final ActionBar actionBar = getSupportActionBar();
    // set defaults for logo & home up
    actionBar.setDisplayHomeAsUpEnabled(bNewEventMode ? false : true);
    actionBar.setDisplayUseLogoEnabled(bNewEventMode ? false : true);
    actionBar.setTitle(bNewEventMode ? R.string.label_create_event : R.string.label_edit_event);
  }
Exemplo n.º 4
0
  /** @see android.app.Activity#onCreate(Bundle) */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    ThemeService.applyTheme(this);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.task_edit_wrapper_activity);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowTitleEnabled(false);

    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setCustomView(R.layout.header_title_view);
    ((TextView) actionBar.getCustomView().findViewById(R.id.title))
        .setText(R.string.TAd_contextEditTask);
  }
  /** Add tabs to action bar, add listeners for each tab, and show bar. */
  private void setUpTabs() {
    ActionBar bar = getSupportActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayShowTitleEnabled(true);
    bar.setDisplayShowHomeEnabled(true);
    BarTabListener tabListener = new BarTabListener<HomeTab>(this, "Home", HomeTab.class);
    Tab tab = bar.newTab().setIcon(R.drawable.home).setTabListener(tabListener);
    bar.addTab(tab);

    tabListener = new BarTabListener<PowerSearchTab>(this, "Settings", PowerSearchTab.class);
    tab = bar.newTab().setIcon(R.drawable.search).setTabListener(tabListener);
    bar.addTab(tab);

    tabListener = new BarTabListener<FavoritesTab>(this, "Favorites", FavoritesTab.class);
    tab = bar.newTab().setIcon(R.drawable.star).setTabListener(tabListener);
    bar.addTab(tab);

    tabListener = new BarTabListener<SettingsTab>(this, "Settings", SettingsTab.class);
    tab = bar.newTab().setIcon(R.drawable.settings).setTabListener(tabListener);
    bar.addTab(tab);
    bar.show();
  }
Exemplo n.º 6
0
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    try {
      mSharedPreferences = Prefs.getSharedPreferences(this);
    } catch (NullPointerException e) {
      if (BuildConfig.DEBUG) {
        Log.w("[" + TAG + "]", "mSharedPreferences == NullPointerException :" + e.getMessage());
      }
    }

    mSharedPreferences.registerOnSharedPreferenceChangeListener(this);

    if (Prefs.getThemeType(this) == false) {
      mThemeId = R.style.AppTheme_Light;
      setTheme(mThemeId);
    } else {
      mThemeId = R.style.AppTheme_Dark;
      setTheme(mThemeId);
    }

    // Eula.showDisclaimer( this );
    Eula.showEula(this, getApplicationContext());

    mActionBar = getActionBar();
    if (mActionBar != null) {
      mActionBar.setDisplayHomeAsUpEnabled(false);
      mActionBar.setDisplayShowHomeEnabled(true);
      mActionBar.setDisplayShowTitleEnabled(true);
    } else {
      if (BuildConfig.DEBUG) {
        Log.w("[" + TAG + "]", "mActionBar == null");
      }
    }

    Bundle extras = getIntent().getExtras();
    if (extras != null) {
      this.setTitle(extras.getString("dir") + " :: " + getString(R.string.app_name));
    } else {
      this.setTitle(" :: " + getString(R.string.app_name));
    }

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    tvDisplay = (TextView) findViewById(R.id.tvDisplay);

    bRename = (Button) findViewById(R.id.bRename);
    bSettings = (Button) findViewById(R.id.bSettings);
    bHelp = (Button) findViewById(R.id.bHelp);
    bExit = (Button) findViewById(R.id.bExit);

    bRename.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            Intent openAndroidFileBrowser = new Intent("com.scto.filerenamer.ANDROIDFILEBROWSER");
            openAndroidFileBrowser.putExtra("what", "renamer");
            openAndroidFileBrowser.putExtra("theme", mThemeId);
            startActivity(openAndroidFileBrowser);
          }
        });

    bSettings.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            Intent openPreferencesActivity = new Intent("com.scto.filerenamer.PREFERENCESACTIVITY");
            startActivity(openPreferencesActivity);
          }
        });

    bHelp.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            FragmentManager fm = getSupportFragmentManager();
            HelpDialog helpDialog = new HelpDialog();
            helpDialog.show(fm, "dlg_help");
          }
        });

    bExit.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            FragmentManager fm = getSupportFragmentManager();
            ExitDialog exitDialog = new ExitDialog();
            exitDialog.show(fm, "dlg_exit");
          }
        });

    /*
    ChangeLog cl = new ChangeLog( this );
    if( cl.firstRun() )
    {
    	cl.getLogDialog().show();
    }
    */
    init();
  }
 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
   inflater.inflate(R.menu.options_menu, menu);
   ActionBar bar = getSupportActivity().getSupportActionBar();
   bar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
 }