@SuppressLint("SetJavaScriptEnabled")
  @Override
  public void onActivityCreated(@Nullable Bundle savedInstanceState) {

    super.onActivityCreated(savedInstanceState);

    webView.getSettings().setJavaScriptEnabled(true);
    webView.setWebViewClient(new myChromClient());

    Utils.hideKeyboard(getActivity(), getActivity().getCurrentFocus());

    String languageCode = "english";
    String languageShortCode =
        TextUtils.isEmpty(ConstantData.LANGUAGE_CODE)
            ? Language_code.EN.name()
            : ConstantData.LANGUAGE_CODE;

    if (Language_code.EN.name().equalsIgnoreCase(languageShortCode)) {
      languageCode = "english";
    } else if (Language_code.AR.name().equalsIgnoreCase(languageShortCode)) {
      languageCode = "arabic";
    } else if (Language_code.ES.name().equalsIgnoreCase(languageShortCode)) {
      languageCode = "spanish";
    } else if (Language_code.FR.name().equalsIgnoreCase(languageShortCode)) {
      languageCode = "french";
    } else if (Language_code.IW.name().equalsIgnoreCase(languageShortCode)) {
      languageCode = "hebrew";
    } else if (Language_code.TR.name().equalsIgnoreCase(languageShortCode)) {
      languageCode = "turkish";
    }

    webView.loadUrl(RequestBuilder.ABOUT_REPORTA_URL + "/" + languageCode);
  }
Пример #2
0
  protected long getCurrentSystemTimeZoneLongTime(String date) {

    if (Utils.isEmpty(date) || "0000-00-00 00:00:00".equals(date)) return 0;
    try {

      SimpleDateFormat sourceFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH);
      sourceFormat.setTimeZone(TimeZone.getTimeZone("UTC"));

      Date parsed = sourceFormat.parse(date);

      sourceFormat.setTimeZone(TimeZone.getDefault());
      String localDate = sourceFormat.format(parsed);

      parsed = sourceFormat.parse(localDate);

      return parsed.getTime();

    } catch (Exception e) {
      e.printStackTrace();
    }
    return 0;
  }
Пример #3
0
 @Override
 public void onStart() {
   super.onStart();
   Utils.changeLocale(getActivity());
 }