Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat code, new workflow to format Java-code #2

Merged
merged 5 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/googleformatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Java-code Formatter

on:
pull_request:
paths-ignore:
- '**.md'
- '**.gradle'
- '**.xml'
workflow_dispatch:

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: axel-op/[email protected]
with:
args: '--replace --aosp --skip-reflowing-long-strings'
commitMessage: "refactor: Format Java-code [skip ci]"
25 changes: 9 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@

plugins {
id 'com.android.application'

}

android {
namespace 'nethical.digipaws'
compileSdk 33

defaultConfig {
applicationId "nethical.digipaws"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"

vectorDrawables {
useSupportLibrary true
}

vectorDrawables.useSupportLibrary true
}

buildTypes {
Expand All @@ -34,20 +30,17 @@ android {

buildFeatures {
viewBinding true

}

}

dependencies {


implementation "androidx.preference:preference:1.2.1"
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'

implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation"org.osmdroid:osmdroid-android:6.1.18"

implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'org.osmdroid:osmdroid-android:6.1.18'
}
132 changes: 58 additions & 74 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,98 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="nethical.digipaws"
android:versionCode="1"
android:versionName="1.0">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">



<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="31"/>
<uses-permission android:name="android.permission.QUERY_PACKAGE_NAMES" />
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
/>
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<uses-permission android:name="android.permission.MANAGE_USERS" />
<uses-permission android:name="android.permission.QUERY_PACKAGE_NAMES" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<uses-permission android:name="android.permission.MANAGE_USERS" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />

<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity
android:name=".LauncherActivity"
android:configChanges="orientation|screenSize|keyboardHidden|smallestScreenSize|screenLayout"
android:hardwareAccelerated="true"

android:supportsPictureInPicture="true"
android:configChanges="orientation|screenSize|keyboardHidden|smallestScreenSize|screenLayout"
android:hardwareAccelerated="true"
android:supportsPictureInPicture="true"
android:exported="true">

<intent-filter>
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>


</activity>



<service
android:exported="true"
android:name=".services.BlockerService"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>



<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/stop_view_service_config" />
</service>

<intent-filter>
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<service
android:exported="true"
android:name=".services.BlockerService"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>


<receiver
android:exported="false"
android:name=".MyDeviceAdminReceiver"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_admin_receiver" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/stop_view_service_config" />
</service>

<receiver android:name=".view.WidgetProvider"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/widget_info" />
</receiver>
<receiver
android:exported="false"
android:name=".MyDeviceAdminReceiver"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>

<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_admin_receiver" />
</receiver>

<receiver
android:name=".view.WidgetProvider"
android:exported="true">
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_info" />


<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
</receiver>
</application>

</manifest>
</manifest>
2 changes: 1 addition & 1 deletion app/src/main/res/anim/fade_enter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
android:duration="@android:integer/config_shortAnimTime"
android:fromAlpha="0.0"
android:interpolator="@android:anim/linear_interpolator"
android:toAlpha="1.0" />
android:toAlpha="1.0" />
2 changes: 1 addition & 1 deletion app/src/main/res/anim/fade_exit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
android:duration="@android:integer/config_shortAnimTime"
android:fromAlpha="1.0"
android:interpolator="@android:anim/linear_interpolator"
android:toAlpha="0.0" />
android:toAlpha="0.0" />
2 changes: 1 addition & 1 deletion app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
</vector>
25 changes: 12 additions & 13 deletions app/src/main/res/layout/activity_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true"
android:clipToPadding="true">

<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true"
android:clipToPadding="true"
>

<FrameLayout
android:id="@+id/fragment_container"
android:fitsSystemWindows="true"
android:clipToPadding="true"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:clipToPadding="true"
android:fitsSystemWindows="true" />

</LinearLayout>
</LinearLayout>
15 changes: 5 additions & 10 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent"

android:orientation="vertical">
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical" />
65 changes: 32 additions & 33 deletions app/src/main/res/layout/fragment_launcher_apps.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
android:id="@+id/appList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:orientation="vertical">
<EditText
android:id="@+id/searchApp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:gravity="center_horizontal|center_vertical"
android:textSize="18sp"
android:hint="Search An Application"
android:textColorHint="@color/lgrey"
android:textColor="@color/white"
android:lines="1"
android:imeOptions="actionSearch" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/appListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:overScrollMode="never" />
</LinearLayout>

</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
android:id="@+id/appList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:orientation="vertical">
<EditText
android:id="@+id/searchApp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:gravity="center_horizontal|center_vertical"
android:textSize="18sp"
android:hint="Search An Application"
android:textColorHint="@color/lgrey"
android:textColor="@color/white"
android:lines="1"
android:imeOptions="actionSearch" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/appListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:overScrollMode="never" />
</LinearLayout>
</LinearLayout>
Loading
Loading