Search in sources :

Example 6 with NewRepoConfig

use of org.fdroid.fdroid.data.NewRepoConfig in project fdroidclient by f-droid.

the class SwapWorkflowActivity method setUpConfirmReceive.

private void setUpConfirmReceive() {
    TextView descriptionTextView = findViewById(R.id.text_description);
    if (descriptionTextView != null) {
        descriptionTextView.setText(getString(R.string.swap_confirm_connect, confirmSwapConfig.getHost()));
    }
    Button confirmReceiveYes = container.findViewById(R.id.confirm_receive_yes);
    if (confirmReceiveYes != null) {
        confirmReceiveYes.setOnClickListener(v -> denySwap());
    }
    Button confirmReceiveNo = container.findViewById(R.id.confirm_receive_no);
    if (confirmReceiveNo != null) {
        confirmReceiveNo.setOnClickListener(new View.OnClickListener() {

            private final NewRepoConfig config = confirmSwapConfig;

            @Override
            public void onClick(View v) {
                swapWith(config);
            }
        });
    }
}
Also used : Button(android.widget.Button) MaterialButton(com.google.android.material.button.MaterialButton) CompoundButton(android.widget.CompoundButton) NewRepoConfig(org.fdroid.fdroid.data.NewRepoConfig) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) SearchView(androidx.appcompat.widget.SearchView) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 7 with NewRepoConfig

use of org.fdroid.fdroid.data.NewRepoConfig in project fdroidclient by f-droid.

the class ManageReposActivity method addRepoFromIntent.

private void addRepoFromIntent(Intent intent) {
    /* an URL from a click, NFC, QRCode scan, etc */
    NewRepoConfig newRepoConfig = new NewRepoConfig(this, intent);
    if (newRepoConfig.isValidRepo()) {
        finishAfterAddingRepo = intent.getBooleanExtra(EXTRA_FINISH_AFTER_ADDING_REPO, true);
        showAddRepo(newRepoConfig.getRepoUriString(), newRepoConfig.getFingerprint(), newRepoConfig.getUsername(), newRepoConfig.getPassword());
        checkIfNewRepoOnSameWifi(newRepoConfig);
    } else if (newRepoConfig.getErrorMessage() != null) {
        Toast.makeText(this, newRepoConfig.getErrorMessage(), Toast.LENGTH_LONG).show();
    }
}
Also used : NewRepoConfig(org.fdroid.fdroid.data.NewRepoConfig)

Aggregations

NewRepoConfig (org.fdroid.fdroid.data.NewRepoConfig)7 Intent (android.content.Intent)3 IntentResult (com.google.zxing.integration.android.IntentResult)2 PendingIntent (android.app.PendingIntent)1 Uri (android.net.Uri)1 View (android.view.View)1 Button (android.widget.Button)1 CompoundButton (android.widget.CompoundButton)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 SearchView (androidx.appcompat.widget.SearchView)1 MaterialButton (com.google.android.material.button.MaterialButton)1