-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joseph Dibble
committed
May 10, 2023
1 parent
429ee46
commit 0192b44
Showing
456 changed files
with
285,970 additions
and
3,434 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...s_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/EisSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.google.ar.core.examples.java.common.helpers; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
|
||
/** | ||
* A class providing persistent EIS preference across instances using {@code | ||
* android.content.SharedPreferences}. | ||
*/ | ||
public class EisSettings { | ||
public static final String SHARED_PREFERENCE_ID = "SHARED_PREFERENCE_EIS_OPTIONS"; | ||
public static final String SHARED_PREFERENCE_EIS_ENABLED = "eis_enabled"; | ||
private boolean eisEnabled = false; | ||
private SharedPreferences sharedPreferences; | ||
|
||
/** Creates shared preference entry for EIS setting. */ | ||
public void onCreate(Context context) { | ||
sharedPreferences = context.getSharedPreferences(SHARED_PREFERENCE_ID, Context.MODE_PRIVATE); | ||
eisEnabled = sharedPreferences.getBoolean(SHARED_PREFERENCE_EIS_ENABLED, false); | ||
} | ||
|
||
/** Returns saved EIS state. */ | ||
public boolean isEisEnabled() { | ||
return eisEnabled; | ||
} | ||
|
||
/** Sets and saves the EIS using {@code android.content.SharedPreferences} */ | ||
public void setEisEnabled(boolean enable) { | ||
if (enable == eisEnabled) { | ||
return; | ||
} | ||
|
||
eisEnabled = enable; | ||
SharedPreferences.Editor editor = sharedPreferences.edit(); | ||
editor.putBoolean(SHARED_PREFERENCE_EIS_ENABLED, eisEnabled); | ||
editor.apply(); | ||
} | ||
} |
Binary file modified
BIN
+2.32 KB
(100%)
samples/augmented_faces_java/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Oops, something went wrong.