Skip to content

Commit b3374b7

Browse files
authored
Merge pull request #296 from mubeen1519/work
UI redesign, digital assitant support, always screen on feature, dependencies update
2 parents 0f65be8 + c1dcc2e commit b3374b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+816
-297
lines changed

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ android {
44
compileSdk 36
55
defaultConfig {
66
applicationId "rocks.poopjournal.flashy"
7-
minSdk 19
7+
minSdk 21
88
targetSdk 36
9-
versionCode 30
10-
versionName "3.0"
9+
versionCode 31
10+
versionName "3.1"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
multiDexEnabled true
1313
resConfigs "en", "cs", "de", "es", "hr", "lt", "nb-rNO", "pt", "pt-rBR", "ru", "sat", "tr", "zh-rCN"
@@ -41,6 +41,7 @@ dependencies {
4141
implementation 'androidx.appcompat:appcompat:1.7.1'
4242
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
4343
implementation 'androidx.preference:preference:1.2.1'
44+
implementation 'androidx.activity:activity:1.10.1'
4445
testImplementation 'junit:junit:4.13.2'
4546
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
4647
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
@@ -51,6 +52,6 @@ dependencies {
5152

5253
implementation 'me.tankery.lib:circularSeekBar:1.4.2'
5354
//to resolve dependency conflicts
54-
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.6.2'
55+
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.9.1'
5556
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.1"
5657
}

app/src/main/AndroidManifest.xml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,29 @@
88
<uses-permission
99
android:name="android.permission.CAMERA"
1010
android:maxSdkVersion="23" />
11+
1112
<uses-feature android:name="android.hardware.camera" />
1213
<uses-feature android:name="android.hardware.camera.autofocus" />
1314

1415
<application
1516
android:allowBackup="true"
1617
android:icon="@mipmap/ic_launcher"
1718
android:label="@string/app_name"
19+
android:localeConfig="@xml/locales_config"
1820
android:roundIcon="@mipmap/ic_launcher_round"
1921
android:supportsRtl="true"
2022
android:theme="@style/AppTheme"
21-
android:localeConfig="@xml/locales_config"
2223
tools:ignore="GoogleAppIndexingWarning">
24+
<activity
25+
android:name=".activities.AssistToggleActivity"
26+
android:exported="true"
27+
android:theme="@android:style/Theme.Translucent.NoTitleBar">
28+
29+
<intent-filter>
30+
<action android:name="android.intent.action.ASSIST" />
31+
<category android:name="android.intent.category.DEFAULT" />
32+
</intent-filter>
33+
</activity>
2334
<activity
2435
android:name=".activities.SettingsActivity"
2536
android:exported="false"
@@ -89,17 +100,15 @@
89100
android:name="android.app.lib_name"
90101
android:value="" />
91102
</activity>
92-
93103
<activity
94104
android:name=".activities.AboutActivity"
95105
android:exported="false"
96-
android:parentActivityName=".activities.MainActivity"
97-
android:label="@string/about">
106+
android:label="@string/about"
107+
android:parentActivityName=".activities.MainActivity">
98108
<meta-data
99109
android:name="android.app.lib_name"
100110
android:value="" />
101111
</activity>
102-
103112
<activity
104113
android:name=".activities.InvisibleActivity"
105114
android:exported="false"
@@ -110,7 +119,6 @@
110119
android:name="android.app.lib_name"
111120
android:value="" />
112121
</activity>
113-
114122
<activity
115123
android:name=".activities.MainActivity"
116124
android:configChanges="orientation"

app/src/main/java/rocks/poopjournal/flashy/activities/AboutActivity.java

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,14 @@ protected void onCreate(Bundle savedInstanceState) {
2323
super.onCreate(savedInstanceState);
2424
ActivityAboutBinding binding = ActivityAboutBinding.inflate(getLayoutInflater());
2525
setContentView(binding.getRoot());
26-
setSupportActionBar(binding.toolbarAbout);
2726
ActionBar actionBar = getSupportActionBar();
2827
if (actionBar != null)
2928
actionBar.setDisplayHomeAsUpEnabled(true);
30-
binding.appVersion.setText(getString(R.string.version_license, BuildConfig.VERSION_NAME));
29+
binding.appVersion.setText(getString(R.string.version_text, BuildConfig.VERSION_NAME));
30+
binding.appacheVersion.setText(getString(R.string.version_license));
31+
binding.backIcon.setOnClickListener(v -> finish());
3132
setupClickToGoToWebsite(binding.appVersion, "https://github.com/Crazy-Marvin/Flashy/blob/development/LICENSE");
3233
setupClickToGoToWebsite(binding.appIcon, "https://crazymarvin.com/flashy/");
33-
setupClickToGoToWebsite(binding.fahadsaleemGithub, "https://github.com/FahadSaleem/");
34-
setupClickToGoToWebsite(binding.crazymarvinGithub, "https://github.com/CrazyMarvin/");
35-
binding.crazymarvinEmail.setOnClickListener(v -> {
36-
try {
37-
Intent intent = new Intent(Intent.ACTION_SENDTO)
38-
.setData(Uri.parse("mailto:"))
39-
.putExtra(Intent.EXTRA_EMAIL, new String[]{"marvin@poopjournal.rocks"})
40-
.putExtra(Intent.EXTRA_SUBJECT, "crazymarvin.com Contact")
41-
.putExtra(Intent.EXTRA_TEXT, "Hello Marvin,\n...\n");
42-
startActivity(intent);
43-
} catch (ActivityNotFoundException e) {
44-
Toast.makeText(this, R.string.no_app_can_handle, Toast.LENGTH_SHORT).show();
45-
}
46-
});
47-
setupClickToGoToWebsite(binding.crazymarvinTwitter, "https://twitter.com/CrazyMarvinApps");
4834
setupClickToGoToWebsite(binding.sourceCode, "https://github.com/Crazy-Marvin/Flashy");
4935
setupClickToGoToWebsite(binding.reportProblem, "https://github.com/Crazy-Marvin/Flashy/issues");
5036
setupClickToGoToWebsite(binding.translate, "https://hosted.weblate.org/engage/flashy/");
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package rocks.poopjournal.flashy.activities;
2+
3+
import android.os.Bundle;
4+
5+
import androidx.activity.EdgeToEdge;
6+
import androidx.appcompat.app.AppCompatActivity;
7+
import androidx.core.graphics.Insets;
8+
import androidx.core.view.ViewCompat;
9+
import androidx.core.view.WindowInsetsCompat;
10+
11+
import rocks.poopjournal.flashy.R;
12+
import rocks.poopjournal.flashy.utils.CameraHelper;
13+
14+
public class AssistToggleActivity extends AppCompatActivity {
15+
16+
@Override
17+
protected void onCreate(Bundle savedInstanceState) {
18+
super.onCreate(savedInstanceState);
19+
CameraHelper helper = CameraHelper.getInstance(this);
20+
helper.toggleNormalFlash(this); // toggle flashlight
21+
22+
finish(); // immediately close activity (no UI)
23+
}
24+
}

0 commit comments

Comments
 (0)