diff --git a/app/build.gradle b/app/build.gradle index 969e97e7a..794fb472d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,35 +55,34 @@ android { } dependencies { - //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1' + //debugImplementation libs.square.leakcanary - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - implementation 'com.google.android.material:material:1.6.0' - implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2' - implementation 'androidx.navigation:navigation-ui-ktx:2.4.2' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.preference:preference-ktx:1.2.0' + implementation libs.androidx.appcompat + implementation libs.androidx.constraintlayout + implementation libs.androidx.legacySupport + implementation libs.androidx.multidex + implementation libs.androidx.navigation.fragment + implementation libs.androidx.navigation.ui + implementation libs.androidx.preference - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + androidTestImplementation libs.androidx.test.junit + androidTestImplementation libs.androidx.test.espressoCore - implementation 'com.squareup.picasso:picasso:2.8' - implementation 'de.hdodenhof:circleimageview:3.1.0' - implementation 'com.google.android.exoplayer:exoplayer:2.17.1' - implementation 'com.google.android.exoplayer:extension-mediasession:2.17.1' - implementation 'androidx.multidex:multidex:2.0.1' + implementation libs.circleimageview - implementation 'com.squareup.retrofit2:retrofit:2.9.0' - implementation 'com.squareup.retrofit2:converter-jackson:2.9.0' - //do not update jackson annotations! it does not supports Environment.getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS) diff --git a/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt b/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt new file mode 100644 index 000000000..2cb9bcea4 --- /dev/null +++ b/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt @@ -0,0 +1,90 @@ +package com.github.libretube.dialogs + +import android.app.Dialog +import android.content.Context +import android.os.Bundle +import android.util.Log +import android.util.TypedValue +import android.widget.Button +import android.widget.EditText +import android.widget.TextView +import android.widget.Toast +import androidx.core.text.HtmlCompat +import androidx.fragment.app.DialogFragment +import androidx.lifecycle.lifecycleScope +import com.github.libretube.R +import com.github.libretube.obj.DeleteUserRequest +import com.github.libretube.requireMainActivityRestart +import com.github.libretube.util.RetrofitInstance +import com.google.android.material.dialog.MaterialAlertDialogBuilder + +class DeleteAccountDialog : DialogFragment() { + private val TAG = "DeleteAccountDialog" + lateinit var username: EditText + lateinit var password: EditText + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + return activity?.let { + val builder = MaterialAlertDialogBuilder(it) + val inflater = requireActivity().layoutInflater + val view = inflater.inflate(R.layout.dialog_delete_account, null) + + view.findViewById