mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2023-12-13 20:50:18 +01:00
Remove jetbrain import Merge branch 'master' into deprecations View bindings #3 View bindings #2 View bindings #1 Rewriting deprecated code. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: M M Arif <mmarif@noreply.codeberg.org> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/809 Reviewed-by: M M Arif <mmarif@noreply.codeberg.org> Co-Authored-By: opyale <opyale@noreply.codeberg.org> Co-Committed-By: opyale <opyale@noreply.codeberg.org>
57 lines
1.5 KiB
Java
57 lines
1.5 KiB
Java
package org.mian.gitnex.fragments;
|
|
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import android.util.Log;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
|
import org.mian.gitnex.databinding.BottomSheetDraftsBinding;
|
|
import org.mian.gitnex.helpers.StaticGlobalVariables;
|
|
|
|
/**
|
|
* Author M M Arif
|
|
*/
|
|
|
|
public class BottomSheetDraftsFragment extends BottomSheetDialogFragment {
|
|
|
|
private String TAG = StaticGlobalVariables.tagDraftsBottomSheet;
|
|
private BottomSheetDraftsFragment.BottomSheetListener bmListener;
|
|
|
|
@Nullable
|
|
@Override
|
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
|
BottomSheetDraftsBinding bottomSheetDraftsBinding = BottomSheetDraftsBinding.inflate(inflater, container, false);
|
|
|
|
bottomSheetDraftsBinding.deleteAllDrafts.setOnClickListener(v1 -> {
|
|
|
|
dismiss();
|
|
bmListener.onButtonClicked("deleteDrafts");
|
|
|
|
});
|
|
|
|
return bottomSheetDraftsBinding.getRoot();
|
|
}
|
|
|
|
public interface BottomSheetListener {
|
|
void onButtonClicked(String text);
|
|
}
|
|
|
|
@Override
|
|
public void onAttach(@NonNull Context context) {
|
|
super.onAttach(context);
|
|
|
|
try {
|
|
bmListener = (BottomSheetDraftsFragment.BottomSheetListener) context;
|
|
}
|
|
catch (ClassCastException e) {
|
|
Log.e(TAG, e.toString());
|
|
}
|
|
}
|
|
|
|
}
|