Skip to content

Commit

Permalink
Update 3.0_r1
Browse files Browse the repository at this point in the history
  • Loading branch information
D4rK7355608 committed May 14, 2023
1 parent cb8a089 commit ee86cf2
Show file tree
Hide file tree
Showing 59 changed files with 283 additions and 809 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Version 3.0_r1:
- Added language support for Hungarian.
- Reworked language system, making it more accurate and user-friendly.
- Fixed various bugs and improved readability, consistency, app performance, and responsiveness by optimizing and styling the outdated code.
- Made various under-the-hood improvements for a better overall app experience.

# Version 2.1_r1:
- Made various under-the-hood improvements for a better overall app experience.

# Version 2.0_r1:
- Made some under-the-hood improvements for a better overall app experience.

Expand Down
25 changes: 13 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ android {
applicationId 'com.d4rk.lowbrightness'
minSdk 26
targetSdk 33
versionCode 29
versionName '2.0_r2'
versionCode 32
versionName '3.0_r1'
archivesBaseName = "${applicationId}-v${versionName}"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
resConfigs 'en', 'de', 'es', 'fr', 'hi', 'in', 'it', 'ja', 'ro', 'ru', 'tr', 'sv', 'bg', 'pl', 'uk'
resourceConfigurations += ['en', 'de', 'es', 'fr', 'hi', 'hu', 'in', 'it', 'ja', 'ro', 'ru', 'tr', 'sv', 'bg', 'pl', 'uk']
}
buildTypes {
release {
Expand All @@ -35,14 +35,15 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
}
buildFeatures {
viewBinding = true
buildConfig = true
}
bundle {
storeArchive {
Expand All @@ -51,17 +52,17 @@ android {
}
}
dependencies {
implementation 'com.google.firebase:firebase-crashlytics:18.3.6'
implementation 'com.google.firebase:firebase-analytics:21.2.1'
implementation 'com.google.firebase:firebase-perf:20.3.1'
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
implementation 'com.google.firebase:firebase-crashlytics:18.3.7'
implementation 'com.google.firebase:firebase-analytics:21.2.2'
implementation 'com.google.firebase:firebase-perf:20.3.2'
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.1'
implementation 'com.google.android.gms:play-services-ads:22.0.0'
implementation 'com.google.android.play:review-ktx:2.0.1'
implementation 'com.google.android.play:app-update-ktx:2.0.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core:1.10.0'
implementation 'androidx.core:core-splashscreen:1.0.0'
implementation 'androidx.core:core-splashscreen:1.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
Expand Down
10 changes: 3 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down Expand Up @@ -61,7 +62,7 @@
</receiver>
<activity
android:name=".ui.startup.StartupActivity"
android:theme="@style/AppTheme.Startup"/>
android:theme="@style/AppThemeStartup"/>
<activity
android:name=".ui.settings.SettingsActivity"
android:exported="false"
Expand All @@ -81,11 +82,6 @@
android:exported="false"
android:label="@string/faq"
android:parentActivityName=".ui.settings.faq.FaqActivity"/>
<activity
android:name=".ui.settings.language.LanguageActivity"
android:exported="false"
android:label="@string/language"
android:parentActivityName=".ui.settings.language.LanguageActivity"/>
<activity
android:name=".ui.settings.feedback.FeedbackActivity"
android:exported="true"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/d4rk/lowbrightness/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import android.net.Uri;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.app.NotificationCompat;
import androidx.core.os.LocaleListCompat;
import androidx.core.splashscreen.SplashScreen;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.FragmentTransaction;
Expand Down Expand Up @@ -61,6 +63,8 @@ protected void onCreate(Bundle savedInstanceState) {
navController = Navigation.findNavController(this, R.id.navigation_content_main);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
String languageCode = sharedPreferences.getString(getString(R.string.key_language), getString(R.string.default_value_language));
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(languageCode));
SharedPreferences prefs = getSharedPreferences("app_usage", MODE_PRIVATE);
long lastUsedTimestamp = prefs.getLong("last_used", 0);
long currentTimestamp = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public int onStartCommand(Intent intent, int flags, int startId) {
mView = new OverlayView(this);
mView.setOpacityPercentage(opacityPercentage);
mView.setColor(color);
WindowManager.LayoutParams params = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, PixelFormat.TRANSLUCENT);
WindowManager.LayoutParams params;
params = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, PixelFormat.TRANSLUCENT);
params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
params.horizontalMargin = 0;
params.verticalMargin = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ private void refreshUI() {
binding.buttonColorPicker.setBackgroundColor(currentColor);
}
static private class OverlayColor {
public String label;
public String hex;
public int color;
public final String label;
public final String hex;
public final int color;
public OverlayColor(String label, String hex) {
this.label = label;
this.hex = hex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package com.d4rk.lowbrightness.ui.settings
import android.content.*
import android.net.Uri
import android.content.Context
import android.content.ClipData
import android.content.SharedPreferences
import android.content.Intent
import android.content.ClipboardManager
import android.os.Build
import android.os.Bundle
import android.provider.Settings
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.os.LocaleListCompat
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
Expand All @@ -16,7 +19,6 @@ import com.d4rk.lowbrightness.R
import com.d4rk.lowbrightness.databinding.ActivitySettingsBinding
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.textview.MaterialTextView
class SettingsActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceChangeListener {
private lateinit var binding: ActivitySettingsBinding
override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -39,34 +41,12 @@ class SettingsActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferen
}
}
}
val languageCode = sharedPreferences?.getString(getString(R.string.key_language), getString(R.string.default_value_language))
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(languageCode))
}
class SettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.preferences_settings, rootKey)
val moreApps: Preference? = findPreference(getString(R.string.key_more_apps))
moreApps?.setOnPreferenceClickListener {
val view: View = layoutInflater.inflate(R.layout.dialog_more_apps, null)
MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.more_apps)
.setIcon(R.drawable.ic_shop)
.setNegativeButton(android.R.string.cancel, null)
.setView(view)
.create()
.show()
val textViewMusicSleepTimer: MaterialTextView = view.findViewById(R.id.text_view_music_sleep_timer)
val textViewEnglishWithLidia: MaterialTextView = view.findViewById(R.id.text_view_english_with_lidia)
val textViewQRCodeScanner: MaterialTextView = view.findViewById(R.id.text_view_qr_code_scanner)
val textViewCleaner: MaterialTextView = view.findViewById(R.id.text_view_cleaner)
val textViewAndroidStudioTutorialsKotlin: MaterialTextView = view.findViewById(R.id.text_view_android_studio_tutorials_kotlin)
val textViewAndroidStudioTutorialsJava: MaterialTextView = view.findViewById(R.id.text_view_android_studio_tutorials_java)
val textViewCartCalculator: MaterialTextView = view.findViewById(R.id.text_view_cart_calculator)
val urls = mapOf(textViewCartCalculator to "https://play.google.com/store/apps/details?id=com.d4rk.cartcalculator", textViewAndroidStudioTutorialsJava to "https://play.google.com/store/apps/details?id=com.d4rk.androidtutorials.java", textViewAndroidStudioTutorialsKotlin to "https://play.google.com/store/apps/details?id=com.d4rk.androidtutorials", textViewCleaner to "https://play.google.com/store/apps/details?id=com.d4rk.cleaner.plus", textViewMusicSleepTimer to "https://play.google.com/store/apps/details?id=com.d4rk.musicsleeptimer.plus", textViewEnglishWithLidia to "https://play.google.com/store/apps/details?id=com.d4rk.englishwithlidia.plus", textViewQRCodeScanner to "https://play.google.com/store/apps/details?id=com.d4rk.qrcodescanner.plus")
urls.forEach { (view, url) -> view.setOnClickListener {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
}
}
true
}
val changelogPreference: Preference? = findPreference(getString(R.string.key_changelog))
changelogPreference?.setOnPreferenceClickListener {
MaterialAlertDialogBuilder(requireContext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class FeedbackActivity : AppCompatActivity() {
.addOnCompleteListener {
it.result?.let { reviewInfo ->
reviewManager.launchReviewFlow(this, reviewInfo).also {
// Add any additional code here, if needed
}
}
}
Expand Down
Loading

0 comments on commit ee86cf2

Please sign in to comment.