mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-04-13 01:42:08 +02:00
adding a couple style and size changes
This commit is contained in:
parent
a33fdda462
commit
1fa730093b
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest
|
||||
package="com.simplemobiletools.flashlight"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.simplemobiletools.flashlight">
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT"/>
|
||||
@ -19,7 +19,7 @@
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/BlackSplashScreen">
|
||||
android:theme="@style/BlackSplashScreen.Dark">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
|
@ -8,6 +8,7 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
|
||||
import com.simplemobiletools.flashlight.BusProvider;
|
||||
import com.simplemobiletools.flashlight.Config;
|
||||
@ -26,6 +27,7 @@ public class MainActivity extends SimpleActivity {
|
||||
@BindView(R.id.toggle_btn) ImageView mToggleBtn;
|
||||
@BindView(R.id.bright_display_btn) ImageView mBrightDisplayBtn;
|
||||
@BindView(R.id.stroboscope_btn) ImageView mStroboscopeBtn;
|
||||
@BindView(R.id.stroboscope_bar) SeekBar mStroboscopeBar;
|
||||
|
||||
private static Bus mBus;
|
||||
private static MyCameraImpl mCameraImpl;
|
||||
@ -111,6 +113,10 @@ public class MainActivity extends SimpleActivity {
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
Config.newInstance(getApplicationContext()).setIsFirstRun(false);
|
||||
releaseCamera();
|
||||
}
|
||||
|
||||
private void releaseCamera() {
|
||||
if (mCameraImpl != null) {
|
||||
mCameraImpl.releaseCamera();
|
||||
mCameraImpl = null;
|
||||
|
@ -16,7 +16,7 @@ public class SimpleActivity extends AppCompatActivity {
|
||||
mConfig = Config.newInstance(getApplicationContext());
|
||||
int theme = mConfig.getIsDarkTheme() ? R.style.AppTheme_Dark : R.style.AppTheme;
|
||||
if (this instanceof MainActivity) {
|
||||
theme = mConfig.getIsDarkTheme() ? R.style.BlackSplashScreen_Dark : R.style.BlackSplashScreen;
|
||||
theme = R.style.BlackSplashScreen_Dark;
|
||||
}
|
||||
setTheme(theme);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -11,26 +11,33 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/toggle_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/main_button_size"
|
||||
android:layout_height="@dimen/main_button_size"
|
||||
android:src="@drawable/circles_big"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bright_display_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/bright_display_margin"
|
||||
android:layout_marginTop="@dimen/buttons_margin"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:src="@mipmap/bright_display"
|
||||
android:visibility="gone"/>
|
||||
android:src="@mipmap/bright_display"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/stroboscope_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/bright_display_margin"
|
||||
android:layout_marginTop="@dimen/buttons_margin"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:src="@mipmap/bright_display"
|
||||
android:visibility="gone"/>
|
||||
android:src="@mipmap/bright_display"/>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/stroboscope_bar"
|
||||
android:layout_width="@dimen/seekbar_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/activity_margin"
|
||||
android:paddingBottom="@dimen/seekbar_vertical_padding"
|
||||
android:paddingTop="@dimen/seekbar_vertical_padding"
|
||||
android:visibility="invisible"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -77,7 +77,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingLeft="@dimen/settings_padding"
|
||||
android:text="@string/stroboscope"/>
|
||||
android:text="@string/show_stroboscope"/>
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/settings_stroboscope"
|
||||
|
@ -8,7 +8,7 @@
|
||||
<string name="settings">Einstellungen</string>
|
||||
<string name="dark_theme">Dunkles Thema</string>
|
||||
<string name="bright_display">Zeige Knopf für helles Display</string>
|
||||
<string name="stroboscope">Show a stroboscope button</string>
|
||||
<string name="show_stroboscope">Show a stroboscope button</string>
|
||||
|
||||
<!-- About -->
|
||||
<string name="about">Über</string>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<string name="settings">Impostazioni</string>
|
||||
<string name="dark_theme">Tema scuro</string>
|
||||
<string name="bright_display">Mostra un pulsante per schermo luminoso</string>
|
||||
<string name="stroboscope">Show a stroboscope button</string>
|
||||
<string name="show_stroboscope">Show a stroboscope button</string>
|
||||
|
||||
<!-- About -->
|
||||
<string name="about">Informazioni</string>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<string name="settings">設定</string>
|
||||
<string name="dark_theme">ダークテーマ</string>
|
||||
<string name="bright_display">Show a bright display button</string>
|
||||
<string name="stroboscope">Show a stroboscope button</string>
|
||||
<string name="show_stroboscope">Show a stroboscope button</string>
|
||||
|
||||
<!-- About -->
|
||||
<string name="about">アプリについて</string>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<string name="settings">Inställningar</string>
|
||||
<string name="dark_theme">Mörkt tema</string>
|
||||
<string name="bright_display">Show a bright display button</string>
|
||||
<string name="stroboscope">Show a stroboscope button</string>
|
||||
<string name="show_stroboscope">Show a stroboscope button</string>
|
||||
|
||||
<!-- About -->
|
||||
<string name="about">Om</string>
|
||||
|
@ -1,9 +1,12 @@
|
||||
<resources>
|
||||
<dimen name="activity_margin">16dp</dimen>
|
||||
<dimen name="bright_display_margin">40dp</dimen>
|
||||
<dimen name="buttons_margin">30dp</dimen>
|
||||
<dimen name="social_padding">8dp</dimen>
|
||||
<dimen name="social_logo">40dp</dimen>
|
||||
<dimen name="settings_padding">8dp</dimen>
|
||||
<dimen name="seekbar_width">250dp</dimen>
|
||||
<dimen name="seekbar_vertical_padding">6dp</dimen>
|
||||
<dimen name="main_button_size">150dp</dimen>
|
||||
|
||||
<dimen name="normal_text_size">14sp</dimen>
|
||||
<dimen name="config_text_size">18sp</dimen>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<string name="settings">Settings</string>
|
||||
<string name="dark_theme">Dark theme</string>
|
||||
<string name="bright_display">Show a bright display button</string>
|
||||
<string name="stroboscope">Show a stroboscope button</string>
|
||||
<string name="show_stroboscope">Show a stroboscope button</string>
|
||||
|
||||
<!-- About -->
|
||||
<string name="about">About</string>
|
||||
|
@ -17,10 +17,6 @@
|
||||
<item name="android:windowBackground">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="BlackSplashScreen" parent="AppTheme">
|
||||
<item name="android:windowBackground">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="BlackSplashScreen.Dark" parent="AppTheme.Dark">
|
||||
<item name="android:windowBackground">@null</item>
|
||||
</style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user