Compare commits
5 commits
88770fa756
...
9e0f2306a8
Author | SHA1 | Date | |
---|---|---|---|
9e0f2306a8 | |||
1c4101ba2f | |||
c06e64ffe8 | |||
7db88df146 | |||
8bd864c895 |
11 changed files with 79 additions and 23 deletions
10
.idea/deploymentTargetSelector.xml
generated
Normal file
10
.idea/deploymentTargetSelector.xml
generated
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?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
Normal file
10
.idea/migrations.xml
generated
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?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 34
|
compileSdk 35
|
||||||
buildToolsVersion = '34.0.0'
|
buildToolsVersion = '35.0.0'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "net.typeblog.shelter"
|
applicationId "net.typeblog.shelter"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 34
|
targetSdkVersion 35
|
||||||
versionCode getVersionCode()
|
versionCode getVersionCode()
|
||||||
versionName getVersionName()
|
versionName getVersionName()
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
@ -76,13 +76,12 @@ 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.6.1'
|
implementation 'androidx.fragment:fragment:1.8.4'
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03'
|
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||||
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.10.0'
|
implementation 'com.google.android.material:material:1.12.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,10 +20,6 @@ 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";
|
||||||
|
@ -120,9 +116,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) {
|
||||||
|
@ -133,7 +129,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +231,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;
|
||||||
|
@ -252,5 +248,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,11 +1,15 @@
|
||||||
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;
|
||||||
|
@ -44,6 +48,7 @@ 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
|
||||||
|
@ -219,6 +224,25 @@ 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,6 +8,7 @@
|
||||||
|
|
||||||
<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,8 +5,10 @@
|
||||||
|
|
||||||
<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,8 +1,22 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
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"
|
||||||
tools:context=".ui.SetupWizardActivity" />
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<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.1.2'
|
classpath 'com.android.tools.build:gradle:8.6.0'
|
||||||
|
|
||||||
|
|
||||||
// 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.0-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0fe8340267b8824d98bf0a923a77662efbed171a
|
Subproject commit ae5ee4b4a0fb380c99e05f53b753cc86b212f1dd
|
Loading…
Add table
Reference in a new issue