mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
properly update transport options location
// FREEBIE
This commit is contained in:
parent
21591dc6b1
commit
9e7928873b
@ -9,6 +9,7 @@ import android.text.style.RelativeSizeSpan;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
@ -105,11 +106,19 @@ public class TransportOptions {
|
|||||||
setTransport(transport.key);
|
setTransport(transport.key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showPopup(View parent) {
|
public void showPopup(final View parent) {
|
||||||
initializeTransportPopup();
|
initializeTransportPopup();
|
||||||
|
final int xoff = context.getResources().getDimensionPixelOffset(R.dimen.transport_selection_popup_xoff);
|
||||||
|
final int yoff = context.getResources().getDimensionPixelOffset(R.dimen.transport_selection_popup_yoff);
|
||||||
transportPopup.showAsDropDown(parent,
|
transportPopup.showAsDropDown(parent,
|
||||||
context.getResources().getDimensionPixelOffset(R.dimen.transport_selection_popup_xoff),
|
xoff,
|
||||||
context.getResources().getDimensionPixelOffset(R.dimen.transport_selection_popup_yoff));
|
yoff);
|
||||||
|
parent.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
|
||||||
|
@Override
|
||||||
|
public void onGlobalLayout() {
|
||||||
|
transportPopup.update(parent, xoff, yoff, -1, -1);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefaultTransport(String transportName) {
|
public void setDefaultTransport(String transportName) {
|
||||||
|
Loading…
Reference in New Issue
Block a user