Exemplo n.º 1
0
 public void setEnlargedMode(boolean enlargedMode) {
   this.enlargedMode = enlargedMode;
   if (enlargedMode) {
     header.showToolBar();
   } else {
     header.showTitleBar();
   }
 }
Exemplo n.º 2
0
 @Override
 public boolean dispatchTouchEvent(MotionEvent event) {
   //// System.out.println("flipStarted" + flipStarted);
   if (flipStarted) return true;
   //        if (header.isSourceSelectMode()) {
   if (header.dispatchTouchEvent(event)) {
     return true;
   }
   //        if (pageIndexView.dispatchTouchEvent(event)) {
   //            return true;
   //        }
   //        }
   if (enlargedMode) {
     current.onTouchEvent(event);
   }
   switch (event.getAction()) {
     case MotionEvent.ACTION_UP:
       return current.dispatchTouchEvent(event);
     case MotionEvent.ACTION_MOVE:
       {
         if (!enlargedMode) onTouchEvent(event);
         else current.onTouchEvent(event);
       }
   }
   return super.dispatchTouchEvent(event);
 }
Exemplo n.º 3
0
 public void someMethod(Item item) {
   setTag(item);
   table.removeAllViews();
   scrollView.scrollTo(0, 0);
   header.render(item);
   for (Item child : item.getChildren()) {
     table.addView(getRowView(child));
   }
 }
Exemplo n.º 4
0
  private void createHeader() {
    headerView = (HeaderView) getActivity();
    headerView.setLeftButton(View.INVISIBLE);
    headerView.setRightButton(
        View.VISIBLE,
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            //				TabsActivityMain tab = (TabsActivityMain) getActivity()
            //						.getParent();
            //				tab.getTabHost().setCurrentTab(3);
            Intent i = new Intent(getActivity(), SearchActivity.class);
            startActivity(i);
          }
        });
    headerView.setLogoVisible(View.GONE);
    headerView.setTitleVisible(View.VISIBLE, getString(R.string.marketplace));
    headerView.setProgressVisible(View.VISIBLE);
  }
Exemplo n.º 5
0
  @Override
  public boolean onTouchEvent(MotionEvent event) {
    //// System.out.println("flipStarted" + flipStarted);
    if (flipStarted) {
      return false;
    }
    //        if (header.isSourceSelectMode()) {
    //            header.onTouchEvent(event);
    //        }
    if (enlargedMode) {
      current.onTouchEvent(event);
    }

    switch (event.getAction()) {
      case MotionEvent.ACTION_MOVE:
        if (event.getHistorySize() > 0 && !flipStarted) {
          if (GestureUtil.flipRight(event)) {
            lastFlipDirection = ACTION_HORIZONTAL;
            flipPage(false);
          } else if (GestureUtil.flipUp(event)) {
            lastFlipDirection = ACTION_VERTICAL;
            flipPage(false);
          } else if (GestureUtil.flipLeft(event)) {
            lastFlipDirection = ACTION_HORIZONTAL;
            flipPage(true);
          } else if (GestureUtil.flipDown(event)) {
            lastFlipDirection = ACTION_VERTICAL;
            flipPage(true);
          }

        } else {
          //                    if (header.isSourceSelectMode())
          header.onTouchEvent(event);
          //                    pageIndexView.onTouchEvent(event);
        }
        break;
      default:
        break;
    }

    return true;
  }
Exemplo n.º 6
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    registerNofitication(true);

    headerView = getView(R.id.activitymain_headerview);

    headerView.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            if (dbUserLogin.isLogin()) {
              logout();
            } else {
              login();
            }
          }
        });

    headerView.updateButton(dbUserLogin.isLogin());
    listView = getView(R.id.mainactivity_listview);

    List<Object> list = new ArrayList<Object>();
    templete(list);

    listView.setAdapter(
        new BaseAdapter(
            this,
            list,
            new CommonGenderView() {
              @Override
              public CustomLinearLayoutView getView(Context context, Object data) {
                return new S2ItemView(context);
              }
            }));

    setupListView(listView);
    listView.setOnItemClickListener(
        new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            S2Item item = (S2Item) parent.getItemAtPosition(position);
            if (!CommonAndroid.NETWORK.haveConnectTed(view.getContext())) {
              // if (item.res == R.drawable.main_img_1
              // || item.res == R.drawable.main_img_3
              // || item.res == R.drawable.main_img_7
              // || item.res == R.drawable.main_img_8) {
              MintUtils.showDialog(
                  view.getContext(), "Mint Medical. Network connection unavailable");
              return;
              // }
            }
            if (item.res == R.drawable.main_img_7 || item.res == R.drawable.main_img_4) {
              gotoPage(item);
            } else {
              if (dbUserLogin.isLogin()) {
                gotoPage(item);
              } else {
                login();
              }
            }
          }
        });
  }
Exemplo n.º 7
0
 private void logout() {
   dbUserLogin.saveLogin(false);
   headerView.updateButton(dbUserLogin.isLogin());
   // startActivity(new Intent(this, S1Activity.class));
   // finish();
 }