private void initActionBar() {
   actionBar.show();
   iv_actionbar_left.setVisibility(View.GONE);
   tv_actionbar_left.setVisibility(View.GONE);
   et_actionbar_search.setVisibility(View.GONE);
   tv_actionbar_title.setVisibility(View.VISIBLE);
   tv_actionbar_title.setText("服务热线");
   iv_actionbar_right.setVisibility(View.VISIBLE);
   iv_actionbar_right.setImageResource(R.drawable.pub);
   iv_actionbar_right.setOnClickListener(
       new View.OnClickListener() {
         @Override
         public void onClick(View v) {
           if (!Utils.isLogon()) {
             startActivity(new Intent(getActivity(), LoginActivity.class));
           }
           //				else if ("01".equals(Utils.user.userBase.level)) {
           //					startActivity(new Intent(getActivity(), AuthAct.class));
           //				}
           else {
             startActivity(new Intent(getActivity(), PublicQuestAct.class));
           }
         }
       });
   tv_actionbar_right.setVisibility(View.GONE);
 }
 private void handleShow() {
   if (actionBar != null) {
     actionBar.show();
   } else {
     Log.w(TAG, "ActionBar is not enabled");
   }
 }
  /**
   * Toggle whether the system UI (status bar / system bar) is visible. This also toggles the action
   * bar visibility.
   *
   * @param show True to show the system UI, false to hide it.
   */
  void setSystemUiVisible(boolean show) {
    mSystemUiVisible = show;

    Window window = getActivity().getWindow();
    WindowManager.LayoutParams winParams = window.getAttributes();
    View view = getView();
    ActionBar actionBar = getActivity().getActionBar();

    if (show) {
      // Show status bar (remove fullscreen flag)
      window.setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
      // Show system bar
      view.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
      // Show action bar
      actionBar.show();
    } else {
      // Add fullscreen flag (hide status bar)
      window.setFlags(
          WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
      // Hide system bar
      view.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
      // Hide action bar
      actionBar.hide();
    }
    window.setAttributes(winParams);
  }
Ejemplo n.º 4
0
        @Override
        public void onPanelSlide(View panel, float slideOffset) {
          // For every 1 percent that the panel is slid upwards, clip 1 percent off the top
          // edge of the shortcut card, to achieve the animated effect of the shortcut card
          // being pushed out of view when the panel is slid upwards. slideOffset is 1 when
          // the shortcut card is fully exposed, and 0 when completely hidden.
          float ratioCardHidden = (1 - slideOffset);
          if (mShortcutCardsListView.getChildCount() > 0) {
            final SwipeableShortcutCard v =
                (SwipeableShortcutCard) mShortcutCardsListView.getChildAt(0);
            v.clipCard(ratioCardHidden);
          }

          if (mActionBar != null) {
            // Amount of available space that is not being hidden by the bottom pane
            final int topPaneHeight = (int) (slideOffset * mShortcutCardsListView.getHeight());

            final int availableActionBarHeight = Math.min(mActionBar.getHeight(), topPaneHeight);
            ((HostInterface) getActivity())
                .setActionBarHideOffset(mActionBar.getHeight() - availableActionBarHeight);

            if (!mActionBar.isShowing()) {
              mActionBar.show();
            }
          }
        }
 protected void onSystemUiShown() {
   final ActionBar actionBar = mActivity.getActionBar();
   if (actionBar != null) {
     actionBar.show();
   }
   mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
   setIsShowing(true);
 }
Ejemplo n.º 6
0
  protected void setActionBarState() {
    final ActionBar bar = activity.getActionBar();

    if (null != bar && !uiFullscreen) {
      bar.show();
    } else if (null != bar && uiFullscreen) {
      bar.hide();
    }
  }
Ejemplo n.º 7
0
 @Override
 public void hideComboView() {
   if (isComboViewShowing()) {
     mComboView.hideViews();
     mActionBar = mActivity.getActionBar();
     setupActionBar();
     if (mActionBar != null) mActionBar.show();
     mNavBar.setVisibility(View.VISIBLE);
   }
 }
Ejemplo n.º 8
0
 @Override
 public void onProgressChanged(Tab tab) {
   super.onProgressChanged(tab);
   if (mComboView != null && !mComboView.isShowing()) {
     mActionBar = mActivity.getActionBar();
     setupActionBar();
     if (mActionBar != null) mActionBar.show();
     if (mNavBar != null) mNavBar.setVisibility(View.VISIBLE);
   }
 }
 @Override
 protected void onSystemUiShown() {
   if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
     final ActionBar actionBar = mActivity.getActionBar();
     if (actionBar != null) {
       actionBar.show();
     }
   }
   setIsShowing(true);
 }
 @Override
 public void onClick(View v) {
   Context context = v.getContext();
   if (context instanceof Activity) {
     ActionBar bar = ((Activity) context).getActionBar();
     if (bar.isShowing()) {
       bar.hide();
     } else {
       bar.show();
     }
   }
 }
  @Override
  protected void onSystemUiShown() {
    if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
      // Manually show the action bar when in low profile mode.
      ActionBar ab = mActivity.getActionBar();
      if (ab != null) {
        ab.show();
      }
    }

    setIsShowing(false);
  }
Ejemplo n.º 12
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.layout_minder_detail);
   ButterKnife.inject(this);
   minderId = getIntent().getIntExtra("minder_id", 0);
   position = getIntent().getIntExtra("position", 0);
   ActionBar actionBar = getActionBar();
   actionBar.show();
   actionBar.setDisplayHomeAsUpEnabled(true);
   initData();
 }
Ejemplo n.º 13
0
 static void setFullScreen(Activity activity, boolean isFullScreen) {
   ActionBar actionBar = activity.getActionBar();
   if (isFullScreen) {
     activity
         .getWindow()
         .getDecorView()
         .setSystemUiVisibility(
             View.SYSTEM_UI_FLAG_LOW_PROFILE
                 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                 | View.SYSTEM_UI_FLAG_FULLSCREEN);
     if (actionBar != null) actionBar.hide();
   } else {
     activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
     if (actionBar != null) actionBar.show();
   }
 }
Ejemplo n.º 14
0
  private void fadeBars(boolean isFade) {
    ActionBar actionBar = getActionBar();
    View decorView = getWindow().getDecorView();
    int uiOptions;
    if (isFade) {

      uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
      setBtnVisible(false);
      if (actionBar != null) actionBar.hide();
    } else {
      uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
      setBtnVisible(true);
      if (actionBar != null) actionBar.show();
    }
    // decorView.setSystemUiVisibility(uiOptions);
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   setContentView(R.layout.topic_detail);
   ActionBar actionBar = getActionBar();
   actionBar.setIcon(null);
   actionBar.setDisplayHomeAsUpEnabled(true);
   actionBar.setDisplayUseLogoEnabled(false);
   actionBar.show();
   Intent intent = getIntent();
   String topic_id = intent.getStringExtra("topic_id");
   int isFocus = intent.getIntExtra("isFocus", 10);
   dm = getResources().getDisplayMetrics();
   ViewPager pager = (ViewPager) findViewById(R.id.pager);
   tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
   pager.setAdapter(new TopicDetailAdapter(getSupportFragmentManager(), topic_id, isFocus));
   tabs.setViewPager(pager);
   setTabsValue();
 }
Ejemplo n.º 16
0
 @Override
 public void show() {
   mActionBar.show();
 }
 public void show() {
   if (mActionBar != null) mActionBar.show();
 }
Ejemplo n.º 18
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.providerinfo);

    actionBar = getActionBar();
    actionBar.show();

    nameinfo_p = (EditText) findViewById(R.id.nameinfop);
    phoneinfo_p = (EditText) findViewById(R.id.phoneinfop);
    addressinfo_p = (EditText) findViewById(R.id.addressinfop);
    postcodeinfo_p = (EditText) findViewById(R.id.postcodeinfop);
    mailinfo_p = (EditText) findViewById(R.id.mailinfop);

    //		back_basicinfop = (Button)findViewById(R.id.back_basicinfop);
    delete_pinfo = (Button) findViewById(R.id.delete_pinfo);
    save_pinfo = (Button) findViewById(R.id.save_pinfo);

    intent_get = this.getIntent();
    bundle_getpinfo = intent_get.getExtras();
    ID = bundle_getpinfo.getInt("id");
    name = bundle_getpinfo.getString("name");
    phone = bundle_getpinfo.getString("phone");
    address = bundle_getpinfo.getString("address");
    postcode = bundle_getpinfo.getString("postcode");
    mail = bundle_getpinfo.getString("mail");

    nameinfo_p.setText(name);
    phoneinfo_p.setText(phone);
    addressinfo_p.setText(address);
    postcodeinfo_p.setText(postcode);
    mailinfo_p.setText(mail);

    //		Toast.makeText(getApplicationContext(), ID.toString(),
    //			     Toast.LENGTH_SHORT).show();

    /** 返回基本信息页面 */

    //		back_basicinfop.setOnClickListener(new Button.OnClickListener() {
    //
    //			@Override
    //			public void onClick(View arg0) {
    //				finish();
    //
    //			}});

    /** 删除该条数据 */
    delete_pinfo.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {

            new AlertDialog.Builder(ProviderInfo.this)
                .setTitle("确定要删除供货商信息吗?")
                .setPositiveButton(
                    "确定",
                    new DialogInterface.OnClickListener() {

                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                        android.database.sqlite.SQLiteDatabase db;
                        db =
                            SQLiteDatabase.openOrCreateDatabase(
                                "data/data/com.shixi.jxctest/databases/basicInfo.db", null);
                        db.execSQL("delete from provider where providerid=?", new Object[] {ID});

                        nameinfo_p.setText("NULL");
                        phoneinfo_p.setText("NULL");
                        addressinfo_p.setText("NULL");
                        postcodeinfo_p.setText("NULL");
                        mailinfo_p.setText("NULL");

                        Toast.makeText(getApplicationContext(), "删除成功!", Toast.LENGTH_SHORT).show();
                      }
                    })
                .setNegativeButton("取消", null)
                .create()
                .show();

            //				finish();
          }
        });

    /** 保存数据 */
    save_pinfo.setOnClickListener(
        new Button.OnClickListener() {

          @Override
          public void onClick(View v) {
            android.database.sqlite.SQLiteDatabase db;
            db =
                SQLiteDatabase.openOrCreateDatabase(
                    "data/data/com.shixi.jxctest/databases/basicInfo.db", null);
            db.execSQL(
                "update provider set name=?, phone=?, address=?, postcode=?, mail=? where providerid=?",
                new Object[] {
                  nameinfo_p.getText().toString(),
                  phoneinfo_p.getText().toString(),
                  addressinfo_p.getText().toString(),
                  postcodeinfo_p.getText().toString(),
                  mailinfo_p.getText().toString(),
                  ID
                });

            Toast.makeText(getApplicationContext(), "保存成功!", Toast.LENGTH_SHORT).show();

            finish();
          }
        });
  }
Ejemplo n.º 19
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String version = "?";
    try {
      PackageInfo manager = getPackageManager().getPackageInfo(getPackageName(), 0);
      version = manager.versionName;
    } catch (NameNotFoundException e) {
      Log.i(TAG, "NameNotFoundException e:" + e);
      e.printStackTrace();
    }

    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US);
    String theDate = sdf.format(new Date());
    Log.i(TAG, "theDate:" + theDate);

    Log.i(TAG, "version " + version);
    System.out.println(
        ">>>>>>                                                            >>>>>>>>>> Starting MainActivity.");

    //
    // experimenting
    //

    ActyTest.proto1(1, getApplicationContext());

    //
    // END experimenting
    //

    Globals g = Globals.getInstance();

    PackageManager pm = getApplicationContext().getPackageManager();

    String haves = "";
    boolean hasGps = pm.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS);
    if (hasGps) {
      haves += "This device has a gps.";
    } else {
      haves += "This device does not have a gps.";
    }
    ;
    if (isNetworkAvailable()) {
      haves += "The network is available.";
    } else {
      haves += "The network is not available.";
    }
    ;
    makeToast(haves);

    Utilities.readPlansTasks(getApplicationContext());

    Utilities.createByTaskArray();

    setContentView(R.layout.activity_main);

    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

    // gets the activity's default ActionBar

    ActionBar actionBar = getActionBar();
    actionBar.show();

    // set the app icon as an action to go home
    // we are home so we don't need it

    actionBar.setDisplayHomeAsUpEnabled(true);

    String t = getTitle().toString();
    setTitle(t + " version " + version);

    Button startPlan = (Button) findViewById(R.id.btnPlan);
    startPlan.setOnClickListener(
        new View.OnClickListener() {

          public void onClick(View v) {
            startPlan();
          }
        });

    SharedPreferences sharedPrefs =
        PreferenceManager.getDefaultSharedPreferences(getApplicationContext());

    String dwco = sharedPrefs.getString("dwco", "");
    Globals.dwco = dwco;
    System.out.println(TAG + " setting Globals.dwco = " + dwco);

    String dwcoRequests = sharedPrefs.getString("dwcoRequests", "");
    Globals.dwcoRequests = dwcoRequests;
    System.out.println(TAG + " setting Globals.dwco = " + dwcoRequests);

    String dwcoReplies = sharedPrefs.getString("dwcoReplies", "");
    Globals.dwcoReplies = dwcoReplies;
    System.out.println(TAG + " setting Globals.dwcoReplies = " + dwcoReplies);

    Log.i(TAG, "Exiting MainActivity.");
    System.out.println(TAG + " -- Exiting MainActivity.");
  }
Ejemplo n.º 20
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_note);

    DataManager.getCurrentState().setActivity(this);

    imageView_photo = (ImageView) findViewById(R.id.imageView_photo);
    textView_tittle = (TextView) findViewById(R.id.textView_tittle);
    textView_description = (TextView) findViewById(R.id.textView_description);
    button_edit = (Button) findViewById(R.id.button_edit);
    button_back = (Button) findViewById(R.id.button_back);

    Note note = DataManager.getNote();
    // Note note = new Note();
    // note.setTitle("title");
    // note.setDescription("asdasdasdjlshdddddddddddddddddddddddddddddddasdas;ldka;sldkasljdkajshdlksjahfljasdhlkjasdhfad");
    //
    // Bitmap bmp1 = BitmapFactory.decodeResource(getResources(),
    // R.drawable.add);
    //
    // note.setPhoto(DataManager.getImageBytes(bmp1));
    // //note.hasImage = false;

    textView_tittle.setText(note.getTitle());
    textView_description.setText(note.getDescription());

    if (note.hasImage) {
      Bitmap bmp = DataManager.getImageFromBytes(note.getPhoto());
      imageView_photo.setImageBitmap(bmp);
    } else imageView_photo.setVisibility(View.GONE);

    button_edit.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            //				Intent myIntent = new Intent(getBaseContext(), EditNote.class);
            //				myIntent.putExtra("previousActivity",
            //						ActivityEnum.ViewNote.toString());
            //				myIntent.putExtra("isUpdate", true);
            //				startActivity(myIntent);
            DataManager.getCurrentState().leftButtonBarButtonClicked(getBaseContext());
          }
        });

    button_back.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            //				String value = getIntent().getStringExtra("previousActivity");
            //				ActivityEnum aEnum = ActivityEnum.valueOf(value);
            //
            //				Intent myIntent;
            //
            //				switch (aEnum) {
            ////				case ChangeChildrenProfile:
            ////					myIntent = new Intent(getBaseContext(),
            ////							ChangeChildrenProfile.class);
            ////					myIntent.putExtra("previousActivity",
            ////							ActivityEnum.ViewNote.toString());
            ////					startActivity(myIntent);
            ////					break;
            //				case Notes:
            //					myIntent = new Intent(getBaseContext(), Notes.class);
            //					myIntent.putExtra("previousActivity",
            //							ActivityEnum.ViewNote.toString());
            //					startActivity(myIntent);
            //					break;
            //				case EditNote:
            //					myIntent = new Intent(getBaseContext(),
            //							Notes.class);
            //					myIntent.putExtra("previousActivity",
            //							ActivityEnum.ViewNote.toString());
            //					startActivity(myIntent);
            //					break;
            //				}

            DataManager.getCurrentState().rightButtonBarButtonClicked(getBaseContext());
          }
        });

    ActionBar aBar = getActionBar();
    aBar.setDisplayShowTitleEnabled(false);
    aBar.setDisplayShowHomeEnabled(false);
    aBar.show();
    getOverflowMenu();
  }
Ejemplo n.º 21
0
 @Override
 public void onHideCustomView() {
   super.onHideCustomView();
   if (mActionBar != null) mActionBar.show();
   mTitleBar.setTranslationY(0);
 }