Fix some crashes
This commit is contained in:
parent
4c7dbc3237
commit
596f72f6da
|
@ -1,9 +1,11 @@
|
||||||
Added:
|
|
||||||
- Announcements for Mastodon with reactions
|
|
||||||
- Pleroma: reactions in posts
|
|
||||||
|
|
||||||
Changed:
|
Changed:
|
||||||
- Filters changed to speed-up the scroll
|
- Move the favourite item in menu
|
||||||
|
|
||||||
Fixed:
|
Fixed:
|
||||||
- Custom emojis not displayed in compose activity
|
- Filters not working
|
||||||
|
- Crash when sharing http URLs
|
||||||
|
- Missing ogg image when sharing
|
||||||
|
- Extra space with quick replies
|
||||||
|
- Crash when doing search
|
||||||
|
- Fix crash when clicking on conversations
|
||||||
|
- Fix crash when editing profile
|
|
@ -358,12 +358,12 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
|
||||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||||
set_profile_save.setOnClickListener(v -> {
|
set_profile_save.setOnClickListener(v -> {
|
||||||
if (set_profile_name.getText() != null && !set_profile_name.getText().toString().contentEquals(set_profile_name.getHint()))
|
if (set_profile_name != null && set_profile_name.getText() != null && !set_profile_name.getText().toString().contentEquals(set_profile_name.getHint()))
|
||||||
profile_username = set_profile_name.getText().toString().trim();
|
profile_username = set_profile_name.getText().toString().trim();
|
||||||
else
|
else
|
||||||
profile_username = null;
|
profile_username = null;
|
||||||
|
|
||||||
if (set_profile_description.getText() != null && !set_profile_description.getText().toString().contentEquals(set_profile_description.getHint()))
|
if (set_profile_description != null && set_profile_description.getText() != null && !set_profile_description.getText().toString().contentEquals(set_profile_description.getHint()))
|
||||||
profile_note = set_profile_description.getText().toString().trim();
|
profile_note = set_profile_description.getText().toString().trim();
|
||||||
else
|
else
|
||||||
profile_note = null;
|
profile_note = null;
|
||||||
|
|
|
@ -41,6 +41,7 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.webkit.WebView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
@ -107,7 +108,6 @@ import app.fedilab.android.interfaces.OnRetrievePeertubeInterface;
|
||||||
import app.fedilab.android.sqlite.AccountDAO;
|
import app.fedilab.android.sqlite.AccountDAO;
|
||||||
import app.fedilab.android.sqlite.PeertubeFavoritesDAO;
|
import app.fedilab.android.sqlite.PeertubeFavoritesDAO;
|
||||||
import app.fedilab.android.sqlite.Sqlite;
|
import app.fedilab.android.sqlite.Sqlite;
|
||||||
import app.fedilab.android.webview.CustomWebview;
|
|
||||||
import app.fedilab.android.webview.MastalabWebChromeClient;
|
import app.fedilab.android.webview.MastalabWebChromeClient;
|
||||||
import app.fedilab.android.webview.MastalabWebViewClient;
|
import app.fedilab.android.webview.MastalabWebViewClient;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -185,7 +185,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
||||||
peertube_description = findViewById(R.id.peertube_description);
|
peertube_description = findViewById(R.id.peertube_description);
|
||||||
peertube_title = findViewById(R.id.peertube_title);
|
peertube_title = findViewById(R.id.peertube_title);
|
||||||
peertube_information_container = findViewById(R.id.peertube_information_container);
|
peertube_information_container = findViewById(R.id.peertube_information_container);
|
||||||
CustomWebview webview_video = findViewById(R.id.webview_video);
|
WebView webview_video = findViewById(R.id.webview_video);
|
||||||
playerView = findViewById(R.id.media_video);
|
playerView = findViewById(R.id.media_video);
|
||||||
write_comment_container = findViewById(R.id.write_comment_container);
|
write_comment_container = findViewById(R.id.write_comment_container);
|
||||||
ImageView my_pp = findViewById(R.id.my_pp);
|
ImageView my_pp = findViewById(R.id.my_pp);
|
||||||
|
|
|
@ -394,12 +394,12 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
|
||||||
if (i == targetedPosition) {
|
if (i == targetedPosition) {
|
||||||
if (targetedPosition < statuses.size() - 1)
|
if (targetedPosition < statuses.size() - 1)
|
||||||
statuses.get(targetedPosition).setShowBottomLine(true);
|
statuses.get(targetedPosition).setShowBottomLine(true);
|
||||||
if (targetedPosition > 0 && statuses.get(targetedPosition).getIn_reply_to_id().compareTo(statuses.get(targetedPosition - 1).getId()) == 0) {
|
if (targetedPosition > 0 && statuses.get(targetedPosition).getIn_reply_to_id() != null && statuses.get(targetedPosition).getIn_reply_to_id().compareTo(statuses.get(targetedPosition - 1).getId()) == 0) {
|
||||||
statuses.get(targetedPosition - 1).setShowBottomLine(true);
|
statuses.get(targetedPosition - 1).setShowBottomLine(true);
|
||||||
statuses.get(targetedPosition).setShowTopLine(true);
|
statuses.get(targetedPosition).setShowTopLine(true);
|
||||||
}
|
}
|
||||||
} else if (0 < i && i <= statuses.size() - 1) {
|
} else if (0 < i && i <= statuses.size() - 1) {
|
||||||
if (statuses.get(i - 1).getId().compareTo(statuses.get(i).getIn_reply_to_id()) == 0) {
|
if (statuses.get(i).getIn_reply_to_id() != null && statuses.get(i - 1).getId().compareTo(statuses.get(i).getIn_reply_to_id()) == 0) {
|
||||||
statuses.get(i - 1).setShowBottomLine(true);
|
statuses.get(i - 1).setShowBottomLine(true);
|
||||||
statuses.get(i).setShowTopLine(true);
|
statuses.get(i).setShowTopLine(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.webkit.WebView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
@ -55,7 +56,6 @@ import app.fedilab.android.helper.CountDrawable;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.sqlite.DomainBlockDAO;
|
import app.fedilab.android.sqlite.DomainBlockDAO;
|
||||||
import app.fedilab.android.sqlite.Sqlite;
|
import app.fedilab.android.sqlite.Sqlite;
|
||||||
import app.fedilab.android.webview.CustomWebview;
|
|
||||||
import app.fedilab.android.webview.MastalabWebChromeClient;
|
import app.fedilab.android.webview.MastalabWebChromeClient;
|
||||||
import app.fedilab.android.webview.MastalabWebViewClient;
|
import app.fedilab.android.webview.MastalabWebViewClient;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -72,7 +72,7 @@ public class WebviewActivity extends BaseActivity {
|
||||||
private String url;
|
private String url;
|
||||||
private String peertubeLinkToFetch;
|
private String peertubeLinkToFetch;
|
||||||
private boolean peertubeLink;
|
private boolean peertubeLink;
|
||||||
private CustomWebview webView;
|
private WebView webView;
|
||||||
private Menu defaultMenu;
|
private Menu defaultMenu;
|
||||||
private MastalabWebViewClient mastalabWebViewClient;
|
private MastalabWebViewClient mastalabWebViewClient;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ import app.fedilab.android.R;
|
||||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||||
import app.fedilab.android.client.HttpsConnection;
|
import app.fedilab.android.client.HttpsConnection;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.webview.CustomWebview;
|
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +60,7 @@ import es.dmoral.toasty.Toasty;
|
||||||
public class WebviewConnectActivity extends BaseActivity {
|
public class WebviewConnectActivity extends BaseActivity {
|
||||||
|
|
||||||
|
|
||||||
private CustomWebview webView;
|
private WebView webView;
|
||||||
private AlertDialog alert;
|
private AlertDialog alert;
|
||||||
private String clientId, clientSecret;
|
private String clientId, clientSecret;
|
||||||
private String instance;
|
private String instance;
|
||||||
|
|
|
@ -176,7 +176,6 @@ import app.fedilab.android.sqlite.StatusStoredDAO;
|
||||||
import app.fedilab.android.sqlite.TempMuteDAO;
|
import app.fedilab.android.sqlite.TempMuteDAO;
|
||||||
import app.fedilab.android.sqlite.TimelineCacheDAO;
|
import app.fedilab.android.sqlite.TimelineCacheDAO;
|
||||||
import app.fedilab.android.sqlite.TimelinesDAO;
|
import app.fedilab.android.sqlite.TimelinesDAO;
|
||||||
import app.fedilab.android.webview.CustomWebview;
|
|
||||||
import br.com.felix.horizontalbargraph.HorizontalBar;
|
import br.com.felix.horizontalbargraph.HorizontalBar;
|
||||||
import br.com.felix.horizontalbargraph.model.BarItem;
|
import br.com.felix.horizontalbargraph.model.BarItem;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -4057,7 +4056,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
ImageView status_cardview_image;
|
ImageView status_cardview_image;
|
||||||
TextView status_cardview_title, status_cardview_content, status_cardview_url;
|
TextView status_cardview_title, status_cardview_content, status_cardview_url;
|
||||||
FrameLayout status_cardview_video;
|
FrameLayout status_cardview_video;
|
||||||
CustomWebview status_cardview_webview;
|
WebView status_cardview_webview;
|
||||||
ImageView hide_preview, hide_preview_h;
|
ImageView hide_preview, hide_preview_h;
|
||||||
TextView status_toot_app;
|
TextView status_toot_app;
|
||||||
RelativeLayout webview_preview;
|
RelativeLayout webview_preview;
|
||||||
|
|
|
@ -30,6 +30,7 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.webkit.WebView;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
@ -71,7 +72,6 @@ import app.fedilab.android.activities.SlideMediaActivity;
|
||||||
import app.fedilab.android.client.Entities.Attachment;
|
import app.fedilab.android.client.Entities.Attachment;
|
||||||
import app.fedilab.android.client.TLSSocketFactory;
|
import app.fedilab.android.client.TLSSocketFactory;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.webview.CustomWebview;
|
|
||||||
import app.fedilab.android.webview.MastalabWebChromeClient;
|
import app.fedilab.android.webview.MastalabWebChromeClient;
|
||||||
import app.fedilab.android.webview.MastalabWebViewClient;
|
import app.fedilab.android.webview.MastalabWebViewClient;
|
||||||
|
|
||||||
|
@ -90,7 +90,6 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
|
||||||
|
|
||||||
private static final Handler HANDLER = new Handler();
|
private static final Handler HANDLER = new Handler();
|
||||||
private Context context;
|
private Context context;
|
||||||
private int mediaPosition;
|
|
||||||
private SimpleExoPlayer player;
|
private SimpleExoPlayer player;
|
||||||
private MediaPlayer playeraudio;
|
private MediaPlayer playeraudio;
|
||||||
private Timer timer;
|
private Timer timer;
|
||||||
|
@ -117,14 +116,11 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
|
||||||
Bundle bundle = this.getArguments();
|
Bundle bundle = this.getArguments();
|
||||||
|
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
mediaPosition = bundle.getInt("position", 1);
|
|
||||||
attachment = bundle.getParcelable("attachment");
|
attachment = bundle.getParcelable("attachment");
|
||||||
}
|
}
|
||||||
|
|
||||||
message_ready = rootView.findViewById(R.id.message_ready);
|
message_ready = rootView.findViewById(R.id.message_ready);
|
||||||
|
|
||||||
TextView progress = rootView.findViewById(R.id.loader_progress);
|
|
||||||
CustomWebview webview_video = rootView.findViewById(R.id.webview_video);
|
|
||||||
RelativeLayout content_audio = rootView.findViewById(R.id.content_audio);
|
RelativeLayout content_audio = rootView.findViewById(R.id.content_audio);
|
||||||
|
|
||||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
|
@ -146,18 +142,6 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
|
||||||
changeDrawableColor(context, prev, R.color.white);
|
changeDrawableColor(context, prev, R.color.white);
|
||||||
changeDrawableColor(context, next, R.color.white);
|
changeDrawableColor(context, next, R.color.white);
|
||||||
}
|
}
|
||||||
prev.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
mediaPosition--;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
next.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
mediaPosition++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
url = attachment.getUrl();
|
url = attachment.getUrl();
|
||||||
imageView.setOnMatrixChangeListener(new OnMatrixChangedListener() {
|
imageView.setOnMatrixChangeListener(new OnMatrixChangedListener() {
|
||||||
|
@ -242,9 +226,7 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
|
||||||
pbar_inf.setScaleY(3f);
|
pbar_inf.setScaleY(3f);
|
||||||
try {
|
try {
|
||||||
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory(Helper.getLiveInstance(context)));
|
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory(Helper.getLiveInstance(context)));
|
||||||
} catch (KeyManagementException e) {
|
} catch (KeyManagementException | NoSuchAlgorithmException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
videoView.setVisibility(View.VISIBLE);
|
videoView.setVisibility(View.VISIBLE);
|
||||||
|
@ -263,31 +245,28 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
|
||||||
break;
|
break;
|
||||||
case "web":
|
case "web":
|
||||||
loader.setVisibility(View.GONE);
|
loader.setVisibility(View.GONE);
|
||||||
webview_video = Helper.initializeWebview((Activity) context, R.id.webview_video, null);
|
WebView webview_video = Helper.initializeWebview((Activity) context, R.id.webview_video, null);
|
||||||
webview_video.setVisibility(View.VISIBLE);
|
webview_video.setVisibility(View.VISIBLE);
|
||||||
FrameLayout webview_container = rootView.findViewById(R.id.main_media_frame);
|
FrameLayout webview_container = rootView.findViewById(R.id.main_media_frame);
|
||||||
final ViewGroup videoLayout = rootView.findViewById(R.id.videoLayout);
|
final ViewGroup videoLayout = rootView.findViewById(R.id.videoLayout);
|
||||||
|
|
||||||
MastalabWebChromeClient mastalabWebChromeClient = new MastalabWebChromeClient((Activity) context, webview_video, webview_container, videoLayout);
|
MastalabWebChromeClient mastalabWebChromeClient = new MastalabWebChromeClient((Activity) context, webview_video, webview_container, videoLayout);
|
||||||
mastalabWebChromeClient.setOnToggledFullscreen(new MastalabWebChromeClient.ToggledFullscreenCallback() {
|
mastalabWebChromeClient.setOnToggledFullscreen(fullscreen -> {
|
||||||
@Override
|
|
||||||
public void toggledFullscreen(boolean fullscreen) {
|
|
||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
videoLayout.setVisibility(View.VISIBLE);
|
videoLayout.setVisibility(View.VISIBLE);
|
||||||
WindowManager.LayoutParams attrs = ((Activity) context).getWindow().getAttributes();
|
WindowManager.LayoutParams attrs = ((Activity) context).getWindow().getAttributes();
|
||||||
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
||||||
attrs.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
attrs.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||||
((Activity) context).getWindow().setAttributes(attrs);
|
((Activity) context).getWindow().setAttributes(attrs);
|
||||||
((Activity) context).getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
((Activity) context).getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||||
} else {
|
} else {
|
||||||
WindowManager.LayoutParams attrs = ((Activity) context).getWindow().getAttributes();
|
WindowManager.LayoutParams attrs = ((Activity) context).getWindow().getAttributes();
|
||||||
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
||||||
attrs.flags &= ~WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
attrs.flags &= ~WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||||
((Activity) context).getWindow().setAttributes(attrs);
|
((Activity) context).getWindow().setAttributes(attrs);
|
||||||
((Activity) context).getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
|
((Activity) context).getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
|
||||||
videoLayout.setVisibility(View.GONE);
|
videoLayout.setVisibility(View.GONE);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
webview_video.getSettings().setAllowFileAccess(true);
|
webview_video.getSettings().setAllowFileAccess(true);
|
||||||
|
@ -425,14 +404,11 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
|
||||||
|
|
||||||
public void togglePlaying(View v) {
|
public void togglePlaying(View v) {
|
||||||
|
|
||||||
HANDLER.postDelayed(new Runnable() {
|
HANDLER.postDelayed(() -> {
|
||||||
@Override
|
if (isPlaying()) {
|
||||||
public void run() {
|
stopPlaying();
|
||||||
if (isPlaying()) {
|
} else {
|
||||||
stopPlaying();
|
startPlaying();
|
||||||
} else {
|
|
||||||
startPlaying();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
@ -494,8 +470,7 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
visualizerView.onResume();
|
visualizerView.onResume();
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSwipe() {
|
public boolean canSwipe() {
|
||||||
|
|
|
@ -85,6 +85,7 @@ import android.webkit.CookieManager;
|
||||||
import android.webkit.MimeTypeMap;
|
import android.webkit.MimeTypeMap;
|
||||||
import android.webkit.URLUtil;
|
import android.webkit.URLUtil;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
|
import android.webkit.WebView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
@ -225,7 +226,6 @@ import app.fedilab.android.sqlite.MainMenuDAO;
|
||||||
import app.fedilab.android.sqlite.Sqlite;
|
import app.fedilab.android.sqlite.Sqlite;
|
||||||
import app.fedilab.android.sqlite.StatusCacheDAO;
|
import app.fedilab.android.sqlite.StatusCacheDAO;
|
||||||
import app.fedilab.android.sqlite.TimelineCacheDAO;
|
import app.fedilab.android.sqlite.TimelineCacheDAO;
|
||||||
import app.fedilab.android.webview.CustomWebview;
|
|
||||||
import app.fedilab.android.webview.ProxyHelper;
|
import app.fedilab.android.webview.ProxyHelper;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
import info.guardianproject.netcipher.client.StrongBuilder;
|
import info.guardianproject.netcipher.client.StrongBuilder;
|
||||||
|
@ -2472,9 +2472,9 @@ public class Helper {
|
||||||
return spannableString;
|
return spannableString;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CustomWebview initializeWebview(Activity activity, int webviewId, View rootView) {
|
public static WebView initializeWebview(Activity activity, int webviewId, View rootView) {
|
||||||
|
|
||||||
CustomWebview webView;
|
WebView webView;
|
||||||
if (rootView == null) {
|
if (rootView == null) {
|
||||||
webView = activity.findViewById(webviewId);
|
webView = activity.findViewById(webviewId);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class MastalabWebChromeClient extends WebChromeClient implements MediaPla
|
||||||
|
|
||||||
private ToggledFullscreenCallback toggledFullscreenCallback;
|
private ToggledFullscreenCallback toggledFullscreenCallback;
|
||||||
|
|
||||||
private CustomWebview webView;
|
private WebView webView;
|
||||||
private View activityNonVideoView;
|
private View activityNonVideoView;
|
||||||
private ViewGroup activityVideoView;
|
private ViewGroup activityVideoView;
|
||||||
private ProgressBar pbar;
|
private ProgressBar pbar;
|
||||||
|
@ -54,7 +54,7 @@ public class MastalabWebChromeClient extends WebChromeClient implements MediaPla
|
||||||
private Activity activity;
|
private Activity activity;
|
||||||
|
|
||||||
|
|
||||||
public MastalabWebChromeClient(Activity activity, CustomWebview webView, FrameLayout activityNonVideoView, ViewGroup activityVideoView) {
|
public MastalabWebChromeClient(Activity activity, WebView webView, FrameLayout activityNonVideoView, ViewGroup activityVideoView) {
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
this.isVideoFullscreen = false;
|
this.isVideoFullscreen = false;
|
||||||
this.webView = webView;
|
this.webView = webView;
|
||||||
|
|
|
@ -19,6 +19,7 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Proxy;
|
import android.net.Proxy;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
@ -28,14 +29,14 @@ import java.lang.reflect.Method;
|
||||||
public class ProxyHelper {
|
public class ProxyHelper {
|
||||||
|
|
||||||
|
|
||||||
public static void setProxy(Context context, CustomWebview webview, String host, int port, String applicationClassName) {
|
public static void setProxy(Context context, WebView webview, String host, int port, String applicationClassName) {
|
||||||
|
|
||||||
setProxyKKPlus(context, webview, host, port, applicationClassName);
|
setProxyKKPlus(context, webview, host, port, applicationClassName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
private static boolean setProxyICS(CustomWebview webview, String host, int port) {
|
private static boolean setProxyICS(WebView webview, String host, int port) {
|
||||||
try {
|
try {
|
||||||
Class jwcjb = Class.forName("android.webkit.JWebCoreJavaBridge");
|
Class jwcjb = Class.forName("android.webkit.JWebCoreJavaBridge");
|
||||||
Class params[] = new Class[1];
|
Class params[] = new Class[1];
|
||||||
|
@ -72,7 +73,7 @@ public class ProxyHelper {
|
||||||
* Set Proxy for Android 4.1 - 4.3.
|
* Set Proxy for Android 4.1 - 4.3.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
private static boolean setProxyJB(CustomWebview webview, String host, int port) {
|
private static boolean setProxyJB(WebView webview, String host, int port) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Class wvcClass = Class.forName("android.webkit.WebViewClassic");
|
Class wvcClass = Class.forName("android.webkit.WebViewClassic");
|
||||||
|
@ -115,7 +116,7 @@ public class ProxyHelper {
|
||||||
// from https://stackoverflow.com/questions/19979578/android-webview-set-proxy-programatically-kitkat
|
// from https://stackoverflow.com/questions/19979578/android-webview-set-proxy-programatically-kitkat
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
private static void setProxyKKPlus(Context appContext, CustomWebview webView, String host, int port, String applicationClassName) {
|
private static void setProxyKKPlus(Context appContext, WebView webView, String host, int port, String applicationClassName) {
|
||||||
|
|
||||||
System.setProperty("http.proxyHost", host);
|
System.setProperty("http.proxyHost", host);
|
||||||
System.setProperty("http.proxyPort", port + "");
|
System.setProperty("http.proxyPort", port + "");
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center" />
|
android:gravity="center" />
|
||||||
|
|
||||||
<app.fedilab.android.webview.CustomWebview
|
<WebView
|
||||||
android:id="@+id/webview_video"
|
android:id="@+id/webview_video"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
style="?android:attr/progressBarStyleHorizontal"
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="10dp"
|
android:layout_height="10dp"
|
||||||
android:padding="1dp"></ProgressBar>
|
android:padding="1dp"/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/webview_container"
|
android:id="@+id/webview_container"
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
<app.fedilab.android.webview.CustomWebview
|
<WebView
|
||||||
android:id="@+id/webview"
|
android:id="@+id/webview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
@ -29,9 +29,9 @@
|
||||||
style="?android:attr/progressBarStyleHorizontal"
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="10dp"
|
android:layout_height="10dp"
|
||||||
android:padding="2dp"></ProgressBar>
|
android:padding="2dp"/>
|
||||||
|
|
||||||
<app.fedilab.android.webview.CustomWebview
|
<WebView
|
||||||
android:id="@+id/webviewConnect"
|
android:id="@+id/webviewConnect"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
|
|
@ -557,7 +557,7 @@
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<app.fedilab.android.webview.CustomWebview
|
<WebView
|
||||||
android:id="@+id/status_cardview_webview"
|
android:id="@+id/status_cardview_webview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
@ -481,7 +481,7 @@
|
||||||
/>
|
/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<app.fedilab.android.webview.CustomWebview
|
<WebView
|
||||||
android:id="@+id/status_cardview_webview"
|
android:id="@+id/status_cardview_webview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
@ -432,7 +432,7 @@
|
||||||
/>
|
/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<app.fedilab.android.webview.CustomWebview
|
<WebView
|
||||||
android:id="@+id/status_cardview_webview"
|
android:id="@+id/status_cardview_webview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
@ -414,7 +414,7 @@
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<app.fedilab.android.webview.CustomWebview
|
<WebView
|
||||||
android:id="@+id/status_cardview_webview"
|
android:id="@+id/status_cardview_webview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_centerInParent="true">
|
android:layout_centerInParent="true">
|
||||||
|
|
||||||
<app.fedilab.android.webview.CustomWebview
|
<WebView
|
||||||
android:id="@+id/webview_video"
|
android:id="@+id/webview_video"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue