diff --git a/app/src/main/java/awais/instagrabber/asyncs/ProfileFetcher.java b/app/src/main/java/awais/instagrabber/asyncs/ProfileFetcher.java index 394fd9a0..514f8692 100755 --- a/app/src/main/java/awais/instagrabber/asyncs/ProfileFetcher.java +++ b/app/src/main/java/awais/instagrabber/asyncs/ProfileFetcher.java @@ -46,7 +46,7 @@ public final class ProfileFetcher extends AsyncTask { if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { final String json = NetworkUtils.readFromConnection(conn); - Log.d(TAG, "doInBackground: " + json); + // Log.d(TAG, "doInBackground: " + json); final JSONObject userJson = new JSONObject(json).getJSONObject("graphql") .getJSONObject(Constants.EXTRAS_USER); diff --git a/app/src/main/java/awais/instagrabber/dialogs/EditTextDialogFragment.java b/app/src/main/java/awais/instagrabber/dialogs/EditTextDialogFragment.java index 830b1edc..7a68d451 100644 --- a/app/src/main/java/awais/instagrabber/dialogs/EditTextDialogFragment.java +++ b/app/src/main/java/awais/instagrabber/dialogs/EditTextDialogFragment.java @@ -3,6 +3,8 @@ package awais.instagrabber.dialogs; import android.app.Dialog; import android.content.Context; import android.os.Bundle; +import android.view.ViewGroup; +import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -14,9 +16,13 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import awais.instagrabber.R; import awais.instagrabber.utils.TextUtils; +import awais.instagrabber.utils.Utils; public class EditTextDialogFragment extends DialogFragment { + private final int margin; + private final int topMargin; + private Context context; private EditTextDialogFragmentCallback callback; @@ -34,7 +40,10 @@ public class EditTextDialogFragment extends DialogFragment { return fragment; } - public EditTextDialogFragment() {} + public EditTextDialogFragment() { + margin = Utils.convertDpToPx(20); + topMargin = Utils.convertDpToPx(8); + } @Override public void onAttach(@NonNull final Context context) { @@ -65,8 +74,16 @@ public class EditTextDialogFragment extends DialogFragment { if (!TextUtils.isEmpty(initialText)) { input.setText(initialText); } + final FrameLayout container = new FrameLayout(context); + final FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.WRAP_CONTENT); + layoutParams.leftMargin = margin; + layoutParams.rightMargin = margin; + layoutParams.topMargin = topMargin; + input.setLayoutParams(layoutParams); + container.addView(input); final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context) - .setView(input) + .setView(container) .setPositiveButton(positiveButtonText, (d, w) -> { final String string = input.getText() != null ? input.getText().toString() : ""; if (callback != null) {