Android Open Source - Android-Universal-Notifier Tab Listener






From Project

Back to project page Android-Universal-Notifier.

License

The source code is released under:

Apache License

If you think the Android project Android-Universal-Notifier listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mairos.universalnotifier.UI;
//w  w  w. j av a  2  s.c om
import com.mairos.universalnotifier.R;

import android.app.ActionBar.Tab;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.app.ActionBar;

public class TabListener implements ActionBar.TabListener{

  private Fragment fragment;
  
  // The contructor.
  public TabListener(Fragment fragment) {
    this.fragment = fragment;
  }

  // When a tab is tapped, the FragmentTransaction replaces
  // the content of our main layout with the specified fragment;
  // that's why we declared an id for the main layout.
  @Override
  public void onTabSelected(Tab tab, FragmentTransaction ft) {
    ft.replace(R.id.activity_main, fragment);
  }

  // When a tab is unselected, we have to hide it from the user's view. 
  @Override
  public void onTabUnselected(Tab tab, FragmentTransaction ft) {
    ft.remove(fragment);
  }

  // Nothing special here. Fragments already did the job.
  @Override
  public void onTabReselected(Tab tab, FragmentTransaction ft) {
    
  }
}




Java Source Code List

com.mairos.universalnotifier.UI.LogFragmentTab.java
com.mairos.universalnotifier.UI.MainActivity.java
com.mairos.universalnotifier.UI.SettingsActivity.java
com.mairos.universalnotifier.UI.TabListener.java
com.mairos.universalnotifier.UI.TaskInfoActivity.java
com.mairos.universalnotifier.UI.TasksFragmentTab.java
com.mairos.universalnotifier.model.AlarmManagerBroadcastReceiver.java
com.mairos.universalnotifier.model.AttachmentData.java
com.mairos.universalnotifier.model.Const.java
com.mairos.universalnotifier.model.JSInterpreter.java
com.mairos.universalnotifier.model.LauncherBroadcastReceiver.java
com.mairos.universalnotifier.model.Logger.java
com.mairos.universalnotifier.model.NotificationService.java
com.mairos.universalnotifier.model.NotificationTask.java
com.mairos.universalnotifier.model.TasksQueue.java
com.mairos.universalnotifier.model.TasksXMLLoader.java
com.mairos.universalnotifier.network.GMailSender.java
com.mairos.universalnotifier.network.JSSEProvider.java
com.mairos.universalnotifier.network.NetworkOperations.java
com.mairos.universalnotifier.network.SMSSender.java