コード例 #1
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();
            }
          }
        }
コード例 #2
0
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
      int topPadding =
          paddingEnabled && actionBar != null && actionBar.isShowing() ? actionBar.getHeight() : 0;
      setPadding(0, topPadding, 0, 0);

      super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
コード例 #3
0
ファイル: ImageActivity.java プロジェクト: mackentan/Moonkin
  /*public void onDialogClick(ArrayList<Integer> list) {

      //ArrayList<String> filterString = new ArrayList<String>();
      if (list.size() == 0) {
          setBtnEnable(true);

      } else {
          for (int i : list) {
              String s = filterWord.get(i).str;
              Log.d(TAG, "onFilterClick  " + s);
              //filterString.add(s);
              mUserFilter.add(s);

          }
          ImageFragment fragment = (ImageFragment) getFragmentManager().
                  findFragmentById(R.id.image_fragment);
          fragment.newImage(mUserFilter);
          setBtnEnable(false);
          //process(fontPath, borderPath, imagePath, list);
      }
  }*/
  private void fadeBars() {
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
      if (actionBar.isShowing()) {
        fadeBars(true);

      } else {
        fadeBars(false);
      }
    }
  }
コード例 #4
0
 @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();
     }
   }
 }
コード例 #5
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // TODO Auto-generated method stub

    rootView = inflater.inflate(R.layout.fragment_strength_layout, container, false);

    ActionBar actionBar = getActivity().getActionBar();
    // actionBar.setDisplayOptions(
    //	    ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
    if (actionBar.isShowing()) {
      actionBar.removeAllTabs();
      // actionBar.setDisplayOptions(
      //	    ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
      // actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    }
    actionBar.setDisplayShowCustomEnabled(false);
    // Screen handling while hiding ActionBar icon.
    actionBar.setDisplayShowHomeEnabled(true);

    // Screen handling while hiding Actionbar title.
    actionBar.setDisplayShowTitleEnabled(true);
    // actionBar.setHomeButtonEnabled(isVisible());
    // Creating ActionBar tabs.
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);

    listStrengthReport = (ListView) rootView.findViewById(R.id.listStrengthReport);

    urlcreatereport = new UrlConnectStrengthReport(rootView.getContext());

    db = new DatabaseOpenHelper(rootView.getContext());

    // load data on the list view
    populateStrengthReportListView(rootView.getContext());

    // ++++++++++++++++++++++++++++++++++++++++++++++
    /*	try{
      new LoadStrengthReport().execute();
    }catch(Exception e){
    	Toast.makeText(getActivity(), "Error occured :"+e.getMessage(), Toast.LENGTH_SHORT);
    	Log.d("Error Occured", e.getMessage());
    }*/
    // +++++++++++++++++++++++++++++++++++++++++++++

    return rootView;
  }
コード例 #6
0
 @Override
 public boolean isShowing() {
   return mActionBar.isShowing();
 }