@Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   // save controls state
   outState.putString("subject", edSubject.getText().toString());
   outState.putBoolean("alarm", chkAlarm.isChecked());
   outState.putLong("dateStart", dateStart.getTimeInMillis());
   outState.putBoolean("allday", chkAllDay.isChecked());
   outState.putInt("repeatType", iRepeatType);
   outState.putInt("repeatEvery", iRepeatEvery);
   outState.putLong("dateEndOn", dateEndOn.getTimeInMillis());
 }
Ejemplo n.º 2
0
 public void save() {
   if (rs.isChecked() == true) {
     edit.putBoolean("silent", true);
     edit.commit();
   } else {
     edit.putBoolean("silent", false);
     edit.commit();
   }
   if (nc.isChecked() == true) {
     edit.putBoolean("nightmode", true);
     edit.commit();
   } else {
     edit.putBoolean("nightmode", false);
     edit.commit();
   }
   Toast.makeText(getApplicationContext(), "保存成功!", Toast.LENGTH_SHORT).show();
 }
  public void SaveData() {
    // check date if no repeat
    if ((iRepeatType == 0) && (DateBeforeNow(dateStart))) return;

    dataRow.SetSubject(edSubject.getText().toString());
    dataRow.SetStartDate(dateStart);
    dataRow.SetAllDay(chkAllDay.isChecked());
    dataRow.SetAlarm(chkAlarm.isChecked());

    // set repeat type
    RepeatData rd = dataRow.GetRepeat();
    rd.SetRepeatTypeAsInt(iRepeatType);
    rd.SetEvery(iRepeatEvery);
    rd.SetEndOnDate(dateEndOn.getTimeInMillis());

    if (SaveDataToTable(dataTable)) CloseActivity(dataTable);
  }
 private void UpdateStartDateTimeView() {
   btnStartDate.setText(AnCalDateUtils.formatMediumDate(this, dateStart));
   if (chkAllDay.isChecked()) {
     btnStartTime.setText(utils.GetResStr(R.string.labNoTime));
   } else {
     btnStartTime.setText(AnCalDateUtils.formatTime(this, dateStart));
   }
 }
 protected final void e()
 {
   u();
   N.a("FIRST_MEDIA_OPENED");
   Y.b();
   w();
   J = false;
   if ((v != awf.d(getActivity())) || (R != null)) {
     x();
   }
   if (a != null)
   {
     v();
     t();
     a.f();
   }
   Z.a(new bfk(TitleBarManager.Visibility.HIDDEN));
   SnapEditorView localSnapEditorView;
   boolean bool;
   if ((a != null) && (avr.a(a)))
   {
     b.a((aku)a);
     localSnapEditorView = b;
     if (!D.isChecked())
     {
       bool = true;
       localSnapEditorView.setAudible(bool);
     }
   }
   for (;;)
   {
     localSnapEditorView = b;
     localSnapEditorView.a(c.b.a, false);
     return;
     bool = false;
     break;
     if (a.mSnapType != Mediabryo.SnapType.DISCOVER) {
       Z.a(new bbx(-1));
     }
   }
 }
 private void x()
 {
   Z.a(new bfk(TitleBarManager.Visibility.HIDDEN));
   int i1;
   label299:
   boolean bool;
   label316:
   label336:
   of localof;
   EasyMetric localEasyMetric;
   if (avr.a(a))
   {
     y.setVisibility(4);
     h.setVisibility(8);
     D.setVisibility(0);
     if (getUserVisibleHint()) {
       Z.a(new bbx(1));
     }
     s.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         ((InputMethodManager)SnapPreviewFragment.a(SnapPreviewFragment.this, "input_method")).hideSoftInputFromWindow(SnapPreviewFragment.b(SnapPreviewFragment.this).getApplicationWindowToken(), 0);
         getActivity().onBackPressed();
       }
     });
     m.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         if ((SnapPreviewFragment.c(SnapPreviewFragment.this).getCaptionView().i()) && (!SnapPreviewFragment.c(SnapPreviewFragment.this).getCaptionView().g()))
         {
           SnapPreviewFragment.c(SnapPreviewFragment.this).getCaptionView().f();
           return;
         }
         SnapPreviewFragment.c(SnapPreviewFragment.this).a(true);
       }
     });
     o.a(new bhr.a()
     {
       public final void a(View paramAnonymousView)
       {
         ((ImageButton)SnapPreviewFragment.e(SnapPreviewFragment.this).a()).setOnClickListener(new View.OnClickListener()
         {
           public final void onClick(View paramAnonymous2View)
           {
             SnapPreviewFragment.d(SnapPreviewFragment.this);
           }
         });
         ((ImageButton)SnapPreviewFragment.g(SnapPreviewFragment.this).a()).setOnClickListener(new View.OnClickListener()
         {
           public final void onClick(View paramAnonymous2View)
           {
             SnapPreviewFragment.f(SnapPreviewFragment.this);
           }
         });
       }
     });
     i.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         AnalyticsEvents.i();
         SnapPreviewFragment.d(SnapPreviewFragment.this);
       }
     });
     t.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         SnapPreviewFragment.h(SnapPreviewFragment.this);
         imMediaMailingMetadata.mSavedInGallery = true;
       }
     });
     z.a(new bhr.a()
     {
       public final void a(View paramAnonymousView)
       {
         SnapPreviewFragment.j(SnapPreviewFragment.this);
       }
     });
     y.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         if (!SnapPreviewFragment.k(SnapPreviewFragment.this).c())
         {
           if (SnapPreviewFragment.l(SnapPreviewFragment.this)) {
             SnapPreviewFragment.d(SnapPreviewFragment.this);
           }
           SnapPreviewFragment.m(SnapPreviewFragment.this);
         }
       }
     });
     L.a(new bhr.a()
     {
       public final void a(View paramAnonymousView)
       {
         ((ListView)paramAnonymousView.findViewById(2131362726)).setAdapter(c);
       }
     });
     A.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         if (akr.J())
         {
           SnapPreviewFragment.n(SnapPreviewFragment.this).show();
           return;
         }
         if (akk.a().d().size() > 1)
         {
           SnapPreviewFragment.o(SnapPreviewFragment.this);
           return;
         }
         SnapPreviewFragment.p(SnapPreviewFragment.this);
       }
     });
     v();
     i1 = D();
     B = i1;
     h.setText(String.valueOf(i1));
     I.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         if (!SnapPreviewFragment.q(SnapPreviewFragment.this))
         {
           rmPrepareSnapMetric = EasyMetric.EasyMetricFactory.b("PREPARE_SNAP").b();
           SnapPreviewFragment.s(SnapPreviewFragment.this);
         }
         SnapPreviewFragment.t(SnapPreviewFragment.this);
       }
     });
     D.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
     {
       public final void onCheckedChanged(CompoundButton paramAnonymousCompoundButton, boolean paramAnonymousBoolean)
       {
         paramAnonymousCompoundButton = SnapPreviewFragment.c(SnapPreviewFragment.this);
         if (!paramAnonymousBoolean) {}
         for (paramAnonymousBoolean = true;; paramAnonymousBoolean = false)
         {
           paramAnonymousCompoundButton.setAudible(paramAnonymousBoolean);
           return;
         }
       }
     });
     b.getCaptionView().setIsVideoSnap(avr.a(a));
     if (R != null) {
       break label541;
     }
     b.setMediabryo(a);
     localObject = b;
     if (D.isChecked()) {
       break label560;
     }
     bool = true;
     ((SnapEditorView)localObject).setAudible(bool);
     localObject = m;
     if (!k) {
       break label565;
     }
     i1 = 8;
     ((Button)localObject).setVisibility(i1);
     if (b.getSwipeFilterType() == FilterPageType.TURN_ON_FILTERS_PAGE)
     {
       if (ad != null)
       {
         ad.a = true;
         ad = null;
       }
       i.setVisibility(8);
       r.setVisibility(8);
       s.setVisibility(8);
     }
     g.a(v);
     v = awf.d(getActivity());
     localof = U;
     bool = awf.b(v);
     if (mSnapCaptureMetric != null)
     {
       localEasyMetric = mSnapCaptureMetric;
       if (!bool) {
         break label570;
       }
     }
   }
   label541:
   label560:
   label565:
   label570:
   for (Object localObject = "portrait";; localObject = "landscape")
   {
     localEasyMetric.a("orientation", localObject).b(false);
     mSnapCaptureMetric = null;
     localof.b();
     O.a = a.h();
     return;
     if ((getUserVisibleHint()) && (a.mSnapType != Mediabryo.SnapType.DISCOVER)) {
       Z.a(new bbx(-1));
     }
     t();
     break;
     b.a(R);
     R = null;
     break label299;
     bool = false;
     break label316;
     i1 = 0;
     break label336;
   }
 }
 protected final boolean n()
 {
   boolean bool2 = false;
   if ((a == null) || ((a.h() == 0) && (a.mRawImageBitmap == null))) {
     bool1 = true;
   }
   Object localObject2;
   FragmentShader.Filter localFilter;
   int i1;
   aku localaku;
   Bitmap localBitmap1;
   label280:
   label286:
   do
   {
     do
     {
       do
       {
         return bool1;
         a.c();
         localObject1 = getActivity();
         localObject2 = b.b.getCurrentPage();
         if (localObject2 != null) {
           ((asm)localObject2).i();
         }
         localObject1 = b.b((Context)localObject1);
         if (!avr.a(a)) {
           break;
         }
         b.c();
         bool1 = bool2;
       } while (a.mVideoUri == null);
       bool1 = bool2;
     } while (a.mVideoUri.getPath() == null);
     localFilter = b.getShaderFilter();
     a.a((Bitmap)localObject1);
     if (D.isChecked()) {
       a.i();
     }
     if ((a.mSnapType == Mediabryo.SnapType.SNAP) && (a.mVideoUri != null))
     {
       i1 = (int)(X.a(a.mVideoUri.getPath()) / 1000.0D);
       a.mTimerValueOrDuration = i1;
     }
     if (!(a instanceof aku)) {
       break label640;
     }
     localaku = (aku)a;
     if (a.mSnapType != Mediabryo.SnapType.DISCOVER) {
       break label624;
     }
     localBitmap1 = mFirstFrameBitmap;
     if (localBitmap1 != null) {
       break;
     }
     if (ReleaseManager.f()) {
       throw new IllegalArgumentException("Videobryo has no first frame bitmap.");
     }
     i1 = 0;
     if (i1 != 0) {
       break label624;
     }
     i1 = 0;
     bool1 = bool2;
   } while (i1 == 0);
   label293:
   if (!b.getCaptionView().i()) {
     a.mCaptionText = b.getCaptionView().getText();
   }
   Object localObject1 = a;
   if (g.getNumberOfStrokes() > 0) {}
   for (boolean bool1 = true;; bool1 = false)
   {
     mHasDrawing = bool1;
     a.mSwipeFilterNumSingleSwipes = O.b;
     a.mSwipeFilterNumDoubleSwipes = O.c;
     a.mGeofilterImpressions = O.d;
     a.mCaptionStyleDescription = b.getCaptionStyleDescription();
     a.mCaptionAnalyticData = b.getCaptionAnalyticsDetails();
     a.mBaseFilter = O.e;
     a.mStackedFilter = O.f;
     return true;
     Bitmap localBitmap2 = mCompositeImageBitmap;
     int i2;
     if (localBitmap2 == null) {
       i2 = localBitmap1.getWidth();
     }
     for (i1 = localBitmap1.getHeight();; i1 = localBitmap2.getHeight())
     {
       localObject2 = aa.a(i2, i1, Bitmap.Config.ARGB_8888);
       localObject1 = localObject2;
       if (localObject2 == null) {
         localObject1 = avp.a(i2, i1, Bitmap.Config.ARGB_8888);
       }
       if (localObject1 != null) {
         break label571;
       }
       localObject1 = String.format("Failed to create bitmap for raw image (width=%d, height=%d)", new Object[] { Integer.valueOf(i2), Integer.valueOf(i1) });
       if (!ReleaseManager.f()) {
         break;
       }
       throw new IllegalArgumentException((String)localObject1);
       i2 = localBitmap2.getWidth();
     }
     i1 = 0;
     break label280;
     label571:
     localObject2 = new Canvas((Bitmap)localObject1);
     if (localBitmap1 != null) {
       ((Canvas)localObject2).drawBitmap(localBitmap1, 0.0F, 0.0F, null);
     }
     if (localBitmap2 != null) {
       ((Canvas)localObject2).drawBitmap(localBitmap2, 0.0F, 0.0F, null);
     }
     mRawImageBitmap = ((Bitmap)localObject1);
     i1 = 1;
     break label280;
     label624:
     mShaderFilter = localFilter;
     W.a(localaku);
     label640:
     i1 = 1;
     break label286;
     bool1 = bool2;
     if (localObject1 == null) {
       break;
     }
     if (localObject1 == null) {
       throw new NullPointerException("Image Snap with no image? Ruh-roh");
     }
     a.a((Bitmap)localObject1);
     a.mTimerValueOrDuration = B;
     break label293;
   }
 }
 public void onClick(View view) {
   LinearLayout linearlayout = (LinearLayout) view.getParent();
   CheckBox checkbox = (CheckBox) view;
   if (checkbox.isChecked()) linearlayout.findViewById(0x7f060093).setEnabled(true);
   if (!checkbox.isChecked()) linearlayout.findViewById(0x7f060093).setEnabled(false);
 }
  protected void onNext() {
    try {

      ConnectionSecurity connectionSecurity = getSelectedSecurity();

      String username = mUsernameView.getText().toString();
      String password = null;
      String clientCertificateAlias = null;

      AuthType authType = getSelectedAuthType();
      if (authType == AuthType.EXTERNAL) {
        clientCertificateAlias = mClientCertificateSpinner.getAlias();
      } else {
        password = mPasswordView.getText().toString();
      }
      String host = mServerView.getText().toString();
      int port = Integer.parseInt(mPortView.getText().toString());

      Map<String, String> extra = null;
      if (Type.IMAP == mStoreType) {
        extra = new HashMap<String, String>();
        extra.put(
            ImapStoreSettings.AUTODETECT_NAMESPACE_KEY,
            Boolean.toString(mImapAutoDetectNamespaceView.isChecked()));
        extra.put(ImapStoreSettings.PATH_PREFIX_KEY, mImapPathPrefixView.getText().toString());
      } else if (Type.WebDAV == mStoreType) {
        extra = new HashMap<String, String>();
        extra.put(WebDavStoreSettings.PATH_KEY, mWebdavPathPrefixView.getText().toString());
        extra.put(WebDavStoreSettings.AUTH_PATH_KEY, mWebdavAuthPathView.getText().toString());
        extra.put(
            WebDavStoreSettings.MAILBOX_PATH_KEY, mWebdavMailboxPathView.getText().toString());
      }

      mAccount.deleteCertificate(host, port, CheckDirection.INCOMING);
      ServerSettings settings =
          new ServerSettings(
              mStoreType,
              host,
              port,
              connectionSecurity,
              authType,
              username,
              password,
              clientCertificateAlias,
              extra);

      mAccount.setStoreUri(RemoteStore.createStoreUri(settings));

      mAccount.setCompression(NetworkType.MOBILE, mCompressionMobile.isChecked());
      mAccount.setCompression(NetworkType.WIFI, mCompressionWifi.isChecked());
      mAccount.setCompression(NetworkType.OTHER, mCompressionOther.isChecked());
      // mAccount.setSubscribedFoldersOnly(mSubscribedFoldersOnly.isChecked());

      // visual voicemail specific setup
      if (!Intent.ACTION_EDIT.equals(getIntent().getAction())) {
        mAccount.setRequiresCellular(mRequiresCellular.isChecked());
        mAccount.setDescription(mAccountName.getText().toString());
        mAccount.setPhoneNumber("");
        mAccount = AccountCreator.initialVisualVoicemailSetup(AccountSetupIncoming.this, mAccount);
      }

      AccountSetupCheckSettings.actionCheckSettings(this, mAccount, CheckDirection.INCOMING);
    } catch (Exception e) {
      failure(e);
    }
  }
Ejemplo n.º 10
0
 public boolean getCheckBoxState() {
   return mCheckBox.isChecked();
 }
Ejemplo n.º 11
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.certify_key_activity);

    final ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(false);
    actionBar.setHomeButtonEnabled(false);

    mSelectKeyFragment =
        (SelectSecretKeyLayoutFragment)
            getSupportFragmentManager().findFragmentById(R.id.sign_key_select_key_fragment);
    mSelectKeyFragment.setCallback(this);
    mSelectKeyFragment.setFilterCertify(true);

    mSelectKeyserverSpinner = (Spinner) findViewById(R.id.sign_key_keyserver);
    ArrayAdapter<String> adapter =
        new ArrayAdapter<String>(
            this,
            android.R.layout.simple_spinner_item,
            Preferences.getPreferences(this).getKeyServers());
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    mSelectKeyserverSpinner.setAdapter(adapter);

    mUploadKeyCheckbox = (CheckBox) findViewById(R.id.sign_key_upload_checkbox);
    if (!mUploadKeyCheckbox.isChecked()) {
      mSelectKeyserverSpinner.setEnabled(false);
    } else {
      mSelectKeyserverSpinner.setEnabled(true);
    }

    mUploadKeyCheckbox.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {

          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (!isChecked) {
              mSelectKeyserverSpinner.setEnabled(false);
            } else {
              mSelectKeyserverSpinner.setEnabled(true);
            }
          }
        });

    mSignButton = (BootstrapButton) findViewById(R.id.sign_key_sign_button);
    mSignButton.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            if (mPubKeyId != 0) {
              if (mMasterKeyId == 0) {
                mSelectKeyFragment.setError(getString(R.string.select_key_to_sign));
              } else {
                initiateSigning();
              }
            }
          }
        });

    mDataUri = getIntent().getData();
    if (mDataUri == null) {
      Log.e(Constants.TAG, "Intent data missing. Should be Uri of key!");
      finish();
      return;
    }

    PGPPublicKeyRing signKey = (PGPPublicKeyRing) ProviderHelper.getPGPKeyRing(this, mDataUri);

    if (signKey != null) {
      mPubKeyId = PgpKeyHelper.getMasterKey(signKey).getKeyID();
      drawPublicKey();
    }
    if (mPubKeyId == 0) {
      Log.e(Constants.TAG, "this shouldn't happen. KeyId == 0!");
      finish();
      return;
    }
  }