mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 04:33:54 -04:00
Refactor: Delete extra files
This commit is contained in:
parent
4b23a64f86
commit
0841d57045
@ -74,8 +74,7 @@ public class LocalFileTransferActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
// Not a typo, 'Log' tags have a length upper limit of 25 characters
|
// Not a typo, 'Log' tags have a length upper limit of 25 characters
|
||||||
public static final String TAG = "LocalFileTransferActvty";
|
public static final String TAG = "LocalFileTransferActvty";
|
||||||
public static final int REQUEST_ENABLE_WIFI_P2P = 1;
|
public static final int REQUEST_ENABLE_LOCATION_SERVICES = 1;
|
||||||
public static final int REQUEST_ENABLE_LOCATION_SERVICES = 2;
|
|
||||||
private static final int PERMISSION_REQUEST_CODE_COARSE_LOCATION = 1;
|
private static final int PERMISSION_REQUEST_CODE_COARSE_LOCATION = 1;
|
||||||
private static final int PERMISSION_REQUEST_CODE_STORAGE_WRITE_ACCESS = 2;
|
private static final int PERMISSION_REQUEST_CODE_STORAGE_WRITE_ACCESS = 2;
|
||||||
|
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
package org.kiwix.kiwixmobile.zim_manager.local_file_transfer;
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
import androidx.fragment.app.DialogFragment;
|
|
||||||
import org.kiwix.kiwixmobile.R;
|
|
||||||
|
|
||||||
import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.LocalFileTransferActivity.REQUEST_ENABLE_LOCATION_SERVICES;
|
|
||||||
import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.LocalFileTransferActivity.showToast;
|
|
||||||
|
|
||||||
public class RequestEnableLocationServicesDialog extends DialogFragment {
|
|
||||||
|
|
||||||
public static final String TAG = "LocationDialog";
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
|
||||||
builder.setMessage(R.string.request_enable_location)
|
|
||||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface paramDialogInterface, int paramInt) {
|
|
||||||
startActivityForResult(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS),
|
|
||||||
REQUEST_ENABLE_LOCATION_SERVICES);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
showToast(getActivity(), R.string.discovery_needs_location, Toast.LENGTH_SHORT);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return builder.create();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
package org.kiwix.kiwixmobile.zim_manager.local_file_transfer;
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
import androidx.fragment.app.DialogFragment;
|
|
||||||
import org.kiwix.kiwixmobile.R;
|
|
||||||
|
|
||||||
import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.LocalFileTransferActivity.REQUEST_ENABLE_WIFI_P2P;
|
|
||||||
import static org.kiwix.kiwixmobile.zim_manager.local_file_transfer.LocalFileTransferActivity.showToast;
|
|
||||||
|
|
||||||
public class RequestEnableWifiP2pServicesDialog extends DialogFragment {
|
|
||||||
|
|
||||||
public static final String TAG = "WifiP2pDialog";
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
|
||||||
builder.setMessage(R.string.request_enable_wifi)
|
|
||||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface paramDialogInterface, int paramInt) {
|
|
||||||
startActivityForResult(new Intent(Settings.ACTION_WIFI_SETTINGS),
|
|
||||||
REQUEST_ENABLE_WIFI_P2P);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
showToast(getActivity(), R.string.discovery_needs_wifi, Toast.LENGTH_SHORT);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return builder.create();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user