diff --git a/.gitignore b/.gitignore
index ccf2efe..27b6010 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,6 @@ proguard/
# Log Files
*.log
+
+# IDE
+.idea
\ No newline at end of file
diff --git a/Gasflow.iml b/Gasflow.iml
deleted file mode 100644
index 42a4d1b..0000000
--- a/Gasflow.iml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Speedo.iml b/Speedo.iml
deleted file mode 100644
index b8ca1fa..0000000
--- a/Speedo.iml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
index 796b96d..42afabf 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -1 +1 @@
-/build
+/build
\ No newline at end of file
diff --git a/app/app.iml b/app/app.iml
deleted file mode 100644
index 6009a59..0000000
--- a/app/app.iml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- generateDebugAndroidTestSources
- generateDebugSources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 2108d18..a2af494 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,28 +1,38 @@
-apply plugin: 'com.android.application'
+plugins {
+ alias(libs.plugins.android.application)
+}
android {
- compileSdkVersion 24
- buildToolsVersion '24.0.2'
+ namespace 'com.mridang.speedo'
+ compileSdk 34
+
defaultConfig {
applicationId "com.mridang.speedo"
- minSdkVersion 16
- targetSdkVersion 24
- versionCode 2
- versionName "1.1"
+ minSdk 24
+ targetSdk 34
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
+
buildTypes {
release {
minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
- productFlavors {
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:support-v4:24.2.1'
- compile project(':colorPicker')
- compile 'ch.acra:acra:4.8.5'
-}
+ implementation libs.legacy.support.v4
+ implementation libs.appcompat
+ implementation libs.material
+ testImplementation libs.junit
+ androidTestImplementation libs.ext.junit
+ androidTestImplementation libs.espresso.core
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 2258444..481bb43 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -1,17 +1,21 @@
# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/mridangagarwalla/Downloads/adt-bundle-mac-x86_64-20140702/sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
-# Add any project specific keep options here:
-
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7915f7d..80a0684 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -5,6 +5,7 @@
+
@@ -16,7 +17,7 @@
android:theme="@style/AppTheme">
@@ -32,7 +33,8 @@
+ android:enabled="true"
+ android:exported="false">
@@ -43,14 +45,16 @@
+ android:enabled="true"
+ android:exported="false">
+ android:enabled="true"
+ android:exported="false">
diff --git a/app/src/main/java/com/mridang/speedo/SettingsActivity.java b/app/src/main/java/com/mridang/speedo/SettingsActivity.java
index 1b37eb2..b120a68 100644
--- a/app/src/main/java/com/mridang/speedo/SettingsActivity.java
+++ b/app/src/main/java/com/mridang/speedo/SettingsActivity.java
@@ -98,17 +98,5 @@ public class SettingsActivity extends PreferenceActivity {
}
});
- findPreference("color").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-
- /**
- * Preference change listener that handles whether the notification should be displayed
- * on the lockscreen depending on whether the the switch is toggled or not.
- */
- @Override
- public boolean onPreferenceChange(Preference enabledPreference, Object newValue) {
- backgroundService.setColor((Integer) newValue);
- return true;
- }
- });
}
}
diff --git a/app/src/main/java/com/mridang/speedo/SpeedoApplication.java b/app/src/main/java/com/mridang/speedo/SpeedoApplication.java
index bf54393..c2f5fbd 100644
--- a/app/src/main/java/com/mridang/speedo/SpeedoApplication.java
+++ b/app/src/main/java/com/mridang/speedo/SpeedoApplication.java
@@ -2,13 +2,5 @@ package com.mridang.speedo;
import android.app.Application;
-import org.acra.annotation.ReportsCrashes;
-
-@ReportsCrashes(
- resNotifTickerText = R.string.crash_notif_ticker_text,
- resNotifTitle = R.string.crash_notif_title,
- resNotifText = R.string.crash_notif_text,
- mailTo = "mridang.agarwalla+speedo@gmail.com"
-)
public class SpeedoApplication extends Application {
}
diff --git a/app/src/main/java/com/mridang/speedo/TrafficService.java b/app/src/main/java/com/mridang/speedo/TrafficService.java
index 1f8cd4d..6dc0a0a 100644
--- a/app/src/main/java/com/mridang/speedo/TrafficService.java
+++ b/app/src/main/java/com/mridang/speedo/TrafficService.java
@@ -1,6 +1,7 @@
package com.mridang.speedo;
import android.annotation.SuppressLint;
+import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
@@ -25,7 +26,7 @@ import android.os.IBinder;
import android.os.Message;
import android.os.PowerManager;
import android.preference.PreferenceManager;
-import android.support.v4.app.NotificationCompat;
+import androidx.core.app.NotificationCompat;
import android.telephony.TelephonyManager;
import android.text.format.Formatter;
import android.util.Log;
@@ -43,6 +44,10 @@ public class TrafficService extends Service {
* The identifier if the component that open from the settings activity
*/
private static final String CMP = "com.android.settings.Settings$DataUsageSummaryActivity";
+ /**
+ * Notification channel ID
+ */
+ private static final String CHANNEL_ID = "network_speed";
/**
* The instance of the handler that updates the notification
*/
@@ -91,9 +96,11 @@ public class TrafficService extends Service {
super.onCreate();
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ createNotificationChannel();
+
Intent ittSettings = new Intent();
ittSettings.setComponent(new ComponentName("com.android.settings", CMP));
- PendingIntent pitSettings = PendingIntent.getActivity(this, 0, ittSettings, 0);
+ PendingIntent pitSettings = PendingIntent.getActivity(this, 0, ittSettings, PendingIntent.FLAG_IMMUTABLE);
notBuilder = new NotificationCompat.Builder(this);
notBuilder.setSmallIcon(R.drawable.wkb000);
notBuilder.setContentIntent(pitSettings);
@@ -103,6 +110,7 @@ public class TrafficService extends Service {
notBuilder.setPriority(Integer.MAX_VALUE);
notBuilder.setCategory(NotificationCompat.CATEGORY_SERVICE);
notBuilder.setLocalOnly(true);
+ notBuilder.setChannelId(CHANNEL_ID);
setColor(settings.getInt("color", Color.TRANSPARENT));
visibilityPublic(settings.getBoolean("lockscreen", true));
@@ -388,4 +396,20 @@ public class TrafficService extends Service {
return TrafficService.this;
}
}
+
+ private void createNotificationChannel() {
+ // Create the NotificationChannel, but only on API 26+ because
+ // the NotificationChannel class is not in the Support Library.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ CharSequence name = getString(R.string.channel_name);
+ String description = getString(R.string.channel_description);
+ int importance = NotificationManager.IMPORTANCE_DEFAULT;
+ NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
+ channel.setDescription(description);
+ // Register the channel with the system. You can't change the importance
+ // or other notification behaviors after this.
+ NotificationManager notificationManager = getSystemService(NotificationManager.class);
+ notificationManager.createNotificationChannel(channel);
+ }
+ }
}
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b763306..4e30d6c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -13,4 +13,6 @@
Unexpected error, please send a report
Throttle has crashed…
Please click here to help fix the issue.
+ Network Speed
+ Notification to show network speed
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 7838931..6c94edb 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -15,13 +15,4 @@
android:key="lowpower"
android:summary="@string/lowpower_summary"
android:title="@string/lowpower_title"/>
-
diff --git a/build.gradle b/build.gradle
index afb6603..565f8c2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,14 +1,4 @@
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:1.2.3'
- }
-}
-
-allprojects {
- repositories {
- jcenter()
- }
-}
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+alias(libs.plugins.android.application) apply false
+}
\ No newline at end of file
diff --git a/colorPicker/build.gradle b/colorPicker/build.gradle
deleted file mode 100644
index 2a74538..0000000
--- a/colorPicker/build.gradle
+++ /dev/null
@@ -1,20 +0,0 @@
-apply plugin: 'com.android.library'
-android {
- compileSdkVersion 22
- buildToolsVersion '22.0.0'
- defaultConfig {
- minSdkVersion 14
- targetSdkVersion 22
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
- }
- }
- productFlavors {
- }
-}
-
-dependencies {
-}
\ No newline at end of file
diff --git a/colorPicker/colorPicker.iml b/colorPicker/colorPicker.iml
deleted file mode 100644
index 11718b7..0000000
--- a/colorPicker/colorPicker.iml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- generateDebugAndroidTestSources
- generateDebugSources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/colorPicker/src/main/AndroidManifest.xml b/colorPicker/src/main/AndroidManifest.xml
deleted file mode 100644
index f9dd5eb..0000000
--- a/colorPicker/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/colorPicker/src/main/java/com/mridang/colorpicker/ColorPreference.java b/colorPicker/src/main/java/com/mridang/colorpicker/ColorPreference.java
deleted file mode 100644
index 86817b9..0000000
--- a/colorPicker/src/main/java/com/mridang/colorpicker/ColorPreference.java
+++ /dev/null
@@ -1,286 +0,0 @@
-package com.mridang.colorpicker;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.content.Context;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.Color;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.GradientDrawable;
-import android.os.Bundle;
-import android.preference.Preference;
-import android.util.AttributeSet;
-import android.util.TypedValue;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.BaseAdapter;
-import android.widget.GridView;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- Custom preference that allows the user to choose a color from a grid of pre-selected colors
- */
-public class ColorPreference extends Preference {
- private int[] mColorChoices = {};
- private int mValue = 0;
- private int mItemLayoutId = R.layout.dash_grid_item_color;
- private int mNumColumns = 5;
-
- public ColorPreference(Context context) {
- super(context);
- initAttrs(null, 0);
- }
-
- /*
- @see android.preference.Preference#Preference(android.content.Context, android.util.AttributeSet)
- */
- public ColorPreference(Context context, AttributeSet attrs) {
- super(context, attrs);
- initAttrs(attrs, 0);
- }
-
- /*
- @see android.preference.Preference#Preference(android.content.Context, android.util.AttributeSet, int)
- */
- public ColorPreference(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- initAttrs(attrs, defStyle);
- }
-
- /*
- @see android.preference.Preference#Preference(android.util.AttributeSet, int)
- */
- private void initAttrs(AttributeSet attrs, int defStyle) {
- TypedArray a = getContext().getTheme().obtainStyledAttributes(
- attrs, R.styleable.ColorPreference, defStyle, defStyle);
-
- try {
- mItemLayoutId = a.getResourceId(R.styleable.ColorPreference_itemLayout, mItemLayoutId);
- mNumColumns = a.getInteger(R.styleable.ColorPreference_numColumns, mNumColumns);
- int choicesResId = a.getResourceId(R.styleable.ColorPreference_choices,
- R.array.color_choices);
- if (choicesResId > 0) {
- String[] choices = a.getResources().getStringArray(choicesResId);
- mColorChoices = new int[choices.length];
- for (int i = 0; i < choices.length; i++) {
- mColorChoices[i] = Color.parseColor(choices[i]);
- }
- }
- } finally {
- a.recycle();
- }
-
- setWidgetLayoutResource(mItemLayoutId);
- }
-
- @SuppressWarnings("NullableProblems")
- @Override
- protected void onBindView(View view) {
- super.onBindView(view);
- View mPreviewView = view.findViewById(R.id.color_view);
- setColorViewValue(mPreviewView, mValue);
- }
-
- private void setValue(int value) {
- if (callChangeListener(value)) {
- mValue = value;
- persistInt(value);
- notifyChanged();
- }
- }
-
- @Override
- protected void onClick() {
- super.onClick();
-
- ColorDialogFragment fragment = ColorDialogFragment.newInstance();
- fragment.setPreference(this);
-
- Activity activity = (Activity) getContext();
- activity.getFragmentManager().beginTransaction()
- .add(fragment, getFragmentTag())
- .commit();
- }
-
- @Override
- protected void onAttachedToActivity() {
- super.onAttachedToActivity();
-
- Activity activity = (Activity) getContext();
- ColorDialogFragment fragment = (ColorDialogFragment) activity
- .getFragmentManager().findFragmentByTag(getFragmentTag());
- if (fragment != null) {
- // re-bind preference to fragment
- fragment.setPreference(this);
- }
- }
-
- @Override
- protected Object onGetDefaultValue(TypedArray a, int index) {
- return a.getInt(index, 0);
- }
-
- @Override
- protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
- setValue(restoreValue ? getPersistedInt(0) : (Integer) defaultValue);
- }
-
- private String getFragmentTag() {
- return "color_" + getKey();
- }
-
- private int getValue() {
- return mValue;
- }
-
- public static class ColorDialogFragment extends DialogFragment {
- private ColorPreference mPreference;
- private ColorGridAdapter mAdapter;
- private GridView mColorGrid;
-
- public ColorDialogFragment() {
- }
-
- public static ColorDialogFragment newInstance() {
- return new ColorDialogFragment();
- }
-
- public void setPreference(ColorPreference preference) {
- mPreference = preference;
- tryBindLists();
- }
-
- @Override
- public void onAttach(Activity activity) {
- super.onAttach(activity);
- tryBindLists();
- }
-
- @SuppressLint("InflateParams")
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
- View rootView = layoutInflater.inflate(R.layout.dash_dialog_colors, null);
-
- mColorGrid = (GridView) rootView.findViewById(R.id.color_grid);
-
- mColorGrid.setNumColumns(mPreference.mNumColumns);
-
- mColorGrid.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView> listView, View view,
- int position, long itemId) {
- mPreference.setValue(mAdapter.getItem(position));
- dismiss();
- }
- });
-
- tryBindLists();
-
- return new AlertDialog.Builder(getActivity())
- .setView(rootView)
- .create();
- }
-
- private void tryBindLists() {
- if (mPreference == null) {
- return;
- }
-
- if (isAdded() && mAdapter == null) {
- mAdapter = new ColorGridAdapter();
- }
-
- if (mAdapter != null && mColorGrid != null) {
- mAdapter.setSelectedColor(mPreference.getValue());
- mColorGrid.setAdapter(mAdapter);
- }
- }
-
- private class ColorGridAdapter extends BaseAdapter {
- private final List mChoices = new ArrayList<>();
- private int mSelectedColor;
-
- private ColorGridAdapter() {
- for (int color : mPreference.mColorChoices) {
- mChoices.add(color);
- }
- }
-
- @Override
- public int getCount() {
- return mChoices.size();
- }
-
- @Override
- public Integer getItem(int position) {
- return mChoices.get(position);
- }
-
- @Override
- public long getItemId(int position) {
- return mChoices.get(position);
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup container) {
- if (convertView == null) {
- convertView = LayoutInflater.from(getActivity())
- .inflate(mPreference.mItemLayoutId, container, false);
- }
-
- int color = getItem(position);
- setColorViewValue(convertView.findViewById(R.id.color_view), color);
- convertView.setBackgroundColor(color == mSelectedColor
- ? 0x6633b5e5 : 0);
-
- return convertView;
- }
-
- public void setSelectedColor(int selectedColor) {
- mSelectedColor = selectedColor;
- notifyDataSetChanged();
- }
- }
- }
-
- private static void setColorViewValue(View view, int color) {
- if (view instanceof ImageView) {
- ImageView imageView = (ImageView) view;
- Resources res = imageView.getContext().getResources();
-
- Drawable currentDrawable = imageView.getDrawable();
- GradientDrawable colorChoiceDrawable;
- if (currentDrawable != null && currentDrawable instanceof GradientDrawable) {
- // Reuse drawable
- colorChoiceDrawable = (GradientDrawable) currentDrawable;
- } else {
- colorChoiceDrawable = new GradientDrawable();
- colorChoiceDrawable.setShape(GradientDrawable.OVAL);
- }
-
- // Set stroke to dark version of color
- int darkenedColor = Color.rgb(
- Color.red(color) * 192 / 256,
- Color.green(color) * 192 / 256,
- Color.blue(color) * 192 / 256);
-
- colorChoiceDrawable.setColor(color);
- colorChoiceDrawable.setStroke((int) TypedValue.applyDimension(
- TypedValue.COMPLEX_UNIT_DIP, 1, res.getDisplayMetrics()), darkenedColor);
- imageView.setImageDrawable(colorChoiceDrawable);
- } else if (view instanceof TextView) {
- ((TextView) view).setTextColor(color);
- }
- }
-}
\ No newline at end of file
diff --git a/colorPicker/src/main/res/layout/dash_dialog_colors.xml b/colorPicker/src/main/res/layout/dash_dialog_colors.xml
deleted file mode 100644
index 1f43e5f..0000000
--- a/colorPicker/src/main/res/layout/dash_dialog_colors.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/colorPicker/src/main/res/layout/dash_grid_item_color.xml b/colorPicker/src/main/res/layout/dash_grid_item_color.xml
deleted file mode 100644
index fd6dbdf..0000000
--- a/colorPicker/src/main/res/layout/dash_grid_item_color.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/colorPicker/src/main/res/values-v11/styles.xml b/colorPicker/src/main/res/values-v11/styles.xml
deleted file mode 100644
index 464ec26..0000000
--- a/colorPicker/src/main/res/values-v11/styles.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
diff --git a/colorPicker/src/main/res/values/attrs.xml b/colorPicker/src/main/res/values/attrs.xml
deleted file mode 100644
index d33e417..0000000
--- a/colorPicker/src/main/res/values/attrs.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/colorPicker/src/main/res/values/styles.xml b/colorPicker/src/main/res/values/styles.xml
deleted file mode 100644
index 471ccf0..0000000
--- a/colorPicker/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/colorPicker/src/main/res/values/swatches.xml b/colorPicker/src/main/res/values/swatches.xml
deleted file mode 100644
index 86a8d16..0000000
--- a/colorPicker/src/main/res/values/swatches.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- - #33b5e5
- - #aa66cc
- - #99cc00
- - #ffbb33
- - #ff4444
- - #0099cc
- - #9933cc
- - #669900
- - #ff8800
- - #cc0000
- - #ffffff
- - #eeeeee
- - #cccccc
- - #888888
-
-
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 1d3591c..4387edc 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,18 +1,21 @@
# Project-wide Gradle settings.
-
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
-
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
-
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
-# Default value: -Xmx10248m -XX:MaxPermSize=256m
-# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
-
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
\ No newline at end of file
+# This option should only be used with decoupled projects. For more details, visit
+# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 0000000..d358485
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -0,0 +1,21 @@
+[versions]
+agp = "8.5.2"
+junit = "4.13.2"
+junitVersion = "1.2.1"
+espressoCore = "3.6.1"
+appcompat = "1.7.0"
+legacySupportV4 = "1.0.0"
+material = "1.12.0"
+
+[libraries]
+junit = { group = "junit", name = "junit", version.ref = "junit" }
+ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
+espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
+appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
+legacy-support-v4 = { module = "androidx.legacy:legacy-support-v4", version.ref = "legacySupportV4" }
+material = { group = "com.google.android.material", name = "material", version.ref = "material" }
+
+
+[plugins]
+android-application = { id = "com.android.application", version.ref = "agp" }
+
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 8c0fb64..e708b1c 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 0c71e76..bbf88c2 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Wed Apr 10 15:27:10 PDT 2013
+#Sat Aug 31 09:41:01 GMT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
diff --git a/gradlew b/gradlew
index 91a7e26..4f906e0 100755
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,20 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# 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
+#
+# https://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.
+#
##############################################################################
##
@@ -6,47 +22,6 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -61,12 +36,53 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
+cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -90,7 +106,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -110,11 +126,13 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
@@ -138,27 +156,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
- i=$((i+1))
+ i=`expr $i + 1`
done
case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=`save "$@"`
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index aec9973..ac1b06f 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,3 +1,19 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@@ -8,20 +24,23 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
+if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -35,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-if exist "%JAVA_EXE%" goto init
+if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -45,34 +64,14 @@ echo location of your Java installation.
goto fail
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
diff --git a/settings.gradle b/settings.gradle
index d589876..9b5c7f3 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1,23 @@
-include ':app', ':colorPicker'
+pluginManagement {
+ repositories {
+ google {
+ content {
+ includeGroupByRegex("com\\.android.*")
+ includeGroupByRegex("com\\.google.*")
+ includeGroupByRegex("androidx.*")
+ }
+ }
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.name = "Gasflow"
+include ':app'