* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.activities.MainWebViewActivity;
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.activities.MainWebViewActivity;
-import com.stoutner.privacybrowser.definitions.PendingDialog;
-import com.stoutner.privacybrowser.dialogs.SaveWebpageDialog;
+import com.stoutner.privacybrowser.dataclasses.PendingDialog;
+import com.stoutner.privacybrowser.dialogs.SaveDialog;
private final WeakReference<FragmentManager> fragmentManagerWeakReference;
// Define the class variables.
private final WeakReference<FragmentManager> fragmentManagerWeakReference;
// Define the class variables.
private final String userAgent;
private final boolean cookiesEnabled;
private String urlString;
// The public constructor.
private final String userAgent;
private final boolean cookiesEnabled;
private String urlString;
// The public constructor.
- public PrepareSaveDialog(Activity activity, Context context, FragmentManager fragmentManager, int saveType, String userAgent, boolean cookiesEnabled) {
+ public PrepareSaveDialog(Activity activity, Context context, FragmentManager fragmentManager, String userAgent, boolean cookiesEnabled) {
// Populate the weak references.
activityWeakReference = new WeakReference<>(activity);
contextWeakReference = new WeakReference<>(context);
fragmentManagerWeakReference = new WeakReference<>(fragmentManager);
// Store the class variables.
// Populate the weak references.
activityWeakReference = new WeakReference<>(activity);
contextWeakReference = new WeakReference<>(context);
fragmentManagerWeakReference = new WeakReference<>(fragmentManager);
// Store the class variables.
String urlMimeType = urlWithoutData.substring(0, urlWithoutData.indexOf(";"));
// Get the Base64 data, which begins after a `,`.
String base64DataString = urlWithoutData.substring(urlWithoutData.indexOf(",") + 1);
// Calculate the file size of the data URL. Each Base64 character represents 6 bits.
String urlMimeType = urlWithoutData.substring(0, urlWithoutData.indexOf(";"));
// Get the Base64 data, which begins after a `,`.
String base64DataString = urlWithoutData.substring(urlWithoutData.indexOf(",") + 1);
// Calculate the file size of the data URL. Each Base64 character represents 6 bits.
// Set the file name according to the MIME type.
fileNameString = context.getString(R.string.file) + "." + MimeTypeMap.getSingleton().getExtensionFromMimeType(urlMimeType);
// Set the file name according to the MIME type.
fileNameString = context.getString(R.string.file) + "." + MimeTypeMap.getSingleton().getExtensionFromMimeType(urlMimeType);
- DialogFragment saveDialogFragment = SaveWebpageDialog.saveWebpage(saveType, urlString, fileStringArray[0], fileStringArray[1], userAgent, cookiesEnabled);
+ DialogFragment saveDialogFragment = SaveDialog.saveUrl(urlString, fileStringArray[0], fileStringArray[1], userAgent, cookiesEnabled);