Java part fixes after code review

This commit is contained in:
Serg
2022-05-31 11:59:35 -04:00
parent a713577099
commit a0eced6a2c
5 changed files with 7 additions and 12 deletions
@@ -132,7 +132,6 @@ public class BraveWalletPanel implements DialogInterface {
activity.openBraveConnectedSitesSettings();
dismiss();
}
dismiss();
} else if (item.getItemId() == R.id.action_settings) {
BraveActivity activity = BraveActivity.getBraveActivity();
if (activity != null) {
@@ -38,8 +38,7 @@ public class BraveWalletEthereumConnectedSitesListAdapter
}
@Override
public @NonNull BraveWalletEthereumConnectedSitesListAdapter.ViewHolder onCreateViewHolder(
ViewGroup parent, int viewType) {
public @NonNull ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
mContext = parent.getContext();
LayoutInflater inflater = LayoutInflater.from(mContext);
View view =
@@ -49,8 +48,7 @@ public class BraveWalletEthereumConnectedSitesListAdapter
}
@Override
public void onBindViewHolder(
@NonNull BraveWalletEthereumConnectedSitesListAdapter.ViewHolder holder, int position) {
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.webSite.setText(mWebSites[position]);
holder.iconTrash.setOnClickListener(v -> {
if (mDelegate != null) {
@@ -70,8 +68,8 @@ public class BraveWalletEthereumConnectedSitesListAdapter
public ViewHolder(View itemView) {
super(itemView);
this.webSite = itemView.findViewById(R.id.web_site);
this.iconTrash = itemView.findViewById(R.id.icon_trash);
webSite = itemView.findViewById(R.id.web_site);
iconTrash = itemView.findViewById(R.id.icon_trash);
}
}
}
@@ -12,7 +12,6 @@ import android.widget.TextView;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.chromium.brave_wallet.mojom.BraveWalletService;
@@ -41,8 +40,6 @@ public class BraveWalletEthereumConnectedSitesPreference
initBraveWalletService();
mRecyclerView = (RecyclerView) holder.findViewById(R.id.connected_sites_list);
LinearLayoutManager layoutMangager = new LinearLayoutManager(getContext());
mRecyclerView.setLayoutManager(layoutMangager);
updateWebSitestList();
}
@@ -18,7 +18,8 @@
android:paddingTop="15dp"
android:paddingBottom="25dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2020 The Brave Authors. All rights reserved.
<!-- Copyright (c) 2022 The Brave Authors. All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at http://mozilla.org/MPL/2.0/. -->