mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
The alert message for downloading starred tracks made more explicit
This commit is contained in:
parent
56701463e4
commit
1aba732ab9
2 changed files with 24 additions and 3 deletions
|
|
@ -12,10 +12,11 @@ import androidx.fragment.app.DialogFragment;
|
|||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.cappielloantonio.play.R;
|
||||
import com.cappielloantonio.play.databinding.DialogConnectionAlertBinding;
|
||||
import com.cappielloantonio.play.databinding.DialogStarredSyncBinding;
|
||||
import com.cappielloantonio.play.model.Download;
|
||||
import com.cappielloantonio.play.util.DownloadUtil;
|
||||
import com.cappielloantonio.play.util.MappingUtil;
|
||||
import com.cappielloantonio.play.util.Preferences;
|
||||
import com.cappielloantonio.play.viewmodel.StarredSyncViewModel;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -23,13 +24,13 @@ import java.util.stream.Collectors;
|
|||
public class StarredSyncDialog extends DialogFragment {
|
||||
private static final String TAG = "ServerUnreachableDialog";
|
||||
|
||||
private DialogConnectionAlertBinding bind;
|
||||
private DialogStarredSyncBinding bind;
|
||||
private StarredSyncViewModel starredSyncViewModel;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
bind = DialogConnectionAlertBinding.inflate(LayoutInflater.from(requireContext()));
|
||||
bind = DialogStarredSyncBinding.inflate(LayoutInflater.from(requireContext()));
|
||||
starredSyncViewModel = new ViewModelProvider(requireActivity()).get(StarredSyncViewModel.class);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
|
|
@ -71,6 +72,12 @@ public class StarredSyncDialog extends DialogFragment {
|
|||
dialog.dismiss();
|
||||
});
|
||||
});
|
||||
|
||||
Button negativeButton = dialog.getButton(Dialog.BUTTON_NEGATIVE);
|
||||
negativeButton.setOnClickListener(v -> {
|
||||
Preferences.setStarredSyncEnabled(false);
|
||||
dialog.dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
14
app/src/main/res/layout/dialog_starred_sync.xml
Normal file
14
app/src/main/res/layout/dialog_starred_sync.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/starred_sync_dialog_summary" />
|
||||
</LinearLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue