diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-02-07 21:11:02 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-02-07 21:11:02 +0100 |
commit | b9d4699d9b0fca05f14907d9dc4873012259ec07 (patch) | |
tree | 45095444b7fe840ba15dcd3f3fbb5a8af7332917 /src/main | |
parent | ac0c76679494f68464dad4c2a1015870dd53ee36 (diff) |
rework RecordingActivity
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/RecordingActivity.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/ThemeHelper.java | 8 | ||||
-rw-r--r-- | src/main/res/layout/activity_recording.xml | 1 | ||||
-rw-r--r-- | src/main/res/values/themes.xml | 2 |
4 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/RecordingActivity.java b/src/main/java/de/pixart/messenger/ui/RecordingActivity.java index b56756ed4..cf247f920 100644 --- a/src/main/java/de/pixart/messenger/ui/RecordingActivity.java +++ b/src/main/java/de/pixart/messenger/ui/RecordingActivity.java @@ -15,6 +15,7 @@ import android.view.View; import android.view.WindowManager; import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import java.io.File; @@ -32,7 +33,7 @@ import de.pixart.messenger.persistance.FileBackend; import de.pixart.messenger.utils.ThemeHelper; import me.drakeet.support.toast.ToastCompat; -public class RecordingActivity extends Activity implements View.OnClickListener { +public class RecordingActivity extends AppCompatActivity implements View.OnClickListener { private ActivityRecordingBinding binding; @@ -59,6 +60,7 @@ public class RecordingActivity extends Activity implements View.OnClickListener setTheme(ThemeHelper.findDialog(this)); super.onCreate(savedInstanceState); this.binding = DataBindingUtil.setContentView(this, R.layout.activity_recording); + this.setTitle(R.string.attach_record_voice); this.binding.cancelButton.setOnClickListener(this); this.binding.shareButton.setOnClickListener(this); this.setFinishOnTouchOutside(false); diff --git a/src/main/java/de/pixart/messenger/utils/ThemeHelper.java b/src/main/java/de/pixart/messenger/utils/ThemeHelper.java index 874e73998..4d1334321 100644 --- a/src/main/java/de/pixart/messenger/utils/ThemeHelper.java +++ b/src/main/java/de/pixart/messenger/utils/ThemeHelper.java @@ -101,7 +101,13 @@ public class ThemeHelper { public static int findDialog(Context context) { final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); final Resources resources = context.getResources(); - final boolean dark = sharedPreferences.getString(SettingsActivity.THEME, resources.getString(R.string.theme)).equals("dark"); + final boolean auto = sharedPreferences.getString(SettingsActivity.THEME, resources.getString(R.string.theme)).equals("auto"); + boolean dark; + if (auto) { + dark = nightMode(context); + } else { + dark = sharedPreferences.getString(SettingsActivity.THEME, resources.getString(R.string.theme)).equals("dark"); + } final String fontSize = sharedPreferences.getString("font_size", resources.getString(R.string.default_font_size)); final String themeColor = sharedPreferences.getString("theme_color", resources.getString(R.string.theme_color)); switch (themeColor) { diff --git a/src/main/res/layout/activity_recording.xml b/src/main/res/layout/activity_recording.xml index 9f6857adf..8ff212e3d 100644 --- a/src/main/res/layout/activity_recording.xml +++ b/src/main/res/layout/activity_recording.xml @@ -48,7 +48,6 @@ android:layout_centerHorizontal="true" android:layout_margin="8dp" android:text="0:00.0" - android:textColor="?attr/colorAccent" android:textSize="50sp" android:textStyle="bold" android:typeface="monospace" /> diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index 7a17e5d92..d20d1c304 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -375,7 +375,7 @@ <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> - <item name="color_background_primary">@color/grey700</item> + <item name="color_background_primary">@color/grey800</item> <item name="divider">@color/white12</item> <item name="TextSizeBody2">14sp</item> <item name="TextSizeDisplay2">45sp</item> |