mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 11:44:09 +02:00
Android - fix crash when double clicking a domain
This commit is contained in:
parent
3e665fb616
commit
ab293376fd
1 changed files with 8 additions and 2 deletions
|
@ -64,7 +64,11 @@ public class HomeFragment extends Fragment {
|
||||||
mDomainsView.setLayoutManager(gridLayoutMgr);
|
mDomainsView.setLayoutManager(gridLayoutMgr);
|
||||||
mDomainAdapter = new DomainAdapter(getContext(), HifiUtils.getInstance().protocolVersionSignature(), nativeGetLastLocation());
|
mDomainAdapter = new DomainAdapter(getContext(), HifiUtils.getInstance().protocolVersionSignature(), nativeGetLastLocation());
|
||||||
mDomainAdapter.setClickListener((view, position, domain) -> {
|
mDomainAdapter.setClickListener((view, position, domain) -> {
|
||||||
new Handler(getActivity().getMainLooper()).postDelayed(() -> mListener.onSelectedDomain(domain.url), 400); // a delay so the ripple effect can be seen
|
new Handler(getActivity().getMainLooper()).postDelayed(() -> {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onSelectedDomain(domain.url);
|
||||||
|
}
|
||||||
|
}, 400); // a delay so the ripple effect can be seen
|
||||||
});
|
});
|
||||||
mDomainAdapter.setListener(new DomainAdapter.AdapterListener() {
|
mDomainAdapter.setListener(new DomainAdapter.AdapterListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -116,7 +120,9 @@ public class HomeFragment extends Fragment {
|
||||||
if (!urlString.trim().isEmpty()) {
|
if (!urlString.trim().isEmpty()) {
|
||||||
urlString = HifiUtils.getInstance().sanitizeHifiUrl(urlString);
|
urlString = HifiUtils.getInstance().sanitizeHifiUrl(urlString);
|
||||||
}
|
}
|
||||||
mListener.onSelectedDomain(urlString);
|
if (mListener != null) {
|
||||||
|
mListener.onSelectedDomain(urlString);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue