@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_mapa_establecimientos);

    ActionBar ab = getSupportActionBar();
    ab.setDisplayOptions(
        ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);

    mapa = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

    Bundle bundle = getIntent().getExtras();
    String municipio = bundle.getString("municipio");

    nombreMunicipio = (TextView) findViewById(R.id.nombreMunicipio);
    nombreMunicipio.setText(Utilities.getCamelCase(municipio));

    String nombre = bundle.getString("nombre");

    ctx = this;

    if (nombre == null) initMapaTodos(municipio);
    else initMapaUno();
    initClickMarker();
  }
  @Override
  protected void initActionBar() {
    ActionBar actionBar = getSherlockActivity().getSupportActionBar();
    ActionBar.LayoutParams params =
        new ActionBar.LayoutParams(
            LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.CENTER);
    View view =
        LayoutInflater.from(getSherlockActivity())
            .inflate(R.layout.custom_actionbar_with_image_text, null);
    titleLeft = (TextView) view.findViewById(R.id.actionbar_title_left);
    titleRight = (TextView) view.findViewById(R.id.actionbar_title_right);
    titleLL = (LinearLayout) view.findViewById(R.id.actionbar_center);
    ImageButton leftButton = (ImageButton) view.findViewById(R.id.actionbar_left);
    ImageButton rightButton = (ImageButton) view.findViewById(R.id.actionbar_right);

    titleLeft.setText(getString(string.history_trend_recent));
    titleRight.setText(getString(string.history_trend_monthly_report));
    leftButton.setImageResource(drawable.public_ic_back);
    rightButton.setImageResource(drawable.detailsoftheresultsview_ic_share);

    titleLeft.setOnClickListener(this);
    titleRight.setOnClickListener(this);
    rightButton.setOnClickListener(this);
    leftButton.setOnClickListener(this);

    switchActionBar(isRecentState);

    actionBar.setCustomView(view, params);
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
    actionBar.setDisplayShowCustomEnabled(true);
  }
Esempio n. 3
0
  private void setupActionBar() {
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

    View actionBarView = LayoutInflater.from(this).inflate(R.layout.photos_action_bar, null);
    actionBarView
        .findViewById(R.id.back)
        .setOnClickListener(
            new OnClickListener() {
              @Override
              public void onClick(View v) {
                onBackPressed();
              }
            });

    actionBarView
        .findViewById(R.id.done_container)
        .setOnClickListener(
            new View.OnClickListener() {

              @Override
              public void onClick(View v) {
                onSaveClicked();
              }
            });

    actionBar.setCustomView(actionBarView);
  }
 private void setupActionBar() {
   final ActionBar actionbar = getSherlockActivity().getSupportActionBar();
   actionbar.setDisplayOptions(
       ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM);
   actionbar.setTitle(getArguments().getString("courseName"));
   actionbar.setSubtitle(getArguments().getString("itemName"));
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    app = TRAApplication.getApp();
    TAG = getClass().getName();
    // Log.i("SWall",TAG+":onCreate");
    defaultRequestData = new Bundle();
    defaultRequestData.putString(
        ServiceManager.Constants.KEY_USER_NAME, getCurrentAccount().userName);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
      actionBar.setCustomView(R.layout.title_bar);
      actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
      actionBar.setIcon(R.drawable.icon);
      actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
      actionBar.setDisplayShowCustomEnabled(true);
      actionBar.setBackgroundDrawable(getResources().getDrawable((R.color.bg)));
    }

    UmengUpdateAgent.setUpdateAutoPopup(false);
    UmengUpdateAgent.setDialogListener(
        new UmengDialogButtonListener() {

          @Override
          public void onClick(int status) {
            switch (status) {
              case UpdateStatus.Update:
                break;
              case UpdateStatus.Ignore:
                break;
              case UpdateStatus.NotNow:
                break;
            }
          }
        });
    //        if(isIgnoredOnce) {
    //            UmengUpdateAgent.update(this);
    //        }
    UmengUpdateAgent.setUpdateListener(this);
    UmengUpdateAgent.update(app.getApplicationContext());

    showQuitButton();

    setBackConfirm(false);
  }
Esempio n. 6
0
 private void initActionBar() {
   ActionBar actionBar = getSupportActionBar();
   ActionBar.LayoutParams params =
       new ActionBar.LayoutParams(
           LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.CENTER);
   View view = LayoutInflater.from(this).inflate(R.layout.custom_actionbar_with_image, null);
   TextView title = (TextView) view.findViewById(R.id.actionbar_title);
   title.setOnClickListener(this);
   title.setText(R.string.clock_remind);
   ImageButton leftButton = (ImageButton) view.findViewById(R.id.actionbar_left);
   leftButton.setImageResource(R.drawable.public_ic_back);
   leftButton.setOnClickListener(this);
   ImageButton rightButton = (ImageButton) view.findViewById(R.id.actionbar_right);
   rightButton.setImageResource(R.drawable.serviceview_ic_add);
   rightButton.setOnClickListener(this);
   actionBar.setCustomView(view, params);
   actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
   actionBar.setDisplayShowCustomEnabled(true);
 }
 public void initActionBar() {
   View headView = LayoutInflater.from(this).inflate(R.layout.detail_news_actionbar, null);
   // 上一篇新闻
   Button newsDetailsTitlebarPref =
       (Button) headView.findViewById(R.id.newsdetails_titlebar_previous);
   newsDetailsTitlebarPref.setOnClickListener(this);
   // 下一篇新闻
   Button newsDetailsTitlebarNext = (Button) headView.findViewById(R.id.newsdetails_titlebar_next);
   newsDetailsTitlebarNext.setOnClickListener(this);
   // 新闻回复条数Button
   mNewsdetailsTitlebarComm = (Button) headView.findViewById(R.id.newsdetails_titlebar_comments);
   mNewsdetailsTitlebarComm.setOnClickListener(this);
   mNewsdetailsTitlebarComm.setText(mNewsData.get(mPosition).get("newslist_item_comments") + "跟帖");
   ActionBar actionBar = getSupportActionBar();
   actionBar.setCustomView(headView);
   actionBar.setDisplayShowCustomEnabled(true);
   actionBar.setDisplayShowHomeEnabled(false);
   actionBar.setDisplayHomeAsUpEnabled(true);
   actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
   actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.title_bg));
 }
Esempio n. 8
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main_loginfb);

    Button btnLogin = (Button) findViewById(R.id.btnLoginFb);
    mFacebook = new Facebook(APP_ID);

    context = LoginFb.this;
    manager = new SessionManager(context);

    btnLogin.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            boolean internet = new InternetUtil(LoginFb.this).isConnectingToInternet();
            if (internet) {
              AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
              mFacebook.authorize(LoginFb.this, APP_PERMISIONS, new LoginDialogListener());
            } else {
              Toast.makeText(LoginFb.this, "Necesita Conectarse a Internet.", Toast.LENGTH_SHORT)
                  .show();
            }
          }
        });

    // nos salteamos el logueo
    if (manager.getEstadoSession()) {
      ((SherlockActivity) context).finish();
      context.startActivity(new Intent(context, Map.class));
      ((SherlockActivity) context).overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
    }

    ActionBar ab = getSupportActionBar();
    ab.setDisplayOptions(
        ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
    ab.setTitle(getString(R.string.register_user));
  }
  private void setupActionBar() {
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

    View actionBarView = LayoutInflater.from(this).inflate(R.layout.compose_action_bar, null);

    View backContainer = actionBarView.findViewById(R.id.back);

    title = (TextView) actionBarView.findViewById(R.id.title);
    subText = (TextView) actionBarView.findViewById(R.id.subtext);

    setTitle(getString(R.string.shared_files));

    backContainer.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            onBackPressed();
          }
        });

    actionBar.setCustomView(actionBarView);
  }
Esempio n. 10
0
  public void setActionBar() {
    try {
      com.actionbarsherlock.app.ActionBar actionBar = getSupportActionBar();
      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
      getSupportActionBar().setHomeButtonEnabled(true);
      actionBar.setDisplayShowHomeEnabled(false);
      actionBar.setDisplayShowTitleEnabled(false);
      actionBar.setCustomView(R.layout.chatactionbar);
      actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

      pic = (ImageView) actionBar.getCustomView().findViewById(R.id.ab_userpic);
      name = (TextView) actionBar.getCustomView().findViewById(R.id.ab_userName);
      LinearLayout backfrChat =
          (LinearLayout) actionBar.getCustomView().findViewById(R.id.ll_backFromChat);
      tv_userStatus = (TextView) actionBar.getCustomView().findViewById(R.id.ab_userStatus);
      LinearLayout ll_userprofile =
          (LinearLayout) actionBar.getCustomView().findViewById(R.id.ll_calluserProfile);

      btn_filetransfer = (Button) actionBar.getCustomView().findViewById(R.id.btnattechment);

      btn_filetransfer.setOnClickListener(
          new View.OnClickListener() {

            @Override
            public void onClick(View v) {
              // TODO Auto-generated method stub
              viewAttechmentPopup(v);
            }
          });

      backfrChat.setOnClickListener(
          new View.OnClickListener() {

            @Override
            public void onClick(View v) {
              // TODO Auto-generated method stub
              callBack();
            }
          });

      ll_userprofile.setOnClickListener(
          new View.OnClickListener() {

            @Override
            public void onClick(View v) {
              callUserProfileActivity();
            }
          });

      vv = detailFragment.getView();
      bodyInput = (EditText) vv.findViewById(R.id.embedded_text_editor);
      Fl_Emoticon_Holder = (FrameLayout) vv.findViewById(R.id.fl_emojicons);
      btn_emoticon_show = (ImageButton) vv.findViewById(R.id.ib_enable_emoticon_frame);

      String user_number = prefs.getString(stored_chatuserNumber, "No Value");
      if (user_number.contains("@")) {
        String[] nu = user_number.split("@");
        nu = nu[0].split(":");
        user_number = nu[1];
      }

      supportnum = prefs.getString(stored_supportnumber, "");
      String nu = detailFragment.stripNumber(user_number);
      String fileuri = Environment.getExternalStorageDirectory() + "/R4W/ProfilePic/" + nu + ".png";
      Log.d("fileuri", fileuri + " !");
      Log.d("supportnum", supportnum);
      Log.d("nu", nu);

      if (nu.equals(supportnum)) {
        pic.setImageResource(R.drawable.roaminglogo);
      } else {
        File imageDirectoryprofile = new File(fileuri);
        if (imageDirectoryprofile.exists()) {
          pic.setImageURI(Uri.parse(fileuri));
        } else {
          pic.setImageResource(R.drawable.ic_contact_picture_180_holo_light);
        }
      }

      String username = nu;

      if (dbContacts == null) {
        dbContacts = new DBContacts(MessageActivity.this);
      }
      String nameServer = "", nameContact = "";
      dbContacts.openToRead();
      Cursor cursor = dbContacts.fetch_contact_from_R4W(nu);
      if (cursor.getCount() > 0) {
        cursor.moveToFirst();
        nameServer = cursor.getString(5).toString();
        nameContact = cursor.getString(2).toString();
        cursor.close();
        dbContacts.close();

        Log.d("nameServer", nameServer + " in");
        Log.d("nameContact", nameContact + " in");

        if (!nameServer.equals("***no name***")) {
          username = nameServer;
        } else {
          username = nameContact;
        }
        name.setText(username);
      } else {
        name.setText(nu);
      }

    } catch (Exception e) {
      // TODO: handle exception
    }
  }