@Override
 public void onStart() {
   super.onStart();
   final ActionBar bar = getActivity().getActionBar();
   mPreviousTitle = bar.getTitle();
   bar.setTitle(R.string.gesture_anywhere_title);
 }
コード例 #2
0
 @Kroll.method
 @Kroll.getProperty
 public String getTitle() {
   if (actionBar == null) {
     return null;
   }
   return (String) actionBar.getTitle();
 }
コード例 #3
0
 private void setTitle(CharSequence title) {
   if (!TextUtils.equals(title, mActionBar.getTitle())) {
     mActionBar.setTitle(title);
   }
   if (mLegacyTitle != null) {
     mLegacyTitle.setText(title);
   }
 }
コード例 #4
0
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   ActionBar actionBar = getActionBar();
   //		actionBar.setDisplayHomeAsUpEnabled(true);
   setContentView(R.layout.tsquare_main);
   overridePendingTransition(R.anim.fade, R.anim.hold);
   EasyTracker.getInstance(this).activityStart(this);
   GoogleAnalytics.getInstance(this).getTracker(MainActivity.TRACKING);
   Tracker tracker = GoogleAnalytics.getInstance(this).getTracker(MainActivity.TRACKING);
   tracker.send(
       MapBuilder.createAppView()
           .set(Fields.SCREEN_NAME, "T-Square Final " + actionBar.getTitle())
           .build());
 }
コード例 #5
0
ファイル: ActionBarHelper.java プロジェクト: grants/OakPark
  /**
   * 改变标题字体 @Title: changeTitleFonts
   *
   * @param activity
   * @param typeface
   */
  public static void changeTitleFonts(Activity activity, Typeface typeface) {
    if (typeface == null || activity == null) {
      Log.e(TAG, "activity或 typeface等于空!");
      return;
    }
    if (activity instanceof ActionBarActivity) {
      try {
        android.support.v7.app.ActionBar actionBar =
            ((ActionBarActivity) activity).getSupportActionBar();
        setTitle(actionBar, typeface, actionBar.getTitle().toString());
      } catch (Exception e) {
        Log.e(TAG, e.toString());
      }

    } else if (activity instanceof Activity) {
      try {
        ActionBar actionBar = activity.getActionBar();
        setTitle(actionBar, typeface, actionBar.getTitle().toString());
      } catch (Exception e) {
        Log.e(TAG, e.toString());
      }
    }
  }
コード例 #6
0
 @Override
 public CharSequence getTitle() {
   return mActionBar.getTitle();
 }