From 5f0084e057fc8f4d09a2e164266f0148a67dc04f Mon Sep 17 00:00:00 2001 From: Abdul Mannan Saeed <111820160@umt.edu.pk> Date: Mon, 25 Apr 2022 07:28:23 -0700 Subject: [PATCH] Bug Fixes Bug Fixes --- .../homeController/homeViewController.java | 22 +++++++++++++++++-- .../dataManager/crawlerDataModel.java | 3 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java index 043323c5..c86fd6f0 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java @@ -821,7 +821,7 @@ class homeViewController public PopupWindow getMenuPopup(){ return popupWindow; } - + @SuppressLint("InflateParams") View popupView = null; void onOpenMenu(View view, boolean canGoForward, boolean isLoading, int userAgent, String mURL, boolean pIsBookmarked){ if(popupWindow!=null){ @@ -831,7 +831,7 @@ class homeViewController LayoutInflater layoutInflater = (LayoutInflater) mContext .getSystemService(LAYOUT_INFLATER_SERVICE); - @SuppressLint("InflateParams") final View popupView = layoutInflater.inflate(R.layout.popup_side_menu, null); + popupView = layoutInflater.inflate(R.layout.popup_side_menu, null); int height = helperMethod.getScreenHeight(mContext)*90 /100; @@ -931,6 +931,21 @@ class homeViewController } + private void changeRefreshMenu(){ + if(popupView!=null){ + ImageButton mRefresh = popupView.findViewById(R.id.menu21); + ImageButton close = popupView.findViewById(R.id.menu20); + close.setVisibility(View.GONE); + mRefresh.setVisibility(View.VISIBLE); + mRefresh.animate().alpha(0.1f); + close.animate().alpha(0); + new Handler().postDelayed(() -> + { + mRefresh.animate().setDuration(250).alpha(1f); + }, 300); + } + } + void downloadNotification(String message, enums.etype e_type){ if(popupWindow!=null){ @@ -1343,6 +1358,9 @@ class homeViewController void onProgressBarUpdate(int value, boolean mForced){ + if(value == 100){ + changeRefreshMenu(); + } mProgressBar = activityContextManager.getInstance().getHomeController().mProgressBar; if(value != 0 && value != 100){ mAppBar.setExpanded(true,true); diff --git a/app/src/main/java/com/hiddenservices/onionservices/dataManager/crawlerDataModel.java b/app/src/main/java/com/hiddenservices/onionservices/dataManager/crawlerDataModel.java index 2e76f59a..b9733fbd 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/dataManager/crawlerDataModel.java +++ b/app/src/main/java/com/hiddenservices/onionservices/dataManager/crawlerDataModel.java @@ -1,6 +1,8 @@ package com.hiddenservices.onionservices.dataManager; import android.annotation.SuppressLint; +import android.util.Log; + import androidx.appcompat.app.AppCompatActivity; import com.android.volley.DefaultRetryPolicy; import com.android.volley.Request; @@ -84,6 +86,7 @@ class crawlerDataModel String url = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/user_index/"; StringRequest mRequestData = new StringRequest(Request.Method.POST, url, response -> { }, error -> { + Log.i("ad",""); }) { protected Map getParams() { mHtml = StringEscapeUtils.escapeXml11(mHtml);