diff --git a/app/src/main/java/org/openobservatory/ooniprobe/activity/InfoActivity.java b/app/src/main/java/org/openobservatory/ooniprobe/activity/InfoActivity.java index 3a75eace3..b418f26df 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/activity/InfoActivity.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/activity/InfoActivity.java @@ -3,44 +3,40 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.widget.TextView; - import androidx.annotation.Nullable; -import androidx.appcompat.widget.Toolbar; - import org.openobservatory.ooniprobe.BuildConfig; import org.openobservatory.ooniprobe.R; - -import butterknife.BindView; -import butterknife.ButterKnife; -import butterknife.OnClick; +import org.openobservatory.ooniprobe.databinding.ActivityInfoBinding; public class InfoActivity extends AbstractActivity { - @BindView(R.id.toolbar) Toolbar toolbar; - @BindView(R.id.version) TextView version; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_info); - ButterKnife.bind(this); - setSupportActionBar(toolbar); + ActivityInfoBinding binding = ActivityInfoBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); + setSupportActionBar(binding.toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); - version.setText(getString(R.string.version, BuildConfig.SOFTWARE_NAME, BuildConfig.VERSION_NAME)); + binding.version.setText(getString(R.string.version, BuildConfig.SOFTWARE_NAME, BuildConfig.VERSION_NAME)); + + binding.blog.setOnClickListener(v -> onBlogClick()); + binding.reports.setOnClickListener(v -> onReportsClick()); + binding.learnMore.setOnClickListener(v -> onLearnMoreClick()); + binding.dataPolicy.setOnClickListener(v -> onDataPolicyClick()); } - @OnClick(R.id.blog) void onBlogClick() { + void onBlogClick() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://ooni.org/blog/"))); } - @OnClick(R.id.reports) void onReportsClick() { + void onReportsClick() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://ooni.org/reports/"))); } - @OnClick(R.id.learnMore) void onLearnMoreClick() { + void onLearnMoreClick() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://ooni.org/"))); } - @OnClick(R.id.dataPolicy) void onDataPolicyClick() { + void onDataPolicyClick() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://ooni.org/about/data-policy/"))); } }