コード例 #1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test);

    // 属于其中之一
    FloatingActionButton actionC = new FloatingActionButton(getBaseContext());
    actionC.setTitle("Hide/Show Action above");
    actionC.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // actionB.setVisibility(actionB.getVisibility() == View.GONE ? View.VISIBLE :
            // View.GONE);
          }
        });

    // 属于其中之一
    FloatingActionButton actionA = new FloatingActionButton(getBaseContext());
    actionC.setTitle("Hide/Show Action above");
    actionC.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // actionB.setVisibility(actionB.getVisibility() == View.GONE ? View.VISIBLE :
            // View.GONE);
          }
        });

    // 属于其中之一
    FloatingActionButton actionB = new FloatingActionButton(getBaseContext());
    actionC.setTitle("Hide/Show Action above");
    actionC.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // actionB.setVisibility(actionB.getVisibility() == View.GONE ? View.VISIBLE :
            // View.GONE);
          }
        });

    ((FloatingActionsMenu) findViewById(R.id.multiple_actions)).addButton(actionC);
    ((FloatingActionsMenu) findViewById(R.id.multiple_actions)).addButton(actionB);
    ((FloatingActionsMenu) findViewById(R.id.multiple_actions)).addButton(actionA);
  }
コード例 #2
0
 @Override
 public void init(Bundle savedInstanceState) {
   super.init(savedInstanceState);
   setToolbar(R.mipmap.ic_arrow_back, "邮件详细");
   if (signal != null) {
     if (signal.objectValue != null) {
       email = (Email) signal.objectValue;
       bindData();
     } else {
       if (signal.intValue != 0) {
         showWaitDialog("正在加载...", true);
         getEmailById(signal.intValue2 == 4 ? "wail" : "");
       }
     }
   }
   // 判断草稿箱和发件箱按钮
   if (signal != null && signal.action != null) {
     flag = signal.intValue2;
   }
   switch (flag) {
     case 2: // 草稿箱
       TT_reply.setTitle("编辑");
       TT_zhuan.setTitle("发送");
       real_delete = "";
       delete = "4";
       break;
     case 1: // 发件箱
       TT_reply.setTitle("编辑");
       real_delete = "";
       delete = "4";
       break;
     case 3: // 已删除
       real_delete = "1";
       delete = "";
       break;
     case 0: // 收件箱
       real_delete = "";
       delete = "4";
       break;
   }
   TT_reply.setOnClickListener(this);
   TT_zhuan.setOnClickListener(this);
   TT_delete.setOnClickListener(this);
 }