pull/2514/head
			
			
		
		
							parent
							
								
									9fd0567122
								
							
						
					
					
						commit
						102e7bd689
					
				| @ -0,0 +1,36 @@ | ||||
| package io.legado.app.ui.association | ||||
| 
 | ||||
| import android.content.DialogInterface | ||||
| import android.os.Bundle | ||||
| import android.view.View | ||||
| import android.view.ViewGroup | ||||
| import io.legado.app.R | ||||
| import io.legado.app.base.BaseDialogFragment | ||||
| import io.legado.app.utils.setLayout | ||||
| 
 | ||||
| class AddToBookshelfDialog() : BaseDialogFragment(R.layout.dialog_add_to_bookshelf) { | ||||
| 
 | ||||
|     constructor(bookUrl: String, finishOnDismiss: Boolean = false) : this() { | ||||
|         arguments = Bundle().apply { | ||||
|             putString("bookUrl", bookUrl) | ||||
|             putBoolean("finishOnDismiss", finishOnDismiss) | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     override fun onStart() { | ||||
|         super.onStart() | ||||
|         setLayout(0.9f, ViewGroup.LayoutParams.WRAP_CONTENT) | ||||
|     } | ||||
| 
 | ||||
|     override fun onDismiss(dialog: DialogInterface) { | ||||
|         super.onDismiss(dialog) | ||||
|         if (arguments?.getBoolean("finishOnDismiss") == true) { | ||||
|             activity?.finish() | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,6 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent"> | ||||
| 
 | ||||
| </androidx.constraintlayout.widget.ConstraintLayout> | ||||
					Loading…
					
					
				
		Reference in new issue