Skip to content

Commit

Permalink
Add translations, WIP: filters and FAB icon change
Browse files Browse the repository at this point in the history
  • Loading branch information
0xf104a committed Mar 30, 2024
1 parent 4c93a3c commit 9bcdaad
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
15 changes: 12 additions & 3 deletions app/src/main/java/com/polar/mirror/LowLightController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,34 @@

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.LightingColorFilter;
import android.graphics.Paint;
import android.util.Log;
import android.view.WindowManager;

import androidx.camera.core.Preview;

import com.google.android.material.floatingactionbutton.FloatingActionButton;

/**
* Implements logic of controlling low-light mode
*/
public class LowLightController {
private final Preview mCameraPreview;
private final Activity mActivity;
private float lastBrightness = 1;
public boolean isLowLightModeEnabled = false;
private FloatingActionButton mLowLightModeButton;
private static final String TAG = "LowLightController";
private static final int WHITENING_VALUE = 128;


LowLightController(Activity activity, Preview cameraPreview){
mCameraPreview = cameraPreview;
LowLightController(Activity activity, FloatingActionButton lowLightModeButton){
mActivity = activity;
mLowLightModeButton = lowLightModeButton;
}

private void enableLowLightMode(){
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/polar/mirror/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected void onCreate(Bundle savedInstanceState) {
//Start camera
try {
startCamera();
mLowLightController = new LowLightController(this, mPreview);
mLowLightController = new LowLightController(this);
} catch (ExecutionException | InterruptedException e) {
final String toastText = getString(R.string.can_not_start_camera);
Toast.makeText(this, toastText, Toast.LENGTH_LONG).show();
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<string name="tap_to_show_actions">Kliknij gdziekolwiek, aby wyświetlić menu akcji</string>
<string name="can_not_start_camera">Brak dostępu do kamery</string>
<string name="no_camera_permissions">Dostęp do kamery nie został przyznany. Użyj aplikacji Ustawienia, aby pryznać dostęp</string>
<string name="low_light">Tryb ciemonści</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
<string name="tap_to_show_actions">Натиснить будь-де, аби знов показити меню дій</string>
<string name="can_not_start_camera">Не вдалося отримати доступ до камери</string>
<string name="no_camera_permissions">Доступ до камери не надано. Скористуйтесь застосунком Налаштування, аби надати доступ вручну</string>
<string name="low_light">Режим пітьми</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
<string name="tap_to_show_actions">Tap anywhere to show actions again</string>
<string name="can_not_start_camera">Can not access camera</string>
<string name="no_camera_permissions">Camera permissions was not granted. Use Settings app to grant it.</string>
<string name="low_light">Low-light mode</string>
<string name="low_light">Dark mode</string>
</resources>

0 comments on commit 9bcdaad

Please sign in to comment.