Compare commits
No commits in common. "9e0f2306a8312f335ae730bafcdafae80d7ec7df" and "88770fa756b6e48ad9a8f961fb9cd8f5f6c03dd6" have entirely different histories.
9e0f2306a8
...
88770fa756
11 changed files with 23 additions and 79 deletions
10
.idea/deploymentTargetSelector.xml
generated
10
.idea/deploymentTargetSelector.xml
generated
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="deploymentTargetSelector">
|
|
||||||
<selectionStates>
|
|
||||||
<SelectionState runConfigName="app">
|
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
|
||||||
</SelectionState>
|
|
||||||
</selectionStates>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
10
.idea/migrations.xml
generated
10
.idea/migrations.xml
generated
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectMigrations">
|
|
||||||
<option name="MigrateToGradleLocalJavaHome">
|
|
||||||
<set>
|
|
||||||
<option value="$PROJECT_DIR$" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -38,12 +38,12 @@ def getVersionName = { ->
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 35
|
compileSdk 34
|
||||||
buildToolsVersion = '35.0.0'
|
buildToolsVersion = '34.0.0'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "net.typeblog.shelter"
|
applicationId "net.typeblog.shelter"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 35
|
targetSdkVersion 34
|
||||||
versionCode getVersionCode()
|
versionCode getVersionCode()
|
||||||
versionName getVersionName()
|
versionName getVersionName()
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
@ -76,12 +76,13 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
|
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
|
||||||
implementation 'androidx.fragment:fragment:1.8.4'
|
implementation 'androidx.fragment:fragment:1.6.1'
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03'
|
||||||
implementation 'androidx.preference:preference:1.2.1'
|
implementation 'androidx.preference:preference:1.2.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
implementation 'com.google.android.material:material:1.12.0'
|
implementation 'com.google.android.material:material:1.10.0'
|
||||||
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
||||||
|
implementation 'mobi.upod:time-duration-picker:1.1.3'
|
||||||
debugImplementation project(path: ':setup-wizard-lib', configuration: 'gingerbreadCompatDebugRuntimeElements')
|
debugImplementation project(path: ':setup-wizard-lib', configuration: 'gingerbreadCompatDebugRuntimeElements')
|
||||||
releaseImplementation project(path: ':setup-wizard-lib', configuration: 'gingerbreadCompatReleaseRuntimeElements')
|
releaseImplementation project(path: ':setup-wizard-lib', configuration: 'gingerbreadCompatReleaseRuntimeElements')
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
|
@ -20,6 +20,10 @@ import net.typeblog.shelter.services.IShelterService;
|
||||||
import net.typeblog.shelter.util.SettingsManager;
|
import net.typeblog.shelter.util.SettingsManager;
|
||||||
import net.typeblog.shelter.util.Utility;
|
import net.typeblog.shelter.util.Utility;
|
||||||
|
|
||||||
|
import mobi.upod.timedurationpicker.TimeDurationPicker;
|
||||||
|
import mobi.upod.timedurationpicker.TimeDurationPickerDialogFragment;
|
||||||
|
import mobi.upod.timedurationpicker.TimeDurationUtil;
|
||||||
|
|
||||||
public class SettingsFragment extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
|
public class SettingsFragment extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
|
||||||
private static final String SETTINGS_VERSION = "settings_version";
|
private static final String SETTINGS_VERSION = "settings_version";
|
||||||
private static final String SETTINGS_SOURCE_CODE = "settings_source_code";
|
private static final String SETTINGS_SOURCE_CODE = "settings_source_code";
|
||||||
|
@ -116,9 +120,9 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Prefer
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAutoFreezeDelay() {
|
private void updateAutoFreezeDelay() {
|
||||||
/*mPrefAutoFreezeDelay.setSummary(TimeDurationUtil.formatMinutesSeconds(
|
mPrefAutoFreezeDelay.setSummary(TimeDurationUtil.formatMinutesSeconds(
|
||||||
((long) mManager.getAutoFreezeDelay()) * 1000
|
((long) mManager.getAutoFreezeDelay()) * 1000
|
||||||
));*/
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean openSummaryUrl(Preference pref) {
|
private boolean openSummaryUrl(Preference pref) {
|
||||||
|
@ -129,7 +133,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Prefer
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean openAutoFreezeDelayPicker(Preference pref) {
|
private boolean openAutoFreezeDelayPicker(Preference pref) {
|
||||||
//new AutoFreezeDelayPickerFragment().show(getActivity().getFragmentManager(), "dialog");
|
new AutoFreezeDelayPickerFragment().show(getActivity().getFragmentManager(), "dialog");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,7 +235,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Prefer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static class AutoFreezeDelayPickerFragment extends TimeDurationPickerDialogFragment {
|
public static class AutoFreezeDelayPickerFragment extends TimeDurationPickerDialogFragment {
|
||||||
@Override
|
@Override
|
||||||
protected long getInitialDuration() {
|
protected long getInitialDuration() {
|
||||||
return ((long) SettingsManager.getInstance().getAutoFreezeDelay()) * 1000;
|
return ((long) SettingsManager.getInstance().getAutoFreezeDelay()) * 1000;
|
||||||
|
@ -248,5 +252,5 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Prefer
|
||||||
if (seconds >= Integer.MAX_VALUE) return;
|
if (seconds >= Integer.MAX_VALUE) return;
|
||||||
SettingsManager.getInstance().setAutoFreezeDelay((int) seconds);
|
SettingsManager.getInstance().setAutoFreezeDelay((int) seconds);
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
package net.typeblog.shelter.ui;
|
package net.typeblog.shelter.ui;
|
||||||
|
|
||||||
import androidx.activity.EdgeToEdge;
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
import androidx.activity.result.ActivityResultLauncher;
|
||||||
import androidx.activity.result.contract.ActivityResultContract;
|
import androidx.activity.result.contract.ActivityResultContract;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.graphics.Insets;
|
|
||||||
import androidx.core.view.ViewCompat;
|
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import android.app.admin.DevicePolicyManager;
|
import android.app.admin.DevicePolicyManager;
|
||||||
|
@ -48,7 +44,6 @@ public class SetupWizardActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
EdgeToEdge.enable(this);
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
// The user could click on the "finish provisioning" notification while having removed
|
// The user could click on the "finish provisioning" notification while having removed
|
||||||
// this activity from the recents stack, in which case the notification will start a new
|
// this activity from the recents stack, in which case the notification will start a new
|
||||||
|
@ -224,25 +219,6 @@ public class SetupWizardActivity extends AppCompatActivity {
|
||||||
mWizard.setLayoutBackground(ContextCompat.getDrawable(inflater.getContext(), R.color.colorAccent));
|
mWizard.setLayoutBackground(ContextCompat.getDrawable(inflater.getContext(), R.color.colorAccent));
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(mWizard, (v, windowInsets) -> {
|
|
||||||
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
|
||||||
|
|
||||||
mWizard.setDecorPaddingTop(insets.top);
|
|
||||||
|
|
||||||
NavigationBar nav = mWizard.getNavigationBar();
|
|
||||||
ViewGroup.LayoutParams params = nav.getLayoutParams();
|
|
||||||
params.height += insets.bottom;
|
|
||||||
|
|
||||||
nav.setLayoutParams(params);
|
|
||||||
|
|
||||||
nav.setPadding(nav.getPaddingLeft(), nav.getPaddingTop(), nav.getPaddingRight(), insets.bottom);
|
|
||||||
return WindowInsetsCompat.CONSUMED;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static abstract class TextWizardFragment extends BaseWizardFragment {
|
protected static abstract class TextWizardFragment extends BaseWizardFragment {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/main_appbar"
|
android:id="@+id/main_appbar"
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:elevation="0dp"
|
app:elevation="0dp"
|
||||||
|
|
|
@ -5,10 +5,8 @@
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/settings_appbar"
|
android:id="@+id/settings_appbar"
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/setup_wizard_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
tools:context=".ui.SetupWizardActivity" />
|
||||||
<View
|
|
||||||
android:id="@+id/status_bar_spacer"
|
|
||||||
android:background="?attr/colorAccent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/setup_wizard_container"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/setup_wizard_container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".ui.SetupWizardActivity" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
@ -7,7 +7,7 @@ buildscript {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.6.0'
|
classpath 'com.android.tools.build:gradle:8.1.2'
|
||||||
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit ae5ee4b4a0fb380c99e05f53b753cc86b212f1dd
|
Subproject commit 0fe8340267b8824d98bf0a923a77662efbed171a
|
Loading…
Add table
Reference in a new issue