Fixed ReceiveTransactionFragment to use full screen width

This commit is contained in:
Severiano Jaramillo 2017-12-23 21:39:41 -06:00
parent 49f032ff99
commit eac5a0e8c4
4 changed files with 19 additions and 4 deletions

View file

@ -17,6 +17,8 @@ import android.text.Editable;
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.ViewGroup;
import android.view.Window;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
@ -175,6 +177,16 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
return dialog; return dialog;
} }
@Override
public void onResume() {
super.onResume();
// Force dialog fragment to use the full width of the screen
Window dialogWindow = getDialog().getWindow();
assert dialogWindow != null;
dialogWindow.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();

View file

@ -17,6 +17,7 @@ import android.text.Editable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.LinearInterpolator; import android.view.animation.LinearInterpolator;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
@ -148,7 +149,9 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
super.onResume(); super.onResume();
// Force dialog fragment to use the full width of the screen // Force dialog fragment to use the full width of the screen
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); Window dialogWindow = getDialog().getWindow();
assert dialogWindow != null;
dialogWindow.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
} }
@Override @Override

View file

@ -2,10 +2,8 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" >
android:minWidth="350dp">
<View <View
android:id="@+id/topView" android:id="@+id/topView"
@ -121,6 +119,7 @@
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/qr_code"
android:src="@color/gray" android:src="@color/gray"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View file

@ -462,4 +462,5 @@
<string name="my_accounts">My Accounts</string> <string name="my_accounts">My Accounts</string>
<string name="dont_have_multiple_accounts">You don\'t have multiple accounts at the moment</string> <string name="dont_have_multiple_accounts">You don\'t have multiple accounts at the moment</string>
<string name="settings">SETTINGS</string> <string name="settings">SETTINGS</string>
<string name="qr_code">QR code</string>
</resources> </resources>