Browse Source

Dialog fixes done

master
preyearegmi 6 years ago
parent
commit
79bf5d1f3a
  1. 66
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeBankListingDialog.java
  2. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeBranchListingDialog.java
  3. 1
      app/src/main/res/drawable/ic_rounded_country_listing_gray.xml
  4. 5
      app/src/main/res/layout/dialog_country_listing.xml
  5. 8
      app/src/main/res/values/styles.xml

66
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeBankListingDialog.java

@ -10,6 +10,7 @@ import android.support.v7.widget.RecyclerView;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
@ -36,7 +37,7 @@ public class PayoutModeBankListingDialog extends DialogFragment implements View.
private EditText searchEditTextView; private EditText searchEditTextView;
private PayoutModeBankListingRvAdapter payoutModeBankListingRvAdapter; private PayoutModeBankListingRvAdapter payoutModeBankListingRvAdapter;
private Window window; private Window window;
private boolean windowHieghtNotFixed=true;
private boolean windowHieghtNotFixed = true;
private TextView dialogTitle; private TextView dialogTitle;
@Override @Override
@ -48,19 +49,11 @@ public class PayoutModeBankListingDialog extends DialogFragment implements View.
cancelButton = view.findViewById(R.id.iv_cancel); cancelButton = view.findViewById(R.id.iv_cancel);
dialogTitle = view.findViewById(R.id.dialog_title_txt); dialogTitle = view.findViewById(R.id.dialog_title_txt);
searchEditTextView = view.findViewById(R.id.searchEditText); searchEditTextView = view.findViewById(R.id.searchEditText);
initialize();
builder.setView(view); builder.setView(view);
Dialog dialog = builder.create();
try {
this.window = dialog.getWindow();
window.setBackgroundDrawableResource(R.drawable.ic_rounded_country_listing_gray);
} catch (NullPointerException e) {
}
initialize();
return dialog;
return builder.create();
} }
private void initialize() { private void initialize() {
@ -88,16 +81,31 @@ public class PayoutModeBankListingDialog extends DialogFragment implements View.
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
if(windowHieghtNotFixed&&window!=null)
{
if (windowHieghtNotFixed && window != null) {
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(window.getAttributes());
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
float multi = getActivity().getResources().getDisplayMetrics().density;
lp.verticalMargin=10*multi;
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
window.setAttributes(lp);
windowHieghtNotFixed=false;
// lp.copyFrom(window.getAttributes());
// window.setBackgroundDrawableResource(R.drawable.ic_rounded_country_listing_gray);
//
// lp.height = WindowManager.LayoutParams.MATCH_PARENT;
// float multi = getActivity().getResources().getDisplayMetrics().density;
// lp.verticalMargin=10*multi;
// window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
// window.setAttributes(lp);
// windowHieghtNotFixed=false;
}
Window window = getDialog().getWindow();
if (window != null) {
window.setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
window.setBackgroundDrawableResource(R.drawable.ic_rounded_country_listing_gray);
// WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
// lp.copyFrom(window.getAttributes());
// float multi = getActivity().getResources().getDisplayMetrics().density;
// lp.verticalMargin=10*multi;
// window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
// window.setAttributes(lp);lp
} }
} }
@ -121,13 +129,15 @@ public class PayoutModeBankListingDialog extends DialogFragment implements View.
private void showCountryNotFoundView(boolean action) { private void showCountryNotFoundView(boolean action) {
if (action) { if (action) {
int rvHeight = countryListRv.getHeight();
noCountryFoundView.setHeight(rvHeight);
countryListRv.setVisibility(View.INVISIBLE);
noCountryFoundView.setVisibility(View.VISIBLE);
if (countryListRv.getVisibility() == View.VISIBLE) {
countryListRv.setVisibility(View.GONE);
noCountryFoundView.setVisibility(View.VISIBLE);
}
} else { } else {
noCountryFoundView.setVisibility(View.INVISIBLE);
countryListRv.setVisibility(View.VISIBLE);
if (countryListRv.getVisibility() != View.VISIBLE) {
noCountryFoundView.setVisibility(View.GONE);
countryListRv.setVisibility(View.VISIBLE);
}
} }
} }
@ -175,9 +185,7 @@ public class PayoutModeBankListingDialog extends DialogFragment implements View.
InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
catch(Exception ex)
{
} catch (Exception ex) {
} }

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeBranchListingDialog.java

@ -41,7 +41,7 @@ public class PayoutModeBranchListingDialog extends DialogFragment implements Vie
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(),R.style.FullScreenDialog);
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null); View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null);
countryListRv = view.findViewById(R.id.countryListRv); countryListRv = view.findViewById(R.id.countryListRv);
noCountryFoundView = view.findViewById(R.id.noCountryFoundTextView); noCountryFoundView = view.findViewById(R.id.noCountryFoundTextView);

1
app/src/main/res/drawable/ic_rounded_country_listing_gray.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="@color/gray"/> <solid android:color="@color/gray"/>
<corners android:radius="12dp"/> <corners android:radius="12dp"/>

5
app/src/main/res/layout/dialog_country_listing.xml

@ -74,12 +74,13 @@
app:layoutManager="android.support.v7.widget.LinearLayoutManager" app:layoutManager="android.support.v7.widget.LinearLayoutManager"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText <com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText
android:paddingTop="20dp"
android:id="@+id/noCountryFoundTextView" android:id="@+id/noCountryFoundTextView"
android:visibility="invisible" android:visibility="invisible"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@null" android:background="@null"
android:enabled="false" android:enabled="false"

8
app/src/main/res/values/styles.xml

@ -31,4 +31,12 @@
<item name="android:windowBackground">@drawable/ic_rounded_white</item> <item name="android:windowBackground">@drawable/ic_rounded_white</item>
</style> </style>
<style name="FullScreenDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">false</item>
<item name="android:windowIsFloating">true</item>
<item name="android:layout_gravity">center</item>
</style>
</resources> </resources>
Loading…
Cancel
Save