Browse Source

fix deposit slip sample size and title and send money screen agree btn visibilty issue

new_design
Mukesh Dhungana 2 years ago
parent
commit
8eeb300faa
  1. 4
      app/src/main/java/com/remit/jmecustomer/features/depositslip/view/DepositSlipActivity.java
  2. 25
      app/src/main/java/com/remit/jmecustomer/features/webbrowser/WebBrowserFragmentV2.java
  3. 59
      app/src/main/java/com/remit/jmecustomer/utils/other/Utility.java
  4. 1
      app/src/main/res/values/strings.xml

4
app/src/main/java/com/remit/jmecustomer/features/depositslip/view/DepositSlipActivity.java

@ -110,7 +110,7 @@ public class DepositSlipActivity extends BaseActivity implements DepositSlipPres
private com.remit.jmecustomer.features.renewId.view.RenewUserIdLiveData.RenewUserIdBinding renewUserIdBinding;
private DepositSlipViewModel viewModel;
private PublishSubject<Boolean> depositSlipLoadedSubject;
private PublishSubject<Boolean> depositSlipLoadedSubject;
private Uri photoURI = null;
private File photoFile;
@ -199,7 +199,7 @@ public class DepositSlipActivity extends BaseActivity implements DepositSlipPres
@OnClick(R.id.slipSampleTextView)
public void onDepositSlipSamplePhotoClicked() {
Utility.showImageDialog(this, getResources().getString(R.string.frontIdSample_text), R.drawable.sample_deposit_slip);
Utility.showImageDialog(this, getResources().getString(R.string.sample_text), R.drawable.sample_deposit_slip, 800);
}

25
app/src/main/java/com/remit/jmecustomer/features/webbrowser/WebBrowserFragmentV2.java

@ -12,10 +12,12 @@ import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.CookieManager;
import android.webkit.JsResult;
import android.webkit.SslErrorHandler;
@ -27,6 +29,7 @@ import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatCheckBox;
@ -183,21 +186,26 @@ public abstract class WebBrowserFragmentV2 extends BaseFragment implements View.
webView.getSettings().setUserAgentString(sb.toString());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
webView.setOnScrollChangeListener(new View.OnScrollChangeListener(){
webView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
@Override
public void onScrollChange(View scrollView, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
int height = (int) Math.floor(webView.getContentHeight() * webView.getScale());
int webViewHeight = webView.getHeight();
int cutoff = height - webViewHeight - 10;
if (scrollY >= cutoff) {
if(llBottom.getVisibility()!=View.VISIBLE){
LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
if (llBottom.getVisibility() != View.VISIBLE) {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
//params.setMargins(0, 0, 0, 180);
String url=webView.getUrl();
if(url.equals(JME_REGISTER_TERMS))
params.height=webViewHeight - 500;
DisplayMetrics displayMetrics = new DisplayMetrics();
WindowManager windowManager = (WindowManager) getContext()
.getSystemService(Context.WINDOW_SERVICE);
windowManager.getDefaultDisplay().getMetrics(displayMetrics);
int screenHeight = displayMetrics.heightPixels;
String url = webView.getUrl();
if (url.equals(JME_REGISTER_TERMS))
params.height = webViewHeight - 500;
else
params.height=webViewHeight - 350;
params.height = webViewHeight - (screenHeight * 20 / 100);
llWebView.setLayoutParams(params);
llBottom.setVisibility(View.VISIBLE);
}
@ -385,7 +393,8 @@ public abstract class WebBrowserFragmentV2 extends BaseFragment implements View.
@Override
public void onReceivedTitle(WebView view, String title) {
if (webView.getVisibility() == View.VISIBLE){}
if (webView.getVisibility() == View.VISIBLE) {
}
// ((WebBrowserFragmentActionListener) getActivity()).updateTitle(title);
}

59
app/src/main/java/com/remit/jmecustomer/utils/other/Utility.java

@ -5,7 +5,9 @@ import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.net.Uri;
import androidx.appcompat.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -49,6 +51,7 @@ public class Utility {
alertDialog.show();
}
public static void showImageDialog(Context context, String title, int image) {
View view = LayoutInflater.from(context).inflate(R.layout.alert_example_layout, null);
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context, R.style.CustomAlertDialog);
@ -57,15 +60,53 @@ public class Utility {
titletext = view.findViewById(R.id.title);
btnok = view.findViewById(R.id.btn_ok);
ImageView imageView = view.findViewById(R.id.image);
if(title==null) {
if (title == null) {
titletext.setVisibility(View.GONE);
android.view.ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
layoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
layoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
layoutParams.height = 500;
imageView.setLayoutParams(layoutParams);
}
else
titletext.setText(title);
} else
titletext.setText(title);
android.view.ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
layoutParams.height = 800;
imageView.setLayoutParams(layoutParams);
imageView.setImageResource(image);
final AlertDialog dialog = alertDialog.create();
btnok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
// alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
}
public static void showImageDialog(Context context, String title, int image, int imageHeight) {
View view = LayoutInflater.from(context).inflate(R.layout.alert_example_layout, null);
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context, R.style.CustomAlertDialog);
alertDialog.setView(view);
TextView titletext, btnok;
titletext = view.findViewById(R.id.title);
btnok = view.findViewById(R.id.btn_ok);
ImageView imageView = view.findViewById(R.id.image);
if (title == null) {
titletext.setVisibility(View.GONE);
android.view.ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
layoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
layoutParams.height = 500;
imageView.setLayoutParams(layoutParams);
} else
titletext.setText(title);
android.view.ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
layoutParams.height = imageHeight;
imageView.setLayoutParams(layoutParams);
imageView.setImageResource(image);
final AlertDialog dialog = alertDialog.create();
@ -107,6 +148,7 @@ public class Utility {
public static void showImageFromServer(Context context, ImageView imageView, String image) {
Glide.with(context).load(image).diskCacheStrategy(DiskCacheStrategy.NONE).into(imageView);
}
public static void showImageFromServerCache(Context context, ImageView imageView, String image) {
Glide.with(context).load(image).diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView);
}
@ -122,7 +164,7 @@ public class Utility {
.into(imageView);*/
}
public static void intetToHome(Context c){
public static void intetToHome(Context c) {
}
public static boolean checkString(String val) {
@ -154,20 +196,19 @@ public class Utility {
public static String checkEllipsizeSmall(String val) {
if (val != null && val.length() > 10) {
return val.substring(0,7) + "...";
return val.substring(0, 7) + "...";
}
return val;
}
public static String checkEllipsizeMedium(String val) {
if (val != null && val.length() > 14) {
return val.substring(0,13) + "...";
return val.substring(0, 13) + "...";
}
return val;
}
public static String getMimeType(Context context, Uri uri) {
String extension;

1
app/src/main/res/values/strings.xml

@ -610,4 +610,5 @@
<string name="deposit_slip_success_text" translatable="false">Thank you, your Deposit Slip is updated successfully</string>
<string name="invalid_deposit_slip_text" translatable="false">Invalid Deposit Slip</string>
<string name="deposit_slip_remarks_text">Message to JME (optional)</string>
<string name="sample_text" translatable="false">Sample</string>
</resources><!---->
Loading…
Cancel
Save