0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00
This commit is contained in:
TrianguloY 2023-05-20 13:54:05 +02:00
parent 4809cc3042
commit 804d677ecf
3 changed files with 15 additions and 14 deletions

View File

@ -45,8 +45,8 @@ public class OpenModule extends AModuleData {
return new GenericPref.Bool("open_noReferrer", true, cntx);
}
public static GenericPref.Bool MERGEBUTTON_PREF(Context cntx) {
return new GenericPref.Bool("", false, cntx);
public static GenericPref.Bool MERGECOPY_PREF(Context cntx) {
return new GenericPref.Bool("open_mergeCopy", false, cntx);
}
@Override
@ -77,7 +77,7 @@ class OpenDialog extends AModuleDialog {
private final GenericPref.Bool closeOpenPref;
private final GenericPref.Bool closeSharePref;
private final GenericPref.Bool noReferrerPref;
private final GenericPref.Bool mergePref;
private final GenericPref.Bool mergeCopyPref;
private final CTabs cTabs;
private final Incognito incognito;
@ -95,7 +95,7 @@ class OpenDialog extends AModuleDialog {
closeOpenPref = OpenModule.CLOSEOPEN_PREF(dialog);
closeSharePref = OpenModule.CLOSESHARE_PREF(dialog);
noReferrerPref = OpenModule.NOREFERRER_PREF(dialog);
mergePref = OpenModule.MERGEBUTTON_PREF(dialog);
mergeCopyPref = OpenModule.MERGECOPY_PREF(dialog);
}
@Override
@ -123,13 +123,13 @@ class OpenDialog extends AModuleDialog {
btn_openWith.setOnClickListener(v -> showList());
// init copy to URL
View btn_copy = views.findViewById(R.id.copyUrl);
var btn_copy = views.findViewById(R.id.copyUrl);
btn_copy.setOnClickListener(v -> AndroidUtils.copyToClipboard(getActivity(), R.string.mOpen_clipboard, getUrl()));
// init share
View btn_share = views.findViewById(R.id.share);
var btn_share = views.findViewById(R.id.share);
btn_share.setOnClickListener(v -> shareUrl());
if (mergePref.get()) {
if (mergeCopyPref.get()) {
btn_copy.setVisibility(View.GONE);
btn_share.setOnLongClickListener(v -> {
AndroidUtils.copyToClipboard(getActivity(), R.string.mOpen_clipboard, getUrl());
@ -276,7 +276,7 @@ class OpenConfig extends AModuleConfig {
private final GenericPref.Bool closeOpenPref;
private final GenericPref.Bool closeSharePref;
private final GenericPref.Bool noReferrerPref;
private final GenericPref.Bool mergePref;
private final GenericPref.Bool mergeCopyPref;
private final GenericPref.Enumeration<OnOffConfig> ctabsPref;
private final GenericPref.Enumeration<OnOffConfig> incognitoPref;
@ -290,7 +290,7 @@ class OpenConfig extends AModuleConfig {
closeSharePref = OpenModule.CLOSESHARE_PREF(activity);
noReferrerPref = OpenModule.NOREFERRER_PREF(activity);
perDomainPref = LastOpened.PERDOMAIN_PREF(activity);
mergePref = OpenModule.MERGEBUTTON_PREF(activity);
mergeCopyPref = OpenModule.MERGECOPY_PREF(activity);
}
@ -311,7 +311,7 @@ class OpenConfig extends AModuleConfig {
closeSharePref.attachToSwitch(views.findViewById(R.id.closeshare_pref));
noReferrerPref.attachToSwitch(views.findViewById(R.id.noReferrer));
perDomainPref.attachToSwitch(views.findViewById(R.id.perDomain));
mergePref.attachToSwitch(views.findViewById(R.id.mergeButtons_pref));
mergeCopyPref.attachToSwitch(views.findViewById(R.id.mergeCopy_pref));
}
}

View File

@ -79,10 +79,10 @@
android:text="@string/mOpen_noReferrer" />
<Switch
android:id="@+id/mergeButtons_pref"
android:id="@+id/mergeCopy_pref"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/smallPadding"
android:text="@string/mOpen_mergeButtons" />
android:text="@string/mOpen_mergeCopy" />
</LinearLayout>

View File

@ -140,14 +140,15 @@ Note: if you edit the patterns, new built-in patterns from app updates will not
- Custom Tabs button: toggle to enable/disable the custom tab feature. When enabled, the browser should be opened in a 'lite' mode.
- Incognito button: For Firefox only. Toggle to enable/disable the incognito mode. When enabled, the browser should be opened in incognito.
- Open button: Press the app name to open the link on that app. If a link can be opened with multiple apps, an arrow will be shown to let you choose.
- Share button: Press the button to share the link. Long press to quickly copy to clipboard."</string>
- Copy button: Press the button to copy the link into the clipboard.
- Share button: Press the button to share the link."</string>
<string name="mOpen_ctabs">Custom tabs:</string>
<string name="mOpen_incognito">Incognito mode:</string>
<string name="mOpen_closeOpen">Close dialog after opening</string>
<string name="mOpen_closeShare">Close dialog after sharing</string>
<string name="mOpen_perDomain">Sort different domains independently</string>
<string name="mOpen_noReferrer">Hide the source app (referrer)</string>
<string name="mOpen_mergeButtons">Merge Copy URL and Share into a single button (long press to copy)</string>
<string name="mOpen_mergeCopy">Merge Copy URL and Share into a single button (long press to copy)</string>
<string name="mOpen_with">Open with %s</string>
<string name="mOpen_open">Open</string>
<string name="mOpen_share">Share</string>