Merge pull request #3588 from ByteHamster/remove-materialdialogs
Removed MaterialDialog dependency
This commit is contained in:
commit
43be061a64
@ -154,9 +154,6 @@ dependencies {
|
|||||||
|
|
||||||
implementation "com.joanzapata.iconify:android-iconify-fontawesome:$iconifyVersion"
|
implementation "com.joanzapata.iconify:android-iconify-fontawesome:$iconifyVersion"
|
||||||
implementation "com.joanzapata.iconify:android-iconify-material:$iconifyVersion"
|
implementation "com.joanzapata.iconify:android-iconify-material:$iconifyVersion"
|
||||||
implementation("com.afollestad.material-dialogs:commons:$materialDialogsVersion") {
|
|
||||||
transitive = true
|
|
||||||
}
|
|
||||||
implementation "com.yqritc:recyclerview-flexibledivider:$recyclerviewFlexibledividerVersion"
|
implementation "com.yqritc:recyclerview-flexibledivider:$recyclerviewFlexibledividerVersion"
|
||||||
implementation "com.githang:viewpagerindicator:2.5.1@aar"
|
implementation "com.githang:viewpagerindicator:2.5.1@aar"
|
||||||
implementation "com.github.shts:TriangleLabelView:$triangleLabelViewVersion"
|
implementation "com.github.shts:TriangleLabelView:$triangleLabelViewVersion"
|
||||||
|
@ -28,7 +28,6 @@ import android.widget.SeekBar.OnSeekBarChangeListener;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.joanzapata.iconify.IconDrawable;
|
import com.joanzapata.iconify.IconDrawable;
|
||||||
import com.joanzapata.iconify.fonts.FontAwesomeIcons;
|
import com.joanzapata.iconify.fonts.FontAwesomeIcons;
|
||||||
@ -427,19 +426,15 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
|
|||||||
case R.id.disable_sleeptimer_item:
|
case R.id.disable_sleeptimer_item:
|
||||||
if (controller.serviceAvailable()) {
|
if (controller.serviceAvailable()) {
|
||||||
|
|
||||||
MaterialDialog.Builder stDialog = new MaterialDialog.Builder(this);
|
new AlertDialog.Builder(this)
|
||||||
stDialog.title(R.string.sleep_timer_label);
|
.setTitle(R.string.sleep_timer_label)
|
||||||
stDialog.content(getString(R.string.time_left_label)
|
.setMessage(getString(R.string.time_left_label)
|
||||||
+ Converter.getDurationStringLong((int) controller
|
+ Converter.getDurationStringLong((int) controller
|
||||||
.getSleepTimerTimeLeft()));
|
.getSleepTimerTimeLeft()))
|
||||||
stDialog.positiveText(R.string.disable_sleeptimer_label);
|
.setPositiveButton(R.string.disable_sleeptimer_label, (dialog, which)
|
||||||
stDialog.negativeText(R.string.cancel_label);
|
-> controller.disableSleepTimer())
|
||||||
stDialog.onPositive((dialog, which) -> {
|
.setNegativeButton(R.string.cancel_label, null)
|
||||||
dialog.dismiss();
|
.show();
|
||||||
controller.disableSleepTimer();
|
|
||||||
});
|
|
||||||
stDialog.onNegative((dialog, which) -> dialog.dismiss());
|
|
||||||
stDialog.build().show();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.set_sleeptimer_item:
|
case R.id.set_sleeptimer_item:
|
||||||
|
@ -6,12 +6,11 @@ import android.net.Uri;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
@ -30,55 +29,55 @@ import de.danoeh.antennapod.core.util.LangUtils;
|
|||||||
public class OpmlImportBaseActivity extends AppCompatActivity {
|
public class OpmlImportBaseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private static final String TAG = "OpmlImportBaseActivity";
|
private static final String TAG = "OpmlImportBaseActivity";
|
||||||
private static final int PERMISSION_REQUEST_READ_EXTERNAL_STORAGE = 5;
|
private static final int PERMISSION_REQUEST_READ_EXTERNAL_STORAGE = 5;
|
||||||
private OpmlImportWorker importWorker;
|
private OpmlImportWorker importWorker;
|
||||||
@Nullable private Uri uri;
|
@Nullable private Uri uri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the choices made by the user in the OpmlFeedChooserActivity and
|
* Handles the choices made by the user in the OpmlFeedChooserActivity and
|
||||||
* starts the OpmlFeedQueuer if necessary.
|
* starts the OpmlFeedQueuer if necessary.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
Log.d(TAG, "Received result");
|
Log.d(TAG, "Received result");
|
||||||
if (resultCode == RESULT_CANCELED) {
|
if (resultCode == RESULT_CANCELED) {
|
||||||
Log.d(TAG, "Activity was cancelled");
|
Log.d(TAG, "Activity was cancelled");
|
||||||
if (finishWhenCanceled()) {
|
if (finishWhenCanceled()) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int[] selected = data.getIntArrayExtra(OpmlFeedChooserActivity.EXTRA_SELECTED_ITEMS);
|
int[] selected = data.getIntArrayExtra(OpmlFeedChooserActivity.EXTRA_SELECTED_ITEMS);
|
||||||
if (selected != null && selected.length > 0) {
|
if (selected != null && selected.length > 0) {
|
||||||
OpmlFeedQueuer queuer = new OpmlFeedQueuer(this, selected) {
|
OpmlFeedQueuer queuer = new OpmlFeedQueuer(this, selected) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Void result) {
|
protected void onPostExecute(Void result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
Intent intent = new Intent(OpmlImportBaseActivity.this, MainActivity.class);
|
Intent intent = new Intent(OpmlImportBaseActivity.this, MainActivity.class);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||||
| Intent.FLAG_ACTIVITY_NEW_TASK);
|
| Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
queuer.executeAsync();
|
queuer.executeAsync();
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "No items were selected");
|
Log.d(TAG, "No items were selected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void importUri(@Nullable Uri uri) {
|
void importUri(@Nullable Uri uri) {
|
||||||
if(uri == null) {
|
if(uri == null) {
|
||||||
new MaterialDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
.content(R.string.opml_import_error_no_file)
|
.setMessage(R.string.opml_import_error_no_file)
|
||||||
.positiveText(android.R.string.ok)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show();
|
.show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||||
uri.toString().contains(Environment.getExternalStorageDirectory().toString())) {
|
uri.toString().contains(Environment.getExternalStorageDirectory().toString())) {
|
||||||
int permission = ActivityCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE);
|
int permission = ActivityCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||||
if (permission != PackageManager.PERMISSION_GRANTED) {
|
if (permission != PackageManager.PERMISSION_GRANTED) {
|
||||||
requestPermission();
|
requestPermission();
|
||||||
@ -88,30 +87,28 @@ public class OpmlImportBaseActivity extends AppCompatActivity {
|
|||||||
startImport();
|
startImport();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void requestPermission() {
|
private void requestPermission() {
|
||||||
String[] permissions = { android.Manifest.permission.READ_EXTERNAL_STORAGE };
|
String[] permissions = { android.Manifest.permission.READ_EXTERNAL_STORAGE };
|
||||||
ActivityCompat.requestPermissions(this, permissions, PERMISSION_REQUEST_READ_EXTERNAL_STORAGE);
|
ActivityCompat.requestPermissions(this, permissions, PERMISSION_REQUEST_READ_EXTERNAL_STORAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestPermissionsResult(int requestCode,
|
public void onRequestPermissionsResult(int requestCode,
|
||||||
String[] permissions,
|
String[] permissions,
|
||||||
int[] grantResults) {
|
int[] grantResults) {
|
||||||
if (requestCode != PERMISSION_REQUEST_READ_EXTERNAL_STORAGE) {
|
if (requestCode != PERMISSION_REQUEST_READ_EXTERNAL_STORAGE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (grantResults.length > 0 && ArrayUtils.contains(grantResults, PackageManager.PERMISSION_GRANTED)) {
|
if (grantResults.length > 0 && ArrayUtils.contains(grantResults, PackageManager.PERMISSION_GRANTED)) {
|
||||||
startImport();
|
startImport();
|
||||||
} else {
|
} else {
|
||||||
new MaterialDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
.content(R.string.opml_import_ask_read_permission)
|
.setMessage(R.string.opml_import_ask_read_permission)
|
||||||
.positiveText(android.R.string.ok)
|
.setPositiveButton(android.R.string.ok, (dialog, which) -> requestPermission())
|
||||||
.negativeText(R.string.cancel_label)
|
.setNegativeButton(R.string.cancel_label, (dialog, which) -> finish())
|
||||||
.onPositive((dialog, which) -> requestPermission())
|
|
||||||
.onNegative((dialog, which) -> finish())
|
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Starts the import process. */
|
/** Starts the import process. */
|
||||||
private void startImport() {
|
private void startImport() {
|
||||||
@ -136,10 +133,10 @@ public class OpmlImportBaseActivity extends AppCompatActivity {
|
|||||||
importWorker.executeAsync();
|
importWorker.executeAsync();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d(TAG, Log.getStackTraceString(e));
|
Log.d(TAG, Log.getStackTraceString(e));
|
||||||
String message = getString(R.string.opml_reader_error);
|
String message = getString(R.string.opml_reader_error);
|
||||||
new MaterialDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
.content(message + " " + e.getMessage())
|
.setMessage(message + " " + e.getMessage())
|
||||||
.positiveText(android.R.string.ok)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,6 @@ import android.text.TextUtils;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
@ -28,22 +26,22 @@ import de.danoeh.antennapod.dialog.ChooseDataFolderDialog;
|
|||||||
/** Is show if there is now external storage available. */
|
/** Is show if there is now external storage available. */
|
||||||
public class StorageErrorActivity extends AppCompatActivity {
|
public class StorageErrorActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private static final String TAG = "StorageErrorActivity";
|
private static final String TAG = "StorageErrorActivity";
|
||||||
|
|
||||||
private static final String[] EXTERNAL_STORAGE_PERMISSIONS = {
|
private static final String[] EXTERNAL_STORAGE_PERMISSIONS = {
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE };
|
Manifest.permission.WRITE_EXTERNAL_STORAGE };
|
||||||
private static final int PERMISSION_REQUEST_EXTERNAL_STORAGE = 42;
|
private static final int PERMISSION_REQUEST_EXTERNAL_STORAGE = 42;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
setTheme(UserPreferences.getTheme());
|
setTheme(UserPreferences.getTheme());
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.storage_error);
|
setContentView(R.layout.storage_error);
|
||||||
|
|
||||||
Button btnChooseDataFolder = findViewById(R.id.btnChooseDataFolder);
|
Button btnChooseDataFolder = findViewById(R.id.btnChooseDataFolder);
|
||||||
btnChooseDataFolder.setOnClickListener(v -> {
|
btnChooseDataFolder.setOnClickListener(v -> {
|
||||||
if (Build.VERSION_CODES.KITKAT <= Build.VERSION.SDK_INT &&
|
if (Build.VERSION_CODES.KITKAT <= Build.VERSION.SDK_INT &&
|
||||||
Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||||
showChooseDataFolderDialog();
|
showChooseDataFolderDialog();
|
||||||
@ -82,11 +80,10 @@ public class StorageErrorActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
if (grantResults[0] != PackageManager.PERMISSION_GRANTED ||
|
if (grantResults[0] != PackageManager.PERMISSION_GRANTED ||
|
||||||
grantResults[1] != PackageManager.PERMISSION_GRANTED) {
|
grantResults[1] != PackageManager.PERMISSION_GRANTED) {
|
||||||
new MaterialDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
.content(R.string.choose_data_directory_permission_rationale)
|
.setMessage(R.string.choose_data_directory_permission_rationale)
|
||||||
.positiveText(android.R.string.ok)
|
.setPositiveButton(android.R.string.ok, (dialog, which) -> requestPermission())
|
||||||
.onPositive((dialog, which) -> requestPermission())
|
.setNegativeButton(android.R.string.cancel, (dialog, which) -> finish())
|
||||||
.onNegative((dialog, which) -> finish())
|
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,15 +98,15 @@ public class StorageErrorActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
try {
|
try {
|
||||||
unregisterReceiver(mediaUpdate);
|
unregisterReceiver(mediaUpdate);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
Log.e(TAG, Log.getStackTraceString(e));
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// see PreferenceController.showChooseDataFolderDialog()
|
// see PreferenceController.showChooseDataFolderDialog()
|
||||||
private void showChooseDataFolderDialog() {
|
private void showChooseDataFolderDialog() {
|
||||||
@ -123,9 +120,9 @@ public class StorageErrorActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
if (resultCode == Activity.RESULT_OK &&
|
if (resultCode == Activity.RESULT_OK &&
|
||||||
requestCode == DirectoryChooserActivity.RESULT_CODE_DIR_SELECTED) {
|
requestCode == DirectoryChooserActivity.RESULT_CODE_DIR_SELECTED) {
|
||||||
String dir = data.getStringExtra(DirectoryChooserActivity.RESULT_SELECTED_DIR);
|
String dir = data.getStringExtra(DirectoryChooserActivity.RESULT_SELECTED_DIR);
|
||||||
|
|
||||||
File path;
|
File path;
|
||||||
@ -138,46 +135,46 @@ public class StorageErrorActivity extends AppCompatActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String message = null;
|
String message = null;
|
||||||
if(!path.exists()) {
|
if(!path.exists()) {
|
||||||
message = String.format(getString(R.string.folder_does_not_exist_error), dir);
|
message = String.format(getString(R.string.folder_does_not_exist_error), dir);
|
||||||
} else if(!path.canRead()) {
|
} else if(!path.canRead()) {
|
||||||
message = String.format(getString(R.string.folder_not_readable_error), dir);
|
message = String.format(getString(R.string.folder_not_readable_error), dir);
|
||||||
} else if(!path.canWrite()) {
|
} else if(!path.canWrite()) {
|
||||||
message = String.format(getString(R.string.folder_not_writable_error), dir);
|
message = String.format(getString(R.string.folder_not_writable_error), dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(message == null) {
|
if(message == null) {
|
||||||
Log.d(TAG, "Setting data folder: " + dir);
|
Log.d(TAG, "Setting data folder: " + dir);
|
||||||
UserPreferences.setDataFolder(dir);
|
UserPreferences.setDataFolder(dir);
|
||||||
leaveErrorState();
|
leaveErrorState();
|
||||||
} else {
|
} else {
|
||||||
AlertDialog.Builder ab = new AlertDialog.Builder(this);
|
AlertDialog.Builder ab = new AlertDialog.Builder(this);
|
||||||
ab.setMessage(message);
|
ab.setMessage(message);
|
||||||
ab.setPositiveButton(android.R.string.ok, null);
|
ab.setPositiveButton(android.R.string.ok, null);
|
||||||
ab.show();
|
ab.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void leaveErrorState() {
|
private void leaveErrorState() {
|
||||||
finish();
|
finish();
|
||||||
startActivity(new Intent(this, MainActivity.class));
|
startActivity(new Intent(this, MainActivity.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
private final BroadcastReceiver mediaUpdate = new BroadcastReceiver() {
|
private final BroadcastReceiver mediaUpdate = new BroadcastReceiver() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (TextUtils.equals(intent.getAction(), Intent.ACTION_MEDIA_MOUNTED)) {
|
if (TextUtils.equals(intent.getAction(), Intent.ACTION_MEDIA_MOUNTED)) {
|
||||||
if (intent.getBooleanExtra("read-only", true)) {
|
if (intent.getBooleanExtra("read-only", true)) {
|
||||||
Log.d(TAG, "Media was mounted; Finishing activity");
|
Log.d(TAG, "Media was mounted; Finishing activity");
|
||||||
leaveErrorState();
|
leaveErrorState();
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "Media seemed to have been mounted read only");
|
Log.d(TAG, "Media seemed to have been mounted read only");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package de.danoeh.antennapod.adapter;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -20,7 +21,6 @@ import de.danoeh.antennapod.core.preferences.UserPreferences;
|
|||||||
import de.danoeh.antennapod.core.util.Converter;
|
import de.danoeh.antennapod.core.util.Converter;
|
||||||
import de.danoeh.antennapod.core.util.StorageUtils;
|
import de.danoeh.antennapod.core.util.StorageUtils;
|
||||||
import de.danoeh.antennapod.dialog.ChooseDataFolderDialog;
|
import de.danoeh.antennapod.dialog.ChooseDataFolderDialog;
|
||||||
import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
|
|
||||||
|
|
||||||
|
|
||||||
public class DataFolderAdapter extends RecyclerView.Adapter<DataFolderAdapter.ViewHolder> {
|
public class DataFolderAdapter extends RecyclerView.Adapter<DataFolderAdapter.ViewHolder> {
|
||||||
@ -105,7 +105,7 @@ public class DataFolderAdapter extends RecyclerView.Adapter<DataFolderAdapter.Vi
|
|||||||
private TextView path;
|
private TextView path;
|
||||||
private TextView size;
|
private TextView size;
|
||||||
private RadioButton radioButton;
|
private RadioButton radioButton;
|
||||||
private MaterialProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
|
|
||||||
ViewHolder(View itemView) {
|
ViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
@ -3,8 +3,7 @@ package de.danoeh.antennapod.adapter.actionbutton;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
|
import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
|
||||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||||
@ -27,16 +26,15 @@ class MobileDownloadHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void confirmMobileDownload(final Context context, final FeedItem item) {
|
static void confirmMobileDownload(final Context context, final FeedItem item) {
|
||||||
MaterialDialog.Builder builder = new MaterialDialog.Builder(context)
|
AlertDialog.Builder builder = new AlertDialog.Builder(context)
|
||||||
.title(R.string.confirm_mobile_download_dialog_title)
|
.setTitle(R.string.confirm_mobile_download_dialog_title)
|
||||||
.content(R.string.confirm_mobile_download_dialog_message)
|
.setMessage(R.string.confirm_mobile_download_dialog_message)
|
||||||
.positiveText(context.getText(R.string.confirm_mobile_download_dialog_enable_temporarily))
|
.setPositiveButton(context.getText(R.string.confirm_mobile_download_dialog_enable_temporarily),
|
||||||
.onPositive((dialog, which) -> downloadFeedItems(context, item));
|
(dialog, which) -> downloadFeedItems(context, item));
|
||||||
if (!DBReader.getQueueIDList().contains(item.getId())) {
|
if (!DBReader.getQueueIDList().contains(item.getId())) {
|
||||||
builder
|
builder.setMessage(R.string.confirm_mobile_download_dialog_message_not_in_queue)
|
||||||
.content(R.string.confirm_mobile_download_dialog_message_not_in_queue)
|
.setNeutralButton(R.string.confirm_mobile_download_dialog_only_add_to_queue,
|
||||||
.neutralText(R.string.confirm_mobile_download_dialog_only_add_to_queue)
|
(dialog, which) -> addToQueue(context, item));
|
||||||
.onNeutral((dialog, which) -> addToQueue(context, item));
|
|
||||||
}
|
}
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,10 @@ package de.danoeh.antennapod.dialog;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
import android.view.View;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.adapter.DataFolderAdapter;
|
import de.danoeh.antennapod.adapter.DataFolderAdapter;
|
||||||
|
|
||||||
@ -25,21 +27,23 @@ public class ChooseDataFolderDialog {
|
|||||||
DataFolderAdapter adapter = new DataFolderAdapter(context, handlerFunc);
|
DataFolderAdapter adapter = new DataFolderAdapter(context, handlerFunc);
|
||||||
|
|
||||||
if (adapter.getItemCount() == 0) {
|
if (adapter.getItemCount() == 0) {
|
||||||
new MaterialDialog.Builder(context)
|
new AlertDialog.Builder(context)
|
||||||
.title(R.string.error_label)
|
.setTitle(R.string.error_label)
|
||||||
.content(R.string.external_storage_error_msg)
|
.setMessage(R.string.external_storage_error_msg)
|
||||||
.neutralText(android.R.string.ok)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show();
|
.show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialDialog dialog = new MaterialDialog.Builder(context)
|
View content = View.inflate(context, R.layout.choose_data_folder_dialog, null);
|
||||||
.title(R.string.choose_data_directory)
|
AlertDialog dialog = new AlertDialog.Builder(context)
|
||||||
.content(R.string.choose_data_directory_message)
|
.setView(content)
|
||||||
.adapter(adapter, null)
|
.setTitle(R.string.choose_data_directory)
|
||||||
.negativeText(R.string.cancel_label)
|
.setMessage(R.string.choose_data_directory_message)
|
||||||
.cancelable(true)
|
.setNegativeButton(R.string.cancel_label, null)
|
||||||
.build();
|
.create();
|
||||||
|
((RecyclerView) content.findViewById(R.id.recyclerView)).setLayoutManager(new LinearLayoutManager(context));
|
||||||
|
((RecyclerView) content.findViewById(R.id.recyclerView)).setAdapter(adapter);
|
||||||
adapter.setDialog(dialog);
|
adapter.setDialog(dialog);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,12 @@ package de.danoeh.antennapod.dialog;
|
|||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.core.feed.util.PlaybackSpeedUtils;
|
import de.danoeh.antennapod.core.feed.util.PlaybackSpeedUtils;
|
||||||
@ -24,7 +24,7 @@ public class PlaybackControlsDialog extends DialogFragment {
|
|||||||
private static final String ARGUMENT_IS_PLAYING_VIDEO = "isPlayingVideo";
|
private static final String ARGUMENT_IS_PLAYING_VIDEO = "isPlayingVideo";
|
||||||
|
|
||||||
private PlaybackController controller;
|
private PlaybackController controller;
|
||||||
private MaterialDialog dialog;
|
private AlertDialog dialog;
|
||||||
private boolean isPlayingVideo;
|
private boolean isPlayingVideo;
|
||||||
|
|
||||||
public static PlaybackControlsDialog newInstance(boolean isPlayingVideo) {
|
public static PlaybackControlsDialog newInstance(boolean isPlayingVideo) {
|
||||||
@ -59,15 +59,14 @@ public class PlaybackControlsDialog extends DialogFragment {
|
|||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
isPlayingVideo = getArguments() != null && getArguments().getBoolean(ARGUMENT_IS_PLAYING_VIDEO);
|
isPlayingVideo = getArguments() != null && getArguments().getBoolean(ARGUMENT_IS_PLAYING_VIDEO);
|
||||||
|
|
||||||
dialog = new MaterialDialog.Builder(getContext())
|
dialog = new AlertDialog.Builder(getContext())
|
||||||
.title(R.string.audio_controls)
|
.setTitle(R.string.audio_controls)
|
||||||
.customView(R.layout.audio_controls, true)
|
.setView(R.layout.audio_controls)
|
||||||
.neutralText(R.string.close_label)
|
.setPositiveButton(R.string.close_label, (dialog1, which) -> {
|
||||||
.onNeutral((dialog1, which) -> {
|
final SeekBar left = dialog.findViewById(R.id.volume_left);
|
||||||
final SeekBar left = (SeekBar) dialog1.findViewById(R.id.volume_left);
|
final SeekBar right = dialog.findViewById(R.id.volume_right);
|
||||||
final SeekBar right = (SeekBar) dialog1.findViewById(R.id.volume_right);
|
|
||||||
UserPreferences.setVolume(left.getProgress(), right.getProgress());
|
UserPreferences.setVolume(left.getProgress(), right.getProgress());
|
||||||
}).build();
|
}).create();
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import android.app.Dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@ -16,10 +17,6 @@ import android.widget.EditText;
|
|||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.DialogAction;
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
import com.afollestad.materialdialogs.internal.MDButton;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Proxy;
|
import java.net.Proxy;
|
||||||
@ -48,7 +45,7 @@ public class ProxyDialog {
|
|||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
|
|
||||||
private MaterialDialog dialog;
|
private AlertDialog dialog;
|
||||||
|
|
||||||
private Spinner spType;
|
private Spinner spType;
|
||||||
private EditText etHost;
|
private EditText etHost;
|
||||||
@ -64,54 +61,53 @@ public class ProxyDialog {
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dialog createDialog() {
|
public Dialog show() {
|
||||||
dialog = new MaterialDialog.Builder(context)
|
View content = View.inflate(context, R.layout.proxy_settings, null);
|
||||||
.title(R.string.pref_proxy_title)
|
dialog = new AlertDialog.Builder(context)
|
||||||
.customView(R.layout.proxy_settings, true)
|
.setTitle(R.string.pref_proxy_title)
|
||||||
.positiveText(R.string.proxy_test_label)
|
.setView(content)
|
||||||
.negativeText(R.string.cancel_label)
|
.setNegativeButton(R.string.cancel_label, null)
|
||||||
.onPositive((dialog1, which) -> {
|
.setPositiveButton(R.string.proxy_test_label, null)
|
||||||
if(!testSuccessful) {
|
.show();
|
||||||
dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false);
|
// To prevent cancelling the dialog on button click
|
||||||
test();
|
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener((view) -> {
|
||||||
return;
|
if (!testSuccessful) {
|
||||||
}
|
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||||
String type = (String) ((Spinner) dialog1.findViewById(R.id.spType)).getSelectedItem();
|
test();
|
||||||
ProxyConfig proxy;
|
return;
|
||||||
if(Proxy.Type.valueOf(type) == Proxy.Type.DIRECT) {
|
}
|
||||||
proxy = ProxyConfig.direct();
|
String type = (String) ((Spinner) content.findViewById(R.id.spType)).getSelectedItem();
|
||||||
} else {
|
ProxyConfig proxy;
|
||||||
String host = etHost.getText().toString();
|
if (Proxy.Type.valueOf(type) == Proxy.Type.DIRECT) {
|
||||||
String port = etPort.getText().toString();
|
proxy = ProxyConfig.direct();
|
||||||
String username = etUsername.getText().toString();
|
} else {
|
||||||
if(TextUtils.isEmpty(username)) {
|
String host = etHost.getText().toString();
|
||||||
username = null;
|
String port = etPort.getText().toString();
|
||||||
}
|
String username = etUsername.getText().toString();
|
||||||
String password = etPassword.getText().toString();
|
if(TextUtils.isEmpty(username)) {
|
||||||
if(TextUtils.isEmpty(password)) {
|
username = null;
|
||||||
password = null;
|
}
|
||||||
}
|
String password = etPassword.getText().toString();
|
||||||
int portValue = 0;
|
if(TextUtils.isEmpty(password)) {
|
||||||
if(!TextUtils.isEmpty(port)) {
|
password = null;
|
||||||
portValue = Integer.valueOf(port);
|
}
|
||||||
}
|
int portValue = 0;
|
||||||
if (Proxy.Type.valueOf(type) == Proxy.Type.SOCKS) {
|
if(!TextUtils.isEmpty(port)) {
|
||||||
proxy = ProxyConfig.socks(host, portValue, username, password);
|
portValue = Integer.valueOf(port);
|
||||||
} else {
|
}
|
||||||
proxy = ProxyConfig.http(host, portValue, username, password);
|
if (Proxy.Type.valueOf(type) == Proxy.Type.SOCKS) {
|
||||||
}
|
proxy = ProxyConfig.socks(host, portValue, username, password);
|
||||||
}
|
} else {
|
||||||
UserPreferences.setProxyConfig(proxy);
|
proxy = ProxyConfig.http(host, portValue, username, password);
|
||||||
AntennapodHttpClient.reinit();
|
}
|
||||||
dialog.dismiss();
|
}
|
||||||
})
|
UserPreferences.setProxyConfig(proxy);
|
||||||
.onNegative((dialog1, which) -> dialog1.dismiss())
|
AntennapodHttpClient.reinit();
|
||||||
.autoDismiss(false)
|
dialog.dismiss();
|
||||||
.build();
|
});
|
||||||
View view = dialog.getCustomView();
|
|
||||||
spType = view.findViewById(R.id.spType);
|
|
||||||
|
|
||||||
List<String> types= new ArrayList<>();
|
spType = content.findViewById(R.id.spType);
|
||||||
|
List<String> types = new ArrayList<>();
|
||||||
types.add(Proxy.Type.DIRECT.name());
|
types.add(Proxy.Type.DIRECT.name());
|
||||||
types.add(Proxy.Type.HTTP.name());
|
types.add(Proxy.Type.HTTP.name());
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
@ -123,22 +119,22 @@ public class ProxyDialog {
|
|||||||
spType.setAdapter(adapter);
|
spType.setAdapter(adapter);
|
||||||
ProxyConfig proxyConfig = UserPreferences.getProxyConfig();
|
ProxyConfig proxyConfig = UserPreferences.getProxyConfig();
|
||||||
spType.setSelection(adapter.getPosition(proxyConfig.type.name()));
|
spType.setSelection(adapter.getPosition(proxyConfig.type.name()));
|
||||||
etHost = view.findViewById(R.id.etHost);
|
etHost = content.findViewById(R.id.etHost);
|
||||||
if(!TextUtils.isEmpty(proxyConfig.host)) {
|
if(!TextUtils.isEmpty(proxyConfig.host)) {
|
||||||
etHost.setText(proxyConfig.host);
|
etHost.setText(proxyConfig.host);
|
||||||
}
|
}
|
||||||
etHost.addTextChangedListener(requireTestOnChange);
|
etHost.addTextChangedListener(requireTestOnChange);
|
||||||
etPort = view.findViewById(R.id.etPort);
|
etPort = content.findViewById(R.id.etPort);
|
||||||
if(proxyConfig.port > 0) {
|
if(proxyConfig.port > 0) {
|
||||||
etPort.setText(String.valueOf(proxyConfig.port));
|
etPort.setText(String.valueOf(proxyConfig.port));
|
||||||
}
|
}
|
||||||
etPort.addTextChangedListener(requireTestOnChange);
|
etPort.addTextChangedListener(requireTestOnChange);
|
||||||
etUsername = view.findViewById(R.id.etUsername);
|
etUsername = content.findViewById(R.id.etUsername);
|
||||||
if(!TextUtils.isEmpty(proxyConfig.username)) {
|
if(!TextUtils.isEmpty(proxyConfig.username)) {
|
||||||
etUsername.setText(proxyConfig.username);
|
etUsername.setText(proxyConfig.username);
|
||||||
}
|
}
|
||||||
etUsername.addTextChangedListener(requireTestOnChange);
|
etUsername.addTextChangedListener(requireTestOnChange);
|
||||||
etPassword = view.findViewById(R.id.etPassword);
|
etPassword = content.findViewById(R.id.etPassword);
|
||||||
if(!TextUtils.isEmpty(proxyConfig.password)) {
|
if(!TextUtils.isEmpty(proxyConfig.password)) {
|
||||||
etPassword.setText(proxyConfig.username);
|
etPassword.setText(proxyConfig.username);
|
||||||
}
|
}
|
||||||
@ -159,7 +155,7 @@ public class ProxyDialog {
|
|||||||
enableSettings(false);
|
enableSettings(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
txtvMessage = view.findViewById(R.id.txtvMessage);
|
txtvMessage = content.findViewById(R.id.txtvMessage);
|
||||||
checkValidity();
|
checkValidity();
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
@ -230,14 +226,12 @@ public class ProxyDialog {
|
|||||||
private void setTestRequired(boolean required) {
|
private void setTestRequired(boolean required) {
|
||||||
if(required) {
|
if(required) {
|
||||||
testSuccessful = false;
|
testSuccessful = false;
|
||||||
MDButton button = dialog.getActionButton(DialogAction.POSITIVE);
|
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setText(R.string.proxy_test_label);
|
||||||
button.setText(context.getText(R.string.proxy_test_label));
|
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
|
||||||
button.setEnabled(true);
|
|
||||||
} else {
|
} else {
|
||||||
testSuccessful = true;
|
testSuccessful = true;
|
||||||
MDButton button = dialog.getActionButton(DialogAction.POSITIVE);
|
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setText(android.R.string.ok);
|
||||||
button.setText(context.getText(android.R.string.ok));
|
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
|
||||||
button.setEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,11 +7,10 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.core.util.IntentUtils;
|
import de.danoeh.antennapod.core.util.IntentUtils;
|
||||||
|
|
||||||
@ -97,21 +96,18 @@ public class RatingDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private static MaterialDialog createDialog() {
|
private static AlertDialog createDialog() {
|
||||||
Context context = mContext.get();
|
Context context = mContext.get();
|
||||||
if(context == null) {
|
if (context == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new MaterialDialog.Builder(context)
|
return new AlertDialog.Builder(context)
|
||||||
.title(R.string.rating_title)
|
.setTitle(R.string.rating_title)
|
||||||
.content(R.string.rating_message)
|
.setMessage(R.string.rating_message)
|
||||||
.positiveText(R.string.rating_now_label)
|
.setPositiveButton(R.string.rating_now_label, (dialog, which) -> rateNow())
|
||||||
.negativeText(R.string.rating_never_label)
|
.setNegativeButton(R.string.rating_never_label, (dialog, which) -> saveRated())
|
||||||
.neutralText(R.string.rating_later_label)
|
.setNeutralButton(R.string.rating_later_label, (dialog, which) -> resetStartDate())
|
||||||
.onPositive((dialog, which) -> rateNow())
|
.setOnCancelListener(dialog1 -> resetStartDate())
|
||||||
.onNegative((dialog, which) -> saveRated())
|
.create();
|
||||||
.onNeutral((dialog, which) -> resetStartDate())
|
|
||||||
.cancelListener(dialog1 -> resetStartDate())
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,12 @@ package de.danoeh.antennapod.dialog;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.core.feed.Feed;
|
import de.danoeh.antennapod.core.feed.Feed;
|
||||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||||
|
|
||||||
@ -25,20 +27,24 @@ public class RenameFeedDialog {
|
|||||||
if(activity == null) {
|
if(activity == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new MaterialDialog.Builder(activity)
|
|
||||||
.title(de.danoeh.antennapod.core.R.string.rename_feed_label)
|
View content = View.inflate(activity, R.layout.edit_text_dialog, null);
|
||||||
.inputType(InputType.TYPE_CLASS_TEXT)
|
EditText editText = content.findViewById(R.id.text);
|
||||||
.input(feed.getTitle(), feed.getTitle(), true, (dialog, input) -> {
|
editText.setText(feed.getTitle());
|
||||||
feed.setCustomTitle(input.toString());
|
AlertDialog dialog = new AlertDialog.Builder(activity)
|
||||||
|
.setView(content)
|
||||||
|
.setTitle(de.danoeh.antennapod.core.R.string.rename_feed_label)
|
||||||
|
.setPositiveButton(android.R.string.ok, (d, input) -> {
|
||||||
|
feed.setCustomTitle(editText.getText().toString());
|
||||||
DBWriter.setFeedCustomTitle(feed);
|
DBWriter.setFeedCustomTitle(feed);
|
||||||
dialog.dismiss();
|
|
||||||
})
|
})
|
||||||
.neutralText(de.danoeh.antennapod.core.R.string.reset)
|
.setNeutralButton(de.danoeh.antennapod.core.R.string.reset, null)
|
||||||
.onNeutral((dialog, which) -> dialog.getInputEditText().setText(feed.getFeedTitle()))
|
.setNegativeButton(de.danoeh.antennapod.core.R.string.cancel_label, null)
|
||||||
.negativeText(de.danoeh.antennapod.core.R.string.cancel_label)
|
|
||||||
.onNegative((dialog, which) -> dialog.dismiss())
|
|
||||||
.autoDismiss(false)
|
|
||||||
.show();
|
.show();
|
||||||
|
|
||||||
|
// To prevent cancelling the dialog on button click
|
||||||
|
dialog.getButton(AlertDialog.BUTTON_NEUTRAL).setOnClickListener(
|
||||||
|
(view) -> editText.setText(feed.getFeedTitle()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package de.danoeh.antennapod.dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
@ -12,9 +11,7 @@ import android.widget.EditText;
|
|||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.DialogAction;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
|
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.core.event.MessageEvent;
|
import de.danoeh.antennapod.core.event.MessageEvent;
|
||||||
import de.danoeh.antennapod.core.preferences.SleepTimerPreferences;
|
import de.danoeh.antennapod.core.preferences.SleepTimerPreferences;
|
||||||
@ -26,7 +23,7 @@ public abstract class SleepTimerDialog {
|
|||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
|
|
||||||
private MaterialDialog dialog;
|
private AlertDialog dialog;
|
||||||
private EditText etxtTime;
|
private EditText etxtTime;
|
||||||
private Spinner spTimeUnit;
|
private Spinner spTimeUnit;
|
||||||
private CheckBox cbShakeToReset;
|
private CheckBox cbShakeToReset;
|
||||||
@ -38,40 +35,38 @@ public abstract class SleepTimerDialog {
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaterialDialog createNewDialog() {
|
public AlertDialog createNewDialog() {
|
||||||
MaterialDialog.Builder builder = new MaterialDialog.Builder(context);
|
View content = View.inflate(context, R.layout.time_dialog, null);
|
||||||
builder.title(R.string.set_sleeptimer_label);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.customView(R.layout.time_dialog, false);
|
builder.setTitle(R.string.set_sleeptimer_label);
|
||||||
builder.positiveText(R.string.set_sleeptimer_label);
|
builder.setView(content);
|
||||||
builder.negativeText(R.string.cancel_label);
|
builder.setNegativeButton(R.string.cancel_label, (dialog, which) -> dialog.dismiss());
|
||||||
builder.onNegative((dialog, which) -> dialog.dismiss());
|
builder.setPositiveButton(R.string.set_sleeptimer_label, (dialog, which) -> {
|
||||||
builder.onPositive((dialog, which) -> {
|
try {
|
||||||
try {
|
savePreferences();
|
||||||
savePreferences();
|
long input = SleepTimerPreferences.timerMillis();
|
||||||
long input = SleepTimerPreferences.timerMillis();
|
onTimerSet(input, cbShakeToReset.isChecked(), cbVibrate.isChecked());
|
||||||
onTimerSet(input, cbShakeToReset.isChecked(), cbVibrate.isChecked());
|
dialog.dismiss();
|
||||||
dialog.dismiss();
|
} catch (NumberFormatException e) {
|
||||||
} catch (NumberFormatException e) {
|
e.printStackTrace();
|
||||||
e.printStackTrace();
|
Toast toast = Toast.makeText(context, R.string.time_dialog_invalid_input,
|
||||||
Toast toast = Toast.makeText(context, R.string.time_dialog_invalid_input,
|
Toast.LENGTH_LONG);
|
||||||
Toast.LENGTH_LONG);
|
toast.show();
|
||||||
toast.show();
|
}
|
||||||
}
|
});
|
||||||
});
|
dialog = builder.create();
|
||||||
dialog = builder.build();
|
|
||||||
|
etxtTime = content.findViewById(R.id.etxtTime);
|
||||||
View view = dialog.getView();
|
spTimeUnit = content.findViewById(R.id.spTimeUnit);
|
||||||
etxtTime = view.findViewById(R.id.etxtTime);
|
cbShakeToReset = content.findViewById(R.id.cbShakeToReset);
|
||||||
spTimeUnit = view.findViewById(R.id.spTimeUnit);
|
cbVibrate = content.findViewById(R.id.cbVibrate);
|
||||||
cbShakeToReset = view.findViewById(R.id.cbShakeToReset);
|
chAutoEnable = content.findViewById(R.id.chAutoEnable);
|
||||||
cbVibrate = view.findViewById(R.id.cbVibrate);
|
|
||||||
chAutoEnable = view.findViewById(R.id.chAutoEnable);
|
|
||||||
|
|
||||||
etxtTime.setText(SleepTimerPreferences.lastTimerValue());
|
etxtTime.setText(SleepTimerPreferences.lastTimerValue());
|
||||||
etxtTime.addTextChangedListener(new TextWatcher() {
|
etxtTime.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
checkInputLength(s.length());
|
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(s.length() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -109,16 +104,6 @@ public abstract class SleepTimerDialog {
|
|||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkInputLength(int length) {
|
|
||||||
if (length > 0) {
|
|
||||||
Log.d(TAG, "Length is larger than 0, enabling confirm button");
|
|
||||||
dialog.getActionButton(DialogAction.POSITIVE).setEnabled(true);
|
|
||||||
} else {
|
|
||||||
Log.d(TAG, "Length is smaller than 0, disabling confirm button");
|
|
||||||
dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void onTimerSet(long millis, boolean shakeToReset, boolean vibrate);
|
public abstract void onTimerSet(long millis, boolean shakeToReset, boolean vibrate);
|
||||||
|
|
||||||
private void savePreferences() {
|
private void savePreferences() {
|
||||||
|
@ -7,10 +7,6 @@ import android.net.Uri;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.DialogAction;
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -45,38 +41,30 @@ public class VariableSpeedDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void showGetPluginDialog(final Context context, boolean showSpeedSelector) {
|
private static void showGetPluginDialog(final Context context, boolean showSpeedSelector) {
|
||||||
MaterialDialog.Builder builder = new MaterialDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.title(R.string.no_playback_plugin_title);
|
builder.setTitle(R.string.no_playback_plugin_title);
|
||||||
builder.content(R.string.no_playback_plugin_or_sonic_msg);
|
builder.setMessage(R.string.no_playback_plugin_or_sonic_msg);
|
||||||
builder.positiveText(R.string.enable_sonic);
|
|
||||||
builder.negativeText(R.string.download_plugin_label);
|
if (Build.VERSION.SDK_INT >= 16) {
|
||||||
builder.neutralText(R.string.close_label);
|
builder.setPositiveButton(R.string.enable_sonic, (dialog, which) -> {
|
||||||
builder.onPositive((dialog, which) -> {
|
|
||||||
if (Build.VERSION.SDK_INT >= 16) { // just to be safe
|
|
||||||
UserPreferences.enableSonic();
|
UserPreferences.enableSonic();
|
||||||
if(showSpeedSelector) {
|
if (showSpeedSelector) {
|
||||||
showSpeedSelectorDialog(context);
|
showSpeedSelectorDialog(context);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
builder.onNegative((dialog, which) -> {
|
|
||||||
try {
|
|
||||||
context.startActivity(playStoreIntent);
|
|
||||||
} catch (ActivityNotFoundException e) {
|
|
||||||
// this is usually thrown on an emulator if the Android market is not installed
|
|
||||||
Log.e(TAG, Log.getStackTraceString(e));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
builder.forceStacking(true);
|
|
||||||
MaterialDialog dialog = builder.show();
|
|
||||||
if (Build.VERSION.SDK_INT < 16) {
|
|
||||||
View pos = dialog.getActionButton(DialogAction.POSITIVE);
|
|
||||||
pos.setEnabled(false);
|
|
||||||
}
|
}
|
||||||
if(!IntentUtils.isCallable(context.getApplicationContext(), playStoreIntent)) {
|
if (IntentUtils.isCallable(context.getApplicationContext(), playStoreIntent)) {
|
||||||
View pos = dialog.getActionButton(DialogAction.NEGATIVE);
|
builder.setNegativeButton(R.string.download_plugin_label, (dialog, which) -> {
|
||||||
pos.setEnabled(false);
|
try {
|
||||||
|
context.startActivity(playStoreIntent);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
// this is usually thrown on an emulator if the Android market is not installed
|
||||||
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
builder.setNeutralButton(R.string.close_label, null);
|
||||||
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void showSpeedSelectorDialog(final Context context) {
|
private static void showSpeedSelectorDialog(final Context context) {
|
||||||
|
@ -2,6 +2,7 @@ package de.danoeh.antennapod.fragment;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.core.view.MenuItemCompat;
|
import androidx.core.view.MenuItemCompat;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
@ -18,8 +19,6 @@ import android.widget.GridView;
|
|||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
|
|
||||||
import de.danoeh.antennapod.discovery.ItunesPodcastSearcher;
|
import de.danoeh.antennapod.discovery.ItunesPodcastSearcher;
|
||||||
import de.danoeh.antennapod.discovery.ItunesTopListLoader;
|
import de.danoeh.antennapod.discovery.ItunesTopListLoader;
|
||||||
import de.danoeh.antennapod.discovery.PodcastSearchResult;
|
import de.danoeh.antennapod.discovery.PodcastSearchResult;
|
||||||
@ -120,9 +119,9 @@ public class ItunesSearchFragment extends Fragment {
|
|||||||
progressBar.setVisibility(View.GONE);
|
progressBar.setVisibility(View.GONE);
|
||||||
gridView.setVisibility(View.VISIBLE);
|
gridView.setVisibility(View.VISIBLE);
|
||||||
String prefix = getString(R.string.error_msg_prefix);
|
String prefix = getString(R.string.error_msg_prefix);
|
||||||
new MaterialDialog.Builder(getActivity())
|
new AlertDialog.Builder(getActivity())
|
||||||
.content(prefix + " " + error.getMessage())
|
.setMessage(prefix + " " + error.getMessage())
|
||||||
.neutralText(android.R.string.ok)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show();
|
.show();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -2,6 +2,7 @@ package de.danoeh.antennapod.fragment;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -11,7 +12,6 @@ import android.widget.AdapterView;
|
|||||||
import android.widget.GridView;
|
import android.widget.GridView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.activity.MainActivity;
|
import de.danoeh.antennapod.activity.MainActivity;
|
||||||
import de.danoeh.antennapod.activity.OnlineFeedViewActivity;
|
import de.danoeh.antennapod.activity.OnlineFeedViewActivity;
|
||||||
@ -110,9 +110,9 @@ public class QuickFeedDiscoveryFragment extends Fragment implements AdapterView.
|
|||||||
Log.e(TAG, Log.getStackTraceString(error));
|
Log.e(TAG, Log.getStackTraceString(error));
|
||||||
view.setAlpha(1f);
|
view.setAlpha(1f);
|
||||||
String prefix = getString(R.string.error_msg_prefix);
|
String prefix = getString(R.string.error_msg_prefix);
|
||||||
new MaterialDialog.Builder(getActivity())
|
new AlertDialog.Builder(getActivity())
|
||||||
.content(prefix + " " + error.getMessage())
|
.setMessage(prefix + " " + error.getMessage())
|
||||||
.neutralText(android.R.string.ok)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show();
|
.show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,8 @@ import android.content.Context;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.preference.Preference;
|
|
||||||
import androidx.preference.PreferenceFragmentCompat;
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.activity.PreferenceActivity;
|
import de.danoeh.antennapod.activity.PreferenceActivity;
|
||||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||||
@ -65,7 +62,7 @@ public class NetworkPreferencesFragment extends PreferenceFragmentCompat {
|
|||||||
// validate and set correct value: number of downloads between 1 and 50 (inclusive)
|
// validate and set correct value: number of downloads between 1 and 50 (inclusive)
|
||||||
findPreference(PREF_PROXY).setOnPreferenceClickListener(preference -> {
|
findPreference(PREF_PROXY).setOnPreferenceClickListener(preference -> {
|
||||||
ProxyDialog dialog = new ProxyDialog(getActivity());
|
ProxyDialog dialog = new ProxyDialog(getActivity());
|
||||||
dialog.createDialog().show();
|
dialog.show();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -107,13 +104,10 @@ public class NetworkPreferencesFragment extends PreferenceFragmentCompat {
|
|||||||
private void showUpdateIntervalTimePreferencesDialog() {
|
private void showUpdateIntervalTimePreferencesDialog() {
|
||||||
final Context context = getActivity();
|
final Context context = getActivity();
|
||||||
|
|
||||||
MaterialDialog.Builder builder = new MaterialDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.title(R.string.pref_autoUpdateIntervallOrTime_title);
|
builder.setTitle(R.string.pref_autoUpdateIntervallOrTime_title);
|
||||||
builder.content(R.string.pref_autoUpdateIntervallOrTime_message);
|
builder.setMessage(R.string.pref_autoUpdateIntervallOrTime_message);
|
||||||
builder.positiveText(R.string.pref_autoUpdateIntervallOrTime_Interval);
|
builder.setPositiveButton(R.string.pref_autoUpdateIntervallOrTime_Interval, (dialog, which) -> {
|
||||||
builder.negativeText(R.string.pref_autoUpdateIntervallOrTime_TimeOfDay);
|
|
||||||
builder.neutralText(R.string.pref_autoUpdateIntervallOrTime_Disable);
|
|
||||||
builder.onPositive((dialog, which) -> {
|
|
||||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder1 = new AlertDialog.Builder(context);
|
||||||
builder1.setTitle(context.getString(R.string.pref_autoUpdateIntervallOrTime_Interval));
|
builder1.setTitle(context.getString(R.string.pref_autoUpdateIntervallOrTime_Interval));
|
||||||
final String[] values = context.getResources().getStringArray(R.array.update_intervall_values);
|
final String[] values = context.getResources().getStringArray(R.array.update_intervall_values);
|
||||||
@ -133,7 +127,7 @@ public class NetworkPreferencesFragment extends PreferenceFragmentCompat {
|
|||||||
builder1.setNegativeButton(context.getString(R.string.cancel_label), null);
|
builder1.setNegativeButton(context.getString(R.string.cancel_label), null);
|
||||||
builder1.show();
|
builder1.show();
|
||||||
});
|
});
|
||||||
builder.onNegative((dialog, which) -> {
|
builder.setNegativeButton(R.string.pref_autoUpdateIntervallOrTime_TimeOfDay, (dialog, which) -> {
|
||||||
int hourOfDay = 7;
|
int hourOfDay = 7;
|
||||||
int minute = 0;
|
int minute = 0;
|
||||||
int[] updateTime = UserPreferences.getUpdateTimeOfDay();
|
int[] updateTime = UserPreferences.getUpdateTimeOfDay();
|
||||||
@ -152,7 +146,7 @@ public class NetworkPreferencesFragment extends PreferenceFragmentCompat {
|
|||||||
timePickerDialog.setTitle(context.getString(R.string.pref_autoUpdateIntervallOrTime_TimeOfDay));
|
timePickerDialog.setTitle(context.getString(R.string.pref_autoUpdateIntervallOrTime_TimeOfDay));
|
||||||
timePickerDialog.show();
|
timePickerDialog.show();
|
||||||
});
|
});
|
||||||
builder.onNeutral((dialog, which) -> {
|
builder.setNeutralButton(R.string.pref_autoUpdateIntervallOrTime_Disable, (dialog, which) -> {
|
||||||
UserPreferences.disableAutoUpdate();
|
UserPreferences.disableAutoUpdate();
|
||||||
setUpdateIntervalText();
|
setUpdateIntervalText();
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
12
app/src/main/res/layout/choose_data_folder_dialog.xml
Normal file
12
app/src/main/res/layout/choose_data_folder_dialog.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/recyclerView" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -37,12 +37,11 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="2 GB" />
|
tools:text="2 GB" />
|
||||||
|
|
||||||
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/used_space"
|
android:id="@+id/used_space"
|
||||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
app:mpb_progressStyle="horizontal" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
15
app/src/main/res/layout/edit_text_dialog.xml
Normal file
15
app/src/main/res/layout/edit_text_dialog.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="text"
|
||||||
|
android:ems="10"
|
||||||
|
android:id="@+id/text" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -3,7 +3,7 @@
|
|||||||
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"
|
||||||
android:padding="32dp">
|
android:padding="16dp">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txtvType"
|
android:id="@+id/txtvType"
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/discover_error"
|
android:id="@+id/discover_error"
|
||||||
android:textColor="@color/md_edittext_error"
|
android:textColor="@color/download_failed_red"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center">
|
android:gravity="center"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
@ -33,7 +34,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black"
|
android:background="@color/black"
|
||||||
@ -33,27 +34,27 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="8dp"
|
||||||
android:background="@drawable/md_transparent"
|
android:background="@android:color/transparent"
|
||||||
android:contentDescription="@string/rewind_label"
|
android:contentDescription="@string/rewind_label"
|
||||||
android:src="@drawable/ic_av_fast_rewind_white_80dp" />
|
app:srcCompat="@drawable/ic_av_fast_rewind_white_80dp" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/butPlay"
|
android:id="@+id/butPlay"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="8dp"
|
||||||
android:background="@drawable/md_transparent"
|
android:background="@android:color/transparent"
|
||||||
android:contentDescription="@string/pause_label"
|
android:contentDescription="@string/pause_label"
|
||||||
android:src="@drawable/ic_av_pause_white_80dp" />
|
app:srcCompat="@drawable/ic_av_pause_white_80dp" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/butFF"
|
android:id="@+id/butFF"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="8dp"
|
||||||
android:background="@drawable/md_transparent"
|
android:background="@android:color/transparent"
|
||||||
android:contentDescription="@string/fast_forward_label"
|
android:contentDescription="@string/fast_forward_label"
|
||||||
android:src="@drawable/ic_av_fast_forward_white_80dp" />
|
app:srcCompat="@drawable/ic_av_fast_forward_white_80dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -15,16 +15,14 @@
|
|||||||
android:key="prefEpisodeCacheSize"
|
android:key="prefEpisodeCacheSize"
|
||||||
android:title="@string/pref_episode_cache_title"
|
android:title="@string/pref_episode_cache_title"
|
||||||
android:summary="@string/pref_episode_cache_summary"
|
android:summary="@string/pref_episode_cache_summary"
|
||||||
android:entryValues="@array/episode_cache_size_values"
|
android:entryValues="@array/episode_cache_size_values"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="-1"
|
android:defaultValue="-1"
|
||||||
android:entries="@array/episode_cleanup_entries"
|
android:entries="@array/episode_cleanup_entries"
|
||||||
android:key="prefEpisodeCleanup"
|
android:key="prefEpisodeCleanup"
|
||||||
android:title="@string/pref_episode_cleanup_title"
|
android:title="@string/pref_episode_cleanup_title"
|
||||||
android:summary="@string/pref_episode_cleanup_summary"
|
android:summary="@string/pref_episode_cleanup_summary"
|
||||||
android:entryValues="@array/episode_cleanup_values"
|
android:entryValues="@array/episode_cleanup_values"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="prefEnableAutoDownloadOnBattery"
|
android:key="prefEnableAutoDownloadOnBattery"
|
||||||
android:title="@string/pref_automatic_download_on_battery_title"
|
android:title="@string/pref_automatic_download_on_battery_title"
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/interruptions">
|
<PreferenceCategory android:title="@string/interruptions">
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
@ -42,8 +40,7 @@
|
|||||||
android:entryValues="@array/video_background_behavior_values"
|
android:entryValues="@array/video_background_behavior_values"
|
||||||
android:key="prefVideoBehavior"
|
android:key="prefVideoBehavior"
|
||||||
android:summary="@string/pref_videoBehavior_sum"
|
android:summary="@string/pref_videoBehavior_sum"
|
||||||
android:title="@string/pref_videoBehavior_title"
|
android:title="@string/pref_videoBehavior_title"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/playback_control">
|
<PreferenceCategory android:title="@string/playback_control">
|
||||||
@ -95,8 +92,7 @@
|
|||||||
android:entries="@array/enqueue_location_options"
|
android:entries="@array/enqueue_location_options"
|
||||||
android:entryValues="@array/enqueue_location_values"
|
android:entryValues="@array/enqueue_location_values"
|
||||||
android:key="prefEnqueueLocation"
|
android:key="prefEnqueueLocation"
|
||||||
android:title="@string/pref_enqueue_location_title"
|
android:title="@string/pref_enqueue_location_title"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
@ -109,8 +105,7 @@
|
|||||||
android:entryValues="@array/smart_mark_as_played_values"
|
android:entryValues="@array/smart_mark_as_played_values"
|
||||||
android:key="prefSmartMarkAsPlayedSecs"
|
android:key="prefSmartMarkAsPlayedSecs"
|
||||||
android:summary="@string/pref_smart_mark_as_played_sum"
|
android:summary="@string/pref_smart_mark_as_played_sum"
|
||||||
android:title="@string/pref_smart_mark_as_played_title"
|
android:title="@string/pref_smart_mark_as_played_title"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
@ -126,8 +121,7 @@
|
|||||||
android:key="prefMediaPlayer"
|
android:key="prefMediaPlayer"
|
||||||
android:title="@string/media_player"
|
android:title="@string/media_player"
|
||||||
android:summary="@string/pref_media_player_message"
|
android:summary="@string/pref_media_player_message"
|
||||||
android:entryValues="@array/media_player_values"
|
android:entryValues="@array/media_player_values"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/experimental_pref">
|
<PreferenceCategory android:title="@string/experimental_pref">
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
android:title="@string/pref_set_theme_title"
|
android:title="@string/pref_set_theme_title"
|
||||||
android:key="prefTheme"
|
android:key="prefTheme"
|
||||||
android:summary="@string/pref_set_theme_sum"
|
android:summary="@string/pref_set_theme_sum"
|
||||||
android:defaultValue="system"
|
android:defaultValue="system"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="prefHiddenDrawerItems"
|
android:key="prefHiddenDrawerItems"
|
||||||
android:summary="@string/pref_nav_drawer_items_sum"
|
android:summary="@string/pref_nav_drawer_items_sum"
|
||||||
@ -22,23 +21,20 @@
|
|||||||
android:title="@string/pref_nav_drawer_feed_order_title"
|
android:title="@string/pref_nav_drawer_feed_order_title"
|
||||||
android:key="prefDrawerFeedOrder"
|
android:key="prefDrawerFeedOrder"
|
||||||
android:summary="@string/pref_nav_drawer_feed_order_sum"
|
android:summary="@string/pref_nav_drawer_feed_order_sum"
|
||||||
android:defaultValue="0"
|
android:defaultValue="0"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:entryValues="@array/nav_drawer_feed_counter_values"
|
android:entryValues="@array/nav_drawer_feed_counter_values"
|
||||||
android:entries="@array/nav_drawer_feed_counter_options"
|
android:entries="@array/nav_drawer_feed_counter_options"
|
||||||
android:title="@string/pref_nav_drawer_feed_counter_title"
|
android:title="@string/pref_nav_drawer_feed_counter_title"
|
||||||
android:key="prefDrawerFeedIndicator"
|
android:key="prefDrawerFeedIndicator"
|
||||||
android:summary="@string/pref_nav_drawer_feed_counter_sum"
|
android:summary="@string/pref_nav_drawer_feed_counter_sum"
|
||||||
android:defaultValue="0"
|
android:defaultValue="0"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:title="@string/pref_episode_cover_title"
|
android:title="@string/pref_episode_cover_title"
|
||||||
android:key="prefEpisodeCover"
|
android:key="prefEpisodeCover"
|
||||||
android:summary="@string/pref_episode_cover_summary"
|
android:summary="@string/pref_episode_cover_summary"
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:enabled="true"
|
android:enabled="true"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/external_elements">
|
<PreferenceCategory android:title="@string/external_elements">
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
@ -71,7 +67,6 @@
|
|||||||
android:key="prefBackButtonBehavior"
|
android:key="prefBackButtonBehavior"
|
||||||
android:title="@string/pref_back_button_behavior_title"
|
android:title="@string/pref_back_button_behavior_title"
|
||||||
android:summary="@string/pref_back_button_behavior_sum"
|
android:summary="@string/pref_back_button_behavior_sum"
|
||||||
android:defaultValue="default"
|
android:defaultValue="default"/>
|
||||||
app:useStockLayout="true"/>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@ -54,7 +54,6 @@ project.ext {
|
|||||||
glideOkhttpIntegrationVersion = "4.8.0"
|
glideOkhttpIntegrationVersion = "4.8.0"
|
||||||
iconifyVersion = "2.2.2"
|
iconifyVersion = "2.2.2"
|
||||||
jsoupVersion = "1.11.2"
|
jsoupVersion = "1.11.2"
|
||||||
materialDialogsVersion = "0.9.0.2"
|
|
||||||
okhttpVersion = "3.12.5"
|
okhttpVersion = "3.12.5"
|
||||||
okioVersion = "1.17.4"
|
okioVersion = "1.17.4"
|
||||||
recyclerviewFlexibledividerVersion = "1.4.0"
|
recyclerviewFlexibledividerVersion = "1.4.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user