Пример #1
0
  public void onBroken(View v) {
    CheckBox ch1 = (CheckBox) findViewById(R.id.CheckBox01);
    CheckBox ch2 = (CheckBox) findViewById(R.id.CheckBox02);
    CheckBox ch3 = (CheckBox) findViewById(R.id.CheckBox03);
    CheckBox ch4 = (CheckBox) findViewById(R.id.CheckBox04);
    CheckBox ch5 = (CheckBox) findViewById(R.id.CheckBox05);
    CheckBox ch6 = (CheckBox) findViewById(R.id.CheckBox06);
    CheckBox ch7 = (CheckBox) findViewById(R.id.CheckBox07);
    CheckBox ch8 = (CheckBox) findViewById(R.id.CheckBox08);
    sms = "";

    if (ch1.isChecked()) sms += "1 ";
    if (ch2.isChecked()) sms += "2 ";
    if (ch3.isChecked()) sms += "3 ";
    if (ch4.isChecked()) sms += "4 ";
    if (ch5.isChecked()) sms += "5 ";
    if (ch6.isChecked()) sms += "6 ";
    if (ch7.isChecked()) sms += "7 ";
    if (ch8.isChecked()) sms += "8 ";

    if (!sms.equals("")) {
      actionBar.setSelectedNavigationItem(0);

      chGreen();

      toastText("Информация сохранена...");
    } else {
      toastText("Не выбран вид устраненной поломки...");
    }
  }
  /*
   * make sure the passed tag is the one selected in the actionbar
   */
  protected void selectTagInActionBar(String tagName) {
    if (!hasActivity()) return;
    if (tagName == null) return;

    ActionBar actionBar = getActionBar();
    if (actionBar == null) return;

    int position = getActionBarAdapter().getIndexOfTagName(tagName);
    if (position == -1) return;
    if (position == actionBar.getSelectedNavigationIndex()) return;

    actionBar.setSelectedNavigationItem(position);
  }
Пример #3
0
  private void switchToScriptFragment() {
    ScriptActivity scriptActivity = (ScriptActivity) getActivity();
    ActionBar actionBar = scriptActivity.getSupportActionBar();
    actionBar.setSelectedNavigationItem(ScriptActivity.FRAGMENT_SCRIPTS);
    scriptActivity.setCurrentFragment(ScriptActivity.FRAGMENT_SCRIPTS);

    FragmentTransaction fragmentTransaction =
        scriptActivity.getSupportFragmentManager().beginTransaction();
    fragmentTransaction.hide(this);
    fragmentTransaction.show(
        scriptActivity.getSupportFragmentManager().findFragmentByTag(ScriptFragment.TAG));
    fragmentTransaction.commit();

    scriptActivity.setIsLookFragmentFromSetLookBrickNewFalse();
    scriptActivity.setIsLookFragmentHandleAddButtonHandled(false);
  }
Пример #4
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.movies_activity);

    final ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    ArrayAdapter<CharSequence> mActionBarList =
        ArrayAdapter.createFromResource(this, R.array.movie_lists, R.layout.sherlock_spinner_item);
    mActionBarList.setDropDownViewResource(R.layout.sherlock_spinner_dropdown_item);
    actionBar.setListNavigationCallbacks(mActionBarList, this);

    // try to restore previously set nav item
    final SharedPreferences prefs =
        PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    final int navItem = prefs.getInt(AppPreferences.KEY_NAVSELECTION, 0);
    actionBar.setSelectedNavigationItem(navItem);
  }
Пример #5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (getSupportFragmentManager().findFragmentById(android.R.id.content) != null) {
      FragmentManager fragMgr = getSupportFragmentManager();
      FragmentTransaction ft = fragMgr.beginTransaction();
      ft.detach(getSupportFragmentManager().findFragmentById(android.R.id.content));
      ft.commit();
    }

    tracker = GoogleAnalyticsTracker.getInstance();

    // Start the tracker in manual dispatch mode...
    tracker.startNewSession(Keys.ANALYTICS_KEY, this);
    // setup action bar for tabs
    ActionBar actionBar = getSupportActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);

    Tab friendsTab =
        actionBar
            .newTab()
            .setText(R.string.friends_tabtitle)
            .setTabListener(
                new TabListenerList<FriendListFragment>(this, "friends", FriendListFragment.class));
    actionBar.addTab(friendsTab, true);

    Tab groupsTab =
        actionBar
            .newTab()
            .setText(R.string.groups_tabtitle)
            .setTabListener(
                new TabListenerList<GroupListFragment>(this, "groups", GroupListFragment.class));
    actionBar.addTab(groupsTab, true);

    actionBar.setSelectedNavigationItem(0);
  }
Пример #6
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);
   // valmistellaan ja populoidaan tabit actionBariin
   getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
   getSupportActionBar().setDisplayShowHomeEnabled(false);
   getSupportActionBar().setDisplayShowTitleEnabled(false);
   final ActionBar bar = getSupportActionBar();
   bar.addTab(
       bar.newTab()
           .setText(R.string.tab_status)
           .setTabListener(
               new TabListener<StatusFragment>(this, STATUS_TAG, StatusFragment.class)));
   mapTab =
       bar.newTab().setText(R.string.tab_map).setTabListener(new MapTabListener(this, MAP_TAG));
   bar.addTab(mapTab);
   bar.addTab(
       bar.newTab()
           .setText(R.string.tab_history)
           .setTabListener(new HistoryTabListener(this, HISTORY_TAG)));
   if (savedInstanceState != null)
     bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
 }
Пример #7
0
 @Override
 public void onPageSelected(int position) {
   super.onPageSelected(position);
   actionBar.setSelectedNavigationItem(position);
 }
Пример #8
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    bookId = getIntent().getIntExtra(EXTRA_bookId, -1);
    chapter_1 = getIntent().getIntExtra(EXTRA_chapter, 0);
    verse_1 = getIntent().getIntExtra(EXTRA_verse, 0);

    ActionBar actionBar = getSupportActionBar();

    if (getResources().getBoolean(R.bool.screen_sw_check_min_600dp) == false) {
      // The following two options trigger the collapsing of the main action bar view.
      actionBar.setDisplayShowHomeEnabled(false);
      actionBar.setDisplayShowTitleEnabled(false);
    }

    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    actionBar.addTab(
        actionBar
            .newTab()
            .setTag(tab_dialer)
            .setText(R.string.goto_tab_dialer_label)
            .setTabListener(
                new TabListener<GotoDialerFragment>(
                    this,
                    "dialer",
                    GotoDialerFragment.class,
                    GotoDialerFragment.createArgs(bookId, chapter_1, verse_1)))); // $NON-NLS-1$
    actionBar.addTab(
        actionBar
            .newTab()
            .setTag(tab_direct)
            .setText(R.string.goto_tab_direct_label)
            .setTabListener(
                new TabListener<GotoDirectFragment>(
                    this,
                    "direct",
                    GotoDirectFragment.class,
                    GotoDirectFragment.createArgs(bookId, chapter_1, verse_1)))); // $NON-NLS-1$
    actionBar.addTab(
        actionBar
            .newTab()
            .setTag(tab_grid)
            .setText(R.string.goto_tab_grid_label)
            .setTabListener(
                new TabListener<GotoGridFragment>(
                    this,
                    "grid",
                    GotoGridFragment.class,
                    GotoGridFragment.createArgs(bookId, chapter_1, verse_1)))); // $NON-NLS-1$

    if (savedInstanceState == null) {
      // get from preferences
      int tabUsed = Preferences.getInt(Prefkey.goto_last_tab, 0);
      if (tabUsed >= 1 && tabUsed <= 3) {
        actionBar.setSelectedNavigationItem(tabUsed - 1 /* to make it 0-based */);
      }
    } else {
      actionBar.setSelectedNavigationItem(savedInstanceState.getInt(INSTANCE_STATE_tab, 0));
    }
  }
 public void onPageSelected(int position) {
   mActionBar.setSelectedNavigationItem(position);
 }
Пример #10
0
 @Override
 public void onRestoreInstanceState(Bundle inState) {
   ActionBar actionBar = getSupportActionBar();
   actionBar.setSelectedNavigationItem(inState.getInt("CurrentTab"));
   super.onRestoreInstanceState(inState);
 }