Skip to content

Commit

Permalink
Utilize Wrapper instead of dynamic theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal authored and greyson-signal committed May 29, 2020
1 parent 2ddd143 commit c634c24
Showing 1 changed file with 2 additions and 12 deletions.
Expand Up @@ -4,6 +4,7 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.ContextThemeWrapper;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
Expand All @@ -16,8 +17,6 @@ public class ClearProfileAvatarActivity extends Activity {

private static final String ARG_TITLE = "arg_title";

private final DynamicTheme theme = new DynamicNoActionBarTheme();

public static Intent createForUserProfilePhoto() {
return new Intent("org.thoughtcrime.securesms.action.CLEAR_PROFILE_PHOTO");
}
Expand All @@ -28,22 +27,13 @@ public static Intent createForGroupProfilePhoto() {
return intent;
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

theme.onCreate(this);
}

@Override
public void onResume() {
super.onResume();

theme.onResume(this);

int titleId = getIntent().getIntExtra(ARG_TITLE, R.string.ClearProfileActivity_remove_profile_photo);

new AlertDialog.Builder(this)
new AlertDialog.Builder(new ContextThemeWrapper(this, DynamicTheme.isDarkTheme(this) ? R.style.TextSecure_DarkTheme : R.style.TextSecure_LightTheme))
.setMessage(titleId)
.setNegativeButton(android.R.string.cancel, (dialog, which) -> finish())
.setPositiveButton(R.string.ClearProfileActivity_remove, (dialog, which) -> {
Expand Down

0 comments on commit c634c24

Please sign in to comment.